/* Halira landing — palette derived from app icon & src/theme.ts
   Dark-first on purpose: the app itself ships dark-only because bright
   screens are hostile mid-attack. Light scheme honors user preference. */

:root {
  --bg: #070807;
  --bg-alt: #0d0f0d;
  --card: #121511;
  --ink: #f2efe7;
  --ink-2: #b7ae9d;
  --ink-3: #8a8274;
  --gold: #e0b84d;
  --gold-soft: #e8c86f;
  --teal: #67bfaa;
  --teal-soft: #86d2c0;
  --line: #262b24;
  --line-soft: #1a1f19;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --glow: rgba(224, 184, 77, 0.14);
  --max: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf8f1;
    --bg-alt: #f3f0e6;
    --card: #ffffff;
    --ink: #1c1e1a;
    --ink-2: #565247;
    --ink-3: #756f60;
    --gold: #8a6a1f;
    --gold-soft: #6f5417;
    --teal: #22715f;
    --teal-soft: #1a5a4b;
    --line: #ddd7c6;
    --line-soft: #e9e4d5;
    --ok: #0e7a52;
    --warn: #92660a;
    --bad: #b43c3c;
    --glow: rgba(224, 184, 77, 0.22);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--teal-soft); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: #070807; padding: 0.6rem 1rem;
  z-index: 100; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 3.6rem; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 0.4rem 0.7rem;
  font: inherit; cursor: pointer;
}
.site-nav ul { display: flex; gap: 1.4rem; list-style: none; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--ink); }

@media (max-width: 46rem) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-head .wrap { flex-wrap: wrap; padding-bottom: 0.5rem; }
  .site-nav ul { flex-direction: column; gap: 0.2rem; padding: 0.4rem 0 0.6rem; }
  .site-nav a { display: block; padding: 0.45rem 0.2rem; font-size: 1.02rem; }
}
.no-js .site-nav { display: block; width: 100%; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 4.5rem 0 4rem; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 3rem; align-items: center;
}
.hero-art { position: relative; justify-self: center; }
.hero-art::before {
  content: ""; position: absolute; inset: -22%;
  background: radial-gradient(circle at 60% 40%, var(--glow), transparent 65%);
  z-index: 0;
}
.hero-art img {
  position: relative; z-index: 1; width: min(15rem, 60vw);
  border-radius: 22%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.status-line {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.9rem; color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 999px; padding: 0.32rem 0.9rem; margin-bottom: 1.4rem;
  background: color-mix(in srgb, var(--gold) 7%, transparent);
}
.status-line .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 750;
  margin-bottom: 1.1rem;
}
h1 .accent { color: var(--gold); }
.hero-sub {
  color: var(--ink-2); font-size: 1.15rem; max-width: 34rem;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.play-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.play-badge svg { border-radius: 10px; }
.hero-note { font-size: 0.85rem; color: var(--ink-3); margin-top: 1rem; }

@media (max-width: 52rem) {
  .hero { padding: 3rem 0 2.8rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-art { order: -1; }
  .hero-art img { width: min(10.5rem, 50vw); }
}

/* ---------- sections ---------- */
section { padding: 4.2rem 0; }
section:nth-of-type(even) { background: var(--bg-alt); }
.kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 0.8rem;
}
h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.2;
  letter-spacing: -0.015em; margin-bottom: 1rem; max-width: 30ch;
}
.lead { color: var(--ink-2); max-width: 44rem; margin-bottom: 2.2rem; }

/* stoplight motif */
.stoplight { display: inline-flex; gap: 0.45rem; margin-bottom: 1rem; }
.stoplight i { width: 12px; height: 12px; border-radius: 50%; }
.stoplight .g { background: var(--ok); }
.stoplight .y { background: var(--warn); }
.stoplight .r { background: var(--bad); }

/* numbered feature rows — deliberately not a card grid */
.feature-rows { list-style: none; max-width: 52rem; }
.feature-rows li {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 1.2rem;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
}
.feature-rows li:last-child { border-bottom: 1px solid var(--line); }
.feature-rows .num {
  font-family: var(--mono); color: var(--gold); font-size: 0.95rem;
  padding-top: 0.2rem;
}
.feature-rows h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.feature-rows p { color: var(--ink-2); font-size: 0.98rem; max-width: 42rem; }

/* privacy contrast columns */
.privacy-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  max-width: 56rem;
}
.privacy-col { border-radius: 18px; padding: 1.8rem 1.6rem; }
.privacy-col.never {
  background: var(--card);
  border: 1px solid var(--line);
}
.privacy-col.stays {
  background: linear-gradient(160deg, color-mix(in srgb, var(--teal) 10%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line));
}
.privacy-col h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.privacy-col ul { list-style: none; }
.privacy-col li {
  padding: 0.42rem 0 0.42rem 1.7rem; position: relative;
  color: var(--ink-2); font-size: 0.97rem;
}
.privacy-col.never li::before {
  content: "\2715"; position: absolute; left: 0; color: var(--bad); font-size: 0.85rem; top: 0.55rem;
}
.privacy-col.stays li::before {
  content: "\2713"; position: absolute; left: 0; color: var(--ok); top: 0.45rem;
}
.privacy-foot { margin-top: 1.4rem; font-size: 0.9rem; color: var(--ink-3); max-width: 56rem; }
@media (max-width: 46rem) { .privacy-cols { grid-template-columns: 1fr; } }

