/* FlagPole — styles
   Warm civic-almanac brand surface. Chrome stays quiet; the flag artwork and a single
   rubric-red "red-letter" accent carry the voice. Light-first, lamplit dark, WCAG 2.2 AA. */

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

body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--rubric); outline-offset: 3px; border-radius: 3px; }

/* ---------- Type ---------- */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.012em; color: var(--ink); }
.display { font-size: var(--t-display); line-height: 1.02; letter-spacing: -0.02em; }
h1, .h1 { font-size: var(--t-h1); }
h2, .h2 { font-size: var(--t-h2); }
h3, .h3 { font-size: var(--t-h3); line-height: 1.2; }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); }
.measure { max-width: var(--measure); }
.italic { font-style: italic; }
.rubric-text { color: var(--rubric); }

.kicker {
  font-family: var(--sans);
  font-size: var(--t-kicker);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--rubric);
  display: inline-flex;
  align-items: center;
  gap: .5ch;
}
.kicker svg { width: 1.05em; height: 1.05em; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.band { padding-block: var(--section-y); }
.band--surface { background: var(--surface); }
.band--sunken { background: var(--sunken); }
.ruled { border-top: 1px solid var(--hairline); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.eyebrow-gap { margin-top: var(--sp-3); }
.mt-7 { margin-top: var(--sp-7); }
.mx-auto { margin-inline: auto; }
.kicker.is-center { justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--hairline); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand .mark { width: 22px; height: 26px; }
.brand .mark .pole { stroke: var(--ink); }
.brand .mark .flag { fill: var(--rubric); }
.nav-links { display: flex; align-items: center; gap: var(--sp-5); }
.nav-links a { font-size: .95rem; color: var(--ink-2); text-decoration: none; transition: color .2s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: inline-flex; }
@media (max-width: 720px) {
  .nav-links .nav-link { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1;
  padding: .8rem 1.25rem; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  border: 1px solid var(--hairline); text-decoration: none; cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { --b-bg: var(--rubric-btn); --b-fg: var(--rubric-ink); border-color: transparent; box-shadow: var(--shadow-1); }
.btn-primary:hover { box-shadow: var(--shadow-2); }
.btn-ghost { --b-bg: transparent; --b-fg: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: .55rem .95rem; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) var(--section-y); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero-copy { max-width: 34rem; }
.hero h1 { margin-top: var(--sp-4); }
.hero .lead { margin-top: var(--sp-5); }
.hero-art { justify-self: center; position: relative; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: clamp(2.5rem, 8vw, 3.5rem); }
  .hero-art { order: -1; }
  .hero-copy { max-width: none; }
}

/* iPhone frame: a transparent-screen PNG shell (z2) layered over the screenshot (z1). */
.iphone-frame {
  position: relative;
  width: min(320px, 82vw);
  aspect-ratio: 365 / 750;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 14px rgba(40,33,28,.10)) drop-shadow(0 26px 52px rgba(40,33,28,.18));
}
.iphone-frame-shell { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.iphone-frame img.iphone-screen {
  position: absolute; left: 3.6%; top: 1.6%; width: 92.8%; height: 96.8%;
  object-fit: cover; object-position: top; border-radius: 8% / 3.7%; z-index: 1;
}
.iphone-frame-sm { width: min(290px, 76vw); }
@media (prefers-color-scheme: dark) {
  .iphone-frame { filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)) drop-shadow(0 28px 56px rgba(0,0,0,.6)); }
}

/* Hero waitlist */
.waitlist { margin-top: var(--sp-6); }
.waitlist-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.field {
  flex: 1 1 14rem; min-width: 0;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: .8rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field::placeholder { color: var(--ink-2); }
.field:focus { outline: none; border-color: var(--rubric); box-shadow: 0 0 0 3px color-mix(in oklab, var(--rubric) 22%, transparent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin-top: var(--sp-3); font-size: var(--t-small); color: var(--ink-2); }
.form-msg { margin-top: var(--sp-3); font-size: var(--t-small); font-weight: 600; min-height: 1.2em; }
.form-msg[data-state="ok"] { color: var(--ink); } /* success reads neutral, distinct from the red error */
.form-msg[data-state="err"] { color: var(--rubric); }

.soon {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: var(--sp-5); padding: .35rem .7rem .35rem .5rem;
  font-size: var(--t-small); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
}
.soon .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--rubric); box-shadow: 0 0 0 3px color-mix(in oklab, var(--rubric) 20%, transparent); }

/* ---------- Generic split section ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--flip .split-art { order: -1; }
.split-copy { max-width: 32rem; }
.split-art { display: flex; justify-content: center; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: clamp(2rem, 7vw, 3rem); }
  .split--flip .split-art { order: 0; }
  .split-copy { max-width: none; }
}

.section-head { max-width: 38rem; }
.section-head h2 { margin-top: var(--sp-3); }
.section-head .lead { margin-top: var(--sp-4); }

/* ---------- Frame gallery ---------- */
.frames { margin-top: var(--sp-7); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }
.frame { text-align: center; }
.frame-img { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-2); background: var(--surface); }
.frame-img img { width: 100%; height: auto; }
.frame figcaption { margin-top: var(--sp-3); font-weight: 600; font-size: .95rem; }
.frame .frame-note { display: block; margin-top: .15rem; color: var(--ink-2); font-weight: 400; font-size: var(--t-small); }
@media (max-width: 620px) {
  .frames { grid-template-columns: 1fr; max-width: 22rem; margin-inline: auto; }
}

