/* ==========================================================================
   Jaha — design system
   Warm desert paper aesthetic, matching the iOS app.
   Shared across index.html and all content pages, and reused by the
   quest-detail page (do not rename the classes below).
   ========================================================================== */

@font-face {
  font-family: "Bitter";
  src: url("/fonts/Bitter.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand tokens */
  --paper: #FFFDF8;        /* cards/surfaces */
  --sand: #F6EEDF;         /* page background */
  --cream: #F2E3CC;        /* secondary surface / hover */
  --ink: #16202F;          /* headings/body, warm navy */
  --meta: #6B6152;         /* secondary text */
  --accent: #E0603A;       /* terracotta, primary action */
  --sage: #4E7C6A;         /* heat-safe / positive cue */
  --gold: #B37F17;         /* AI badge on light surfaces */
  --outline: #D9CBB2;      /* hairlines / borders */
  --outline-soft: #EADFC9; /* dividers */

  /* Derived — AA-safe text/fill variants of the brand hues above.
     The tokens above are used decoratively (dots, borders, icons);
     these are used wherever a hue sits as small text and needs 4.5:1+. */
  --accent-strong: #C24721;   /* accent, darkened for button fills under paper text */
  --accent-strong-hover: #A83F1D;
  --accent-ink: #B8451F;      /* accent, darkened for text on --accent tints */
  --gold-ink: #8A6110;        /* gold, darkened for text on gold tints */
  --sage-ink: #355C4E;        /* sage, darkened for text on sage tints */

  /* Derived */
  --shadow: 0 1px 2px rgba(22, 32, 47, 0.04), 0 8px 24px -12px rgba(22, 32, 47, 0.18);
  --shadow-lift: 0 2px 4px rgba(22, 32, 47, 0.05), 0 16px 36px -14px rgba(22, 32, 47, 0.24);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 26px;   /* v4 framed shell: .field plate corners */
  --frame: 24px;       /* v4 framed shell: paper gutter thickness, desktop */
  --frame-tight: 10px; /* v4 framed shell: paper gutter thickness, mobile */
  --font-display: "Bitter", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: rgba(224, 96, 58, 0.24); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p { color: var(--ink); }

/* ---- Layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}

main { flex: 1; }

section { padding: 72px 0; }

@media (max-width: 720px) {
  section { padding: 56px 0; }
}

/* Editorial section furniture — a small-caps kicker with a short rule. */
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 16px;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ---- Site header --------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--outline-soft);
  background: var(--sand);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-header a.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.site-header .brand img {
  width: 30px;
  height: 30px;
  display: block;
}

.site-header .brand .wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-header .brand .wordmark .dot {
  color: var(--accent-ink);
}

/* ---- Site footer ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--outline-soft);
  margin-top: auto;
}

.site-footer .wrap {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 30px;
  padding-bottom: 30px;
  font-size: 13.5px;
  color: var(--meta);
}

.site-footer a {
  color: var(--meta);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-ink);
}

.site-footer .copyright {
  margin-left: auto;
}

@media (max-width: 520px) {
  .site-footer .copyright { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   Framed gallery shell (v4)
   A paper-white frame surrounds the viewport; the nav band is built into
   its top edge; a sand "field" plate sits inset like a print in a mat —
   hairline border, a fine inner fillet, and a soft lift off the paper.
   Markup contract (do not deviate — two other pages are built against it):
     <body class="framed">
       <div class="frame">
         <header class="site-nav"> brand / .tabs / .account-link </header>
         <div class="field">
           <main>…</main>
           <footer class="site-footer">…</footer>
         </div>
       </div>
     </body>
   ========================================================================== */

body.framed {
  background: var(--paper);
}

.frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ---- Nav (frame's top edge) ------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 15px var(--frame) 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--outline-soft);
}

.site-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.site-nav .brand img { width: 25px; height: 25px; display: block; }

.site-nav .brand .wordmark {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-nav .brand .wordmark .dot { color: var(--accent-ink); }

.site-nav .tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.site-nav .tabs a {
  position: relative;
  color: var(--meta);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav .tabs a:hover,
.site-nav .tabs a:focus-visible {
  color: var(--ink);
  background: var(--sand);
}

.site-nav .tabs a.active {
  color: var(--ink);
}

/* Active tab marker: a short terracotta tick riding the frame's hairline. */
.site-nav .tabs a.active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -15px;
  height: 2px;
  background: var(--accent-strong);
  border-radius: 2px 2px 0 0;
}

.site-nav .account-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.site-nav .account-link:hover,
.site-nav .account-link:focus-visible {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  background: var(--sand);
}

.site-nav .account-link.active {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}

/* ---- Field (sand plate in the mat) ------------------------------------ */
.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--sand);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  margin: 0 var(--frame) var(--frame);
  overflow: hidden;
  /* Double-edged mat: a fine paper fillet just inside the hairline,
     then a soft ambient drop so the plate floats off the frame. */
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.65),
    0 1px 2px rgba(22, 32, 47, 0.05),
    0 30px 70px -36px rgba(22, 32, 47, 0.3);
}

