/* storydrills.com — the landing page.
 *
 * Separate from the app on purpose. It shares the brand tokens and the
 * wordmark and nothing else: the app is offline-first and never names a
 * hostname, and this page is the one surface whose whole job is to name one.
 *
 * Same rules as docs/: one stylesheet, no build step, no dependencies.
 * The palette is the app's STUDIO theme, which is what you get when you open
 * Storydrills for the first time — the page should look like the product.
 */

:root{
  --brand-red:#E0392F;
  --brand-cream:#FFEDDF;
  --brand-grey:#747578;
  --black:#000;

  --bg:#000;
  --bg-1:#0C0E0F;
  --bg-2:#141618;
  --bg-3:#1C1F21;
  --line:#26292C;

  --ink:var(--brand-cream);
  /* Lifted greys rather than brand grey: #747578 measures 4.06:1 on the
     raised surface, which fails AA for body text. Same departure the app
     makes, for the same reason. */
  --ink-2:#B9B2AC;
  --ink-3:#8E8A87;

  /* #E0392F is 4.42:1 on studio ink — fine for graphics, short of AA for
     small text. Links and small red type take the lifted tint, exactly as
     --accent-ink does in the app. */
  --accent:var(--brand-red);
  --accent-ink:#F1554E;

  --maxw:1080px;
  --radius:14px;

  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --label:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}

/* Self-hosted, like the app's. A landing page that waits on a font CDN is a
   landing page that renders late for the exact audience it is trying to
   impress. */
@font-face{
  font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;
  src:url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
}

*{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-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img,video{max-width:100%;display:block}

a{color:var(--accent-ink)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--accent-ink);outline-offset:2px;
}

.wrap{width:100%;max-width:var(--maxw);margin:0 auto;padding:0 22px}

.label{
  font-family:var(--label);font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink-3);margin:0 0 14px;
}

/* ------------------------------------------------------------------ bar -- */

.bar{
  position:sticky;top:0;z-index:20;
  background:rgba(0,0,0,.82);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--line);
}
.bar-in{display:flex;align-items:center;justify-content:space-between;gap:16px;height:62px}
.bar .wordmark{height:24px}

/* ---------------------------------------------------------------- hero --- */

.hero{padding:70px 0 40px;text-align:center}
.hero .wordmark{height:74px;margin:0 auto 26px}
@media (max-width:640px){ .hero .wordmark{height:46px} .hero{padding:48px 0 28px} }

h1{
  font-family:var(--serif);
  font-size:clamp(30px,5.2vw,54px);
  line-height:1.1;
  letter-spacing:-.01em;
  margin:0 auto 18px;
  max-width:22ch;
  /* Supported in every current engine and harmless where it is not: without
     it this headline breaks as "Drill story / structure until you / can see
     it", which is three ragged lines and one orphan. */
  text-wrap:balance;
}
.lede{
  font-size:clamp(17px,2.1vw,20px);
  color:var(--ink-2);
  max-width:56ch;margin:0 auto 8px;
}
.hero-note{
  font-family:var(--label);font-size:12px;letter-spacing:.06em;
  color:var(--ink-3);margin:22px 0 0;
}

.cta-row{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:28px}

