/* =========================================================================
   Skirmforge — Combat Calculator
   Marketing site theme. Mirrors the app's design system:
   "Schiefer" (slate, dark, default) and "Pergament" (parchment, light).
   Accent: brass / copper. System fonts only — no webfonts, no CDN.
   ========================================================================= */

/* ---------- Design tokens: Schiefer (dark) is the default ---------------- */
:root {
  --bg:            #12131A;
  --bg-deep:       #0D0E14;
  --surface:       #191B25;
  --surface-2:     #1F2130;
  --line:          rgba(192, 138, 62, 0.20);
  --line-soft:     rgba(236, 231, 220, 0.10);

  --accent:        #C08A3E;
  --accent-bright: #E2B36A;
  --accent-dim:    rgba(192, 138, 62, 0.14);

  --text:          #ECE7DC;
  --text-dim:      #A8A69D;
  --text-faint:    #8E8C84;

  --damage:        #D0625A;   /* damage only — never decorative */
  --healing:       #6FB07C;   /* healing only */

  --on-accent:     #12131A;   /* text drawn on top of the brass accent */
  --nav-bg:        rgba(18, 19, 26, 0.72);
  --shadow:        0 18px 44px rgba(0, 0, 0, 0.45);

  --radius:        16px;
  --radius-lg:     22px;
  --maxw:          1120px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: dark light;
}

