/* ============================================================
   TILTED TUMBLER - Precision Industrial design system
   Shared brand tokens (slate #1c2128 + amber #f0a832), light/dark.
   Hand-rolled, no build step.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* brand constants */
  --amber: #f0a832;
  --amber-bright: #ffbd4a;
  --slate-ink: #1c2128;

  /* dark theme (default) */
  --bg:        #121519;
  --bg-grid:   rgba(255,255,255,.028);
  --surface:   #1a1f25;
  --surface-2: #20262e;
  --border:    #2c343d;
  --border-bright: #3a444f;
  --text:      #e9ecef;
  --text-dim:  #9aa4af;
  --text-faint:#6b7480;
  --accent:    var(--amber);
  --accent-2:  var(--amber-bright);
  --accent-ink:#1c2128;     /* text that sits on amber fills */
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 18px 40px -20px rgba(0,0,0,.7);
  --glow: rgba(240,168,50,.14);

  /* type */
  --f-display: "Archivo Expanded","Archivo",sans-serif;
  --f-body: "IBM Plex Sans",sans-serif;
  --f-mono: "IBM Plex Mono",ui-monospace,monospace;

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

html[data-theme="light"] {
  --bg:        #f6f5f0;
  --bg-grid:   rgba(28,33,40,.045);
  --surface:   #ffffff;
  --surface-2: #efede6;
  --border:    #e0ddd2;
  --border-bright: #cdc8b8;
  --text:      #1c2128;
  --text-dim:  #5a6472;
  --text-faint:#8a8577;
  --accent:    #c1810e;          /* darker amber for contrast on light */
  --accent-2:  #a96d05;
  --accent-ink:#1c2128;
  --shadow: 0 1px 0 rgba(255,255,255,.6), 0 16px 34px -22px rgba(28,33,40,.28);
  --glow: rgba(193,129,14,.12);
}

/* ---------- RESET ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* soft amber glow only; the blueprint grid is confined to the hero below */
  background-image: radial-gradient(120% 80% at 80% -8%, var(--glow), transparent 52%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }
img,svg { display: block; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px;
  font-family: var(--f-mono); font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- WORDMARK ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.wordmark__mark { flex: none; } /* inherits --text so the real glass outline adapts to theme; amber liquid stays amber */
.wordmark__text {
  font-family: var(--f-mono); font-weight: 600; letter-spacing: .14em;
  font-size: 15px;
}
.cursor { color: var(--accent); animation: blink 1.15s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.wordmark--sm .wordmark__text { font-size: 14px; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(18px,4vw,40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.site-nav { margin-left: auto; display: flex; gap: 26px; }
.site-nav a {
  font-family: var(--f-mono); font-size: 13px; color: var(--text-dim);
  letter-spacing: .02em; position: relative; padding: 4px 0;
  transition: color .2s var(--ease);
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { width: 100%; }

.theme-toggle {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-dim); cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-bright); transform: translateY(-1px); }
.icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

@media (max-width: 680px) { .site-nav { display: none; } }

/* ---------- BUTTONS ---------- */
.btn {
  --by: 0;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: 14px; font-weight: 500;
  letter-spacing: .01em; padding: 13px 22px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .22s var(--ease), background .2s, box-shadow .25s, border-color .2s, color .2s;
  transform: translateY(var(--by));
}
.btn__arrow { transition: transform .25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px var(--glow); }
.btn--primary:hover { background: var(--accent-2); --by: -2px; box-shadow: 0 14px 30px -10px var(--glow); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-bright); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); --by: -2px; }
.btn--lg { padding: 16px 30px; font-size: 15px; }

/* ---------- HERO ---------- */
.hero { position: relative; max-width: var(--maxw); margin: 0 auto; padding: clamp(48px,9vw,110px) clamp(18px,4vw,40px) clamp(40px,7vw,80px); }
/* faint blueprint grid, only behind the hero, fading out toward the page */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px,5vw,64px); align-items: center; }
.eyebrow {
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .18em;
  color: var(--accent); margin-bottom: 22px;
}
.hero__title {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(34px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -.01em;
  text-wrap: balance;
}
.hero__title .accent { color: var(--accent); position: relative; white-space: nowrap; }
.hero__title .accent::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .08em; height: .09em;
  background: var(--accent); opacity: .5;
}
.hero__lede { font-size: clamp(16px,1.6vw,18.5px); color: var(--text-dim); max-width: 36em; margin-top: 24px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__note {
  display: flex; align-items: center; gap: 9px; margin-top: 26px;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--text-faint); letter-spacing: .01em;
}
.hero__note .dot { width: 7px; height: 7px; border-radius: 50%; background: #38b46b; box-shadow: 0 0 0 3px color-mix(in srgb,#38b46b 22%,transparent); }

/* schematic */
.hero__schematic { position: relative; }
.schematic { width: 100%; height: auto; overflow: visible; }
.schematic__label, .schematic__caption { font-family: var(--f-mono); color: var(--text-faint); }
.schematic__label { font-size: 11px; letter-spacing: .16em; margin-bottom: 10px; }
.schematic__caption { font-size: 12px; margin-top: 12px; line-height: 1.5; }
.sch-block rect { fill: var(--surface); stroke: var(--border-bright); stroke-width: 1; }
.sch-block text { fill: var(--text-dim); font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; }
.sch-core polygon { fill: color-mix(in srgb, var(--accent) 16%, var(--surface)); stroke: var(--accent); stroke-width: 1.6; }
.sch-core text { fill: var(--accent); font-family: var(--f-mono); font-weight: 600; font-size: 15px; }
.sch-core__sub { fill: var(--text-faint) !important; font-size: 9px !important; letter-spacing: .14em; }
.sch-wire path { stroke-dasharray: 240; stroke-dashoffset: 240; opacity: .85; }
.sch-block, .sch-core { opacity: 0; transform: translateX(-8px); }
.reveal.in .sch-block { animation: schIn .5s var(--ease) forwards; animation-delay: var(--d,0s); }
.reveal.in .sch-core { animation: schIn .6s var(--ease) forwards; animation-delay: var(--d,0s); }
.reveal.in .sch-wire path { animation: dash 1s var(--ease) forwards; animation-delay: .6s; }
@keyframes schIn { to { opacity: 1; transform: none; } }
@keyframes dash { to { stroke-dashoffset: 0; } }

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__schematic { max-width: 420px; }
}