.btn{
  display:inline-block;border:none;border-radius:12px;cursor:pointer;
  font:600 16px/1 var(--sans);padding:15px 26px;text-decoration:none;
  transition:transform .12s ease,background .12s ease,border-color .12s ease;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:#ef4a40}
.btn-quiet{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn-quiet:hover{border-color:var(--ink-3)}
@media (prefers-reduced-motion:reduce){ .btn{transition:none} .btn:active{transform:none} }

/* --------------------------------------------------------------- phone --- */

/* A bezel, not a photograph of a handset. The clips are recorded at a real
   390x844 viewport, so this frame is showing the true layout rather than a
   desktop build squeezed into a phone shape. */
.phone{
  width:min(300px,78vw);
  margin:0 auto;
  border:10px solid #17191B;
  border-radius:42px;
  background:#000;
  box-shadow:0 30px 80px rgba(0,0,0,.75), 0 0 0 1px #2A2E31;
  overflow:hidden;
  line-height:0;
}
.phone video{width:100%;height:auto;border-radius:32px}

.hero-shot{margin-top:44px}
/* The hero clip earns more room than the ones beside prose further down. */
@media (min-width:900px){ .hero-shot{width:334px} }

/* -------------------------------------------------------------- section -- */

section{padding:74px 0;border-top:1px solid var(--line)}
h2{
  font-family:var(--serif);font-size:clamp(24px,3.4vw,34px);line-height:1.2;
  margin:0 0 14px;letter-spacing:-.005em;
}
h3{font-size:19px;margin:0 0 8px;letter-spacing:-.005em}
p{margin:0 0 16px;color:var(--ink-2)}
p.tight{margin-bottom:0}
strong{color:var(--ink);font-weight:600}

/* A feature row: prose on one side, a phone on the other, stacked on mobile
   with the phone SECOND — the claim should arrive before the evidence. */
.feature{display:grid;grid-template-columns:1fr;gap:34px;align-items:center}
@media (min-width:860px){
  .feature{grid-template-columns:1fr 1fr;gap:60px}
  .feature.flip .feature-copy{order:2}
}
.feature-copy{max-width:46ch}

.ticks{list-style:none;margin:18px 0 0;padding:0}
.ticks li{position:relative;padding-left:22px;margin:0 0 10px;color:var(--ink-2)}
.ticks li::before{
  content:"";position:absolute;left:0;top:9px;width:8px;height:8px;
  border-radius:50%;background:var(--accent);
}

/* ------------------------------------------------------------ framework -- */

.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.card{
  background:var(--bg-1);border:1px solid var(--line);border-radius:var(--radius);
  padding:22px;
}
.card .slots{
  font-family:var(--label);font-size:12px;color:var(--accent-ink);letter-spacing:.06em;
  margin:0 0 10px;
}
.card p{font-size:15px;margin:0}

.stats{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-top:8px}
.stat{background:var(--bg-1);border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.stat b{display:block;font-family:var(--serif);font-size:32px;line-height:1.1;color:var(--ink)}
.stat span{font-family:var(--label);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3)}

/* ------------------------------------------------------------------ form -- */

.form-wrap{
  background:var(--bg-1);border:1px solid var(--line);border-radius:18px;padding:28px;
  max-width:620px;
}
@media (max-width:640px){ .form-wrap{padding:20px} }

.field{margin:0 0 16px}
.field label{
  display:block;font-family:var(--label);font-size:11px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--ink-3);margin:0 0 7px;
}
.field input,.field select,.field textarea{
  width:100%;background:var(--bg-2);color:var(--ink);
  border:1px solid var(--line);border-radius:10px;
  padding:13px 14px;font:400 16px/1.45 var(--sans);
}
.field textarea{min-height:110px;resize:vertical}
.field input::placeholder,.field textarea::placeholder{color:#6E6A67}

.form-note{font-size:13px;color:var(--ink-3);margin:14px 0 0}
.form-status{margin:16px 0 0;font-size:15px;min-height:1.4em}
.form-status.is-bad{color:var(--accent-ink)}
.form-status.is-good{color:#7FD08C}

/* Anti-spam that costs a visitor nothing: a field only a bot fills in. */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* ---------------------------------------------------------------- foot --- */

footer{border-top:1px solid var(--line);padding:40px 0 60px;color:var(--ink-3);font-size:14px}
footer .wordmark{height:20px;margin-bottom:18px;opacity:.9}
footer a{color:var(--ink-2)}
.foot-row{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center}

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

/* Lifted verbatim from the app's stylesheet so there is one lockup, not a
   lookalike. Sized by HEIGHT only — the viewBox aspect has moved three times
   and a hard-coded width bakes in whichever ratio was current that week. */
.wordmark{height:26px;width:auto;display:block;overflow:visible}
.wm-l path{fill:var(--wm-ink,#E0392F)}
.wm-disc{fill:var(--wm-disc,#E0392F)}
.wm-disc{animation:wm-rise-disc 420ms cubic-bezier(.2,.9,.3,1) both}
.wm-arc{stroke-dasharray:832;animation:wm-draw 520ms cubic-bezier(.2,.9,.3,1) 90ms both}
.wm-l{animation:wm-rise .55s cubic-bezier(.22,1,.36,1) both;animation-delay:calc(620ms + var(--i) * 70ms)}
.wm-dot{
  animation:wm-pop .45s cubic-bezier(.34,1.56,.64,1) both;
  animation-delay:calc(620ms + var(--i) * 70ms + 120ms);
  transform-box:fill-box;transform-origin:center;
}
@keyframes wm-draw{ from{stroke-dashoffset:832} to{stroke-dashoffset:0} }
@keyframes wm-rise-disc{ from{opacity:0;transform:translateY(3px)} to{opacity:1;transform:none} }
@keyframes wm-rise{ from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
@keyframes wm-pop{
  from{opacity:0;transform:scale(0)}
  60%{opacity:1;transform:scale(1.25)}
  to{opacity:1;transform:scale(1)}
}

/* The bar's copy has already played by the time anyone scrolls; running it
   again on every paint is noise. */
.bar .wm-l,.bar .wm-dot,.bar .wm-disc,.bar .wm-arc,
footer .wm-l,footer .wm-dot,footer .wm-disc,footer .wm-arc{animation:none}

/* `.wm-l{opacity:1}` plus `both` is the app's rule and it carries here: where
   CSS animation is ignored the lockup renders VISIBLE rather than blank. */
@media (prefers-reduced-motion:reduce){
  .wm-l,.wm-dot,.wm-disc,.wm-arc{animation:none !important}
  .wm-arc{stroke-dasharray:none}
}
