/* ============================================
   SNAPFIRE EXPERIMENTS — shared base
   Mechanics only. Each direction sets tokens + composition.
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* brand, fixed across directions */
  --accent: #ff6b35;
  --accent-hi: #ff8c5a;
  --on-accent: #120a06;
  --ok: #3ccf7a;

  /* defaults, overridden per direction */
  --bg: #0a0a0f;
  --raise: #13131b;
  --raise-2: #1b1b26;
  --line: #2a2a38;
  --line-2: #3a3a4a;
  --text: #ecebf2;
  --muted: #b3b2c4;
  --faint: #8d8ca2;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', ui-monospace, monospace;

  /* 4-based spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color-scheme: dark; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 1.0625rem; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Browser surfaces, themed */
::selection { background: var(--accent); color: var(--on-accent); }
html { caret-color: var(--accent); scrollbar-color: var(--line-2) var(--bg); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; 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: 2000; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 16px; }

/* Icons: one stroke family, drawn */
.i { width: 1em; height: 1em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }

/* Links */
.link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s, color .2s; }
.link:hover { color: var(--accent-hi); text-decoration-color: currentColor; }
.link .i { transition: transform .3s var(--ease); }
.link:hover .i { transform: translateX(3px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font-weight: 600; font-size: 1rem; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform .3s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .3s;
}
.btn .i { transition: transform .3s var(--ease); }
.btn:hover .i { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -6px rgba(255,107,53,.55); }
.btn--primary:hover { background: var(--accent-hi); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 12px 28px -10px rgba(255,107,53,.7); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }

/* ============================================
   NAV (mechanics shared, look tunable)
   ============================================ */
.nav { position: fixed; inset: 0 0 auto; z-index: 1000; padding: 18px 0; border-bottom: 1px solid transparent; transition: background-color .3s, padding .3s, border-color .3s; }
.nav--scrolled { background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line); padding: 10px 0; }
.nav__container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__link { display: inline-flex; align-items: center; gap: 6px; font-size: .94rem; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav__link:hover { color: var(--text); }
.nav__link--cta { color: var(--on-accent); background: var(--accent); padding: 9px 16px; border-radius: 8px; font-weight: 600; }
.nav__link--cta:hover { color: var(--on-accent); background: var(--accent-hi); }
.nav__services details { position: relative; }
.nav__services summary { cursor: pointer; list-style: none; }
.nav__services summary::-webkit-details-marker { display: none; }
.nav__services summary .i { color: var(--accent); transition: transform .25s var(--ease); }
.nav__services details[open] summary .i { transform: rotate(180deg); }
.nav__submenu { position: absolute; top: calc(100% + 14px); left: -12px; min-width: 260px; padding: 8px; background: var(--raise-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 48px -12px rgba(0,0,0,.6); }
.nav__submenu a { display: block; padding: 10px 12px; color: var(--muted); font-size: .92rem; border-radius: 8px; }
.nav__submenu a:hover, .nav__submenu a:focus-visible { color: var(--text); background: var(--raise); }
.nav__link[aria-current="page"], .nav__submenu a[aria-current="page"] { color: var(--text); }
.nav__submenu a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); }
.nav__toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav__toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav__toggle--active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle--active span:nth-child(2) { opacity: 0; }
.nav__toggle--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__menu { position: fixed; top: 68px; left: 12px; right: 12px; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px; background: var(--raise-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.6); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
  .nav__menu--open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__menu .nav__link { display: flex; padding: 12px; font-size: 1rem; }
  .nav__link--cta { justify-content: center; margin-top: 6px; }
  .nav__submenu { position: static; box-shadow: none; border: 0; padding: 0 0 0 8px; background: transparent; }
}

/* ============================================
   SERVICE PICKER (behavior shared)
   ============================================ */
.picker__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.picker__choice { min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 600; color: var(--text); transition: background-color .2s, border-color .2s, color .2s; }
.picker__choice:hover { border-color: var(--text); }
.picker__choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ============================================
   TRAINING EXERCISE (behavior shared)
   ============================================ */
