/* Cornerstory site. Nocturne tokens, shared with app/src/theme/tokens.ts. */
:root {
  --ground: #161826;
  --ground-deep: #12131f;
  --surface: #1e2030;
  --surface-2: #232532;
  --ink: #e9e9ed;
  --ink-2: #b2b6ca;   /* 8.8:1 on ground */
  --ink-3: #9397ab;   /* 5.6:1 on ground, fine print only */
  --accent: #9184d9;  /* line and glow, never a large fill */
  --accent-text: #b5abfc; /* 8.0:1 on ground, for text links */
  --accent-deep: #5d5294;
  --rule: rgba(233, 233, 237, 0.14);
  --lamp: #e8c48a;    /* streetlamp warmth, used only on the walker trail */

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(88px, 13vw, 168px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }

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

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--ink); color: var(--ground); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* Type */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 8.6vw, 6.75rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 0.8em;
  max-width: 18ch;
  text-wrap: balance;
}
h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.35em; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; margin: 0; }
.fineprint { font-size: 0.875rem; color: var(--ink-3); margin: 0.9em 0 0; }

/* Header */
.site-header { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav { display: none; } }

/* Buttons and inputs */
.btn {
  font: 500 1rem/1 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 0 24px;
  height: 52px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s, box-shadow .2s;
}
.btn:hover { background: rgba(145, 132, 217, 0.16); box-shadow: 0 0 24px rgba(145, 132, 217, 0.28); }
.btn:active { background: rgba(145, 132, 217, 0.26); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-quiet { border-color: rgba(233, 233, 237, 0.4); }
.btn-quiet:hover { background: rgba(233, 233, 237, 0.08); box-shadow: none; }

input[type="email"], input[type="text"] {
  font: 400 1rem var(--sans);
  color: var(--ink);
  background: var(--ground-deep);
  border: 1px solid rgba(233, 233, 237, 0.28);
  border-radius: 999px;
  height: 52px;
  padding: 0 22px;
  width: 100%;
  min-width: 0;
}
input::placeholder { color: var(--ink-3); }
input:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-color: transparent; }
input[aria-invalid="true"] { border-color: #f0a3a3; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Hero */
.hero { padding: 150px 0 var(--section); position: relative; overflow: hidden; }
.hero::before {
  /* a single soft pool of light behind the phone, like a lamp on a corner */
  content: ""; position: absolute; right: -10%; top: 4%; width: 70vw; max-width: 900px; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(145, 132, 217, 0.13), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(40px, 6vw, 96px); align-items: center; position: relative; }
.hero-copy .lede { margin-bottom: 44px; }

.signup { max-width: 520px; }
.signup-label { display: block; font-weight: 500; margin-bottom: 12px; }
.signup-row { display: flex; gap: 10px; }
.signup-note { font-size: 0.9rem; color: var(--ink-3); margin: 12px 0 0; min-height: 1.5em; }
.signup-note.is-ok { color: var(--accent-text); }
.signup-note.is-error { color: #f3b3b3; }

@media (max-width: 900px) {
  .hero { padding-top: 120px; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .signup-row { flex-direction: column; }
  .signup-row .btn { width: 100%; }
}

/* Phone mockup */
.phone-stage { margin: 0; justify-self: center; text-align: center; }
.phone {
  width: min(330px, 82vw);
  aspect-ratio: 9 / 19;
  border-radius: 46px;
  padding: 11px;
  background: #0f101a;
  border: 1px solid rgba(233, 233, 237, 0.12);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  margin: 0 auto;
}
.phone-screen {
  height: 100%;
  border-radius: 36px;
  background: var(--ground);
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 38px 14px 16px;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
}
.app-status { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 11px; margin: 0 4px 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 8px var(--accent); }
.app-map { width: 100%; height: auto; display: block; }
.app-card {
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 0 22px rgba(145, 132, 217, 0.35);
}
.app-earlier { list-style: none; margin: 14px 4px 0; padding: 0; flex: 1; color: var(--ink-2); font-size: 11px; }
.app-earlier-title { color: var(--ink-3); font-size: 10px; margin: 0 0 6px; }
.app-earlier li { padding: 7px 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 8px; }
.app-earlier li span:last-child { color: var(--ink-3); }
.app-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.app-chip { font-size: 10px; color: var(--accent-text); border: 1px solid var(--accent-deep); border-radius: 999px; padding: 2px 8px; }
.app-card-title { font-family: var(--serif); font-size: 19px; line-height: 1.15; margin: 0 0 6px; color: var(--ink); }
.app-card-body { margin: 0 0 8px; color: var(--ink-2); font-size: 12px; }
.app-card-source { margin: 0; color: var(--ink-3); font-size: 10px; }
.app-actions { display: flex; gap: 8px; margin-top: 12px; }
.app-btn { flex: 1; text-align: center; border: 1px solid var(--accent); border-radius: 999px; padding: 8px 0; color: var(--ink); font-size: 11px; }
.app-btn-quiet { flex: 0 0 34%; border-color: rgba(233, 233, 237, 0.3); }
.phone-caption { margin-top: 22px; color: var(--ink-3); font-size: 0.9rem; }

.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.eq i { display: block; width: 3px; height: 100%; border-radius: 2px; background: var(--accent-text); transform-origin: bottom; transform: scaleY(0.3); }

/* The one orchestrated moment: the walker reaches the corner, the place lights up, the story starts. */
@media (prefers-reduced-motion: no-preference) {
  .walker { animation: walk 2.6s cubic-bezier(.45, 0, .3, 1) .5s both; }
  .route { stroke-dashoffset: 0; animation: trail 2.6s linear .5s both; }
  .pin-glow { transform-origin: 168px 113px; animation: arrive 1.2s ease-out 3s both, breathe 3.2s ease-in-out 4.2s infinite; }
  .app-card { animation: card-in .9s ease-out 3.1s both; }
  .hero .eq i { animation: bar 1s ease-in-out 3.4s infinite alternate; }
  .hero .eq i:nth-child(2) { animation-delay: 3.55s; }
  .hero .eq i:nth-child(3) { animation-delay: 3.7s; }
  .hero .eq i:nth-child(4) { animation-delay: 3.5s; }
}
@keyframes walk {
  0%   { transform: translate(-128px, 70px); }
  45%  { transform: translate(-80px, 70px); }
  60%  { transform: translate(-80px, 1px); }
  100% { transform: translate(0, 0); }
}
@keyframes trail { from { opacity: 0; } 30% { opacity: 1; } to { opacity: 1; } }
@keyframes arrive { from { opacity: 0; transform: scale(.4); } to { opacity: .18; transform: scale(1); } }
@keyframes breathe { 50% { opacity: .32; transform: scale(1.25); } }
@keyframes card-in { from { border-color: var(--rule); box-shadow: none; } to { border-color: var(--accent); box-shadow: 0 0 22px rgba(145, 132, 217, 0.35); } }
@keyframes bar { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* Photography. Until a photo is dropped into /images, the frame shows a quiet street-grid instead. */
[data-photo] {
  margin: 0;
  position: relative;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23242638' stroke-width='5'%3E%3Cpath d='M-10 70 L250 52'/%3E%3Cpath d='M-10 170 L250 176'/%3E%3Cpath d='M80 -10 L76 250'/%3E%3Cpath d='M190 -10 L196 250'/%3E%3C/g%3E%3C/svg%3E");
}
[data-photo] img { width: 100%; height: 100%; object-fit: cover; }
[data-photo].is-empty img { visibility: hidden; }
.credit { color: var(--ink-3); font-size: 0.78rem; }
.credit:empty { display: none; }

.photo-band { height: clamp(260px, 42vw, 560px); }
.photo-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--ground) 0%, transparent 18%, transparent 70%, rgba(22, 24, 38, 0.85) 100%); pointer-events: none; }
.photo-band figcaption { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 1; color: var(--ink-2); font-size: 0.9rem; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* Sections */
.section { padding: var(--section) 0 0; }
.site-footer { margin-top: var(--section); }

/* How it works: a real sequence, so it is numbered */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); }
.steps li { counter-increment: step; border-top: 1px solid var(--rule); padding-top: 28px; }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: var(--accent-text); font-weight: 300; margin-bottom: 18px; }
.steps p { color: var(--ink-2); margin: 0; max-width: 30em; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 56px); margin: clamp(56px, 7vw, 88px) 0 0; padding: 32px 0 0; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 10px 1fr; column-gap: 16px; }
.facts dt, .facts dd { grid-column: 2; }
.facts div::before { content: ""; grid-row: 1 / span 2; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; border: 1.5px solid var(--accent); box-shadow: 0 0 10px rgba(145, 132, 217, .5); }
.facts dt { font-weight: 600; margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .steps, .facts { grid-template-columns: 1fr; }
}

