/* =====================================================================
   Ashfall landing — styled to match the game itself:
   fonts   : Cinzel Bold (title, = LocaleManager TITLE_FONT_PATH)
             Lora (body, = LocaleManager BODY_FONT_PATH)
   palette : gold    #D9A840  (game C_GOLD 0.85,0.66,0.25)
             text    #E8DBBA  (game C_TEXT 0.91,0.86,0.73)
             panel   #140F0D  (game C_PANEL_BG 0.08,0.06,0.05)
             border  #8C6B2E  (game C_PANEL_BORDER 0.55,0.42,0.18)
             subtitle#A8946E  (game menu subtitle 0.66,0.58,0.43)
   ===================================================================== */

@font-face {
  font-family: 'Cinzel';
  src: url('assets/fonts/Cinzel-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('assets/fonts/Lora-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('assets/fonts/Lora-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #0a0807;
  --panel: #140f0d;
  --panel-soft: rgba(20, 15, 13, 0.88);
  --gold: #d9a840;
  --gold-soft: #e6bd63;
  --gold-border: #8c6b2e;
  --gold-border-dim: rgba(140, 107, 46, 0.45);
  --text: #e8dbba;
  --text-dim: #a8946e;
  --muted: #7d6f56;
  --discord: #5865f2;
  --green: #6aa84f;
  --maxw: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, .btn, .nav-brand, .footer-brand, .sound-toggle {
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

a { color: var(--gold-soft); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== Game-style panel (TutorialHint / Begin-button recipe) ===== */
.g-panel {
  background: var(--panel-soft);
  border: 1px solid var(--gold-border-dim);
  border-radius: 10px;
}

/* ===== Sound toggle ===== */
.sound-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid var(--gold-border-dim);
  border-radius: 10px;
  background: rgba(20, 15, 13, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color .25s, transform .2s, box-shadow .25s;
}
.sound-toggle:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(217, 168, 64, 0.22); }
.sound-main { display: inline-flex; align-items: center; gap: 8px; }
.sound-icon { font-size: 15px; color: var(--gold); transition: color .25s; }
.sound-toggle.playing .sound-icon { animation: pulse 1.6s ease-in-out infinite; }
.sound-track {
  font-family: 'Lora', serif; font-style: italic; font-size: 11px;
  color: var(--text-dim); display: none;
}
.sound-toggle.playing .sound-track { display: block; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(10,8,7,0.94), rgba(10,8,7,0));
  backdrop-filter: blur(3px);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--gold); font-size: 19px; letter-spacing: 0.18em;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.7);
}
.nav-emblem { width: 34px; height: 34px; filter: drop-shadow(0 0 6px rgba(217,168,64,.45)); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); }
.nav-links a { color: var(--text-dim); font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 0.05em; transition: color .2s; }
.nav-links a:hover { color: var(--gold-soft); }
.nav-cta {
  padding: 8px 18px; border: 1px solid var(--gold-border); border-radius: 8px;
  background: rgba(20,15,13,0.7);
  color: var(--gold-soft) !important;
  transition: background .25s, box-shadow .25s;
}
.nav-cta:hover { background: rgba(217,168,64,0.14); box-shadow: 0 0 14px rgba(217,168,64,0.25); }

/* ===== Hero — mirrors the game main menu ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: -4%;
  background-size: cover; background-position: center 30%;
  animation: drift 30s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.09) translateY(-16px); } }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(10,8,7,0.05), rgba(10,8,7,0.55) 75%),
    linear-gradient(180deg, rgba(10,8,7,0.5) 0%, rgba(10,8,7,0.12) 35%, rgba(10,8,7,0.92) 100%);
}
#embers {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 760px; padding: 100px 22px 60px;
}
.hero-emblem {
  width: 110px; height: 110px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 0 24px rgba(217,168,64,.45));
  animation: float 5.5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
/* Game wordmark: Cinzel Bold 72px, gold, 3px soft-black shadow, no outline */
.hero-title {
  font-size: clamp(46px, 9vw, 84px);
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--gold);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7), 0 0 44px rgba(217, 168, 64, 0.28);
  animation: title-kindle 6s ease-in-out infinite;
}
@keyframes title-kindle {
  0%, 100% { text-shadow: 3px 3px 0 rgba(0,0,0,0.7), 0 0 34px rgba(217,168,64,0.22); }
  50%      { text-shadow: 3px 3px 0 rgba(0,0,0,0.7), 0 0 54px rgba(217,168,64,0.42); }
}
/* Game subtitle: small, muted parchment (0.66, 0.58, 0.43) */
.hero-sub {
  margin-top: 14px;
  font-family: 'Lora', serif;
  font-size: clamp(14px, 2.2vw, 18px);
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-dim);
}
.hero-tag {
  margin: 24px auto 0; max-width: 560px;
  font-size: clamp(16px, 2.3vw, 19px); color: var(--text-dim); font-style: italic;
}
.hero-cta { margin-top: 34px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 13px; letter-spacing: 0.1em; color: var(--muted); font-family: 'Cinzel', serif; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  vertical-align: middle; margin-right: 6px;
  background: var(--green);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%,100% { box-shadow: 0 0 4px var(--green); }
  50% { box-shadow: 0 0 12px var(--green), 0 0 20px rgba(106,168,79,.5); }
}
.hero-scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--gold-border); font-size: 22px;
  animation: sink 2.2s ease-in-out infinite;
}
@keyframes sink { 0%,100% { transform: translate(-50%, 0); opacity: .5; } 50% { transform: translate(-50%, 8px); opacity: 1; } }

