/* Spec — writeonspec.app. One stylesheet for every page. */

@font-face { font-family: 'Courier Prime'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/CourierPrime-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/CourierPrime-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/CourierPrime-Italic.woff2') format('woff2'); }

/* Colors come from the app icon: yellow #FFC53D on near-black #141414.
   Yellow is a fill colour only on light backgrounds; it fails contrast as text there. */
:root {
  color-scheme: light dark;
  --ink: #141414;
  --yellow: #FFC53D;
  --yellow-deep: #E0A92E;

  --bg: #faf8f3;
  --surface: #ffffff;
  --text: #141414;
  --muted: #57534b;
  --line: #e4dfd3;
  --link: #141414;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 12px 32px rgb(0 0 0 / .08);
  --card-head: #fff4d4;   /* Why Spec card headers */
  --card-rule: #f0dca6;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Courier Prime', 'Courier New', Courier, monospace;
  --wrap: 1120px;
  --gutter: 20px;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1d1d1d;
    --text: #f3f0e8;
    --muted: #b3aea3;
    --line: #2d2d2d;
    --link: #FFC53D;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .45);
    --card-head: rgb(255 197 61 / .10);
    --card-rule: rgb(255 197 61 / .22);
  }
}

*, *::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(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-family: var(--mono); font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 740px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.eyebrow { font-family: var(--mono); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--ink); color: #fff;
  border-bottom: 1px solid #262626;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--mono); font-weight: 700; font-size: 1.25rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: #e8e4da; text-decoration: none; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--yellow); }
@media (max-width: 640px) { .site-nav .wide { display: none; } }

/* ── Hero (always on black, like the icon) ──────────────────────────────── */
.hero { background: var(--ink); color: #fff; text-align: center; padding: 56px 0 0; overflow: hidden; }
.hero-icon { width: 112px; height: 112px; margin: 0 auto 28px; border-radius: 25px; box-shadow: 0 10px 40px rgb(255 197 61 / .18); }
.hero h1 {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(2rem, 6.4vw, 3.8rem); letter-spacing: -.02em; line-height: 1.12;
  margin: 0 auto .45em;
}
.hero h1 span, .cta h2 span { display: inline-block; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero .lede { color: #d6d1c6; font-size: clamp(1.05rem, 2.4vw, 1.25rem); max-width: 34em; margin: 0 auto 28px; }
.hero-shot { margin: 48px auto 0; max-width: 1040px; padding: 0 var(--gutter); }
.hero-shot img {
  border-radius: 12px 12px 0 0;
  border: 1px solid #333; border-bottom: 0;
  box-shadow: 0 -10px 80px rgb(255 197 61 / .10), 0 30px 80px rgb(0 0 0 / .6);
}

/* ── Store button (filled in by js/site.js) ─────────────────────────────── */
.store { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 54px; justify-content: center; }
.store-soon {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid #5a5a5a; border-radius: 10px; padding: 12px 20px;
  color: #fff; font-weight: 600; font-size: 1rem;
}
.store-soon svg { width: 18px; height: 18px; fill: currentColor; }
.store a.badge { display: inline-block; padding: 0; } /* Apple: clear space ≥ ¼ badge height, kept by the gap around it */
.store a.badge img { height: 54px; width: auto; }
.store-note { color: #bdb8ad; font-size: .9rem; margin: 0; }
.price-line { color: #bdb8ad; font-size: .95rem; margin: 16px 0 0; }
/* On light sections the soon-pill follows the page colours */
.section:not(.cta) .store-soon { border-color: var(--line); color: var(--text); background: var(--surface); }
.section:not(.cta) .store-note, .section:not(.cta) .price-line { color: var(--muted); }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
@media (max-width: 640px) { .section { padding: 64px 0; } }

/* Why Spec */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
/* Styled like the app's Index Cards: number, uppercase Courier heading, thin divider, synopsis. */
.why-item {
  display: grid; grid-template-columns: auto 1fr; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: 8px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
.why-item .num, .why-item h3 { background: var(--card-head); padding-top: 14px; padding-bottom: 12px; line-height: 1.2rem; }
.why-item .num { font-size: .8rem; color: var(--muted); padding-left: 18px; padding-right: 10px; }
.why-item h3 { font-family: var(--mono); font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; margin: 0; padding-right: 18px; }
.why-item p { grid-column: 1 / -1; margin: 0; padding: 14px 18px 20px; border-top: 1px solid var(--card-rule); color: var(--muted); }
/* Line up the dividers across a row, even when one heading wraps more. */
@supports (grid-template-rows: subgrid) { .why-item { grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; } }
@media (max-width: 960px) { .why { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .why { grid-template-columns: 1fr; } }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; list-style: none; margin: 0; padding: 0; }
.feature svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.feature h3 { margin-bottom: .3em; }
.feature p { color: var(--muted); margin: 0; font-size: .98rem; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .features { grid-template-columns: 1fr; gap: 28px; } }

/* Themes: a grid on desktop, a swipe row on phones */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; margin: 0; padding: 0; }
.themes figure { margin: 0; }
.themes img { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 16 / 10; object-fit: cover; }
.themes figcaption { font-family: var(--mono); font-size: .95rem; margin-top: 10px; }
.themes-note { color: var(--muted); margin-top: 28px; }
@media (max-width: 760px) {
  .themes {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px;
    margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 16px;
    scrollbar-width: none;
  }
  .themes::-webkit-scrollbar { display: none; }
  .themes li { flex: 0 0 80%; scroll-snap-align: center; }
}

/* Demo video */
.video {
  aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); overflow: hidden;
  background: var(--ink); color: #d6d1c6; display: grid; place-items: center; text-align: center;
  border: 1px solid #2d2d2d;
}
.video iframe { width: 100%; height: 100%; border: 0; }
.video .placeholder { font-family: var(--mono); padding: 20px; }
.video .placeholder svg { width: 56px; height: 56px; fill: var(--yellow); margin: 0 auto 12px; display: block; }

/* Closing call to action */
.cta { text-align: center; background: var(--ink); color: #fff; }
.cta h2 { color: #fff; font-size: clamp(1.7rem, 5vw, 2.8rem); margin: 0 auto .6em; }
.cta h2 em { font-style: normal; color: var(--yellow); }
.section.cta + .site-footer { border-top: 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: .95rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer-grid nav ul, .social { list-style: none; margin: 0; padding: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: .9rem;
}
.social a:hover { border-color: var(--text); }
.legal { margin-top: 32px; font-size: .85rem; }
.legal p { margin: 0 0 .4em; }

/* ── Text pages (privacy, support, press) ───────────────────────────────── */
.page-head { background: var(--ink); color: #fff; padding: 56px 0 48px; }
.page-head h1 { font-family: var(--mono); font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .25em; }
.page-head p { color: #d6d1c6; margin: 0; font-size: 1.1rem; }
.prose { padding-top: 56px; padding-bottom: 80px; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; word-break: break-word; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 0 0 32px; }
.contact-card p:last-child { margin: 0; }
.big-link { font-size: 1.25rem; font-weight: 600; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-family: var(--mono); font-weight: 700; }
details[open] summary::after { content: '–'; }
details > div { padding-top: 10px; color: var(--muted); }
details > div p:last-child { margin: 0; }

/* Press kit */
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0 0 16px; }
.press-grid.shots { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.press-grid figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; height: 100%; }
.press-grid img { margin: 0 auto 10px; border-radius: 8px; }
.press-grid figcaption { font-size: .9rem; color: var(--muted); }
.button {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--yellow); color: var(--ink); font-weight: 600; padding: 11px 18px; border-radius: 10px;
}
.button:hover { background: var(--yellow-deep); }
.copy-block { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.copy-block p:last-child { margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 8px; } }
