/* Mafia website: home and download pages. The game itself (/play) has its own styles. */
@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,500;0,6..96,700;1,6..96,500&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --ink: #0E1024;        /* night */
  --ink-2: #161936;      /* raised night */
  --ink-3: #22264A;      /* lines on night */
  --velvet: #7A111A;     /* the app's red */
  --blood: #D7263D;      /* Mafia faction */
  --lantern: #E8B04B;    /* morning light */
  --bone: #F2EBDD;       /* text */
  --smoke: #8A8FA8;      /* quiet text */
  --town: #3F6FD8;
  --neutral: #FF9500;
  --cult: #B06AE0;
  --display: 'Bodoni Moda', 'New York', Georgia, serif;
  --body: 'Instrument Sans', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --t-xs: .75rem;
  --t-sm: .875rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: clamp(1.5rem, 2.4vw, 2rem);
  --t-2xl: clamp(2rem, 4vw, 3.25rem);
  --t-3xl: clamp(3.25rem, 6.8vw, 6rem);
  --s-sm: 1rem;
  --s-md: clamp(1.25rem, 2.5vw, 2rem);
  --s-lg: clamp(4rem, 8vw, 7rem);
  --gutter: max(clamp(1.25rem, 5vw, 5rem), env(safe-area-inset-left), env(safe-area-inset-right));
  --page: min(1280px, calc(100% - 2 * var(--gutter)));
}
html { font-size: 100%; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--ink); color: var(--bone); font: var(--t-md)/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
/* ── Devices ─────────────────────────────────────────────────────────
   Size:  phone < 600 px · tablet 600–1023 px · desktop ≥ 1024 px (each page's grid follows these).
   Input: fingers (phones, tablets) get controls at least 44 px tall and no hover-only effects;
          a mouse gets hover states; the keyboard works everywhere, including on iPads with one:
          a skip link, a visible focus ring on every control, and Tab order that follows the page. */
:focus { outline: none; }
:focus-visible { outline: 0.1875rem solid var(--lantern); outline-offset: 0.1875rem; border-radius: 0.5rem; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 20; background: var(--lantern); color: var(--ink); padding: 0.625rem 1rem; border-radius: 0.625rem; font-weight: 600; text-decoration: none; }
.skip:focus { top: 0.625rem; }
@media (pointer: coarse) {
  .top nav a, .brand { min-height: max(44px, 2.75rem); display: inline-flex; align-items: center; }
  .btn { min-height: max(48px, 3rem); }
  footer a { display: inline-flex; align-items: center; min-height: max(44px, 2.75rem); }
}

.wrap { width: var(--page); margin-inline: auto; }

/* ── Top bar ───────────────────────────────── */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(0.75rem); -webkit-backdrop-filter: blur(0.75rem); border-bottom: 1px solid var(--ink-3); }
.top .wrap { display: flex; align-items: center; gap: 1.75rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; font: 700 var(--t-lg) var(--display); letter-spacing: .02em; }
.brand img { width: 2.125rem; height: 2.125rem; border-radius: 0.5rem; }
.top nav { display: flex; gap: 1.375rem; margin-left: auto; align-items: center; }
.top nav a { text-decoration: none; color: var(--smoke); font-weight: 500; font-size: var(--t-sm); white-space: nowrap; }
.top nav a[aria-current="page"] { color: var(--bone); }
.top nav a.play { color: var(--ink); background: var(--lantern); padding: 0.5rem 1rem; border-radius: 62.4375rem; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .top nav a:hover { color: var(--bone); }
  .top nav a.play:hover { color: var(--ink); background: #F2C369; }
      }
@media (max-width: 719px) { .top nav a.hide-sm { display: none; } .top .wrap { gap: 0.75rem; } .top nav { gap: 0.875rem; } }
/* Small phones: four links and the logo still fit on one line. */
@media (max-width: 399px) { .top nav { gap: 0.625rem; } .top nav a.play { padding: 0.5rem 0.8rem; } .brand { gap: 0.4rem; } }

/* ── Buttons ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.9375rem 1.5rem; border-radius: 62.4375rem; font: 600 var(--t-md) var(--body); text-decoration: none; border: 0; cursor: pointer; }
.btn.primary { background: var(--lantern); color: var(--ink); }
.btn.primary:hover { background: #F2C369; }
.btn.ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--smoke); }

/* ── Type ──────────────────────────────────── */
.eyebrow { font: 500 var(--t-xs) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lantern); margin: 0 0 1.125rem; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: var(--t-2xl); line-height: 1.06; }
.lead { font-size: var(--t-lg); color: color-mix(in srgb, var(--bone) 82%, var(--smoke)); max-width: 38em; }
.muted { color: var(--smoke); }
section { padding: var(--s-lg) 0; }
section + section { border-top: 1px solid var(--ink-3); }

/* ── Footer ────────────────────────────────── */
footer { border-top: 1px solid var(--ink-3); padding: var(--s-md) 0 calc(var(--s-md) + env(safe-area-inset-bottom)); color: var(--smoke); font-size: var(--t-sm); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.875rem 1.75rem; align-items: center; }
footer nav { display: flex; gap: 1.25rem; margin-left: auto; }
footer a { text-decoration: none; }
footer a:hover { color: var(--bone); }

