/* MadI Games website: the studio, its games, help and the legal pages. The colours are the game's own (Ui.cs). */
:root {
  --bg: #0c1c14;
  --bg-deep: #07120c;
  --surface: #162c21;
  --surface-2: #22402f;
  --line: #2e5240;
  --gold: #f0c242;
  --gold-soft: #f6d985;
  --ink: #ecf2ee;
  --muted: #96b0a2;
  --hot: #ff8028;
  --good: #389658;
  --ice: #4696cd;
  --skill: #c4a0ff;
  --radius: 18px;
  --wide: 1160px;
  --display: "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(240, 194, 66, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(56, 150, 88, 0.12), transparent 60%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 17px/1.65 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-soft); }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--gold); color: var(--bg-deep); padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 10;
}
.skip:focus { left: 16px; }

.wrap { width: min(var(--wide), 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(7, 18, 12, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 194, 66, 0.14);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; }
.brand span { font: 700 20px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.brand span b { color: var(--gold); font-weight: 700; }

.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--bg-deep); background: var(--gold); }

/* ---------------------------------------------------------------- type */

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: 0.04em; }
h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: 0.02em; }
h3 { font-size: 22px; }

.gold-text {
  background: linear-gradient(180deg, #fff1c2 0%, var(--gold) 45%, #b8862a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}

.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}

.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); max-width: 640px; }

/* ---------------------------------------------------------------- buttons and badges */

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 14px; font-weight: 800; font-size: 17px; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.button:hover { transform: translateY(-2px); }
.button-gold { background: linear-gradient(180deg, #f8d66d, var(--gold) 60%, #d9a62e); color: #1d1606; box-shadow: 0 10px 30px -10px rgba(240, 194, 66, 0.55); }
.button-gold:hover { color: #1d1606; box-shadow: 0 14px 34px -10px rgba(240, 194, 66, 0.7); }
.button-ghost { border-color: var(--line); color: var(--ink); background: rgba(22, 44, 33, 0.6); }
.button-ghost:hover { color: var(--ink); border-color: var(--gold); }

.badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; background: rgba(240, 194, 66, 0.12); color: var(--gold-soft);
  border: 1px solid rgba(240, 194, 66, 0.3);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* ---------------------------------------------------------------- sections */

.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: linear-gradient(180deg, rgba(22, 44, 33, 0.55), rgba(22, 44, 33, 0.15)); border-block: 1px solid rgba(46, 82, 64, 0.5); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--muted); margin: 0; }

/* A screenshot in a dark frame with a soft gold glow. */
.shot {
  border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(240, 194, 66, 0.28);
  background: var(--bg-deep);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(22, 44, 33, 0.8), 0 0 60px -20px rgba(240, 194, 66, 0.35);
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tilt { transform: perspective(1400px) rotateY(-8deg) rotateX(3deg); transition: transform 0.4s ease; }
.tilt:hover { transform: perspective(1400px) rotateY(0deg) rotateX(0deg); }

/* ---------------------------------------------------------------- cards and grids */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface), rgba(22, 44, 33, 0.7));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  position: relative;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(240, 194, 66, 0.1); border: 1px solid rgba(240, 194, 66, 0.3);
}
.card .icon svg { width: 28px; height: 28px; }

/* The featured game on the studio page. */
.game {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; overflow: hidden; padding: 0;
}
.game .game-text { padding: clamp(26px, 4vw, 44px); }
.game .game-art { position: relative; min-height: 260px; }
.game .game-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game .game-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--surface) 0%, transparent 35%); }
.game h2 { margin-bottom: 4px; }
.tagline { font-family: var(--display); font-style: italic; color: var(--gold-soft); font-size: 20px; margin: 0 0 14px; }

/* Steps of a round. */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; margin-bottom: 14px;
  font: 700 20px/1 var(--display); color: #1d1606; background: var(--gold);
}
.step h3 { font-size: 19px; }
.step p { color: var(--muted); margin: 0; font-size: 16px; }

/* Screenshot gallery. */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.gallery figure { margin: 0; }
.gallery figcaption { color: var(--muted); font-size: 15px; margin-top: 10px; }
.gallery .wide { grid-column: span 2; }

