/* Atlas marketing site — shared stylesheet.
 *
 * SOURCE OF TRUTH FOR COLOUR IS Atlas/constants/theme.ts, not this file.
 * The values below are a deliberate hand copy across a process boundary: this
 * site is plain static HTML with no build step, so it cannot import a
 * TypeScript module. If a role changes in theme.ts, change it here too.
 *
 *   light role        theme.ts source        value
 *   canvas            light.cloudCream       #FAF4EA
 *   surface           light.cloudWhite       #FFFDF8
 *   chrome            light.skyBlue          #2E8BE6
 *   accent            light.horizonOrange    #F08A3C
 *   textPrimary       light.ink              #17140F
 *   textSecondary     light.inkSoft          #5C564C
 *   divider           light.line             #E8DFD0
 *   border            light.silver           #C6BFB3
 *
 * Type tokens mirror Atlas/constants/tokens.ts: Fraunces 600 for display,
 * Inter 400/500/600 for body and labels. Fonts are self-hosted rather than
 * pulled from a CDN because the privacy policy promises no third-party
 * requests, and a font CDN is one.
 */

/* ---------- fonts ---------- */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_500Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  --canvas: #faf4ea;
  --canvas-deep: #f3ead9;
  --surface: #fffdf8;
  --chrome: #2e8be6;
  --chrome-deep: #1e63b0;
  /* theme.ts `action` — the INTERACTIVE role, which is not the same as chrome.
     Light shares sky blue with the header; dark diverges to ember, because
     dark's chrome is a near-black dusk and blue-on-black is unreadable. */
  --action: #2e8be6;
  /* theme.ts `link` (light.skyDeep). A SEPARATE, darker role from `action`
     precisely so link TEXT clears 4.5:1 on canvas — contrast.test.ts pins
     link/canvas at 4.5 with no lightDebt, while action/canvas is only held to
     3.0 because it is a button FILL, not text. Using action here measured
     3.22:1 and failed. */
  --link: #1e63b0;
  --accent: #f08a3c;
  --accent-deep: #d96f24;
  --text-primary: #17140f;
  --text-secondary: #5c564c;
  --divider: #e8dfd0;
  --border: #c6bfb3;
  --on-chrome: #faf4ea;
  /* DELIBERATE DIVERGENCE FROM light.onAccent (#FFFDF8).
     theme.ts's light theme puts near-white on horizonOrange, which measures
     2.46:1 — contrast.test.ts records that as `lightDebt: 2.45`, pre-existing
     debt inherited when light was renamed. This site is new public code, so it
     takes the fix the project already made for dark instead: dark.emberInk on
     the same orange, which THEME.md §3 measures at 7.58:1. Same colour, same
     reasoning, AA clean. The app is unaffected. */
  --on-accent: #1a0e04;
  --shadow: rgba(23, 20, 15, 0.1);

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --gutter: 20px;
  --radius-card: 24px;
  --radius-media: 16px;
  --radius-pill: 999px;
  --reading-column: 680px;
  --page-column: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Mirrors theme.ts's `dark` object. Dark's chrome is the dusk gradient
       (duskNear -> duskFar), NOT sky blue — the header below reads that. */
    --canvas: #0b0e16;
    --canvas-deep: #05070b;
    --surface: #131826;
    --chrome: #0c111f;
    --chrome-deep: #1b2542;
    --action: #f08a3c;
    /* theme.ts dark.duskLink — dark's link role is a lifted blue, not ember. */
    --link: #5aa9f0;
    --accent: #f08a3c;
    --accent-deep: #d96f24;
    --text-primary: #faf4ea;
    --text-secondary: #c9c2b8;
    --divider: #262e42;
    --border: #5a6480;
    --on-chrome: #faf4ea;
    --on-accent: #1a0e04;
    --shadow: rgba(5, 7, 11, 0.45);
  }
}

/* ---------- reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Focus rings are never suppressed — see the web input pass. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--page-column);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text-primary);
  padding: 12px 16px;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- header ---------- */

.site-header {
  background: linear-gradient(180deg, var(--chrome), var(--chrome-deep));
  color: var(--on-chrome);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--on-chrome);
}
.wordmark:hover {
  text-decoration: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  opacity: 0.85;
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-accent:hover {
  background: var(--accent-deep);
}

.btn-on-chrome {
  background: var(--on-chrome);
  color: var(--chrome-deep);
}
.btn-on-chrome:hover {
  opacity: 0.92;
}

.btn-ghost {
  background: transparent;
  color: var(--link);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--link);
}

/* ---------- hero ---------- */

.hero {
  padding: 64px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0 0 16px;
}

.hero p.lede {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* Sized for the real photography that replaces it later — a 3:4 portrait
   matching the app's card media, so swapping in an <img> changes nothing. */
.media-placeholder {
  /* width is explicit because the box has no content: a grid item with an auto
     width and an auto margin shrink-to-fits, which for an empty div is 0 and
     makes the whole placeholder silently invisible. */
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, var(--chrome), var(--accent));
  box-shadow: 0 18px 40px var(--shadow);
  position: relative;
  overflow: hidden;
}
.media-placeholder::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background: var(--canvas);
  clip-path: polygon(0 34%, 100% 0, 100% 100%, 0 100%);
}

/* ---------- how it works ---------- */

.strip {
  padding: 56px 0 64px;
  border-top: 1px solid var(--divider);
}

.strip h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 32px);
  margin: 0 0 32px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.step h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 8px;
}

.step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-media);
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

/* ---------- document pages ---------- */

.doc {
  padding: 48px 0 72px;
}

.doc .wrap {
  max-width: var(--reading-column);
}

.doc h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 8px;
}

.doc .meta {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 32px;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
}

.doc h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 17px;
  margin: 24px 0 8px;
}

.doc p,
.doc li {
  color: var(--text-primary);
  font-size: 16px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin-bottom: 8px;
}

.doc strong {
  font-weight: 600;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-media);
  padding: 20px 22px;
  margin: 28px 0;
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout p:first-child {
  margin-top: 0;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--accent);
  color: var(--on-accent);
  padding: 40px 0;
  margin-top: 40px;
}

.site-footer a {
  color: var(--on-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}

.footer-note {
  font-size: 14px;
  opacity: 0.9;
  margin: 16px 0 0;
  width: 100%;
}

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 88px 0 80px;
  }
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
  }
  .media-placeholder {
    max-width: 380px;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .btn:hover {
    transform: none;
  }
}