/* ---------- Pergament (light) ------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg:            #F5EEE1;
    --bg-deep:       #EDE4D3;
    --surface:       #FCF8F0;
    --surface-2:     #F7F0E2;
    --line:          rgba(138, 95, 34, 0.26);
    --line-soft:     rgba(36, 34, 44, 0.10);

    --accent:        #815920;
    --accent-bright: #74501C;
    --accent-dim:    rgba(138, 95, 34, 0.12);

    --text:          #23212B;
    --text-dim:      #55503F;
    --text-faint:    #5C584C;

    --damage:        #9E3229;
    --healing:       #2F6B3D;

    --on-accent:     #FCF8F0;
    --nav-bg:        rgba(245, 238, 225, 0.75);
    --shadow:        0 18px 40px rgba(60, 44, 18, 0.16);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Self-drawn atmosphere only: a soft brass vignette, no imported artwork. */
  background-image:
    radial-gradient(900px 520px at 78% -8%, rgba(192, 138, 62, 0.13), transparent 62%),
    radial-gradient(700px 460px at 5% 8%, rgba(192, 138, 62, 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p  { margin: 0 0 1rem; }

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.7rem 1.1rem;
  z-index: 200;
  border-radius: 0 0 10px 0;
  font-weight: 650;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.section { padding: clamp(3.2rem, 8vw, 5.5rem) 0; }
.section-head { max-width: 62ch; margin-bottom: 2.4rem; }
.section-head p { color: var(--text-dim); font-size: 1.06rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ---------- Language visibility ----------------------------------------- */
/* Default (no JS): English. `html.lang-de` flips the page to German. */
html:not(.lang-de) .de { display: none !important; }
html.lang-de .en { display: none !important; }

/* ---------- Navigation: frosted glass, echoing iOS Liquid Glass --------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
  padding: 0.55rem 22px;
  max-width: var(--maxw);
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand:hover { text-decoration: none; color: var(--accent-bright); }
.brand .d20 { width: 26px; height: 26px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 550;
}
.nav-links a:hover { color: var(--text); background: var(--accent-dim); text-decoration: none; }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Hero -------------------------------------------------------- */
.hero { padding: clamp(2.6rem, 7vw, 4.8rem) 0 clamp(2.4rem, 6vw, 4rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 { margin-bottom: 0.6rem; }
.hero h1 .accent { color: var(--accent-bright); }
.lede {
  font-size: clamp(1.05rem, 2.1vw, 1.24rem);
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 1.4rem;
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
}
.platforms li {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  background: var(--accent-dim);
}

/* ---------- App Store badge placeholder --------------------------------- */
.cta-block { display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-start; }

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.appstore-badge .apple-mark { width: 26px; height: 32px; flex: none; fill: currentColor; }
.appstore-badge .badge-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore-badge .badge-small { font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.appstore-badge .badge-big { font-size: 1.12rem; font-weight: 650; }

/* Pending state — deliberately loud so the placeholder cannot be missed. */
.appstore-badge[data-appstore-pending] {
  cursor: not-allowed;
  opacity: 0.72;
  filter: grayscale(0.35);
  border-style: dashed;
  border-width: 2px;
  border-color: var(--accent);
  position: relative;
}
.appstore-badge[data-appstore-pending]::after {
  content: attr(data-pending-label);
  position: absolute;
  top: -11px;
  right: -10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
html.lang-de .appstore-badge[data-appstore-pending]::after {
  content: attr(data-pending-label-de);
}

.pending-note {
  font-size: 0.88rem;
  color: var(--text-dim);
  border-left: 3px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.75rem;
  max-width: 46ch;
  margin: 0;
}

.trust-line {
  font-size: 0.9rem;
  color: var(--text-faint);
  margin: 0;
}

/* ---------- Device mockup (drawn in CSS — no imported artwork) ---------- */
.mockup {
  position: relative;
  margin: 0 auto;
  width: min(320px, 88vw);
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(160deg, var(--surface-2), var(--bg-deep));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.mockup-screen {
  border-radius: 32px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  padding: 1.1rem 0.9rem 1rem;
  overflow: hidden;
}
.mockup-notch {
  width: 96px;
  height: 20px;
  border-radius: 0 0 14px 14px;
  background: var(--bg-deep);
  margin: -1.1rem auto 0.7rem;
}
.mock-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.mock-title strong { color: var(--text); font-size: 0.95rem; }

.mock-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  margin-bottom: 0.42rem;
  font-size: 0.8rem;
}
.mock-row.active { border-color: var(--accent); background: var(--accent-dim); }
.mock-init {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--accent), var(--accent-bright));
  color: var(--on-accent);
  font-weight: 800;
  font-size: 0.82rem;
}
.mock-name { font-weight: 600; }
.mock-sub { color: var(--text-faint); font-size: 0.7rem; }
.mock-hp { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.75rem; color: var(--text-dim); }
.hpbar { width: 62px; height: 5px; border-radius: 3px; background: var(--line-soft); margin-top: 3px; overflow: hidden; }
.hpbar span { display: block; height: 100%; background: var(--healing); }
.hpbar span.hurt { background: var(--damage); }
.hpbar .hp-91 { width: 91%; }
.hpbar .hp-93 { width: 93%; }
.hpbar .hp-26 { width: 26%; }

.mock-calc {
  margin-top: 0.75rem;
  padding: 0.7rem 0.7rem 0.6rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.mock-calc-head { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-dim); }
.mock-big { font-size: 1.85rem; font-weight: 750; color: var(--accent-bright); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.mock-steps { font-family: var(--font-mono); font-size: 0.63rem; color: var(--text-faint); line-height: 1.7; }

/* ---------- Cards / feature grid ---------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--line);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.35rem; }
.card p { color: var(--text-dim); font-size: 0.96rem; margin: 0; }
.card .icon {
  width: 34px; height: 34px;
  margin-bottom: 0.85rem;
  color: var(--accent);
}
.card .icon svg { width: 100%; height: 100%; display: block; }

/* Reveal-on-scroll (progressive enhancement; JS adds .revealed) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Worked example ---------------------------------------------- */
.example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  align-items: stretch;
}
@media (max-width: 780px) { .example { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.panel h3 { color: var(--accent-bright); }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 0.95rem;
}
.steps li:last-child { border-bottom: 0; }
.steps .k { color: var(--text-dim); }
.steps .v { font-family: var(--font-mono); color: var(--text); white-space: nowrap; }
.steps li.total .v { color: var(--accent-bright); font-weight: 700; }

/* ---------- Pricing ------------------------------------------------------ */
.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 1.1rem;
  align-items: start;
}
.tier {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tier.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.tier-name { font-size: 0.8rem; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.tier-price { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; margin: 0.35rem 0 0.15rem; }
.tier-price small { font-size: 0.85rem; font-weight: 500; color: var(--text-dim); letter-spacing: 0; }
.tier ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.tier li {
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.tier li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 9px; height: 9px;
  transform: rotate(45deg);
  border: 1px solid var(--accent);
  background: var(--accent-dim);
}
.tier .note { margin-top: auto; padding-top: 1rem; font-size: 0.82rem; color: var(--text-faint); }

/* ---------- Privacy callout ---------------------------------------------- */
.callout {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  padding: clamp(1.6rem, 4vw, 2.6rem);
}
.callout h2 { margin-bottom: 0.6rem; }
.callout ul { columns: 2; column-gap: 2rem; margin: 1rem 0 0; }
@media (max-width: 640px) { .callout ul { columns: 1; } }

.attribution {
  font-size: 0.84rem;
  color: var(--text-faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
  margin-top: 1.6rem;
}

/* ---------- Legal / long-form pages -------------------------------------- */
.doc { max-width: 78ch; margin: 0 auto; padding: clamp(2rem, 6vw, 3.4rem) 0 4rem; }
.doc h2 { margin-top: 2.4rem; }
.doc h3 { margin-top: 1.7rem; color: var(--accent-bright); }
.doc p, .doc li { color: var(--text-dim); }
.doc strong { color: var(--text); }
.doc .meta { font-size: 0.9rem; color: var(--text-faint); }

.addr {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  font-style: normal;
  color: var(--text);
}
.addr a { word-break: break-word; }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: 0.9rem 1.1rem;
  border-radius: 0 12px 12px 0;
  margin: 1.4rem 0;
  color: var(--text);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.6rem;
  font-size: 0.92rem;
}
table.data th, table.data td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
}
table.data th { color: var(--text); font-weight: 650; }
.table-scroll { overflow-x: auto; }

/* ---------- FAQ ---------------------------------------------------------- */
details.faq {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
}
details.faq[open] { border-color: var(--line); }
details.faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 0.7rem 0 0; color: var(--text-dim); font-size: 0.96rem; }

/* ---------- Contact card -------------------------------------------------- */
.contact {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  color: var(--text);
  font-weight: 650;
  box-shadow: var(--shadow);
}
.contact:hover { border-color: var(--accent); text-decoration: none; }
.contact .icon { width: 30px; height: 30px; color: var(--accent); flex: none; }
.contact span { display: block; }
.contact .sub { font-size: 0.8rem; font-weight: 500; color: var(--text-dim); }

/* ---------- Footer -------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
  padding: 2.6rem 0 3rem;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--text-dim); font-size: 0.92rem; }
.footer-links a:hover { color: var(--accent-bright); }
.footer small { color: var(--text-faint); font-size: 0.85rem; display: block; }
.footer .disclaimer { max-width: 62ch; margin-top: 1.4rem; color: var(--text-faint); font-size: 0.82rem; }

/* ---------- Utilities ----------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.lede-centered { margin-left: auto; margin-right: auto; }
.cta-centered { align-items: center; }