/* Responsive refinement: retain the palette and type, let the layout adapt. */
body { background-image: radial-gradient(ellipse at 85% 0%, #19182e 0, transparent 45%); }
.top .wrap { height: 4.75rem; }
.top nav a { min-height: 44px; display: inline-flex; align-items: center; }
.brand { flex-shrink: 0; }
.btn { min-height: 48px; transition: background .18s, box-shadow .18s, transform .18s; }
section[id] { scroll-margin-top: 6rem; }
.hero { min-height: min(850px, calc(100svh - 4.75rem)); padding: clamp(3rem, 7vw, 6rem) 0; }
.hero .wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 6rem); }
.hero h1 { max-width: 9.5em; line-height: 1.04; text-wrap: balance; }
.hero .lead { max-width: 31em; line-height: 1.7; }
.hero .eyebrow { display: flex; align-items: center; gap: .75rem; font-size: .6875rem; letter-spacing: .12em; }
.hero .eyebrow::before { content: ''; width: 1.5rem; height: 1px; background: var(--lantern); flex-shrink: 0; }
.hero .actions { gap: .75rem; margin-top: 1.75rem; }
.code { margin-top: 1.5rem; width: 100%; max-width: 26rem; }
.code input { font-size: 1rem; letter-spacing: .16em; min-height: 44px; }
.code label { font-size: .6875rem; }
.hero .table { position: relative; isolation: isolate; padding: 2.5rem 0; }
.hero .table::before, .hero .table::after { content: ''; position: absolute; z-index: -1; width: min(80%, 20rem); aspect-ratio: 5 / 7; top: 2.5rem; border: 1px solid #704047; border-radius: 1.125rem; background: repeating-linear-gradient(45deg, #4e1520 0 2px, #351422 2px 10px); }
.hero .table::before { transform: rotate(-12deg) translate(-1rem, .6rem); opacity: .6; }
.hero .table::after { transform: rotate(9deg) translate(.8rem, .3rem); opacity: .8; }
.hero .card { width: min(80%, 20rem); transform: rotate(-3deg); }
.hero .hint { margin-top: 1rem; text-align: center; line-height: 1.6; font-size: .625rem; letter-spacing: .12em; }
.hero .front { padding: clamp(1rem, 2vw, 1.625rem); }
.hero .front h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.hero .front p { font-size: .9375rem; }
.hero .front .fac, .hero .front .foot { font-size: .6875rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 2rem; color: var(--smoke); font: .6875rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.hero-facts span + span::before { content: '✦'; color: var(--lantern); margin-right: 1.5rem; }
.round { border-radius: .875rem; }
.phase { padding: clamp(1.25rem, 2.5vw, 2rem); }
.phase .n { color: var(--lantern); }
.phase.morning .n { color: inherit; }
.faction { border: 1px solid var(--ink-3); border-top: 2px solid var(--fc); border-radius: .875rem; }
.faction, .phase, .feat > *, .host > *, .platform, .browser > * { min-width: 0; }
.faction p, .phase p, .feat p { line-height: 1.7; }
h2 { max-width: 24em; text-wrap: balance; line-height: 1.15; }
.host { gap: clamp(2rem, 6vw, 5rem); }
.faq { column-gap: 3rem; }
.platform { border-radius: 1rem; }
.intro h1 { max-width: 12em; }
@media (min-width: 1800px) { .hero { min-height: 850px; } }
@media (min-width: 768px) and (max-width: 1100px) {
  .hero .wrap { gap: 2rem; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .hero h1 { font-size: clamp(3rem, 6.4vw, 4.75rem); }
  .hero .actions .btn { padding-inline: 1.125rem; }
  .hero .table::before, .hero .table::after, .hero .card { width: 88%; }
  .hero .hint { max-width: 20em; }
}
@media (max-width: 767px) {
  .top .wrap { height: 4.25rem; }
  .hero { padding: 3rem 0 2.5rem; min-height: auto; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .hero h1 { font-size: clamp(3rem, 9vw, 4.75rem); max-width: 11em; }
  .hero .lead { max-width: 34em; }
  .hero .table { padding: 2rem 0 1rem; }
  .hero .card, .hero .table::before, .hero .table::after { width: min(60%, 15rem); }
  .hero .table::before, .hero .table::after { top: 2rem; }
  .hero .front h3 { font-size: 1.5rem; }
  .hero .front p { font-size: .875rem; }
  .hero .front .foot { font-size: .625rem; }
  .hero-facts { margin-top: 1.5rem; }
  .hero .actions { flex-direction: row; }
  .hero .actions .btn { flex: 1 1 12rem; }
  footer nav { margin-left: 0; flex-wrap: wrap; }
}
@media (max-width: 370px) {
  .brand { font-size: 1.125rem; gap: .4rem; }
  .brand img { width: 1.75rem; height: 1.75rem; }
  .top nav { gap: .75rem; }
  .top nav a { font-size: .8125rem; }
  .code { padding-left: .625rem; }
  .code label { font-size: .625rem; letter-spacing: .02em; }
  .code input { padding-inline: .5rem; letter-spacing: .08em; }
  .code button { padding-inline: .75rem; }
  .hero-facts { gap: .75rem; font-size: .625rem; }
  .hero-facts span + span::before { margin-right: .75rem; }
}