/* Sample story */
.story-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 112px); align-items: center; }
.story-photo { aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; }
.story-photo figcaption { position: absolute; left: 16px; right: 16px; bottom: 14px; color: var(--ink); font-size: 0.85rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); display: flex; flex-direction: column; }
.story-photo .credit { color: var(--ink-2); }
.story-place { color: var(--ink-3); margin: -0.6em 0 1.4em; font-size: 0.95rem; }
.story-text { margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--accent); }
.story-text p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  line-height: 1.45;
  margin: 0;
  max-width: 32em;
}
.story-text.is-speaking { box-shadow: -14px 0 28px -18px var(--accent); }
.player { display: flex; align-items: center; gap: 18px; margin-top: 36px; }
.play {
  display: inline-flex; align-items: center; gap: 14px;
  font: 500 1rem var(--sans); color: var(--ink);
  background: transparent; border: 1.5px solid var(--accent); border-radius: 999px;
  padding: 0 26px 0 8px; height: 60px; cursor: pointer;
  transition: box-shadow .2s, background-color .2s;
}
.play svg { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: rgba(145, 132, 217, 0.22); fill: var(--ink); }
.play .icon-stop { display: none; }
.play[aria-pressed="true"] .icon-play { display: none; }
.play[aria-pressed="true"] .icon-stop { display: block; }
.play:hover, .play[aria-pressed="true"] { box-shadow: 0 0 28px rgba(145, 132, 217, 0.4); background: rgba(145, 132, 217, 0.1); }
.eq-player { opacity: 0; transition: opacity .3s; height: 18px; }
.play[aria-pressed="true"] + .eq-player { opacity: 1; }
.play[aria-pressed="true"] + .eq-player i { animation: bar .7s ease-in-out infinite alternate; }
.play[aria-pressed="true"] + .eq-player i:nth-child(2) { animation-delay: .15s; }
.play[aria-pressed="true"] + .eq-player i:nth-child(3) { animation-delay: .3s; }
.play[aria-pressed="true"] + .eq-player i:nth-child(4) { animation-delay: .1s; }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none !important; transform: scaleY(.7); } }
.sources { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); font-size: 0.92rem; }
.sources-title { color: var(--ink-3); margin: 0 0 8px; }
.sources ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-photo { aspect-ratio: 4 / 3; order: 2; }
}

