/* =========================================================================
   Shoti — launch site styles.
   Tokens inherited verbatim from /DESIGN.md; marketing extensions per
   /marketing/DESIGN-MARKETING.md. Pure CSS, no framework, no second font.
   One canvas, four ink tiers, one clay accent used as ink only.
   Solid colours only — the canvas is one colour and it stays that colour
   (the banned visual tells per ANTI-SLOP.md §1-2 are absent by design).
   ========================================================================= */

:root {
  --canvas:           #08090b;
  --gutter:           #0c0d10; /* one graphite step above canvas; frames the column */
  --surface-1:        #121215;
  --surface-2:        #18181d;
  --ink:              #dcd9d2;
  --ink-muted:        #9a948a;
  --ink-dim:          #7e7a72;
  --ink-faint:        #5e5a52;
  --hairline:         #1a1a1e;
  --hairline-strong:  #252529;
  --accent:           #c98562;
  --accent-hover:     #dd9270;
  --accent-quiet:     #2a1d15;

  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* spacing — 8px scale (one 4px half-step), straight from DESIGN.md §4 */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-18: 72px; --s-20: 80px;
  --s-24: 96px; --s-32: 128px;

  --column:     600px;        /* the reading measure (~66ch at 16px) */
  --shell:      728px;        /* 600 column + 64 breathing each side */
  --measure:    66ch;         /* max line-length for body prose */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; }
html, body { margin: 0; padding: 0; }
/* tooltip pseudo-elements in .voices-prose use position:absolute + nowrap and
   can extend past the viewport on narrow screens; contain their bounding box
   without affecting vertical scroll. */
html { overflow-x: hidden; }

body {
  /* gutter is a quiet graphite step above canvas, so the reading column —
     which stays canvas-true for full text weight — reads as the darkest,
     densest band on the page. Two solid surfaces. No gradient, no blur. */
  background: var(--gutter);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  font-feature-settings: "kern" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color 160ms ease-out; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--accent-quiet); color: var(--ink); }
::-moz-selection { background: var(--accent-quiet); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
code { font-family: var(--font-mono); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--canvas);
  padding: var(--s-2) var(--s-4); border-radius: 4px; z-index: 100;
}
.skip:focus { left: var(--s-4); top: var(--s-4); }

/* ---------------------------------------------------------- the reading shell */

main {
  background: var(--canvas);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--s-24) var(--s-16) var(--s-20);
  min-height: 100vh;
}

/* ---------------------------------------------------------- corner brand mark */

.corner-mark {
  position: fixed;
  bottom: var(--s-8);
  left: calc(50vw + 364px + 32px); /* 50vw + (728/2) + 32px gutter inset */
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  z-index: 1;
  pointer-events: none;
}
@media (max-width: 1100px) { .corner-mark { display: none; } }

/* ---------------------------------------------------------- wordmark */

.wordmark {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--ink);
  line-height: 1;
  margin: 0 0 var(--s-10) 0;
  display: inline-block;
}
.wordmark .dot {
  color: var(--accent);
  display: inline-block;
  animation: breathe 4.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

/* ---------------------------------------------------------- thesis lead (h1) */

.thesis-lead {
  font-size: 26px;
  line-height: 1.22;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.014em;
  max-width: 40ch;
  margin: 0 0 var(--s-3) 0;
  text-wrap: balance;
}
.thesis-lead .accent { color: var(--accent); }

/* Mechanism subhead — sits between the benefit-led h1 and the demo. Carries
   the "what kind of product" the H1 leaves to the subhead + demo (the locked
   positioning sentence from closed-product-language-current.md). */
.thesis-sub {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: -0.003em;
  max-width: 40ch;
  margin: 0 0 var(--s-10) 0;
  text-wrap: pretty;
}

/* ---------------------------------------------------------- hero demo embed */

/* The §6.3 cross-role redirect demo lives here as the show to the thesis's
   tell. Calm container — the canvas frames it, no heavy player chrome. The
   media file is recorded separately (Spec 6); until it lands, the poster
   placeholder holds the frame at the correct aspect ratio. */
.demo {
  margin: 0 0 var(--s-10) 0;
  max-width: var(--column);
}
.demo-frame {
  position: relative;
  display: block;
  width: 100%;
  /* Matches the recorded source exactly (1920×1080 = 16:9). The frame MUST
     equal the source ratio: with object-fit: cover any mismatch crops the
     two panes' left/right edges — the Inbound/Yours columns the demo exists
     to show. Keep this in lockstep with the recorder output. */
  aspect-ratio: 16 / 9;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}
.demo-frame video,
.demo-frame video > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}
/* the caption rail beneath the frame — what the demo shows, period-closed */
.demo-caption {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: var(--s-4) 0 0 0;
  max-width: var(--column);
}
.demo-caption a { color: var(--ink); border-bottom: 1px solid var(--hairline-strong); padding-bottom: 1px; }
.demo-caption a:hover { color: var(--accent); border-bottom-color: var(--accent-quiet); }

