/* Estim.AI — shared design tokens, base styles, components, isometric model styles */

:root {
  /* Brand (from the Estim.AI cube logo) */
  --blue: #1E8FEF;
  --blue-300: #4AB0F5;
  --blue-600: #0B6FD0;   /* button fill — 5:1 with white */
  --blue-700: #0A58A6;
  --blue-100: #DDEEFD;
  --blue-50: #F0F7FE;
  --ink: #16191D;
  --ink-2: #23272D;
  --ink-3: #3A3F47;
  --muted: #5B616B;      /* 6.3:1 on white */
  --gray: #9A9DA3;
  --gray-2: #C9CED6;
  --line: #E3E7EC;
  --bg: #F3F5F8;
  --surface: #FFFFFF;

  --success: #12A150;
  --warn: #E5A100;
  --danger: #D93636;

  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-line: rgba(255, 255, 255, 0.85);
  --glass-dark: rgba(22, 25, 29, 0.72);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(22, 25, 29, .06), 0 1px 1px rgba(22, 25, 29, .04);
  --shadow: 0 12px 32px -14px rgba(22, 25, 29, .22), 0 2px 6px rgba(22, 25, 29, .05);
  --shadow-lg: 0 40px 90px -40px rgba(10, 50, 100, .45), 0 8px 24px -12px rgba(22, 25, 29, .12);

  --font-head: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--blue-600); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.i { width: 20px; height: 20px; flex: none; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; }
.logo-word { font-family: var(--font-head); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; line-height: 1; }
.logo-word span { color: var(--blue); }
.logo--light { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(11, 111, 208, .7); }
.btn-primary:hover { background: var(--blue-700); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); }
.btn-ghost { background: var(--glass-strong); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gray-2); background: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--blue-50); }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .i { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.btn:hover .i-shift { transform: translateX(3px); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center;
  background: var(--glass-strong); border: 1px solid var(--line); cursor: pointer; color: var(--ink);
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { background: #fff; border-color: var(--gray-2); }

/* ---------- Glass / cards ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}
.glass-dark {
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  color: #fff;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.chip .i { width: 15px; height: 15px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-600);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

.num { font-family: var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.num .dim { color: var(--gray); }

/* progress bars */
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .8s var(--ease); }
.bar--dark { background: rgba(255, 255, 255, .14); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--gray-2); border-radius: 12px; background: #fff;
  font-size: 16px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.textarea { min-height: 120px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(30, 143, 239, .18); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--danger); display: none; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }
.field.invalid .err { display: block; }

/* ---------- Isometric model ---------- */
.iso-svg { width: 100%; height: 100%; overflow: visible; }
.iso-grid line { stroke: rgba(22, 25, 29, .09); stroke-width: .8; }
.iso-dim line { stroke: rgba(22, 25, 29, .35); stroke-width: .9; }
.iso-svg .f { stroke-width: .6; stroke-linejoin: round; transition: opacity .35s var(--ease); }

.k-slab.f-t { fill: #FAFBFC; stroke: #C9D1DB; stroke-width: 1; }
.k-slab.f-r { fill: #E2E7ED; stroke: #C9D1DB; }
.k-slab.f-l { fill: #D3DAE2; stroke: #C9D1DB; }

.k-wall.f-t { fill: #FFFFFF; stroke: #FFFFFF; }
.k-wall.f-r { fill: #E6EAEF; stroke: #E6EAEF; }
.k-wall.f-l { fill: #D2D8E0; stroke: #D2D8E0; }

.k-cut.f-t { fill: #3A3F47; stroke: #3A3F47; }
.k-cut.f-r { fill: #E6EAEF; stroke: #E6EAEF; }
.k-cut.f-l { fill: #D2D8E0; stroke: #D2D8E0; }

.k-glass.f-t { fill: #D9EDFC; stroke: #D9EDFC; }
.k-glass.f-r { fill: #B9DDF8; stroke: #B9DDF8; }
.k-glass.f-l { fill: #9DCEF4; stroke: #9DCEF4; }

.k-blue.f-t { fill: #5CB8F7; stroke: #5CB8F7; }
.k-blue.f-r { fill: #1E8FEF; stroke: #1E8FEF; }
.k-blue.f-l { fill: #0B6FD0; stroke: #0B6FD0; }

.k-ink.f-t { fill: #4A5059; stroke: #4A5059; }
.k-ink.f-r { fill: #2A2F36; stroke: #2A2F36; }
.k-ink.f-l { fill: #16191D; stroke: #16191D; }

.k-furn.f-t { fill: #F7F8FA; stroke: #F7F8FA; }
.k-furn.f-r { fill: #DCE1E7; stroke: #DCE1E7; }
.k-furn.f-l { fill: #C8CFD8; stroke: #C8CFD8; }

.k-zone { fill: rgba(22, 25, 29, .035); stroke: rgba(22, 25, 29, .1); stroke-width: .8; stroke-dasharray: 4 3; }
.k-zone-blue { fill: rgba(30, 143, 239, .1); stroke: rgba(30, 143, 239, .45); stroke-width: .8; stroke-dasharray: 4 3; }

/* highlight state: dim everything not matching */
.iso-root.has-hl .iso-b:not(.hl) .f-t { fill: #F6F8FA; stroke: #F6F8FA; }
.iso-root.has-hl .iso-b:not(.hl) .f-r { fill: #E8ECF0; stroke: #E8ECF0; }
.iso-root.has-hl .iso-b:not(.hl) .f-l { fill: #DCE1E7; stroke: #DCE1E7; }
.iso-root.has-hl .iso-zone:not(.hl) .f { opacity: .3; }
.iso-root.has-hl .iso-b.hl .f-t { fill: #5CB8F7; stroke: #5CB8F7; }
.iso-root.has-hl .iso-b.hl .f-r { fill: #1E8FEF; stroke: #1E8FEF; }
.iso-root.has-hl .iso-b.hl .f-l { fill: #0B6FD0; stroke: #0B6FD0; }
.iso-root.has-hl .iso-zone.hl .f { fill: rgba(30, 143, 239, .22); stroke: var(--blue); opacity: 1; }
.iso-root.has-hl .iso-pin:not(.hl) { opacity: .25; }

.iso-pin { transition: opacity .3s var(--ease); }
.iso-pin-ring { fill: rgba(30, 143, 239, .18); transform-origin: center; transform-box: fill-box; animation: pinPulse 2.4s var(--ease) infinite; }
.iso-pin-dot { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.iso-pin-core { fill: var(--blue); }
@keyframes pinPulse { 0% { transform: scale(.6); opacity: 1; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

.iso-anim .iso-b { animation: isoIn .7s var(--ease) backwards; animation-delay: var(--d, 0ms); }
@keyframes isoIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .iso-pin-ring { display: none; }
}