@media (max-width: 520px) {
  .site-nav {
    gap: 14px;
    padding: 11px var(--frame-tight) 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar { display: none; }

  .site-nav .brand,
  .site-nav .tabs,
  .site-nav .account-link {
    flex-shrink: 0;
  }

  .site-nav .brand img { width: 22px; height: 22px; }
  .site-nav .brand .wordmark { font-size: 18px; }
  .site-nav .tabs { gap: 2px; }
  .site-nav .tabs a { padding: 5px 9px; }
  .site-nav .tabs a.active::after { bottom: -11px; }

  .field { margin: 0 var(--frame-tight) var(--frame-tight); border-radius: 16px; }
}

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease,
    border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent-strong);
  color: var(--paper);
  border-color: var(--accent-strong);
  box-shadow: 0 10px 20px -12px rgba(194, 71, 33, 0.65);
}

.btn-primary:hover {
  background: var(--accent-strong-hover);
  border-color: var(--accent-strong-hover);
  box-shadow: 0 12px 22px -12px rgba(168, 63, 29, 0.7);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--outline);
}

.btn-secondary:hover { background: var(--paper); border-color: var(--ink); }

/* ---- Chips (filter vocabulary) --------------------------------------------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--outline);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---- Origin badges ----------------------------------------------------------- */
.badge-origin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  border: 1px solid transparent;
}

.badge-origin .glyph {
  font-size: 12px;
  line-height: 1;
}

.badge-ai {
  background: #FBF3E1;
  color: var(--gold-ink);
  border-color: #E9D8AC;
}

.badge-curated {
  background: #EAF2EE;
  color: var(--sage-ink);
  border-color: #CFE2D8;
}

.badge-community {
  background: #FBE9E2;
  color: var(--accent-ink);
  border-color: #F0C9B8;
}

/* ---- Cards ----------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 18px 20px 20px;
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--cream);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* The covers are dusk-dark illustrations on a light card — seat them with a
   fine ink hairline so the edge reads deliberate, not clipped. */
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 0 1px rgba(22, 32, 47, 0.14),
    inset 0 -1px 0 rgba(22, 32, 47, 0.2);
  pointer-events: none;
}

.card h3 {
  font-size: 19px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.card .chip-row { margin-top: 4px; }

/* ---- Utility -------------------------------------------------------------- */
.meta { color: var(--meta); }
.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;
}

/* ---- Content pages (privacy / terms / support / community-guidelines) ----- */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 28px 96px;
}

.doc .back {
  color: var(--meta);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.doc .back:hover { color: var(--accent-ink); }

.doc h1 {
  font-size: clamp(32px, 5vw, 40px);
  margin: 26px 0 6px;
}

.doc .upd {
  color: var(--meta);
  font-size: 14px;
  margin-bottom: 34px;
}

.doc h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  margin: 38px 0 10px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.doc h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  margin: 20px 0 8px;
  color: var(--ink);
}

.doc p, .doc li {
  color: #3C3427;
  margin-bottom: 12px;
}

.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 7px; }
.doc strong { color: var(--ink); }
.doc a { color: var(--accent-ink); }
.doc a:hover { text-decoration: none; }

.doc hr {
  border: 0;
  border-top: 1px solid var(--outline-soft);
  margin: 40px 0;
}

