/* ═══════════════════════════════════════════════════════════════════════════
   GA Drawings Agent — HERO
   Nav + headline + the three-window draggable product scene.
   Light system, attio.com bar. Tokens only: see css/tokens.css.
   ═══════════════════════════════════════════════════════════════════════════ */

body { overflow-x: hidden; }

/* ───────────────────────────────── NAV ───────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  height: 68px;
  max-width: 1416px; margin: 0 auto;
  padding: 0 36px;
  display: flex; align-items: center; gap: 34px;
}

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand-mark {
  width: 25px; height: 25px; border-radius: 6px;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  font: italic 900 11px/1 'Arial Black', 'Arial Bold', Arial, sans-serif;
  letter-spacing: -.01em; padding-right: 1px;
}
.brand-name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  letter-spacing: -.028em;
}

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: var(--ink);
  letter-spacing: -.014em; text-decoration: none; opacity: .88;
  transition: opacity .15s ease;
}
.nav-links a:hover { opacity: .55; }

.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-sm { height: 36px; padding: 0 15px; font-size: 14px; text-decoration: none; }

.nav-burger {
  display: none; margin-left: auto;
  width: 38px; height: 38px; border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); background: #fff; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-burger span { display: block; width: 16px; height: 1.5px; background: var(--ink); border-radius: 2px; }

/* ───────────────────────────────── HERO ──────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding-bottom: 44px;
  /* pale gradient, white at the top, cropped hard at the section edge */
  background:
    linear-gradient(180deg,
      #ffffff 0%,
      #ffffff 21%,
      #fbfcfd 31%,
      #f4f6fa 46%,
      #eff2f8 60%,
      #eef1f7 74%,
      #eef1f7 100%);
}

/* faint vertical pinstripes, only over the pale part */
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56%;
  background-image: repeating-linear-gradient(90deg,
      rgba(23,30,64,.042) 0 1px, transparent 1px 48px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 34%, #000 100%);
  pointer-events: none;
}

.hero-head {
  position: relative; z-index: 2;
  padding: 60px 24px 0;
  text-align: center;
}

.hero-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 8px 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 14px; font-weight: 500; letter-spacing: -.014em;
  color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: border-color .16s ease, transform .16s ease;
}
.hero-chip svg { color: var(--ink-faint); }
.hero-chip:hover { border-color: rgba(0,0,0,.2); }

.hero-title {
  margin: 26px auto 0;
  max-width: 15ch;
  font-size: clamp(40px, 5.05vw, 72px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.045em;
  color: var(--ink);
}

.hero-sub {
  margin: 21px auto 0;
  max-width: 566px;
  font-size: 19px;
  line-height: 1.47;
  letter-spacing: -.014em;
  color: var(--ink);
}
.hero-sub .dim { color: var(--ink-mute); }

/* Positioning line: who built it, and what it is for. Sits between the
   sub-head and the buttons, quieter than the sub so the hierarchy holds. */
.hero-note {
  margin: 15px auto 0;
  max-width: 600px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.01em;
  font-weight: 500;
  color: var(--ink);
}
.hero-note .dim { font-weight: 400; color: var(--ink-mute); }

.hero-actions {
  margin-top: 28px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.hero-actions .btn { height: 44px; padding: 0 20px; font-size: 15px; text-decoration: none; }

/* ──────────────────────────────── SCENE ──────────────────────────────── */

.scene {
  position: relative; z-index: 1;
  margin-top: 60px;
  height: 550px;                    /* JS overwrites: 550 * scale */
  perspective: 2400px;
  perspective-origin: 50% 30%;
}
.scene-inner {
  position: absolute; left: 50%; top: 0;
  width: 1240px; height: 550px;
  margin-left: -620px;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}
.scene-inner.tilting { transition: none; }

.win {
  position: absolute;
  left: var(--wx); top: var(--wy);
  width: var(--ww); height: var(--wh);
  z-index: var(--zi, 1);
  transform-style: preserve-3d;
  will-change: transform;
}
.win-lift {
  width: 100%; height: 100%;
  border-radius: var(--r-win);
  background: #fff;
  box-shadow: var(--shadow-win);
  transform: scale(calc(var(--ms, 1) * var(--lift, 1)));
  transform-origin: center center;
  transition: box-shadow .34s cubic-bezier(.22,1,.36,1),
              transform .34s cubic-bezier(.22,1,.36,1);
}
.win.is-drag { cursor: grabbing; }
.win.is-drag .win-lift {
  --lift: 1.014;
  box-shadow:
    0 1px 2px rgba(0,0,0,.05),
    0 20px 44px -12px rgba(16,24,40,.20),
    0 60px 120px -30px rgba(16,24,40,.30);
  transition: box-shadow .18s ease, transform .18s ease;
}
.win-enter {
  width: 100%; height: 100%;
  border-radius: var(--r-win);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.085);
  background: #fff;
  display: flex; flex-direction: column;
  opacity: 0;
  animation: winIn .74s cubic-bezier(.16,1,.3,1) both;
}
@keyframes winIn {
  from { opacity: 0; transform: translate3d(0, 30px, 0); }
  to   { opacity: 1; transform: none; }
}

.drag-handle { cursor: grab; -webkit-user-select: none; user-select: none; touch-action: none; }
.win.is-drag .drag-handle { cursor: grabbing; }

/* ── light window chrome bar (Revit + Runner) ── */
.bar {
  flex: none; height: 38px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  background: #f6f6f7;
  border-bottom: 1px solid var(--line);
}
.bar-dots { display: flex; gap: 6px; margin-right: 2px; }
.bar-dots i { width: 9px; height: 9px; border-radius: 50%; background: #d7d8dd; display: block; }
.bar-title {
  font: 500 10px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute);
}
.bar-meta {
  margin-left: auto;
  font: 400 10px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint);
}