/* Cities */
.cities { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 24px; align-items: stretch; }
.city { background: var(--surface); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.city-photo { aspect-ratio: 4 / 3; }
.city-lead .city-photo { aspect-ratio: auto; flex: 1; min-height: 260px; }
.city-photo figcaption { position: absolute; right: 10px; bottom: 8px; }
.city-body { padding: 24px 26px 28px; }
.city-body p { color: var(--ink-2); margin: 0; }
.city-body .city-when { color: var(--accent-text); margin: 0 0 12px; font-weight: 500; }
.city-lead h3 { font-size: 2.1rem; }
.suggest { padding: 26px; border: 1px dashed rgba(233, 233, 237, 0.26); background: transparent; gap: 0; }
.suggest p { color: var(--ink-2); margin: 0 0 20px; }
.suggest label { font-size: 0.9rem; font-weight: 500; margin: 0 0 6px; }
.suggest input { margin-bottom: 14px; height: 48px; }
.suggest .btn { margin-top: 6px; height: 48px; }
@media (max-width: 980px) { .cities { grid-template-columns: 1fr 1fr; } .city-lead { grid-column: 1 / -1; } .city-lead .city-photo { aspect-ratio: 16 / 9; flex: none; } }
@media (max-width: 620px) { .cities { grid-template-columns: 1fr; } }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: clamp(40px, 6vw, 96px); align-items: center; }
.price-card { border: 1.5px solid var(--accent); border-radius: 18px; padding: 36px 34px 30px; box-shadow: 0 0 60px -20px rgba(145, 132, 217, 0.45); }
.price { margin: 0 0 22px; display: flex; align-items: baseline; gap: 10px; }
.price-amount { font-family: var(--serif); font-weight: 300; font-size: 4.5rem; line-height: 1; letter-spacing: -0.02em; }
.price-unit { color: var(--ink-2); }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.price-list li { display: flex; gap: 12px; }
.price-list li::before { content: ""; flex: 0 0 14px; height: 8px; margin-top: 8px; border-left: 1.5px solid var(--accent-text); border-bottom: 1.5px solid var(--accent-text); transform: rotate(-45deg); }
@media (max-width: 820px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Trust */
.trust-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); }
.trust-copy p { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 1.1em; max-width: 36em; }
.trust-copy p:first-child { color: var(--ink); font-family: var(--serif); font-size: clamp(1.35rem, 2vw, 1.6rem); line-height: 1.45; }
@media (max-width: 820px) { .trust-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 96px); }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 24px 44px 24px 0; position: relative; font-size: 1.15rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -9px; border-right: 1.5px solid var(--accent-text); border-bottom: 1.5px solid var(--accent-text); transform: rotate(45deg); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq details p { margin: -6px 0 26px; color: var(--ink-2); max-width: 38em; }
@media (max-width: 820px) { .faq-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 44px; background: var(--ground-deep); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 32px 48px; align-items: start; }
.footer-brand p { color: var(--ink-3); margin: 10px 0 0; font-family: var(--serif); font-style: italic; }
.stores { display: flex; gap: 12px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(233, 233, 237, 0.28); border-radius: 12px; padding: 8px 16px 8px 12px; color: var(--ink-2); line-height: 1.15; font-size: 1rem; }
.store svg { width: 24px; height: 24px; fill: var(--ink-2); }
.store small { display: block; font-size: 0.68rem; color: var(--ink-3); }
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.credit-line { color: var(--ink-3); font-size: 0.9rem; margin: 0; justify-self: end; }
.credit-line a { color: var(--ink-2); }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .credit-line { justify-self: start; }
}

/* Legal pages */
.legal { padding: 140px 0 0; }
.legal .wrap { max-width: 760px; }
.legal h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 2em 0 0.5em; }
.legal p, .legal li { color: var(--ink-2); }
.draft-note { border: 1px dashed var(--accent); border-radius: 10px; padding: 14px 18px; color: var(--ink-2); font-size: 0.95rem; }
