:root {
  --bg: #241E1A;
  --surface: #332B24;
  --surface-raised: #3D342B;
  --border: #5A4B3C;
  --text: #F2E9DC;
  --text-dim: #C7B9A6;
  --rust: #C1502E;
  --gold: #D4A017;
  --sage: #8A9A5B;
  --slate: #7A8FA6;
  --danger: #B84C3E;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

a { color: var(--gold); }

.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.15em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 10px;
}

h1, h2, h3 { font-family: 'Roboto Slab', serif; font-weight: 700; margin: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 600; }
.topnav a { color: var(--text-dim); text-decoration: none; }
.topnav a:hover { color: var(--text); }
.topnav-github { color: var(--gold) !important; }
@media (max-width: 720px) { .topnav a:not(.topnav-github) { display: none; } }

/* ---------- hero ---------- */

.hero { padding: 64px 20px 40px; }
.hero-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; gap: 40px; } }

.hero-copy { position: relative; }
.hero-copy::before {
  content: ""; position: absolute; inset: -24px -20px -12px -16px; z-index: -1;
  background: radial-gradient(ellipse 100% 95% at 42% 40%, rgba(12,10,8,0.8) 0%, rgba(12,10,8,0.55) 60%, transparent 88%);
  pointer-events: none;
}
.hero-copy h1 { font-size: 44px; line-height: 1.08; margin: 4px 0 18px; text-shadow: 0 0 14px rgba(0,0,0,0.75), 0 0 30px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.8); }
@media (max-width: 500px) { .hero-copy h1 { font-size: 34px; } }
.hero-sub { font-size: 16px; color: var(--text-dim); max-width: 46ch; margin: 0 0 26px; text-shadow: 0 0 10px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.45); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.hero-fineprint { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-dim); }
.dev-notice {
  margin-top: 16px; padding: 10px 14px; max-width: 46ch;
  border: 1.5px dashed var(--gold); border-radius: 8px;
  font-size: 12.5px; color: var(--text-dim); line-height: 1.5;
}
.dev-notice strong { color: var(--text); }
.dev-notice a { color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px;
  padding: 13px 22px; border-radius: 6px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: border-color 0.15s, filter 0.1s, transform 0.1s;
}
.btn-primary { background: var(--gold); color: #1E1712; }
.btn-primary:hover { border-color: var(--text); transform: translateY(-1px); }
.btn-primary:active { filter: brightness(0.85); transform: none; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--text); }

/* Real screenshot in the same tilted-card frame the hand-drawn mockup used
   to occupy -- honest now instead of a stand-in, since the app has changed
   enough over time that the old approximation had drifted out of sync. */
.hero-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preview-frame {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  transform: rotate(1.2deg);
  overflow: hidden;
}
.preview-screenshot { display: block; width: 100%; height: auto; border-radius: 8px; }
.preview-gallery-link {
  background: none; border: none; color: var(--text-dim); font-family: 'Inter', sans-serif;
  font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 8px;
  transition: color 0.15s;
}
.preview-gallery-link:hover { color: var(--gold); }

/* ---------- dividers & sections ---------- */

.divider {
  max-width: 1180px; margin: 8px auto; border: none;
  border-top: 2px dashed var(--border);
}
.section { padding: 48px 20px; }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section h2 { font-size: 28px; margin: 2px 0 28px; max-width: 30ch; }
.section-lede { color: var(--text-dim); font-size: 15px; max-width: 60ch; margin: -8px 0 20px; }

/* ---------- feature grid ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.feature-icon { font-size: 26px; margin-bottom: 10px; }
.feature-title { font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.feature-desc { font-size: 13.5px; color: var(--text-dim); }

/* ---------- how it works ---------- */

.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .path-grid { grid-template-columns: 1fr; } }
.path-card { background: var(--surface); border: 2px dashed var(--border); border-radius: 12px; padding: 24px; }
.path-card h3 { font-size: 19px; margin: 12px 0 10px; }
.path-card p { font-size: 14px; color: var(--text-dim); margin: 0 0 10px; }
.path-note { font-size: 12.5px !important; font-family: 'JetBrains Mono', monospace; }