/* Quiet media controls overlaid on the frame — pause/play + view-larger.
   Chrome-light per DESIGN.md §5/§7: caption-weight text, no scrubber, no
   surface fill, no shadow/blur. Bottom-right sits over the frame's dark/empty
   corner (the baked-in footer is bottom-left, captions are centred). Always
   visible so they're discoverable for keyboard + touch; quiet at rest, ink on
   hover/focus. Hidden when JS is absent (no-JS shows a static poster with no
   controls to drive). */
.no-js .demo-controls { display: none; }
.demo-controls {
  position: absolute;
  right: var(--s-3);
  bottom: var(--s-3);
  display: flex;
  gap: var(--s-2);
  z-index: 2;
}
.demo-ctl {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.003em;
  line-height: 1;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 7px 9px; /* >= 24px hit target (WCAG 2.5.8) */
  cursor: pointer;
  text-decoration: none;
  transition: color 160ms ease-out;
}
.demo-ctl:hover { color: var(--ink); }
.demo-ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; color: var(--ink); }

/* ---------------------------------------------------------- front door (email gate) */

.front-door { margin: 0 0 var(--s-12) 0; }

.front-door .sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 var(--s-5) 0;
  max-width: var(--measure);
}

form.invite {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  max-width: 480px;
  flex-wrap: wrap;
}
form.invite input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-faint);
  padding: var(--s-2) 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.003em;
  outline: none;
  transition: border-color 160ms ease-out;
}
form.invite input[type="email"]::placeholder { color: var(--ink-faint); }
form.invite input[type="email"]:focus { border-bottom-color: var(--accent); }

/* primary CTA — clay fill, used as ink (DESIGN.md button-primary) */
form.invite button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--canvas);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.003em;
  padding: var(--s-2) var(--s-4);
  border-radius: 4px;
  transition: background 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out;
}
form.invite button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
form.invite button:active { transform: translateY(1px); }
form.invite button:disabled { opacity: 0.6; cursor: default; }
form.invite[data-done="true"] { display: none; }

/* honeypot: visually hidden but script-focusable (bots fill it) */
form.invite .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  font-size: 14px;
  color: var(--ink-dim);
  margin: var(--s-3) 0 0 0;
  min-height: 1px;
}
.form-status.confirmed { color: var(--ink); }

/* the "on its way" success state, swapped in by JS */
.front-door[data-sent="true"] form.invite,
.front-door[data-sent="true"] .invite-or { display: none; }
.sent-state {
  display: none;
  max-width: var(--measure);
}
.front-door[data-sent="true"] .sent-state { display: block; }
.sent-state .title {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 var(--s-2) 0;
}
.sent-state .body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
}

/* secondary CTA — quiet prose link to cal.com */
.invite-or {
  font-size: 14px;
  color: var(--ink-dim);
  margin: var(--s-3) 0 0 0;
  line-height: 1.5;
}
.invite-or a {
  color: var(--ink);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 1px;
  transition: color 160ms ease-out, border-color 160ms ease-out;
}
.invite-or a:hover { color: var(--accent); border-bottom-color: var(--accent-quiet); }
.invite-or .arr {
  display: inline-block;
  margin-left: 4px;
  transition: transform 160ms ease-out;
}
.invite-or a:hover .arr { transform: translateX(2px); }

/* ---------------------------------------------------------- the rule between hero and essay */

.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: var(--s-12) 0 var(--s-12) 0;
  max-width: var(--column);
}

/* ---------------------------------------------------------- thesis essay */

p {
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink-muted);
  margin: 0 0 var(--s-4) 0;
  max-width: var(--measure);
}
p strong { color: var(--ink); font-weight: 600; }
p em {
  /* DESIGN.md: no italic. Emphasis via colour, not slope. */
  font-style: normal;
  color: var(--ink);
}
p code {
  color: var(--ink);
  background: rgba(220, 217, 210, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: var(--s-12) 0 var(--s-3) 0;
}

/* ---------------------------------------------------------- the editorial cartoon */

.quiet-break {
  margin: var(--s-18) 0 var(--s-12) 0;
  padding: 0;
  max-width: var(--column);
}
.quiet-break a {
  display: block;
  cursor: zoom-in;
  border-radius: 4px;
  transition: opacity 160ms ease-out;
}
.quiet-break a:hover { opacity: 0.92; }
.quiet-break a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.quiet-break img { display: block; width: 100%; height: auto; border-radius: 4px; }
.quiet-break figcaption {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: var(--s-4) 0 0 0;
  max-width: var(--measure);
}

/* ---------------------------------------------------------- voices */

.voices-prose {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-muted);
  margin: 0 0 var(--s-4) 0;
  max-width: var(--column);
}
.voices-prose a.q {
  color: var(--ink);
  font-weight: 500;
  font-style: normal;
  text-decoration: none;
  position: relative;
  transition: color 160ms ease-out, border-bottom-color 160ms ease-out;
  cursor: pointer;
  border-bottom: 1px solid var(--hairline-strong);
}
.voices-prose a.q:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* tooltip is always in the DOM (opacity 0); fades in with a 4px rise. */
.voices-prose a.q::after {
  content: attr(data-source);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  color: var(--canvas);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  font-family: var(--font-sans);
  letter-spacing: -0.003em;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}
