/* Crit Dice site. Colors and type follow the App Store marketing shots (make-screenshots.py):
   Georgia Bold headlines, brass and parchment on near-black. */
:root {
  --bg: #121416;
  --bg-deep: #0b0a09;
  --panel: #1a1c1f;
  --panel-2: #22252a;
  --line: rgba(237, 227, 204, 0.12);
  --parchment: #ede3cc;
  --brass: #cc9e47;
  --brass-hi: #e0b866;
  --ink: #a39e93;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wrap: 1160px;
  --gutter: 16px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--parchment);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--brass-hi); text-underline-offset: 3px; }
a:hover { color: var(--parchment); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: clamp(30px, 4.4vw, 44px); }
h3 { font-size: 21px; color: var(--brass); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--panel); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 10, 9, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--parchment); text-decoration: none; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.brand span { font: 700 21px/1 var(--serif); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--parchment); }
/* Apple's badge: official artwork, never under 40px tall on screen, clear space on every side. */
.store-badge { display: inline-block; flex: none; padding: 4px 0; line-height: 0; }
.store-badge img { height: 40px; width: auto; }
.store-badge.large img { height: 56px; }
.store-badge:hover { opacity: 0.85; }

@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; padding-bottom: 6px; }
  .header-badge { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 6px 0 0; gap: 0; justify-content: space-between; }
  .nav a { padding: 6px 0; font-size: 14px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(72px, 13vw, 150px) 0 clamp(64px, 9vw, 110px);
  background:
    linear-gradient(180deg, rgba(11, 10, 9, 0.35) 0%, rgba(11, 10, 9, 0.55) 55%, var(--bg-deep) 100%),
    url("art/battlefield.webp") center 30% / cover no-repeat;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(60px, 11vw, 120px); margin: 0 0 0.1em; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 0, 0, 0.6); }
.tagline { color: var(--brass); font-size: clamp(20px, 2.6vw, 26px); margin-bottom: 0.9em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.lede { max-width: 36rem; margin: 0 auto 2em; font-size: clamp(17px, 2vw, 19px); color: rgba(237, 227, 204, 0.92); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }
.fine { color: var(--ink); font-size: 14px; margin: 12px 0 0; }
.glyph { position: absolute; width: clamp(64px, 9vw, 120px); height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.g1 { left: 6%; top: 22%; transform: rotate(-14deg); }
.g2 { right: 7%; top: 16%; transform: rotate(12deg); }
.g3 { left: 12%; bottom: 14%; transform: rotate(20deg); width: clamp(48px, 6vw, 80px); }
.g4 { right: 13%; bottom: 18%; transform: rotate(-22deg); width: clamp(48px, 6vw, 80px); }
@media (max-width: 760px) {
  .g1 { left: -18px; top: 8%; } .g2 { right: -14px; top: 4%; }
  .g3, .g4 { display: none; }
}

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.alt { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker { color: var(--brass); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px; }
.section-head { margin-bottom: 36px; }
.section-head h2 { text-wrap: balance; }
.section-head p { color: var(--ink); font-size: 18px; max-width: 44rem; }

/* Screenshots */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.tabs button { font: 600 15px var(--sans); color: var(--ink); background: none; border: 0; border-radius: 999px; padding: 8px 20px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brass); color: #16130e; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gallery[hidden] { display: none; }
.shot { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45); transition: transform 0.2s ease; }
.shot:hover { transform: translateY(-4px); }
.shot img { width: 100%; height: auto; }
@media (max-width: 900px) {
  .gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 18px;
    scrollbar-width: thin;
  }
  .gallery .shot { flex: 0 0 66%; scroll-snap-align: center; }
  .gallery.pad .shot { flex-basis: 82%; }
}
.swipe-hint { display: none; color: var(--ink); font-size: 14px; margin-top: 4px; }
@media (max-width: 900px) { .swipe-hint { display: block; } }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 8px; }
.card p { color: rgba(237, 227, 204, 0.85); font-size: 16px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* Roll20 */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.4em; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 48px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font: 700 16px var(--serif); color: #16130e; background: var(--brass);
}
code { font: 0.92em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--parchment); }
.note { border-left: 3px solid var(--brass); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; color: var(--ink); font-size: 15px; }
.note p:last-child { margin-bottom: 0; }

/* Nothing attached */
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.checks li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.checks strong { display: block; font: 700 19px/1.3 var(--serif); color: var(--parchment); margin-bottom: 6px; }
.checks strong::before { content: "\2713"; color: var(--brass); margin-right: 8px; }
.checks span { color: var(--ink); font-size: 15px; }
@media (max-width: 900px) { .checks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .checks { grid-template-columns: 1fr; } }

/* Closing call to action */
.cta {
  text-align: center; padding: clamp(80px, 12vw, 140px) 0;
  background:
    linear-gradient(180deg, var(--bg-deep) 0%, rgba(11, 10, 9, 0.55) 30%, rgba(11, 10, 9, 0.55) 70%, var(--bg-deep) 100%),
    url("art/dungeon.webp") center / cover no-repeat;
}
.cta h2 { text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); }
.cta p { color: rgba(237, 227, 204, 0.88); }

/* Text pages (support, privacy) */
.page-hero {
  padding: clamp(56px, 8vw, 96px) 0 clamp(28px, 4vw, 44px);
  background:
    linear-gradient(180deg, rgba(11, 10, 9, 0.6) 0%, var(--bg-deep) 100%),
    url("art/battlefield.webp") center 35% / cover no-repeat;
}
.page-hero h1 { font-size: clamp(42px, 7vw, 68px); margin-bottom: 0.15em; }
.page-hero p { color: var(--ink); margin: 0; }
.prose { max-width: 46rem; padding-bottom: clamp(56px, 8vw, 96px); }
.prose h2 { font-size: clamp(26px, 3.4vw, 32px); margin-top: 1.6em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.prose h2:first-of-type { border-top: 0; margin-top: 0.4em; }
.prose h3 { margin-top: 1.4em; font-size: 19px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--parchment); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--parchment); text-decoration: none; font-size: 14px; }
.toc a:hover { border-color: var(--brass); }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 28px 0 8px; }
.contact p { margin: 0; }
.button { display: inline-block; background: var(--brass); color: #16130e; font-weight: 600; text-decoration: none; border-radius: 999px; padding: 10px 20px; }
.button:hover { background: var(--brass-hi); color: #16130e; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--ink); font-size: 14px; background: var(--bg-deep); }
.site-footer .wrap { display: grid; gap: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--parchment); text-decoration: none; }
.footer-links a:hover { color: var(--brass-hi); }
.site-footer p { margin: 0; max-width: 60rem; }

/* Screenshot viewer */
.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.viewer::backdrop { background: rgba(5, 5, 5, 0.92); }
.viewer[open] { display: grid; place-items: center; }
.viewer img { max-width: min(92vw, 1100px); max-height: 88vh; width: auto; height: auto; border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.viewer button { position: fixed; border: 1px solid var(--line); background: rgba(26, 28, 31, 0.9); color: var(--parchment); width: 48px; height: 48px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.viewer button:hover { border-color: var(--brass); }
.viewer .close { top: 16px; right: 16px; }
.viewer .prev { left: 16px; top: 50%; transform: translateY(-50%); }
.viewer .next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .viewer .prev, .viewer .next { top: auto; bottom: 20px; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot { transition: none; }
  .shot:hover { transform: none; }
}