.stamp {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; color: #1E1712;
}
.stamp-gold { background: var(--gold); }
.stamp-slate { background: var(--slate); }

/* ---------- self-host / code ---------- */

.code-card { background: #1B1712; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 16px; overflow: hidden; }
.code-card-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim);
  padding: 8px 16px; border-bottom: 1px solid var(--border);
}
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; }
.code-card code { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text); line-height: 1.6; }
.section p code {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em;
}

/* ---------- FAQ ---------- */

.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: 18px 0; border-bottom: 1px dashed var(--border); }
.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.faq-a { font-size: 14px; color: var(--text-dim); max-width: 68ch; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 24px 20px; margin-top: 20px; }
.site-footer-inner {
  max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-dim);
}
.site-footer-links { display: flex; gap: 18px; }
.site-footer-links a { color: var(--text-dim); text-decoration: none; }
.site-footer-links a:hover { color: var(--gold); }

/* ---------- screenshot gallery ---------- */

.gallery-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 16, 13, 0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease;
}
.gallery-overlay.open { opacity: 1; visibility: visible; }
.gallery-stage { max-width: min(1000px, 92vw); max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gallery-img { max-width: 100%; max-height: 74vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.gallery-caption { display: flex; align-items: center; gap: 14px; color: var(--text-dim); font-size: 13.5px; text-align: center; }
.gallery-counter { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); opacity: 0.7; white-space: nowrap; }
.gallery-close, .gallery-nav {
  position: fixed; background: var(--surface-raised); border: 1px solid var(--border); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: border-color 0.15s;
}
.gallery-close:hover, .gallery-nav:hover { border-color: var(--gold); }
.gallery-close { top: 20px; right: 20px; }
.gallery-nav { top: 50%; transform: translateY(-50%); font-size: 26px; }
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }
@media (max-width: 640px) {
  .gallery-nav { width: 38px; height: 38px; }
  .gallery-prev { left: 8px; }
  .gallery-next { right: 8px; }
  .gallery-close { top: 12px; right: 12px; }
}

/* ---------- android ---------- */

.android-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.android-card-main { flex: 1 1 380px; }
.android-card-main p { font-size: 14px; color: var(--text-dim); margin: 0; }
.android-download { flex: 0 0 auto; }

/* ---------- scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-in { opacity: 1; transform: none; }

/* ---------- scroll-driven sky ---------- */

.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, #241E1A 0%, #4a2f22 40%, #8a4326 70%, #c1502e 100%); }

.sun-rays {
  position: absolute; left: 22%; top: 14vh; width: 380px; height: 380px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(245, 200, 120, 0.22) 0deg 4deg, transparent 4deg 20deg);
  animation: sun-rotate 120s linear infinite;
}
@keyframes sun-rotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.sun {
  position: absolute; left: 22%; top: 14vh; width: 130px; height: 130px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #FCE7B8 0%, #F5C878 30%, var(--gold) 58%, var(--rust) 85%, transparent 100%);
  box-shadow: 0 0 70px 24px rgba(193, 80, 46, 0.32), 0 0 140px 70px rgba(212, 160, 23, 0.14);
}

.fog {
  position: absolute; width: 55vw; height: 220px; border-radius: 50%;
  filter: blur(48px); background: var(--text-dim); opacity: 0.1;
}
.fog-a { top: 58vh; left: -22vw; animation: fog-drift-a 55s ease-in-out infinite; }
.fog-b { top: 78vh; right: -26vw; animation: fog-drift-b 70s ease-in-out infinite; }
@keyframes fog-drift-a { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(32vw); } }
@keyframes fog-drift-b { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-28vw); } }

.stars { position: absolute; inset: 0; opacity: 0; }
.star { position: absolute; border-radius: 50%; background: #F2E9DC; animation: star-twinkle 3.4s ease-in-out infinite; }
@keyframes star-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

@media (max-width: 640px) {
  .sun-rays { width: 260px; height: 260px; }
  .sun { width: 92px; height: 92px; }
}

/* ---------- accessibility ---------- */

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover { transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .sun-rays, .fog, .star { animation: none; }
}