/* doctor report */
.report-flow { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 2.5rem; align-items: start; max-width: 60rem; }
.report-list { list-style: none; counter-reset: rep; }
.report-list li {
  counter-increment: rep; position: relative;
  padding: 0.7rem 0 0.7rem 2.6rem; color: var(--ink-2);
}
.report-list li::before {
  content: counter(rep, decimal-leading-zero);
  position: absolute; left: 0; top: 0.78rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--teal);
}
.report-list li strong { color: var(--ink); display: block; font-size: 1.02rem; }
.report-aside {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 0 14px 14px 0;
  padding: 1.5rem 1.6rem; font-size: 0.97rem; color: var(--ink-2);
}
.report-aside p + p { margin-top: 0.9rem; }
@media (max-width: 52rem) { .report-flow { grid-template-columns: 1fr; } }

/* languages */
.lang-flow { max-width: 54rem; color: var(--ink-2); }
.lang-flow .endonyms {
  font-size: 1.05rem; line-height: 2.1; letter-spacing: 0.01em;
  color: var(--ink); margin: 1.4rem 0;
}
.lang-flow .endonyms span { white-space: nowrap; }
.lang-flow .endonyms .sep { color: var(--gold); margin: 0 0.55rem; white-space: normal; }

/* guides teaser */
.guide-links { list-style: none; max-width: 52rem; }
.guide-links li { border-top: 1px solid var(--line); }
.guide-links li:last-child { border-bottom: 1px solid var(--line); }
.guide-links a {
  display: block; padding: 1.2rem 0.2rem; text-decoration: none; color: var(--ink);
}
.guide-links a:hover .t { color: var(--gold); }
.guide-links .t { font-weight: 650; font-size: 1.08rem; transition: color 0.15s; }
.guide-links .d { color: var(--ink-3); font-size: 0.92rem; margin-top: 0.2rem; }

/* FAQ */
.faq { max-width: 52rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.2rem 1.1rem 0.2rem;
  font-weight: 620; position: relative; font-size: 1.03rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.4rem; top: 50%;
  transform: translateY(-50%); color: var(--gold); font-size: 1.3rem; font-weight: 400;
}
.faq details[open] summary::after { content: "\2013"; }
.faq .a { padding: 0 0.2rem 1.3rem; color: var(--ink-2); max-width: 46rem; }

/* footer */
.site-foot {
  border-top: 1px solid var(--line); padding: 2.8rem 0 3.2rem;
  font-size: 0.9rem; color: var(--ink-3); background: var(--bg);
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; margin-bottom: 1.8rem; }
.foot-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.foot-nav a { color: var(--ink-2); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }
.disclaimer {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.2rem; max-width: 60rem; line-height: 1.6;
  background: var(--bg-alt);
}

/* ---------- guide/article pages ---------- */
.crumbs { font-size: 0.85rem; color: var(--ink-3); padding: 1.4rem 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.article { padding: 2.2rem 0 3.5rem; }
.article-inner { max-width: 44rem; }
.article h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin-bottom: 0.9rem; }
.article .byline { color: var(--ink-3); font-size: 0.88rem; margin-bottom: 2.2rem; font-family: var(--mono); }
.article h2 { font-size: 1.45rem; margin: 2.4rem 0 0.8rem; max-width: none; }
.article h3 { font-size: 1.12rem; margin: 1.8rem 0 0.5rem; }
.article p { margin-bottom: 1.05rem; color: var(--ink-2); }
.article ul, .article ol { margin: 0 0 1.2rem 1.4rem; color: var(--ink-2); }
.article li { margin-bottom: 0.45rem; }
.article strong { color: var(--ink); }
.article .app-note {
  border: 1px solid color-mix(in srgb, var(--teal) 32%, var(--line));
  background: color-mix(in srgb, var(--teal) 7%, var(--card));
  border-radius: 14px; padding: 1.3rem 1.4rem; margin: 2rem 0;
}
.article .app-note h2, .article .app-note h3 { margin-top: 0; }
.article .src { font-size: 0.85rem; color: var(--ink-3); margin-top: 2.6rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.article .src a { color: var(--ink-3); overflow-wrap: anywhere; }
.next-reads { background: var(--bg-alt); padding: 2.6rem 0 3rem; }
.next-reads h2 { font-size: 1.3rem; margin-bottom: 1rem; }
