/* Mad Mind Games: shares MathMADics' paper, ink and lime so the studio and its games read as one family. */

:root {
  color-scheme: light;
  --bg: #f1f1ec;
  --surface: #ffffff;
  --surface-soft: #e8eadf;
  --text: #1d1e19;
  --muted: #62645a;
  --line: #d9dacc;
  --brand: #bcee29;
  --brand-hover: #b0e51c;
  --brand-ink: #1c1e0f;
  --focus: #1d1e19;


  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(29, 30, 25, 0.04), 0 16px 44px rgba(29, 30, 25, 0.07);

  /* Type scale: perfect fourth (1.333) from 17px. */
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.4167rem;
  --step-2: 1.8889rem;
  --step-3: 2.5185rem;
  --step-4: clamp(2.5rem, 1.6rem + 3.6vw, 4.4775rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1a1b15;
    --surface: #23241d;
    --surface-soft: #2b2d24;
    --text: #ecede4;
    --muted: #a3a596;
    --line: #36382e;
    --focus: #bcee29;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 44px rgba(0, 0, 0, 0.35);
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

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

::selection { background: color-mix(in srgb, var(--brand) 55%, transparent); color: var(--brand-ink); }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 24px;
}

.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 700; font-style: italic; font-size: 1.1rem;
}
.wordmark-text { font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.wm-mad { font-weight: 700; font-style: italic; padding-right: 0.06em; }

.site-header nav { display: flex; gap: 4px; }
.site-header nav a {
  padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--text); background: var(--surface-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 70ms ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ---------- Hero ---------- */

.hero { padding-block: 72px 88px; }
.hero h1 {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  max-width: 16ch;
}
.lede { margin-top: 24px; max-width: 36rem; font-size: 1.15rem; color: var(--muted); }

/* ---------- Sections ---------- */

.section-title {
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin-bottom: 32px;
}

.games, .contact { padding-block: 72px; border-top: 1px solid var(--line); }

.trains { color: var(--muted); font-size: 0.95rem; }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px;
  font-size: var(--step--1); font-weight: 600;
  white-space: nowrap;
}
.status-live { background: var(--brand); color: var(--brand-ink); }
.status-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-ink); }
.status-concept { border: 1px dashed var(--muted); color: var(--muted); }

/* Flagship */

.flagship {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.flagship-shot {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f1f1ec;
  border: 1px solid var(--line);
}

.flagship-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-right: 16px; }
.flagship-name { font-size: var(--step-3); line-height: 1; letter-spacing: -0.03em; font-weight: 500; }
.flagship-body > p:not(.status):not(.trains) { max-width: 42ch; }

/* Upcoming placeholders */

.upcoming-title { margin: 64px 0 20px; font-size: var(--step-2); letter-spacing: -0.02em; font-weight: 600; }

.upcoming {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.placeholder {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 190px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}
.placeholder .status { margin-bottom: 10px; }
.placeholder h4 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.placeholder p:last-child { margin-top: 6px; }

/* Contact */

.contact-email {
  display: inline-block;
  font-size: clamp(1.6rem, 1rem + 3vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  background-image: linear-gradient(var(--brand), var(--brand));
  background-size: 100% 0.22em;
  background-position: 0 92%;
  background-repeat: no-repeat;
  transition: background-size 180ms ease;
  overflow-wrap: anywhere;
}
.contact-email:hover { background-size: 100% 0.5em; }

/* Footer */

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-block: 28px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero { padding-block: 40px 64px; }
  .flagship { grid-template-columns: 1fr; gap: 24px; }
  .flagship-body { padding: 0 4px 8px; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .site-header { padding-block: 16px; }
  .site-header nav a { padding: 8px 10px; }
  .wordmark-text { font-size: 1.05rem; }
  .flagship { padding: 14px; }
  .games, .contact { padding-block: 56px; }
}