/* ═══════════════════ 1 · REVIT WINDOW ═══════════════════ */

.revit-canvas {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 0%, #2a2c30 0%, #1e2023 62%, #17181b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
/* Fit by whichever axis runs out first. `height:100%` with a max-width let
   the slot stay full-height while its width was clamped, so overflow:hidden
   sliced the right-hand edge off the sheet. */
.sheet-slot {
  width: 100%;
  height: auto;
  aspect-ratio: 841 / 594;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.32), 0 14px 34px -10px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
}
/* placeholder frame only while the slot is empty — vanishes on injection */
.sheet-slot > svg { display: block; width: 100%; height: 100%; }
.sheet-slot:empty::after {
  content: '';
  position: absolute; inset: 3.4%;
  border: 1px solid rgba(0,0,0,.10);
  border-right-width: 1px;
  box-shadow: inset -104px 0 0 -103px rgba(0,0,0,.10);
}

/* ═══════════════════ 2 · GA DRAWINGS AGENT PANE ═══════════════════ */
/* Colours, sizes and labels are lifted verbatim from lib/panel.xaml. */

.win-pane .win-enter { background: var(--panel-bg); border-color: rgba(0,0,0,.24); }

.pane-head {
  flex: none; height: 60px;
  background: var(--red);
  display: flex; align-items: stretch;
  position: relative;
}
/* The pane is narrower than the real dockable pane, so the lockup must not be
   allowed to wrap — "GA DRAWINGS" is one line or it is not the wordmark. */
.pane-logo {
  display: flex; flex-direction: column; justify-content: center;
  margin-left: 14px; flex: none; min-width: 0;
}
.pane-logo-box {
  align-self: flex-start;
  border: 2.5px solid #fff;
  padding: 2px 9px 3px;
  color: #fff;
  font: italic 900 15px/1.15 'Arial Black', 'Arial Bold', Arial, sans-serif;
  letter-spacing: -.015em;
  white-space: nowrap;
}
.pane-logo-sub {
  margin: 3px 0 0 3px;
  font: 700 8px/1 var(--mono-revit);
  color: #fff; opacity: .75; letter-spacing: .04em;
}
.pane-chrome {
  margin-left: auto;
  display: flex; align-items: flex-start;
  padding: 6px 4px 0 0;
  flex: 0 1 auto; min-width: 0;
}
/* panel.xaml sets 56/42/52/34/34. Held in proportion, just scaled to fit. */
.chb {
  height: 34px; border: 0; background: transparent; color: #fff;
  font: 700 7.5px/1 var(--mono-revit);
  letter-spacing: .02em; cursor: pointer; padding: 0;
  flex: none;
  transition: background .12s ease;
}
.chb:hover { background: #aa0000; }
.chb-i { font-size: 17px; font-weight: 400; font-family: var(--font); }
.chb-g { font-size: 16px; }

.pane-strip {
  flex: none; height: 28px;
  background: var(--panel-strip);
  display: flex; align-items: center; padding: 0 14px 0 16px;
}
.st {
  display: inline-flex; align-items: center;
  font: 400 8px/1 var(--mono-revit);
  color: var(--panel-dim); letter-spacing: .05em; margin-right: 14px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-idle); margin-right: 5px; }