.doc .note {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  background: var(--cream);
  font-size: 14.5px;
  color: var(--meta);
  margin: 26px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.doc .lead {
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  background: var(--paper);
  font-size: 15.5px;
  color: var(--ink);
  margin: 26px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.doc .safety {
  border: 1px solid var(--outline);
  background: var(--paper);
  padding: 16px 18px;
  margin: 24px 0;
  border-radius: var(--radius-sm);
}

.doc .card {
  padding: 20px 22px;
  margin: 26px 0;
  box-shadow: none;
}

.doc .card p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Landing page
   ========================================================================== */

/* ---- Hero ------------------------------------------------------------- */
.hero {
  padding: clamp(56px, 9vh, 96px) 0 0;
  overflow: hidden;
}

.hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 26px;
}

.hero .eyebrow .compass {
  width: 26px;
  height: 26px;
  margin: 0;
}

.hero .compass {
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
}

.hero .wordmark {
  font-family: var(--font-display);
  font-size: clamp(56px, 11vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero .wordmark .dot { color: var(--accent); }

.hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(21px, 4vw, 30px);
  line-height: 1.3;
  margin-top: 20px;
  max-width: 18ch;
  color: var(--ink);
}

.hero .subline {
  color: var(--meta);
  margin-top: 18px;
  max-width: 46ch;
  font-size: 16.5px;
  line-height: 1.65;
}

.hero .actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--meta);
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--paper);
}

.soon-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(224, 96, 58, 0.55);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 96, 58, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(224, 96, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 96, 58, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .soon-pill .dot { animation: none; }
  .card-media img { transition: none; }
}

/* The horizon: the app's dusk-ridgeline illustration language, printed in
   the site's sand tints. Sits full-bleed at the base of the hero; the next
   section's hairline becomes its ground line. */
.hero .horizon {
  margin-top: clamp(-30px, -2vw, -10px);
  pointer-events: none;
}

.hero .horizon svg {
  display: block;
  width: 100%;
  height: clamp(150px, 22vw, 300px);
}

/* ---- How it works --------------------------------------------------------- */
.how {
  border-top: 1px solid var(--outline);
}

.how h2.section-title {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 44px;
  max-width: 24ch;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
}

.step {
  border-top: 1px solid var(--outline);
  padding-top: 20px;
}

.step .num {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--accent-ink);
  margin-bottom: 16px;
}

.step h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 10px;
  color: var(--ink);
}

.step p {
  color: var(--meta);
  font-size: 15px;
  margin-bottom: 16px;
}

.step .step-trail {
  width: 170px;
  height: 34px;
  margin-top: 6px;
}

/* ---- Live examples ---------------------------------------------------------- */
.examples {
  border-top: 1px solid var(--outline-soft);
}

.examples .section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.examples h2.section-title {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 8px;
}

.examples .section-sub {
  color: var(--meta);
  max-width: 60ch;
}

.examples .section-link {
  display: inline-block;
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding-bottom: 6px;
  white-space: nowrap;
}

.examples .section-link:hover,
.examples .section-link:focus-visible {
  text-decoration: underline;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 720px) {
  .example-grid { grid-template-columns: 1fr; }
}

.example-card {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--radius);
  transition: transform 0.18s ease;
}

.example-card:hover {
  transform: translateY(-3px);
}

.example-card:hover .card {
  box-shadow: var(--shadow-lift);
  border-color: #CBBB9E;
}

.example-card:hover .card-media img {
  transform: scale(1.025);
}

.example-card .card {
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.example-card .badge-origin {
  margin-bottom: 4px;
}

/* ---- Trust / origin section --------------------------------------------- */
.trust {
  border-top: 1px solid var(--outline-soft);
}

.trust h2.section-title {
  font-size: clamp(28px, 4vw, 36px);
  margin-bottom: 40px;
}

/* One ledger, three entries — reads as a single promise, not three cards. */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (max-width: 800px) {
  .trust-grid { grid-template-columns: 1fr; }
}

.trust-item {
  background: none;
  border: 0;
  border-left: 1px solid var(--outline-soft);
  border-radius: 0;
  padding: 26px 28px 28px;
}

.trust-item:first-child { border-left: 0; }

@media (max-width: 800px) {
  .trust-item { border-left: 0; border-top: 1px solid var(--outline-soft); }
  .trust-item:first-child { border-top: 0; }
}

.trust-item .badge-origin { margin-bottom: 12px; }

.trust-item p {
  color: var(--meta);
  font-size: 14.5px;
}

.trust .coda {
  color: var(--meta);
  font-size: 14px;
  margin-top: 18px;
}

.section-title { color: var(--ink); }