/* Skill chips. */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.chip.fire { color: #ffb27a; } .chip.ice { color: #9fd3f5; } .chip.dark { color: #d2b6ff; } .chip.life { color: #b8f0a0; }
.chip.gold { color: var(--gold-soft); } .chip.poison { color: #a6e88a; }

/* ---------------------------------------------------------------- long text pages (help, privacy, terms) */

.page-head { padding: clamp(44px, 7vw, 80px) 0 24px; }
.page-head p { color: var(--muted); max-width: 720px; }

.prose { max-width: 820px; padding-bottom: 72px; }
.prose h2 { font-size: 28px; margin-top: 48px; padding-top: 8px; border-top: 1px solid rgba(46, 82, 64, 0.7); }
.prose h3 { margin-top: 28px; font-size: 21px; }
.prose p, .prose li { color: #d3dfd8; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--ink); }

.notice {
  border: 1px solid rgba(255, 128, 40, 0.5); background: rgba(255, 128, 40, 0.09); color: #ffd2b3;
  border-radius: 14px; padding: 16px 18px; margin: 8px 0 28px; font-size: 16px;
}
.notice strong { color: #ffe3cf; }
.fill { background: rgba(240, 194, 66, 0.16); color: var(--gold-soft); border-radius: 6px; padding: 1px 6px; font-weight: 700; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 8px 0 12px; }
.toc ol { margin: 6px 0 0; columns: 2; column-gap: 32px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--gold); }

table { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--gold-soft); font-weight: 700; background: rgba(22, 44, 33, 0.7); }
.table-scroll { overflow-x: auto; }

/* FAQ. */
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; padding: 0 20px;
}
.faq details[open] { border-color: rgba(240, 194, 66, 0.45); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 700; color: var(--ink); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 12px; font: 400 28px/1 var(--display); color: var(--gold);
}
.faq details[open] summary::after { content: "–"; }
.faq details > *:not(summary) { margin-top: 0; }
.faq details > :last-child { padding-bottom: 18px; margin-bottom: 0; }

.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background: linear-gradient(120deg, rgba(240, 194, 66, 0.14), rgba(22, 44, 33, 0.9));
  border: 1px solid rgba(240, 194, 66, 0.35); border-radius: var(--radius); padding: 26px 28px; margin: 36px 0;
}
.contact-card p { margin: 4px 0 0; color: var(--muted); }
.contact-card h3 { margin: 0; }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid rgba(240, 194, 66, 0.14); background: var(--bg-deep); padding: 40px 0 28px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h4 { font: 700 14px/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 6px 0 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 8px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer p { color: var(--muted); margin: 10px 0 0; font-size: 15px; }
.fine { border-top: 1px solid rgba(46, 82, 64, 0.6); margin-top: 28px; padding-top: 18px; font-size: 14px; color: #6f8a7b; }

/* ---------------------------------------------------------------- phones and tablets */

@media (max-width: 900px) {
  .hero-grid, .game, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tilt { transform: none; }
  .game .game-art { min-height: 220px; order: -1; }
  .game .game-art::after { background: linear-gradient(0deg, var(--surface) 0%, transparent 45%); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header .wrap { padding: 10px 0; gap: 10px; }
  .nav { margin-left: 0; width: 100%; }
  .nav a { padding: 7px 11px; font-size: 14px; }
  .grid-3, .steps, .gallery, .footer-grid { grid-template-columns: 1fr; }
  .gallery .wide { grid-column: auto; }
  .toc ol { columns: 1; }
  .button { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .tilt, .tilt:hover { transform: none; }
}

/* Grid boxes may shrink below their pictures' size, so nothing pushes the page wider than the phone. */
.hero-grid > *, .grid > *, .game > *, .steps > *, .gallery > *, .footer-grid > * { min-width: 0; }
.game .game-text p + p { margin-top: 12px; }
#skills { margin-top: 20px; }
.fine { font-family: var(--display); letter-spacing: 0.02em; }
.toc li { margin: 0 0 8px; break-inside: avoid; }