/* ---------- BANDS ---------- */
.band { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px,8vw,100px) clamp(18px,4vw,40px); }
.band--alt { max-width: none; background: var(--surface); border-block: 1px solid var(--border); }
.band--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; color: var(--accent); margin-bottom: 16px; }
.band__head { max-width: 760px; margin-bottom: clamp(36px,5vw,56px); }
.band__title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(26px,3.6vw,40px); line-height: 1.08; letter-spacing: -.01em;
  text-wrap: balance;
}
.band__sub { color: var(--text-dim); font-size: clamp(15px,1.4vw,17px); margin-top: 16px; max-width: 60ch; }

/* ---------- DEMO GRID ---------- */
.demo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.demo-card {
  position: relative; display: flex; flex-direction: column;
  padding: 26px 22px 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .28s var(--ease), border-color .25s, box-shadow .28s;
}
.demo-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.demo-card:hover { transform: translateY(-5px); border-color: var(--border-bright); box-shadow: var(--shadow); }
.demo-card:hover::before { transform: scaleX(1); }
.demo-card__no { font-family: var(--f-mono); font-size: 12px; color: var(--text-faint); letter-spacing: .1em; }
.demo-card h3 { font-family: var(--f-display); font-weight: 700; font-size: 21px; margin: 14px 0 10px; }
.demo-card p { font-size: 14px; color: var(--text-dim); flex: 1; }
.demo-card__cta { margin-top: 18px; font-family: var(--f-mono); font-size: 13px; color: var(--accent); }
.demo-grid__foot { margin-top: 28px; font-size: 14.5px; color: var(--text-dim); font-family: var(--f-mono); }
.demo-grid__foot a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb,var(--accent) 40%,transparent); }
.demo-grid__foot a:hover { border-color: var(--accent); }

@media (max-width: 900px) { .demo-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .demo-grid { grid-template-columns: 1fr; } }

/* ---------- STEPS ---------- */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-top: 30px; }
.step::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 1px; background: var(--border); }
.step::after { content: ""; position: absolute; top: 6px; left: 0; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.step__no { font-family: var(--f-mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.step h3 { font-family: var(--f-display); font-weight: 600; font-size: 18px; margin: 10px 0 8px; }
.step p { font-size: 14px; color: var(--text-dim); }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2,1fr); gap: 28px 20px; } }
@media (max-width: 460px) { .steps { grid-template-columns: 1fr; } }

