:root {
  --bg: #070b16;
  --ink: #eef1f7;
  --muted: #a9b1c3;
  --gold: #e5b567;
  --gold-soft: rgba(229, 181, 103, 0.35);
  --card: rgba(8, 12, 24, 0.62);
  --hair: rgba(255, 255, 255, 0.09);
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-webgl {
  background: radial-gradient(ellipse at 50% 70%, #2b2418 0%, #0b1430 55%, #070b16 100%) fixed;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(3, 5, 12, 0.6) 100%);
}

/* ---------- header ---------- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 40px);
}

.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0.02em; }
.brand-sub { margin-top: 6px; font-size: 11px; letter-spacing: 0.18em; color: var(--gold); }

.top-actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font: 400 14px/1 var(--sans);
  letter-spacing: 0.04em;
  color: #0b0f1a;
  background: var(--gold);
  border: 1px solid var(--gold);
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn:hover { background: #f1c983; border-color: #f1c983; }
.btn.ghost { color: var(--ink); background: rgba(8, 12, 24, 0.45); border-color: var(--hair); backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--gold-soft); color: var(--gold); }
.btn.big { padding: 15px 28px; font-size: 16px; }
.btn[hidden] { display: none; }
.btn:focus-visible, .dots button:focus-visible, .brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- side: law office / developer ---------- */
body[data-side="lawyer"] [data-side="developer"],
body[data-side="developer"] [data-side="lawyer"] { display: none !important; }

.side-switch { display: inline-flex; border: 1px solid var(--gold-soft); background: rgba(8, 12, 24, 0.5); backdrop-filter: blur(6px); }
.side-switch button {
  padding: 10px 18px;
  font: 400 15px/1 var(--sans);
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.side-switch button:hover { color: var(--ink); }
.side-switch button[aria-checked="true"] { background: var(--gold); color: #0b0f1a; }
.side-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.side-switch.small button { padding: 9px 12px; font-size: 13px; }

.side-pick { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.side-pick > span { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }

.other-side { margin-top: 16px !important; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 14px !important; }
.link { padding: 0; font: inherit; color: var(--gold); background: none; border: 0; border-bottom: 1px solid var(--gold-soft); cursor: pointer; }
.link:hover { border-bottom-color: var(--gold); }

/* ---------- play the tour ---------- */
.tour {
  position: fixed;
  left: clamp(16px, 2.5vw, 32px);
  bottom: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font: 400 14px/1 var(--sans);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(8, 12, 24, 0.6);
  border: 1px solid var(--gold-soft);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.tour:hover { border-color: var(--gold); color: var(--gold); }
.tour:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* play triangle; media controls keep ▶ even in RTL */
.tour i { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid var(--gold); }
/* pause bars while playing */
.tour.on i { width: 10px; height: 12px; border: 0; border-left: 3px solid var(--gold); border-right: 3px solid var(--gold); }
body.still .tour { display: none; }

/* ---------- chapter dots ---------- */
.dots {
  position: fixed;
  left: clamp(12px, 2.5vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.dots button.on { background: var(--gold); border-color: var(--gold); transform: scale(1.25); }

/* ---------- chapters ---------- */
main { position: relative; z-index: 2; }

.chapter {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px clamp(16px, 7vw, 120px) 60px;
  position: relative;
}
.chapter.start { justify-content: flex-start; }
.chapter.end { justify-content: flex-end; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold);
}

h1, h2 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: 0.005em; }
h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; margin-bottom: 16px; }

.card {
  width: min(460px, 100%);
  padding: 30px 30px 26px;
  background: var(--card);
  border: 1px solid var(--hair);
  border-top: 1px solid var(--gold-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.card.in { opacity: 1; transform: none; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }

/* hero */
.hero { flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; padding-bottom: 120px; }
.hero h1 { font-size: clamp(76px, 12vw, 150px); line-height: 0.95; font-weight: 400; text-shadow: 0 0 40px rgba(229, 181, 103, 0.25); }
.lead { max-width: 560px; margin: 18px auto 0; font-size: clamp(16px, 1.6vw, 19px); color: #cfd5e2; }
.hero .eyebrow { margin-bottom: 18px; }
.hero-inner { animation: rise 1.6s ease both 0.2s; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.3em; color: var(--muted); }
.scroll-cue i { width: 1px; height: 42px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* signatures stat */
.stat { margin-top: 22px; }
.stat-row { display: flex; align-items: baseline; gap: 10px; }
.stat-num { font-family: var(--serif); font-size: 34px; color: var(--ink); }
.stat-num b { font-weight: 500; color: var(--gold); }
.stat-label { color: var(--muted); font-size: 14px; }
.bar { margin-top: 10px; height: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.3s; }

/* document chips */
.chips { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--hair); font-size: 14px; color: #d6dbe6; }
.chips i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.chips b { margin-inline-start: auto; font-weight: 500; color: var(--c); font-variant-numeric: tabular-nums; }

/* milestones */
.steps { list-style: none; counter-reset: s; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.steps li { counter-increment: s; position: relative; padding: 5px 26px 5px 0; font-size: 14px; color: rgba(214, 219, 230, 0.45); transition: color 0.4s; }
.steps li::before { content: counter(s); position: absolute; right: 0; top: 7px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); font-size: 10px; line-height: 17px; text-align: center; color: rgba(214, 219, 230, 0.5); transition: all 0.4s; }
.steps li.done { color: #e6e9f0; }
.steps.opp { grid-template-columns: 1fr; }
.steps.opp li { font-size: 15px; }
.steps li.done::before { background: var(--gold); border-color: var(--gold); color: #0b0f1a; }

/* insights: a quarter goal tied to the work */
.goal { margin-top: 20px; padding: 16px 16px 14px; border: 1px solid var(--gold-soft); background: rgba(229, 181, 103, 0.06); }
.goal-label { margin: 0 !important; font-size: 11px !important; font-weight: 500; letter-spacing: 0.18em; color: var(--gold) !important; }
.goal-title { margin: 4px 0 0 !important; font-family: var(--serif); font-size: 20px !important; color: var(--ink) !important; }
.goal-row { margin-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; color: #d6dbe6; }
.goal-row b { color: var(--gold); font-weight: 500; }
.goal-num { font-family: var(--serif); font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.goal-bar i { width: 0; transition: width 1.6s ease 0.4s; }
.card.in .goal-bar i { width: 91.7%; }
.goal-next { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.goal-next li { position: relative; padding: 3px 14px 3px 0; }
.goal-next li::before { content: ""; position: absolute; right: 0; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* features */
.features { list-style: none; margin: 20px 0 0; padding: 0; }
.features li { display: flex; flex-direction: column; padding: 11px 0; border-top: 1px solid var(--hair); }
.features b { font-weight: 500; font-size: 15px; }
.features span { color: var(--muted); font-size: 14px; }
/* finale */
.finale { flex-direction: column; justify-content: center; text-align: center; }
.finale-inner { padding: 48px clamp(16px, 5vw, 72px); background: radial-gradient(ellipse at center, rgba(5, 8, 18, 0.82) 0%, rgba(5, 8, 18, 0.55) 55%, transparent 75%); }
.finale h2 { font-size: clamp(34px, 5vw, 64px); }
.cta { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.foot { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(169, 177, 195, 0.6); letter-spacing: 0.1em; }

/* ?still=N — the scene alone, for capturing a frame */
body.still .top, body.still .dots, body.still main, body.still .veil { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .top { padding: 16px; }
  .brand-name { font-size: 24px; }
  .top-actions .btn.ghost { display: none; }
  .top-actions { gap: 6px; }
  .side-switch.small button { padding: 8px 9px; font-size: 12px; }
  .side-switch button { padding: 9px 14px; font-size: 14px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .dots { display: none; }
  .tour { left: 16px; bottom: 16px; padding: 10px 14px; font-size: 13px; }
  .chapter { padding: 90px 16px 28px; align-items: flex-end; }
  .chapter.start, .chapter.end { justify-content: center; }
  .card { padding: 22px 20px; }
  .card p { font-size: 15px; }
  .hero { padding-bottom: 110px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  .steps li { font-size: 13px; }
}