/* ===== Buttons — the game's Begin-button recipe ===== */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 13px 28px; border-radius: 8px;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--gold-border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .25s, background .25s, border-color .25s;
}
.btn::after {  /* ember sheen sweep on hover */
  content: "";
  position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(217,168,64,0.16), transparent);
  transition: left .5s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn:hover::after { left: 120%; }
.btn-kicker { font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.btn-store { font-size: 19px; }
.btn-primary {
  border-color: var(--gold);
  color: var(--gold-soft);
  box-shadow: 0 0 0 rgba(217,168,64,0);
  animation: btn-kindle 3.5s ease-in-out infinite;
}
@keyframes btn-kindle {
  0%,100% { box-shadow: 0 6px 20px rgba(217,168,64,.16); }
  50%     { box-shadow: 0 6px 30px rgba(217,168,64,.36); }
}
.btn-primary:hover { background: rgba(217,168,64,0.12); box-shadow: 0 10px 34px rgba(217,168,64,.45); }
.btn-discord {
  border-color: rgba(88,101,242,0.65);
  color: #c7ccff;
}
.btn-discord:hover { background: rgba(88,101,242,0.16); box-shadow: 0 10px 30px rgba(88,101,242,.4); }
.btn-ghost:hover { background: rgba(217,168,64,0.08); }
.btn-soon {
  border-style: dashed;
  border-color: rgba(106,168,79,0.5);
  color: var(--text-dim);
  cursor: default;
}
.btn-soon:hover { transform: none; }
.btn-soon::after { display: none; }
.btn-lg { padding: 16px 34px; }
.btn-lg .btn-store { font-size: 22px; }

/* ===== Sections ===== */
.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) clamp(18px, 5vw, 40px);
}
.section-alt { max-width: none; background: linear-gradient(180deg, #0e0b09, #141009); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-title {
  text-align: center;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.7);
}
/* rune divider under section titles, drawn in on reveal */
.section-title::after {
  content: "";
  display: block; width: 0; height: 2px; margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: width 1s ease .2s;
}
.in-view .section-title::after, .section-title.in::after { width: 90px; }
.section-lead {
  text-align: center; max-width: 640px; margin: 22px auto 0;
  color: var(--text-dim); font-size: clamp(16px, 2.3vw, 19px);
}

/* ===== Feature grid ===== */
.feature-grid {
  margin-top: 54px;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  padding: 28px 26px;
  border: 1px solid var(--gold-border-dim);
  border-radius: 10px;
  background: var(--panel-soft);
  transition: transform .3s ease, border-color .3s, box-shadow .3s;
  transform-style: preserve-3d;
  will-change: transform;
}
.feature:hover {
  border-color: var(--gold-border);
  box-shadow: 0 16px 38px rgba(0,0,0,.55), 0 0 18px rgba(217,168,64,.12);
}
.feature-icon {
  font-size: 28px; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; margin-bottom: 16px;
  color: var(--gold);
  background: radial-gradient(circle at 30% 30%, rgba(217,168,64,.18), rgba(217,168,64,.03));
  border: 1px solid var(--gold-border-dim);
  transition: transform .3s ease;
}
.feature:hover .feature-icon { transform: scale(1.12) rotate(-4deg); }
.feature h3 { font-size: 20px; color: var(--gold-soft); margin-bottom: 8px; letter-spacing: 0.04em; }
.feature p { color: var(--text-dim); font-size: 16px; }

/* ===== Screenshots — real game captures in phone frames ===== */
.shots {
  margin-top: 60px;
  display: flex; gap: clamp(18px, 4vw, 44px);
  justify-content: center; align-items: flex-start;
  flex-wrap: wrap;
}
.shot {
  width: min(300px, 78vw);
  border-radius: 26px;
  padding: 10px;
  background: #0d0a08;
  border: 1px solid var(--gold-border-dim);
  box-shadow: 0 24px 60px rgba(0,0,0,.65);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s;
  will-change: transform;
}
.shot img { border-radius: 18px; }
.shot:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--gold-border);
  box-shadow: 0 34px 80px rgba(0,0,0,.75), 0 0 30px rgba(217,168,64,.15);
}
.shot figcaption {
  padding: 12px 6px 4px;
  text-align: center;
  font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.08em;
  color: var(--text-dim);
}
.shots .shot:nth-child(2) { margin-top: 46px; }