.voices-prose a.q:hover::after,
.voices-prose a.q:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------- reading list */

ul.dash {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4) 0;
  max-width: var(--column);
}
ul.dash li {
  padding-left: var(--s-5);
  position: relative;
  margin-bottom: var(--s-3);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}
ul.dash li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}
ul.dash li a.reading-item {
  color: var(--ink);
  text-decoration: none;
  display: block;
  transition: color 160ms ease-out;
}
ul.dash li a.reading-item:hover { color: var(--accent); }
ul.dash li a.reading-item:hover .who { color: var(--accent); opacity: 0.7; }
ul.dash li .who {
  color: var(--ink-faint);
  font-size: 12px;
  display: block;
  margin-top: 1px;
  transition: color 160ms ease-out, opacity 160ms ease-out;
}

/* ---------------------------------------------------------- founder bridge */

.bridge {
  font-size: 17px;
  color: var(--ink);
  font-weight: 500;
  margin: var(--s-12) 0 var(--s-6) 0;
  max-width: var(--measure);
  line-height: 1.55;
}

/* ---------------------------------------------------------- built-by */

.built-by {
  margin: var(--s-16) 0 0 0;
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.5;
}
.built-by a { color: var(--ink); }
.built-by a:hover { color: var(--accent); }

/* ---------------------------------------------------------- scroll reveal */

/* The single premium motion beyond the H1 fade: the two figure moments — the
   hero demo embed and the editorial cartoon — settle in with a whisper-soft
   6px rise as each enters the viewport, once. Reveal is applied ONLY to those
   decorative figures, never to the thesis essay, the front-door CTA, or any
   load-bearing reading content (which always renders at full opacity — calm,
   no motion, "letters not dashboards"). No parallax, no scroll-jacking, no
   counters — restrained per DESIGN.md §7 dialog-chrome motion budget. Fully
   removed under prefers-reduced-motion (see below); the .is-in class is also
   applied immediately when JS is absent or IntersectionObserver is missing,
   so no-JS users always see the figures at full opacity. */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------------------------------------------------------- lightbox */

.lightbox {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  color: inherit;
  overflow: hidden;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 200ms ease-out, transform 200ms ease-out,
              overlay 200ms ease-out allow-discrete,
              display 200ms ease-out allow-discrete;
}
.lightbox[open] { display: flex; }
@starting-style {
  .lightbox[open] { opacity: 0; transform: scale(0.985); }
}
.lightbox::backdrop {
  background: rgba(8, 9, 11, 0.96);
  cursor: zoom-out;
  opacity: 1;
  transition: opacity 200ms ease-out,
              overlay 200ms ease-out allow-discrete,
              display 200ms ease-out allow-discrete;
}
@starting-style {
  .lightbox[open]::backdrop { opacity: 0; }
}
.lightbox-frame {
  position: relative;
  display: inline-block;
  max-width: 92vw;
  max-height: 86vh;
}
.lightbox-image {
  display: block;
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  cursor: zoom-out;
}
/* The enlarged demo loop (video mode). Sized like the image; hidden until the
   dialog is opened in video mode. The two modes are mutually exclusive. */
.lightbox-video {
  display: none;
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  cursor: zoom-out;
}
.lightbox--video .lightbox-image { display: none; }
.lightbox--video .lightbox-video { display: block; }
.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: -0.003em;
  line-height: 1;
  padding: var(--s-2) var(--s-4);
  border-radius: 4px;
  outline: 0;
  transition: color 160ms ease-out, border-color 160ms ease-out;
}
.lightbox-close:hover { color: var(--accent); border-color: var(--accent-quiet); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 720px) {
  body { background: var(--canvas); }
  main {
    border-left: 0;
    border-right: 0;
    padding: var(--s-16) var(--s-5) var(--s-14, 56px);
    min-height: auto;
  }
  .thesis-lead { font-size: 22px; max-width: none; }
  .thesis-sub { font-size: 15px; max-width: none; }
  .quiet-break { margin: var(--s-12) 0 var(--s-8) 0; }
  .quiet-break figcaption { font-size: 12px; margin-top: var(--s-3); }
  .demo-caption { font-size: 12px; }
  .lightbox-frame { max-width: 96vw; max-height: 82vh; }
  .lightbox-image { max-width: 96vw; max-height: 82vh; }
  .lightbox-video { max-width: 96vw; max-height: 82vh; }
  .lightbox-close { top: -36px; padding: 6px 10px; font-size: 12px; }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .wordmark .dot { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  /* The demo loop never autoplays under reduced motion (JS gate). Hide the
     play/pause toggle too, so there is no affordance that could start the
     >5s motion against the user's expressed preference — the static poster,
     the "View larger" still, and the figcaption carry the demo without motion.
     The pause control is only needed where autoplay runs, i.e. NOT here. */
  .demo-ctl[data-demo-toggle] { display: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