/* ---------- Almanac red-letter list ---------- */
.almanac-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-1);
}
.today { padding-bottom: var(--sp-5); border-bottom: 1px solid var(--hairline); }
.today .date { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.08; }
.status { display: inline-flex; align-items: center; gap: .55rem; margin-top: var(--sp-3); font-family: var(--serif); font-size: 1.3rem; }
.status--flying { color: var(--rubric); }
.status .glyph { width: 1.4rem; height: 1.4rem; }
.today p { margin-top: var(--sp-2); color: var(--ink-2); font-size: var(--t-small); }

.obs-label { margin-top: var(--sp-5); font-size: var(--t-kicker); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.obs-list { list-style: none; padding: 0; margin-top: var(--sp-2); }
.obs { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .85rem; align-items: baseline; padding: var(--sp-4) 0; border-bottom: 1px solid var(--hairline); }
.obs:last-child { border-bottom: 0; padding-bottom: 0; }
.obs .glyph { width: 1.25rem; height: 1.25rem; align-self: start; margin-top: .15rem; }
.obs--flying .glyph { color: var(--rubric); }
.obs--half .glyph { color: var(--ink-3); } /* graphic, 3:1 OK; stays muted vs the rubric flying glyph */
.obs .name { font-weight: 600; }
.obs .rule { display: block; font-size: var(--t-small); color: var(--ink-2); font-weight: 400; margin-top: .1rem; }
.obs .when { font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; }
.cite { margin-top: var(--sp-4); font-size: var(--t-small); color: var(--ink-2); }

/* ---------- Feature cards (reminders / private) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); margin-top: var(--sp-7); }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 1.75rem); }
.card .ic { width: 1.6rem; height: 1.6rem; color: var(--rubric); }
.card h3 { margin-top: var(--sp-4); }
.card p { margin-top: var(--sp-2); color: var(--ink-2); font-size: .98rem; }

/* ---------- Manifesto ---------- */
.manifesto { text-align: left; }
.manifesto .quote { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); line-height: 1.22; letter-spacing: -0.015em; max-width: 24ch; }
.manifesto .quote em { font-style: italic; } /* italic carries the emphasis; rubric stays reserved for functional signals */
.manifesto .by { margin-top: var(--sp-5); font-size: var(--t-small); color: var(--ink-2); }
.anti { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: var(--sp-6); }
.anti span { font-size: var(--t-small); color: var(--ink-2); background: var(--surface); border: 1px solid var(--hairline); padding: .4rem .8rem; border-radius: 999px; }

