/* ManaPal: shared stylesheet. No external requests, system fonts only. */

:root {
  color-scheme: dark light;
  --bg: #0b0a10;
  --bg-2: #110f18;
  --surface: #17161f;
  --surface-2: #201e2b;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f5f1e8;
  --muted: #b8b2c4;
  --accent: #ffc63c;
  --accent-light: #ffe89e;
  --accent-deep: #db8c14;
  --accent-text: #ffc63c;
  --arcane: #9e73ff;
  --on-accent: #1f1229;
  --halo-gold: rgba(255, 198, 60, 0.16);
  --halo-violet: rgba(158, 115, 255, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1120px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf8f1;
    --bg-2: #f4efe3;
    --surface: #ffffff;
    --surface-2: #f3eee2;
    --border: rgba(31, 18, 41, 0.12);
    --text: #1a1722;
    --muted: #565063;
    --accent-text: #8a5a00;
    --halo-gold: rgba(219, 140, 20, 0.14);
    --halo-violet: rgba(158, 115, 255, 0.12);
    --shadow: 0 20px 50px rgba(31, 18, 41, 0.14);
  }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 100% -10%, var(--halo-violet), transparent 60%),
    radial-gradient(50rem 36rem at -10% 10%, var(--halo-gold), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.header-nav { display: flex; align-items: center; gap: 1.1rem; font-size: 0.95rem; }
.header-nav a { color: var(--muted); text-decoration: none; }
.header-nav a:hover { color: var(--text); }
.header-nav .hide-sm { display: none; }
@media (min-width: 720px) { .header-nav .hide-sm { display: inline; } }

/* Language switcher (no JS) */
.lang { position: relative; }
.lang summary {
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
}
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  min-width: 12rem;
  max-height: 70vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lang li a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.lang li a:hover, .lang li a[aria-current="page"] { background: var(--surface-2); }
.footer .lang ul { top: auto; bottom: calc(100% + 0.5rem); left: 0; right: auto; }

/* Store button */
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.4rem 0.75rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent) 45%, var(--accent-deep));
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: 0 10px 30px rgba(255, 198, 60, 0.25);
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn small { display: block; font-size: 0.72rem; font-weight: 600; opacity: 0.85; }
.store-btn strong { display: block; font-size: 1.15rem; }
.store-btn.is-soon { cursor: default; }
.btn-note { margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 6rem) 0 3rem; }
.hero .container { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero .container { grid-template-columns: 1.1fr 0.9fr; } }
.hero-icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.eyebrow {
  display: inline-block;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.hero h1 .gold { color: var(--accent-text); }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 36rem; }
.hero-shot { position: relative; isolation: isolate; justify-self: center; max-width: 340px; }
.hero-shot::before {
  content: "";
  position: absolute;
  inset: 8% -10%;
  background: radial-gradient(closest-side, rgba(255, 198, 60, 0.35), rgba(158, 115, 255, 0.18), transparent);
  filter: blur(30px);
  z-index: -1;
}
.hero-shot img { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.45)); }
.trust { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.5rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.trust li::before { content: "✦ "; color: var(--accent-text); }

/* Sections */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section-head { max-width: 44rem; margin-bottom: 2.25rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.panel {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  box-shadow: var(--shadow);
}
.download-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .download-grid { grid-template-columns: 1fr auto; } }
.download-mote { width: 170px; justify-self: center; }

.reasons { display: grid; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .reasons { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .reasons { grid-template-columns: repeat(3, 1fr); } }
.reasons li {
  padding: 1.25rem 1.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.reasons strong { display: block; margin-bottom: 0.3rem; font-size: 1.05rem; }
.reasons span { color: var(--muted); font-size: 0.97rem; }

/* Screenshots gallery */
.shots {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 1.25rem 1.5rem;
  margin: 0;
  list-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.25rem;
  overscroll-behavior-x: contain;
}
@media (min-width: 1160px) { .shots { padding-inline: calc((100vw - var(--max)) / 2); scroll-padding-inline: calc((100vw - var(--max)) / 2); } }
.shots li { flex: 0 0 auto; width: min(62vw, 250px); scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots figcaption { margin-top: 0.6rem; font-size: 0.92rem; color: var(--muted); text-align: center; }
.scroll-hint { color: var(--muted); font-size: 0.9rem; }

/* Steps */
.steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .steps.four { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 1.4rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: var(--on-accent);
  font-weight: 800;
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { color: var(--muted); margin: 0; }

/* Guide cards */
.cards { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card-link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card-link h3 { font-size: 1.15rem; }
.card-link p { color: var(--muted); font-size: 0.97rem; margin: 0 0 1rem; }
.card-link .more { margin-top: auto; color: var(--accent-text); font-weight: 600; }

/* FAQ */
.faq { display: grid; gap: 0.75rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 1.25rem;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2rem 1.1rem 0;
  font-weight: 650;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--accent-text);
}
.faq details[open] summary::after { content: "–"; }
.faq summary h3 { display: inline; font-family: var(--sans); font-size: 1.05rem; font-weight: 650; }
.faq .answer { padding-bottom: 1.1rem; color: var(--muted); }
.faq .answer p:last-child { margin: 0; }

/* Final CTA */
.final-cta { text-align: center; }
.final-cta .panel { background: radial-gradient(40rem 20rem at 50% 0%, var(--halo-gold), transparent), linear-gradient(160deg, var(--surface), var(--bg-2)); }
.final-cta img.mote { width: 120px; margin: 0 auto 1rem; }
.final-cta p { color: var(--muted); max-width: 34rem; margin-inline: auto; }

/* Footer */
.footer {
  margin-top: 3rem;
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.93rem;
  color: var(--muted);
}
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer h2 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); margin-bottom: 0.8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.legal-note { margin-top: 2rem; font-size: 0.82rem; line-height: 1.5; }

/* Articles (guides, legal) */
.breadcrumb { padding: 1.5rem 0 0; font-size: 0.9rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; }
.breadcrumb a { color: var(--muted); }

.article { padding: 2rem 0 3rem; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); }
.article h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-top: 2.5rem; }
.article h3 { margin-top: 1.75rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: 0.45rem; }
.article .lead { margin-bottom: 1.5rem; }
.meta { color: var(--muted); font-size: 0.92rem; }

.answer-box {
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}
.answer-box p:last-child { margin: 0; }

.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text); }
td { color: var(--muted); }

.app-block {
  margin: 2.5rem 0;
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 760px) { .app-block { grid-template-columns: 1fr 240px; } }
.app-block figure { margin: 0; }
.app-block figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; text-align: center; }
.app-block .panel { padding: clamp(1.5rem, 4vw, 2.25rem); }

.related { margin-top: 3rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card-link:hover { transform: none; }
}

@media print {
  .site-header, .footer, .store-btn { display: none; }
  body { background: #fff; color: #000; }
}
