:root {
  /* Cream paper / ink black / helmet red. The app's color palette
     pulled into the marketing site verbatim. */
  --paper: #f5edda;
  --paper-warm: #f8eedc;
  --ink: #1b140c;
  --ink-soft: #4a3d2c;
  --rule: #c9b894;
  --accent: #e73701;     /* helmet red, used SPARINGLY */
  --olive: #6b6b3c;      /* secondary, scholarly green */

  --serif: "GFS Didot", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Fira Sans", system-ui, -apple-system, sans-serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  /* Subtle paper grain, very low contrast, on top of the cream ground.
     SVG-encoded so no extra HTTP request. */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

::selection { background: var(--accent); color: var(--paper); }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ─── Masthead ─── */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.5rem var(--gutter) 1rem;
  border-bottom: 1px solid var(--rule);
}
.masthead-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  line-height: 0;
}
.masthead-wordmark {
  height: clamp(1.5rem, 2.4vw, 1.875rem);
  width: auto;
  display: block;
}
.masthead-nav { display: flex; gap: 1.25rem; font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.masthead-nav a { text-decoration: none; color: var(--ink-soft); }
.masthead-nav a:hover { color: var(--accent); }
.masthead-nav a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--accent); }

/* ─── Hero ─── */
.hero {
  padding: clamp(3rem, 9vw, 6rem) var(--gutter) clamp(2rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.hero > * { position: relative; z-index: 1; }

/* Klisy mark — owl perched on the temple base, with foliage. The
   composed app-icon SVG (not just the owl). Sits beside the hero
   text on desktop, stacks above on mobile. */
.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-mark {
  width: 100%;
  max-width: clamp(240px, 40vw, 480px);
  height: auto;
  display: block;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  max-width: 18ch;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  font-family: var(--sans);
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 36ch;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.875rem; align-items: center; }

/* "Download on the App Store" badge: black pill, white type, Apple
   glyph. Matches Apple's marketing guidelines closely enough to swap
   in the official asset later without layout drift. The shine sweep
   on ::after is borrowed from iliadaligned.com — long pause then a
   quick diagonal pass, so the page doesn't feel busy. */
.appstore-badge {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: #000;
  color: #fff;
  padding: 0.55rem 1.1rem 0.6rem;
  border-radius: 0.625rem;
  text-decoration: none;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  transition: transform 120ms ease;
  border: 1px solid #000;
}
.appstore-badge:hover { color: #fff; transform: translateY(-1px); }
.appstore-badge .apple { width: 1.4rem; height: 1.4rem; flex-shrink: 0; }
.appstore-badge-text { display: flex; flex-direction: column; line-height: 1; }
.appstore-badge-text small { font-size: 0.6875rem; opacity: 0.85; margin-bottom: 0.18rem; }
.appstore-badge-text strong { font-size: 1.0625rem; font-weight: 500; }

.appstore-badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  animation: shine 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%, 75% { left: -100%; }
  100% { left: 200%; }
}

/* ─── Screenshot strip ─── */
.shots {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.shots-rail {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  overflow-x: auto;
  padding-right: var(--gutter);
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.shots-rail::-webkit-scrollbar { height: 6px; }
.shots-rail::-webkit-scrollbar-track { background: transparent; }
.shots-rail::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
/* Each shot is a button that opens a lightbox; reset button chrome
   so the screenshot reads as an image, not a control. */
.shot {
  flex: 0 0 auto;
  width: clamp(140px, 16vw, 200px);
  scroll-snap-align: start;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  transition: transform 160ms ease;
}
.shot:hover { transform: translateY(-2px); }
.shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.375rem;
  box-shadow: 0 1px 0 rgba(27, 20, 12, 0.08), 0 16px 32px -16px rgba(27, 20, 12, 0.18);
}

/* ─── Lightbox ─── */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
  /* center via dialog's default + tweak */
  margin: auto;
  cursor: zoom-out;
}
.lightbox::backdrop {
  background: rgba(15, 11, 6, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.6);
}

/* ─── Body sections (used on index after hero, and on prose pages) ─── */
.section {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1.5rem;
  letter-spacing: -0.005em;
}
.section-title em { font-style: italic; }
.prose {
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
}
.prose p { margin: 0 0 1.1em; }
.prose p:first-child { margin-top: 0; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: rgba(27, 20, 12, 0.06);
  padding: 0.05em 0.35em;
  border-radius: 0.2em;
}
.prose .greek {
  font-family: var(--serif);
  font-style: italic;
}

/* ─── Prose-page top header (Support, Privacy) ─── */
.page-header {
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--rule);
}
.page-header .eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  font-family: var(--sans);
}
.page-header h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
.page-header .updated {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ─── Definition list (used on Support FAQ) ─── */
.qa { max-width: var(--measure); }
.qa dt {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  margin-top: 1.75em;
  margin-bottom: 0.4em;
  color: var(--ink);
}
.qa dt:first-child { margin-top: 0; }
.qa dd {
  margin-left: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
}

/* ─── Colophon ─── */
.colophon {
  padding: 1.75rem var(--gutter) 2.25rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.colophon-greek {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05em;
  color: var(--ink);
}
.colophon p { margin: 0; }

/* ─── Two-up grid: hero pair (text + owl) ─── */
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 7fr 5fr;
    align-items: center;
  }
}

/* ─── Reduced motion / preference niceties ─── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
