/* ============================================================
   Quest Academy — the front door to the Quest family.
   Same scholarly dark DNA as its siblings (Chronology, Eureka,
   Literature, Philosophy, D&D), tuned to a warm neutral gold —
   a doorway, not a world. Each card carries its own accent.
   Mobile-first, no framework.
   ============================================================ */
:root {
  --bg:        #14120f;
  --bg-2:      #1b1712;
  --panel:     #211d16;
  --panel-2:   #2a251c;
  --line:      #3a3327;
  --ink:       #efe7d6;
  --ink-dim:   #c6bca4;
  --muted:     #968c77;
  --gold:      #d7b24a;
  --gold-soft: #ead18a;
  --good:      #8fb562;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 12px 34px rgba(0,0,0,.42);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 960px;
  --fs: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 780px at 50% -12%, #2a2417 0%, transparent 58%),
    radial-gradient(900px 600px at 88% 8%, rgba(103,212,224,.06) 0%, transparent 55%),
    radial-gradient(900px 600px at 10% 22%, rgba(180,147,230,.05) 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
/* fine paper grain, same trick the siblings use */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .1px; line-height: 1.15; margin: 0; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--gold); color: #201a08; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--gold); color: #201a08; padding: 8px 14px; z-index: 99; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---- App bar ------------------------------------------------ */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: max(11px, env(safe-area-inset-top)) clamp(16px, 5vw, 28px) 11px;
  background: rgba(20,18,15,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-glyph { display: inline-flex; line-height: 1; color: var(--gold); }
.brand-glyph svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 0 10px rgba(215,178,74,.5)); }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand-name .thin { color: var(--gold-soft); font-weight: 600; }

.install-btn {
  display: none; align-items: center; gap: 7px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #201a08; border: 0; font-weight: 700;
  padding: 9px 15px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 4px 14px rgba(215,178,74,.28);
}
.install-btn.show { display: inline-flex; }
.install-btn:hover { filter: brightness(1.06); }

/* ---- Layout ------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: clamp(28px, 6vw, 56px) clamp(16px, 5vw, 28px) 40px; }

/* ---- Hero --------------------------------------------------- */
.hero { text-align: center; margin-bottom: clamp(30px, 6vw, 48px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-soft); background: rgba(215,178,74,.08);
  border: 1px solid rgba(215,178,74,.24); padding: 6px 13px; border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(38px, 9vw, 66px); letter-spacing: -.5px; }
.hero h1 .amp { color: var(--gold); }
.hero .lede {
  max-width: 34ch; margin: 16px auto 0; color: var(--ink-dim);
  font-size: clamp(16px, 3.4vw, 19px); line-height: 1.55;
}
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 24px;
}
.hero-stats .chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-dim);
}
.hero-stats .chip b { color: var(--ink); font-weight: 700; }
.hero-stats .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---- Card grid ---------------------------------------------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  --accent: var(--gold);
}
/* accent hairline along the top edge */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .8;
}
/* soft accent bloom, revealed on hover */
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(420px 200px at 80% -20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  transition: opacity .22s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset;
}
.card:hover::after, .card:focus-within::after { opacity: 1; }

.card-top { display: flex; align-items: center; gap: 14px; }
.token {
  flex: none; width: 54px; height: 54px; border-radius: 15px;
  display: grid; place-items: center; font-size: 27px; line-height: 1;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 6px 16px rgba(0,0,0,.3), 0 0 20px color-mix(in srgb, var(--accent) 18%, transparent);
}
.card-head { min-width: 0; }
.card h2 { font-size: 21px; letter-spacing: -.1px; }
.tag {
  display: inline-block; margin-top: 5px; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 700;
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
}
.card p { margin: 0; color: var(--ink-dim); font-size: 14.5px; line-height: 1.5; flex: 1; }
.card-cta {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 2px;
  font-weight: 700; font-size: 14px; color: var(--ink);
}
.card-cta .arrow { color: var(--accent); transition: transform .18s ease; }
.card:hover .card-cta .arrow, .card:focus-within .card-cta .arrow { transform: translateX(4px); }
/* make the whole card clickable while keeping a real, focusable link */
.card-link { position: absolute; inset: 0; z-index: 2; }
.card-link:focus { outline: none; }

/* ---- Footer ------------------------------------------------- */
.foot {
  margin-top: clamp(36px, 7vw, 56px); padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  color: var(--muted); font-size: 13.5px; text-align: center;
}
.foot a { color: var(--ink-dim); border-bottom: 1px solid transparent; }
.foot a:hover { color: var(--gold-soft); border-bottom-color: currentColor; }
.foot .sep { opacity: .4; }

@media (max-width: 420px) {
  .token { width: 48px; height: 48px; font-size: 24px; }
  .card h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
