/* ============================================================
   DISPATCH — Shared Design System
   Agentic disclosure delivery for real estate agents.
   Aesthetic: calm, modern, utilitarian SaaS. White app surfaces,
   cool neutrals, one confident cobalt accent + emerald for "live".
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:ital,wght@0,400..800;1,400..600&family=Hanken+Grotesk:ital,wght@0,400..700;1,400..500&display=swap');

:root {
  /* --- Neutrals (cool, tinted toward ink-blue) --- */
  --paper:      oklch(0.984 0.003 264);   /* page background, near-white */
  --paper-2:    oklch(0.966 0.004 264);   /* subtle inset panel */
  --surface:    oklch(1 0 0);             /* pure-white app cards */
  --ink:        oklch(0.235 0.014 266);   /* cool near-black */
  --ink-soft:   oklch(0.445 0.013 266);   /* secondary text */
  --ink-faint:  oklch(0.600 0.011 266);   /* tertiary text */
  --line:       oklch(0.235 0.014 266 / 0.12);
  --line-soft:  oklch(0.235 0.014 266 / 0.07);

  /* --- Accent (cobalt) + status --- */
  --accent:      oklch(0.535 0.155 256);  /* primary cobalt */
  --accent-deep: oklch(0.460 0.150 256);  /* pressed / text-on-light */
  --accent-soft: oklch(0.535 0.155 256 / 0.10);
  --success:     oklch(0.640 0.130 162);  /* live / delivered emerald */
  --success-deep:oklch(0.500 0.105 162);
  --success-soft:oklch(0.640 0.130 162 / 0.12);
  --warn:        oklch(0.660 0.130 52);   /* in-progress amber (sparing) */
  --warn-soft:   oklch(0.660 0.130 52 / 0.14);

  /* --- Elevation: crisp, restrained --- */
  --shadow-xs: 0 1px 2px oklch(0.235 0.014 266 / 0.06);
  --shadow-sm: 0 1px 3px oklch(0.235 0.014 266 / 0.07), 0 4px 12px -6px oklch(0.235 0.014 266 / 0.10);
  --shadow-md: 0 4px 8px -4px oklch(0.235 0.014 266 / 0.08), 0 18px 40px -22px oklch(0.235 0.014 266 / 0.22);
  --shadow-lg: 0 8px 16px -8px oklch(0.235 0.014 266 / 0.10), 0 40px 80px -36px oklch(0.235 0.014 266 / 0.32);
  --ring: 0 0 0 4px var(--accent-soft);

  --radius:     12px;
  --radius-lg:  18px;
  --radius-sm:  8px;

  --display: 'Schibsted Grotesk', system-ui, sans-serif;
  --body:    'Hanken Grotesk', system-ui, sans-serif;

  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.004em;
}

/* gentle, cool wash — no disco glow */
body.washed {
  background-image:
    radial-gradient(1100px 560px at 84% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(760px 460px at -6% 4%, oklch(0.640 0.130 162 / 0.07), transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.06;
  margin: 0;
}

.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 4.6vw, 4.1rem);
  letter-spacing: -0.022em;
  line-height: 1.02;
}