/* ---------- Pricing band ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); margin-top: var(--sp-7); max-width: 40rem; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: clamp(1.5rem, 3vw, 2rem); }
.plan--featured { border-color: color-mix(in oklab, var(--rubric) 45%, var(--hairline)); box-shadow: var(--shadow-1); }
.plan h3 { font-size: 1.55rem; }
.plan .plan-price { margin-top: var(--sp-2); font-family: var(--serif); font-size: 1.05rem; color: var(--ink-2); }
.plan .plan-note { margin-top: var(--sp-3); color: var(--ink-2); font-size: .98rem; }
.plan-tag { position: absolute; top: -.7rem; left: clamp(1.5rem, 3vw, 2rem); font-size: var(--t-kicker); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--rubric-ink); background: var(--rubric-btn); padding: .25rem .6rem; border-radius: 999px; }
.pricing-foot { margin-top: var(--sp-5); color: var(--ink-2); font-size: var(--t-small); max-width: 40rem; }
.inline-link { color: var(--rubric); text-decoration: none; font-weight: 600; border-bottom: 1px solid color-mix(in oklab, var(--rubric) 40%, transparent); }
.inline-link:hover { border-bottom-color: var(--rubric); }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; max-width: 24rem; } }

/* ---------- Final CTA ---------- */
.cta-final { text-align: center; }
.cta-final .section-head { margin-inline: auto; }
.cta-final .waitlist-form { max-width: 30rem; margin-inline: auto; justify-content: center; }
.cta-final .form-note, .cta-final .form-msg { text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--hairline); padding-block: var(--sp-8) var(--sp-6); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-6); }
.footer-brand .brand { font-size: 1.2rem; }
.footer-brand p { margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--t-small); max-width: 24rem; }
.foot-col h4 { font-family: var(--sans); font-size: var(--t-kicker); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.foot-col ul { list-style: none; padding: 0; margin-top: var(--sp-3); }
.foot-col li + li { margin-top: var(--sp-2); }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.foot-col a:hover { color: var(--ink); }
.footer-bottom { margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: var(--t-small); color: var(--ink-2); }
.footer-bottom .made { display: inline-flex; align-items: center; gap: .5ch; }
.footer-bottom .made svg { width: 1em; height: 1em; color: var(--rubric); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Legal / prose pages ---------- */
.legal { padding-block: clamp(2rem, 5vw, 3.5rem) var(--section-y); }
.legal .doc { max-width: 46rem; }
.legal h1 { font-size: var(--t-h1); }
.legal .updated { margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--t-small); }
.notice { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); background: var(--rubric-weak); border: 1px solid color-mix(in oklab, var(--rubric) 30%, var(--hairline)); border-radius: var(--r); font-size: var(--t-small); color: var(--ink); }
.notice strong { color: var(--rubric); }
.prose { margin-top: var(--sp-6); }
.prose h2 { font-size: 1.45rem; margin-top: var(--sp-7); }
.prose h3 { font-size: 1.15rem; margin-top: var(--sp-5); font-family: var(--sans); font-weight: 700; }
.prose p, .prose li { color: var(--ink-2); max-width: var(--measure); }
.prose p { margin-top: var(--sp-3); }
.prose ul, .prose ol { margin-top: var(--sp-3); padding-left: 1.3rem; }
.prose li { margin-top: var(--sp-2); }
.prose a { color: var(--rubric); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in oklab, var(--rubric) 45%, transparent); }
.prose a:hover { text-decoration-color: var(--rubric); }
.prose strong { color: var(--ink); }
.toc { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); background: var(--sunken); border-radius: var(--r); }
.toc ul { list-style: none; padding: 0; columns: 2; column-gap: var(--sp-6); }
.toc li { margin-top: var(--sp-2); }
.toc a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.toc a:hover { color: var(--rubric); }
@media (max-width: 560px) { .toc ul { columns: 1; } }

/* ---------- 404 ---------- */
.nf { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: var(--sp-4); padding-block: var(--sp-9); }
.nf .big { font-family: var(--serif); font-size: clamp(3rem, 10vw, 6rem); color: var(--rubric); line-height: 1; }

/* ---------- Reveal motion (progressive enhancement) ----------
   Gated on .js so content is fully visible without JavaScript or if the
   observer never runs; reduced-motion opts out entirely. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1 !important; transform: none !important; transition: none; } }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: var(--gutter); top: .5rem; z-index: 100; background: var(--rubric-btn); color: var(--rubric-ink); padding: .6rem 1rem; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