/* ---------- AI BAND ---------- */
.ai-band { max-width: none; background: var(--surface); border-block: 1px solid var(--border); }
.ai-band__inner { max-width: var(--maxw); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,5vw,60px); align-items: center; }
.ai-band__copy .btn { margin-top: 26px; }
.terminal { border: 1px solid var(--border-bright); border-radius: 8px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow); }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.terminal__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); }
.terminal__bar span:first-child { background: #e0664b; }
.terminal__bar span:nth-child(2) { background: #e0a93b; }
.terminal__bar span:nth-child(3) { background: #4caf6e; }
.terminal__bar b { margin-left: auto; font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; color: var(--text-faint); }
.terminal__body { font-family: var(--f-mono); font-size: 12.5px; line-height: 1.85; padding: 16px 18px; color: var(--text-dim); white-space: pre-wrap; }
.terminal__body .ok { color: #4caf6e; font-weight: 600; }
.tl--in { color: var(--text); }
.tl--out b { color: var(--accent) !important; }
.tl--dim { color: var(--text-faint); }
.ai-band__inner .tl { display: block; opacity: 0; animation: tlIn .4s var(--ease) forwards; }
.reveal.in .tl:nth-child(1){animation-delay:.0s}.reveal.in .tl:nth-child(2){animation-delay:.5s}.reveal.in .tl:nth-child(3){animation-delay:.9s}.reveal.in .tl:nth-child(4){animation-delay:1.25s}.reveal.in .tl:nth-child(5){animation-delay:1.55s}.reveal.in .tl:nth-child(6){animation-delay:1.85s}.reveal.in .tl:nth-child(7){animation-delay:2.15s}
@keyframes tlIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) { .ai-band__inner { grid-template-columns: 1fr; } }

/* ---------- CTA ---------- */
.cta-band { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px,9vw,120px) clamp(18px,4vw,40px); text-align: center; }
.cta-band__inner { max-width: 640px; margin: 0 auto; }
.cta-band h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px,4.4vw,48px); line-height: 1.05; margin: 12px 0; text-wrap: balance; }
.cta-band p { color: var(--text-dim); font-size: 16px; margin-bottom: 30px; }
.cta-band .section-label { text-align: center; }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px clamp(18px,4vw,40px) 36px; }
.site-footer__inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-footer__tag { font-family: var(--f-mono); font-size: 12.5px; color: var(--text-faint); letter-spacing: .04em; }
.site-footer__phone { margin-left: auto; font-family: var(--f-mono); font-size: 13.5px; color: var(--text-dim); }
.site-footer__phone:hover { color: var(--text); }
.site-footer__mail { font-family: var(--f-mono); font-size: 13.5px; color: var(--accent); }
.site-footer__mail:hover { color: var(--accent-2); }
.site-footer__rule { max-width: var(--maxw); margin: 24px auto 0; height: 1px; background: linear-gradient(90deg, var(--accent), transparent 40%); opacity: .5; }
.site-footer__fine { max-width: var(--maxw); margin: 16px auto 0; font-family: var(--f-mono); font-size: 11.5px; color: var(--text-faint); }

/* ---------- QUESTIONNAIRE FORM ---------- */
.q-wrap { max-width: 760px; margin: 0 auto; padding: clamp(40px,7vw,80px) clamp(18px,4vw,40px) 90px; }
.q-intro { margin-bottom: 40px; }
.q-intro h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px,4.4vw,44px); line-height: 1.05; letter-spacing: -.01em; }
.q-intro p { color: var(--text-dim); font-size: 16px; margin-top: 16px; max-width: 56ch; }
.q-section { margin-top: 44px; }
.q-section > .section-label { margin-bottom: 22px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.field { margin-bottom: 24px; }
.field > label, .field > .field__q {
  display: block; font-weight: 600; font-size: 15px; margin-bottom: 9px; color: var(--text);
}
.field__hint { font-weight: 400; color: var(--text-faint); font-family: var(--f-mono); font-size: 12px; }
.field input[type=text], .field input[type=email], .field textarea, .field select {
  width: 100%; font-family: var(--f-body); font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 14.5px; padding: 10px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  font-family: var(--f-mono); transition: border-color .2s, color .2s, background .2s;
}
.choice input { accent-color: var(--accent); width: 15px; height: 15px; }
.choice:hover { border-color: var(--border-bright); }
.choice:has(input:checked) { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.q-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.q-submit { margin-top: 36px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.q-status { font-family: var(--f-mono); font-size: 13px; color: var(--text-dim); }
.q-status.err { color: #e0664b; }
.q-required { color: var(--accent); }
/* thank-you */
.q-thanks { text-align: center; padding: clamp(60px,12vw,130px) 20px; max-width: 560px; margin: 0 auto; }
.q-thanks__check { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid var(--accent); }
.q-thanks h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px,4vw,38px); }
.q-thanks p { color: var(--text-dim); font-size: 16px; margin-top: 14px; }
.q-thanks .btn { margin-top: 30px; }
[hidden] { display: none !important; }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.in .sch-block, .reveal.in .sch-core { animation: none; opacity: 1; transform: none; }
  .reveal.in .sch-wire path { animation: none; stroke-dashoffset: 0; }
  .ai-band__inner .tl { opacity: 1; animation: none; }
  .cursor { animation: none; }
}