/* ===== Help ===== */
.help-grid {
  margin-top: 50px;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.help-card {
  padding: 34px 30px; border-radius: 10px; text-align: center;
  border: 1px solid var(--gold-border-dim);
  background: var(--panel-soft);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.help-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.help-discord { border-color: rgba(88,101,242,0.4); }
.help-discord:hover { border-color: rgba(88,101,242,0.7); box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 24px rgba(88,101,242,.18); }
.help-card:not(.help-discord):hover { border-color: var(--gold-border); }
.help-emoji { font-size: 38px; margin-bottom: 14px; }
.help-card h3 { font-size: 22px; color: var(--gold-soft); margin-bottom: 10px; }
.help-card p { color: var(--text-dim); margin-bottom: 22px; }
.help-card .btn { margin: 0 auto; }

/* ===== FAQ ===== */
.faq { margin-top: 44px; max-width: 760px; margin-left: auto; margin-right: auto; }
.faq-item {
  border: 1px solid var(--gold-border-dim);
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--panel-soft);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.faq-item[open] { border-color: var(--gold-border); box-shadow: 0 8px 26px rgba(0,0,0,.4); }
.faq-item summary {
  cursor: pointer; list-style: none;
  padding: 18px 22px;
  font-family: 'Cinzel', serif; font-size: 17px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  transition: color .2s;
}
.faq-item summary:hover { color: var(--gold-soft); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--gold); font-size: 24px; line-height: 1; transition: transform .3s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 22px 20px; color: var(--text-dim); font-size: 17px; }
.faq-item[open] .faq-body { animation: faq-open .35s ease; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ===== Download ===== */
.section-download {
  position: relative; text-align: center;
  padding: clamp(80px, 12vw, 140px) 22px;
  background: url('assets/hero_bg.jpg') center 70% / cover fixed;
}
.dl-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,7,0.88), rgba(10,8,7,0.93)); }
.dl-inner { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }
.dl-emblem {
  width: 92px; height: 92px; margin: 0 auto 16px;
  filter: drop-shadow(0 0 22px rgba(217,168,64,.5));
  animation: float 5.5s ease-in-out infinite;
}
.dl-buttons { margin-top: 30px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.dl-discord { display: inline-block; margin-top: 26px; color: var(--text-dim); font-style: italic; border-bottom: 1px dotted var(--muted); transition: color .2s; }
.dl-discord:hover { color: var(--gold-soft); }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 46px 22px 40px;
  border-top: 1px solid var(--gold-border-dim);
  background: #080605;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; letter-spacing: 0.18em; color: var(--gold);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.7);
}
.footer-emblem { width: 28px; height: 28px; }
.footer-links { margin: 18px 0 16px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 0.05em; transition: color .2s; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-fine { color: var(--muted); font-size: 14px; }
.footer-legal { margin-top: 8px; color: var(--muted); font-size: 12.5px; font-style: italic; }
.footer-legal a { color: var(--text-dim); border-bottom: 1px dotted var(--muted); transition: color .2s; }
.footer-legal a:hover { color: var(--gold-soft); }

/* ===== Legal pages (terms.html / copyright.html) ===== */
.legal-page { background: var(--ink); }
.legal {
  max-width: 780px; margin: 0 auto;
  padding: 130px 22px 90px;
}
.legal-title {
  font-size: clamp(30px, 5vw, 42px); color: var(--gold);
  letter-spacing: 0.06em; text-shadow: 2px 2px 0 rgba(0,0,0,0.7);
  margin-bottom: 6px;
}
.legal-date { color: var(--muted); font-style: italic; font-size: 14px; margin-bottom: 34px; }
.legal h2 {
  font-size: 19px; color: var(--gold-soft); letter-spacing: 0.05em;
  margin: 36px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--gold-border-dim);
}
.legal p { margin: 0 0 14px; color: var(--text); }
.legal ul { margin: 0 0 14px 24px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--gold-soft); border-bottom: 1px dotted var(--gold-border); transition: color .2s; }
.legal a:hover { color: var(--gold); }
.legal-backline { margin-top: 46px; }
.legal-backline a { font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 0.05em; border-bottom: none; }

/* ===== Reveal on scroll (staggered via --d) ===== */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s ease var(--d, 0s), transform .7s ease var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .section-download { background-attachment: scroll; }
  .shots .shot:nth-child(2) { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-emblem, .dl-emblem, .hero-title, .btn-primary,
  .sound-toggle.playing .sound-icon, .dot, .hero-scroll-hint { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  #embers { display: none; }
}