.exercise__doc { padding: var(--s5); border-radius: 12px; background: var(--raise-2); border: 1px solid var(--line); }
.exercise__doclabel { font-size: .8rem; font-weight: 600; color: var(--faint); margin-bottom: var(--s2); letter-spacing: .01em; }
.exercise__doc p:last-child { color: var(--text); }
#draftPromise { transition: background-color .3s, color .3s, box-shadow .3s; border-radius: 3px; }
.training-preview__highlight { background: rgba(255,107,53,.22); color: #ffd2bd; box-shadow: 0 0 0 3px rgba(255,107,53,.22); text-decoration: underline wavy var(--accent); text-underline-offset: 4px; }
.exercise__feedback h3 { color: var(--text); }

/* ============================================
   DESK (automation example, behavior shared)
   ============================================ */
.desk { position: relative; background: var(--raise); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.desk__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.desk__title { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.desk__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(60,207,122,.15); }
.desk__tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.desk__tab { font-size: .8rem; font-weight: 500; color: var(--muted); padding: 6px 10px; border-radius: 6px; transition: background-color .2s, color .2s; }
.desk__tab:hover { color: var(--text); }
.desk__tab[aria-selected="true"] { background: var(--raise-2); color: var(--text); }
.desk__body { padding: 16px; display: grid; gap: 14px; min-height: 360px; align-content: start; }
.msg { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; transition: opacity .4s, transform .5s var(--ease); }
.msg__meta { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: .72rem; color: var(--faint); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.msg__meta span:first-child { color: var(--accent); }
.msg__from { font-weight: 600; font-size: .94rem; margin-bottom: 4px; }
.msg__text { font-size: .9rem; color: var(--muted); line-height: 1.55; }
.desk__label { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: 10px; min-height: 18px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.desk--done .spinner { animation: none; border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 2px var(--raise); }
@keyframes spin { to { transform: rotate(360deg); } }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.field { background: var(--raise-2); border-radius: 9px; padding: 8px 11px; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .45s var(--ease); }
.field--in { opacity: 1; transform: none; }
.field dt { font-size: .7rem; font-weight: 600; color: var(--faint); }
.field dd { font-size: .86rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.draft { padding: 12px 14px; border-radius: 10px; background: color-mix(in oklab, var(--accent) 7%, var(--raise)); opacity: 0; transition: opacity .4s; }
.draft--in { opacity: 1; }
.draft__label { font-size: .72rem; font-weight: 600; color: var(--accent-hi); margin-bottom: 3px; }
.draft__text { font-size: .9rem; line-height: 1.55; min-height: 2.8em; }
.draft__text::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
.desk--done .draft__text::after { content: none; }
@keyframes blink { 50% { opacity: 0; } }
.desk__handoff { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); background: color-mix(in oklab, var(--accent) 6%, var(--raise)); transform: translateY(100%); opacity: 0; transition: transform .5s var(--ease), opacity .4s; }
.desk--done .desk__handoff { transform: none; opacity: 1; }
.handoff__title { font-weight: 700; font-size: .96rem; display: flex; align-items: center; gap: 8px; }
.handoff__title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.handoff__sub { font-size: .82rem; color: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,107,53,.6); } 100% { box-shadow: 0 0 0 10px rgba(255,107,53,0); } }
.desk--sent .desk__handoff { background: rgba(60,207,122,.08); }
.desk--sent .handoff__title::before { background: var(--ok); animation: none; }
@media (max-width: 560px) {
  .desk__bar { flex-direction: column; align-items: stretch; }
  .desk__tab { flex: 1; }
  .desk__handoff { flex-direction: column; align-items: stretch; }
}

/* ============================================
   PROGRAM RAIL (behavior shared)
   ============================================ */
.rail { position: relative; --p: 0; }
.rail::before, .rail::after { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; }
.rail::before { background: var(--line); }
.rail::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); }
.phase { position: relative; padding-left: 44px; }
.phase::before { content: ""; position: absolute; left: 0; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); transition: border-color .4s, background-color .4s, box-shadow .4s; z-index: 1; }
.phase--lit::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(255,107,53,.18); }

/* ============================================
   FAQ (mechanics)
   ============================================ */
.faq__item { border-top: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 1px solid var(--line); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font-weight: 600; font-size: 1.1rem; transition: color .2s; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent-hi); }
.faq__item summary .i { color: var(--accent); font-size: 1.1rem; transition: transform .35s var(--ease); }
.faq__item[open] summary .i { transform: rotate(45deg); }
.faq__item > div { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.faq__item[open] > div { grid-template-rows: 1fr; }
.faq__item > div > p { overflow: hidden; color: var(--muted); max-width: 62ch; }
.faq__item[open] > div > p { padding-bottom: 24px; }

/* ============================================
   REVEAL + MOTION
   ============================================ */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal--in { opacity: 1; transform: none; }

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