.dot.live { background: var(--dot-live); }
.st-session {
  margin-left: auto;
  font: 400 8px/1 var(--mono-revit); color: #444; letter-spacing: .05em;
}

.pane-chat {
  flex: 1 1 auto; min-height: 0;
  background: var(--panel-chat);
  padding: 8px 12px;
  display: flex; flex-direction: column; align-items: stretch;
  overflow: hidden;
}

.bub {
  max-width: 340px; margin: 2px 6px 4px;
  padding: 9px 12px; border-radius: 3px;
  font: 400 12px/18px var(--mono-revit);
  color: #fff;
}
.bub-you { background: var(--red); align-self: flex-end; }
.bub-ga  { background: #1f1f1f; align-self: flex-start; max-width: 400px; }
.bub-label {
  margin: 6px 6px 0;
  font: 700 8px/1 var(--mono-revit);
  letter-spacing: .06em; color: var(--red);
}

/* manifest card — mirrors _render_manifest_card() */
.mcard {
  margin: 5px 6px 8px; align-self: flex-start;
  max-width: 440px; width: calc(100% - 12px);
  border: 1.5px solid var(--red); border-radius: 3px;
  overflow: hidden;
}
.mcard-head {
  background: var(--red); padding: 6px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font: 700 10px/1.25 var(--mono-revit); color: #fff; letter-spacing: .05em;
}
.mrow {
  background: #141414; padding: 6px 12px;
  display: flex; align-items: center; gap: 8px;
}
.mrow.alt { background: #1c1c1c; }
.mnum {
  flex: none; width: 92px;
  font: 700 11px/1.35 var(--mono-revit); color: var(--red);
}
.mname {
  flex: 1 1 auto; min-width: 0;
  font: 400 11px/1.35 var(--mono-revit); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mct { flex: none; font: 400 9px/1.35 var(--mono-revit); color: #888; }
.mcard-foot {
  background: #141414; border-top: 1px solid #242424;
  padding: 7px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.mtot-l { font: 400 9px/1 var(--mono-revit); color: #888; letter-spacing: .1em; }
.mtot-r { font: 700 9px/1 var(--mono-revit); color: #fff; letter-spacing: .07em; }

.pane-input {
  flex: none; background: var(--panel-input);
  padding: 8px 10px; display: flex; gap: 6px;
}
.pane-field {
  flex: 1 1 auto; height: 38px;
  background: var(--panel-field);
  border: 1px solid var(--panel-border);
  display: flex; align-items: center; padding: 0 10px;
  font: 400 12px/1 var(--mono-revit); color: #fff; letter-spacing: .04em;
}
.caret {
  display: inline-block; width: 1.5px; height: 14px;
  background: var(--red); margin-left: 2px;
  animation: caretBlink 1.05s steps(1) infinite;
}
@keyframes caretBlink { 0%,49% { opacity: 1 } 50%,100% { opacity: 0 } }

.pane-send {
  flex: none; width: 52px; height: 38px;
  background: var(--red); color: #fff; border: 0; border-radius: 2px;
  font-size: 13px; cursor: pointer; transition: background .12s ease;
}
.pane-send:hover { background: var(--red-hover); }
.pane-send:active { background: var(--red-press); }

.pane-tag {
  flex: none; height: 18px; background: var(--red);
  display: grid; place-items: center;
  font: 700 7px/1 Arial, Helvetica, sans-serif;
  color: #fff; opacity: .96; letter-spacing: .02em;
}
.pane-tag { color: rgba(255,255,255,.86); }

/* ═══════════════════ 3 · RUNNER ═══════════════════ */

.runlist {
  flex: 1 1 auto; min-height: 0;
  margin: 0; padding: 13px 0; list-style: none;
  background: #fff;
}
.run {
  height: 30px; display: flex; align-items: center; gap: 11px;
  padding: 0 18px 0 16px;
  transition: opacity .3s ease;
}
.ri {
  flex: none; width: 18px;
  font: 500 10px/1 var(--mono); color: var(--ink-ghost); letter-spacing: .04em;
}
.rk { flex: none; width: 13px; height: 13px; position: relative; }
.rk::before {                       /* pending: hollow ring */
  content: ''; position: absolute; inset: 2px;
  border: 1.4px solid #dfe0e4; border-radius: 50%;
}
.run.done .rk::before {
  inset: 0;
  border: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M2.6 6.9 5 9.3l5.4-5.6' fill='none' stroke='%2335c759' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px 13px no-repeat;
}
.run.live .rk::before {
  inset: 3px; border: 0; border-radius: 50%;
  background: var(--dot-live);
  animation: runPulse 1.4s ease-out infinite;
}
@keyframes runPulse {
  0%   { box-shadow: 0 0 0 0 rgba(53,199,89,.45); }
  70%  { box-shadow: 0 0 0 6px rgba(53,199,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,199,89,0); }
}
.rl {
  flex: 1 1 auto; min-width: 0;
  font: 400 12.5px/1 var(--font); letter-spacing: -.012em;
  color: var(--ink-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.run.done .rl { color: var(--ink); }
.run.live .rl { color: var(--ink); font-weight: 500; }
.rt {
  flex: none; font: 400 11px/1 var(--mono); color: var(--ink-faint);
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.run.pend { opacity: .42; }
.run.pend .rt { visibility: hidden; }

/* ─────────────────────────── RESPONSIVE ─────────────────────────── */

@media (max-width: 1080px) {
  .nav-links { display: none; }
}

@media (max-width: 900px) {
  .nav-in { height: 60px; padding: 0 20px; gap: 12px; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .hero { padding-bottom: 56px; }
  .hero-head { padding: 48px 20px 0; }
  .hero-chip { height: 32px; font-size: 13px; padding: 0 8px 0 13px; }
  .hero-title { margin-top: 22px; font-size: clamp(36px, 10.4vw, 46px); letter-spacing: -.038em; max-width: 13ch; }
  .hero-sub { margin-top: 16px; font-size: 16.5px; max-width: 400px; }
  .hero-note { margin-top: 13px; font-size: 13.5px; max-width: 360px; }
  .hero-actions { margin-top: 26px; flex-direction: column; gap: 9px; }
  .hero-actions .btn { width: 100%; max-width: 300px; }

  /* Scene stops being a draggable stage and becomes a clean stack. */
  .scene {
    height: auto !important;
    margin-top: 44px;
    padding: 0 20px;
    perspective: none;
  }
  .scene-inner {
    position: static; width: auto; height: auto; margin: 0;
    transform: none !important;
    display: flex; flex-direction: column; gap: 18px;
  }
  .win {
    position: static;
    width: 100%; height: var(--mh, auto);
    transform: none !important;
  }
  .win-lift {
    width: var(--ww); height: var(--wh);
    transform-origin: top left;
    transform: scale(var(--ms, 1));
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 24px -10px rgba(16,24,40,.16);
  }
  /* stack order: pane, revit, runner */
  .win-pane   { order: 1; }
  .win-revit  { order: 2; }
  .win-runner { order: 3; }
  .drag-handle { cursor: default; }
  .hero::after { height: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  .win-enter { opacity: 1; animation: none; }
  .scene-inner { transition: none; }
  .caret { animation: none; }
  .run.live .rk::before { animation: none; }
}

/* while a window is being thrown, nothing else on the page reacts */
body.is-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }
body.is-dragging * { cursor: grabbing !important; }