.eyebrow {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

a { color: inherit; }
.mono-num { font-variant-numeric: tabular-nums; }

/* --- Layout helpers --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: 1rem; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* --- Brand mark: a minimal "dispatch node" --- */
.brand { display: inline-flex; align-items: center; gap: 0.58rem; font-family: var(--display); font-weight: 700; font-size: 1.14rem; letter-spacing: -0.022em; }
.mark {
  display: inline-block; width: 1.45em; height: 1.45em; border-radius: 6px; flex: 0 0 auto; position: relative;
  border: 1.6px solid var(--ink); background: var(--surface); vertical-align: middle;
}
.mark::before { /* signal node — sized by % so it scales with any box (px or em) */
  content: ""; position: absolute; inset: 0; margin: auto; width: 30%; height: 30%;
  border-radius: 50%; background: var(--accent);
}
.mark::after { /* dispatch tick */
  content: ""; position: absolute; right: -19%; top: 50%; width: 30%; height: 11%; min-height: 1.5px; max-height: 2.5px;
  border-radius: 1px; background: var(--accent); transform: translateY(-50%);
}
.mark.pulse::before { animation: nodePulse 2.4s var(--ease) infinite; }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%      { box-shadow: 0 0 0 5px transparent; transform: scale(1.08); }
}
/* legacy alias so older markup degrades gracefully */
.ball { display: inline-block; width: 1.45em; height: 1.45em; border-radius: 6px; border: 1.6px solid var(--ink); background: var(--surface); position: relative; flex: 0 0 auto; vertical-align: middle; }
.ball::before { content:""; position:absolute; inset:0; margin:auto; width:30%; height:30%; border-radius:50%; background:var(--accent); }
.ball.spin { animation: none; }

/* --- Buttons --- */
.btn {
  font-family: var(--body); font-weight: 600; font-size: 0.94rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.66rem 1.1rem; border-radius: 9px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: transform .16s var(--ease), background .18s, box-shadow .18s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.btn-accent:hover { background: var(--accent-deep); box-shadow: var(--shadow-sm); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: oklch(0.30 0.016 266); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* --- Panels / cards --- */
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.tag {
  display: inline-flex; align-items: center; gap: 0.38rem;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.005em;
  padding: 0.26rem 0.58rem; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface);
}
.tag-accent  { background: var(--accent-soft);  border-color: oklch(0.535 0.155 256 / 0.4); color: var(--accent-deep); }
.tag-success { background: var(--success-soft); border-color: oklch(0.640 0.130 162 / 0.42); color: var(--success-deep); }
.tag-warn    { background: var(--warn-soft);    border-color: oklch(0.660 0.130 52 / 0.42); color: oklch(0.48 0.11 52); }
.tag-ghost   { color: var(--ink-faint); }

.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; display: inline-block; }
.dot.live { background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: livePulse 2s var(--ease) infinite; }
@keyframes livePulse { 0%{box-shadow:0 0 0 0 oklch(0.640 0.130 162 / 0.5);} 70%,100%{box-shadow:0 0 0 6px transparent;} }

/* --- Device frames: clean, white, real --- */
.phone {
  width: 320px; border-radius: 40px; background: var(--ink); padding: 9px;
  box-shadow: var(--shadow-lg); position: relative; flex: 0 0 auto;
}
.phone-screen { background: var(--surface); border-radius: 32px; overflow: hidden; position: relative; }
.notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 92px; height: 20px; background: var(--ink); border-radius: 999px; z-index: 5; }

.browser { border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md); }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 10px 13px; background: var(--paper-2); border-bottom: 1.5px solid var(--line); }
.browser-bar .dots { display: flex; gap: 6px; }
.browser-bar .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; background: var(--line); }
.browser-url { font-size: 0.78rem; color: var(--ink-faint); background: var(--surface); border: 1.5px solid var(--line); border-radius: 7px; padding: 4px 12px; margin-left: 6px; flex: 1; }

hr.rule { border: none; border-top: 1.5px solid var(--line); margin: 0; }
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   MOTION UTILITIES (storytelling)
   ============================================================ */
/* reveal-on-scroll: add .in (via JS IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* timeline step fill — JS toggles .done sequentially */
.tl-step { opacity: 0.5; transition: opacity .45s var(--ease); }
.tl-step.done { opacity: 1; }
.tl-step .tl-ic { transition: background .45s var(--ease), color .45s var(--ease), transform .45s var(--ease); }

/* growing bars — set height via --h, reveal toggles scale */
.grow { transform: scaleY(0); transform-origin: bottom; transition: transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.grow.in { transform: scaleY(1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .grow { transform: scaleY(1); }
}
