/* BoardGameWorld landing — "Nocturne" tokens, mirrored from app/lib/core/theme.dart.
   Mobile-first: base rules target narrow screens, min-width queries add columns.
   Nothing has a fixed width larger than the viewport; sizes are fluid (clamp/min). */
:root {
  --accent: #4fbfa8;
  --accent-ink: #0b0a09;
  --accent-soft: #17322d;
  --bg: #121110;
  --bg-deep: #0b0a09;
  --surf1: #1c1917;
  --surf2: #23201d;
  --ink: #ece4d9;
  --muted: #9e9488;
  --hairline: #262320;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  /* 16px on phones, growing to 40px on wide screens */
  --gutter: clamp(16px, 4vw, 40px);
  /* vertical rhythm between sections */
  --section-y: clamp(56px, 9vw, 112px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(16px, 1.1vw + 12px, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; overflow-wrap: break-word; text-wrap: balance; }
p { margin: 0; overflow-wrap: break-word; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm);
}
.skip:focus { left: 8px; }

.wrap {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.wrap--narrow { max-width: 780px; }

/* ── "Coming soon" badge ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(79, 191, 168, .35);
  font-weight: 800; letter-spacing: .02em; border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge--lg { padding: clamp(11px, 1.4vw, 14px) clamp(20px, 2.4vw, 26px); font-size: clamp(16px, 1.2vw + 11px, 18px); }
.pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { to { transform: scale(2.8); opacity: 0; } }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 17, 16, .82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.brand img { flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__link {
  flex: none; padding: 8px 4px; font-weight: 700; font-size: 15px;
  color: var(--muted); text-decoration: none;
}
.topbar__link:hover { color: var(--ink); }

/* ── Phone-style screenshot frame (used in hero and showcase) ─────────── */
.shot {
  width: 100%;
  border-radius: clamp(20px, 3.4vw, 30px);
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid #2f2b27;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .85), 0 0 0 clamp(4px, .8vw, 7px) #1a1816;
  /* Bezel: the screenshot sits inside the frame instead of touching it. */
  padding: clamp(9px, 1.9vw, 14px);
}
.shot img { width: 100%; border-radius: clamp(12px, 2.2vw, 18px); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(40px, 7vw, 96px) var(--section-y);
  background:
    radial-gradient(70% 50% at 85% 25%, rgba(79, 191, 168, .15), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(224, 163, 62, .06), transparent 70%);
}
.hero__grid { display: grid; gap: clamp(40px, 6vw, 64px); align-items: center; }
.hero__copy { min-width: 0; }
.eyebrow {
  color: var(--accent); font-weight: 700; font-size: clamp(12px, .4vw + 11px, 14px);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px;
}
h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(34px, 5.2vw + 14px, 62px); letter-spacing: -.02em;
}
h1 em { font-style: italic; color: var(--accent); }
.lead { color: var(--muted); font-size: clamp(16px, .6vw + 14px, 19px); max-width: 34em; margin-top: 20px; }
.soon { margin-top: clamp(24px, 3vw, 32px); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.soon__note { color: var(--muted); font-size: 15px; font-weight: 600; }
.soon__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: clamp(11px, 1.4vw, 14px) clamp(22px, 2.4vw, 28px);
  font: inherit; font-weight: 800; font-size: clamp(16px, 1.2vw + 11px, 18px); letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--wide { width: 100%; }

.hero__visual { display: flex; justify-content: center; min-width: 0; }
/* Phone screenshot: never wider than 72% of the screen, never taller than
   ~70% of the viewport (landscape phones), capped at 320px on desktop. */
.shot--hero {
  width: min(72vw, 320px, calc(70svh * 1080 / 2307));
  min-width: 180px;
  transform: rotate(-2deg);
}
@supports not (height: 1svh) {
  .shot--hero { width: min(72vw, 320px, calc(70vh * 1080 / 2307)); }
}

@media (min-width: 920px) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .hero__visual { justify-content: flex-end; }
}

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-deep); border-block: 1px solid var(--hairline); }
.section__title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(28px, 2.8vw + 16px, 44px); letter-spacing: -.015em;
  text-align: center; margin-bottom: clamp(32px, 5vw, 56px);
}

/* Screenshot + text rows. Stacked on phones; two columns from 820px,
   alternating sides so the page doesn't read as a single column of images. */
.showcase { display: grid; gap: clamp(56px, 8vw, 96px); }
.showcase__row { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; justify-items: center; }
.showcase__row .shot { width: min(64vw, 300px); min-width: 170px; }
.showcase__copy { max-width: 32em; min-width: 0; text-align: center; }
.showcase__copy h3 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 1.6vw + 16px, 34px); letter-spacing: -.01em; margin-bottom: 12px; }
.showcase__copy p { color: var(--muted); }

@media (min-width: 820px) {
  .showcase__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .showcase__copy { text-align: left; justify-self: start; }
  .showcase__row:nth-child(even) .shot { order: 2; }
  .showcase__row:nth-child(even) .showcase__copy { justify-self: end; }
}

/* Smaller features without a screenshot: as many columns as fit. */
.features {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin-top: clamp(56px, 8vw, 96px);
}
.feature {
  background: var(--surf1); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: clamp(20px, 2.4vw, 28px);
}
.feature h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 16px; }

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.faq details { border-bottom: 1px solid var(--hairline); }
.faq details:first-child { border-top: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 18px 36px 18px 0; min-height: 44px;
  font-weight: 700; font-size: clamp(16px, .5vw + 14px, 18px);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding: 0 0 20px; max-width: 60ch; }
.faq details p a { color: var(--accent); }

/* ── Closing ──────────────────────────────────────────────────────────── */
.final {
  padding-block: var(--section-y); text-align: center;
  background: radial-gradient(50% 60% at 50% 40%, rgba(79, 191, 168, .14), transparent 70%);
}
.final__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.final img { width: clamp(56px, 6vw, 72px); filter: drop-shadow(0 16px 28px rgba(79, 191, 168, .35)); }
.final h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.4vw + 16px, 52px); letter-spacing: -.02em; }
.final__lead { color: var(--muted); font-size: clamp(16px, .6vw + 14px, 19px); max-width: 34em; margin: -8px 0 0; }

/* ── "Avvisami" form ──────────────────────────────────────────────────── */
.notify {
  width: 100%; max-width: 520px; text-align: left;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--surf1); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: clamp(18px, 3vw, 28px);
}
.notify__fields { display: grid; gap: 14px; }
@media (min-width: 560px) { .notify__fields { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; font-weight: 700; color: var(--muted); }
.field__input {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg-deep); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 12px 14px;
}
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 191, 168, .25); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check a { color: var(--accent); }
.notify__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notify__status { margin: 0; min-height: 1.5em; font-size: 15px; font-weight: 600; color: var(--muted); }
.notify__status:empty { display: none; }
.notify__status--ok { color: var(--accent); }
.notify__status--error { color: #ffb3ad; }
#avvisami { scroll-margin-top: 72px; }

.footer {
  border-top: 1px solid var(--hairline); font-size: 14px;
  padding-block: 24px max(28px, env(safe-area-inset-bottom));
}
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer__muted { color: var(--muted); }
/* ── Legal pages (privacy.html, elimina-account.html) ─────────────────── */
.legal { padding-block: clamp(32px, 6vw, 64px); }
.legal h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3vw + 16px, 44px); letter-spacing: -.015em; margin-bottom: 12px; }
.legal h2 { font-size: clamp(20px, 1vw + 16px, 24px); font-weight: 800; margin: 36px 0 12px; }
.legal h3 { font-size: 17px; font-weight: 800; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--ink); opacity: .92; }
.legal p { margin: 0 0 12px; }
.legal ul, .legal ol { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal .table-wrap { overflow-x: auto; margin: 8px 0 16px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.legal th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.legal mark.placeholder { background: rgba(226, 104, 95, .18); color: #ffb3ad; border-radius: 4px; padding: 0 4px; }
.footer a { color: inherit; }

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

/* ── /whoami ─────────────────────────────────────────────────────────── */
.whoami { padding-block: clamp(32px, 6vw, 64px); }
.whoami__prompt {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px; color: var(--muted); margin-bottom: clamp(20px, 3vw, 28px);
}
.whoami__sigil { color: var(--accent); margin-right: 6px; }
.whoami__caret {
  display: inline-block; width: .55em; height: 1.1em; margin-left: 4px; vertical-align: -.2em;
  background: var(--accent); animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .whoami__caret { animation: none; } }
.whoami__intro { display: grid; gap: clamp(20px, 3vw, 32px); align-items: center; }
.whoami__photo img {
  width: 160px; height: 160px; object-fit: cover;
  border-radius: 50%; border: 1px solid var(--hairline);
}
.whoami h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 3.4vw + 16px, 50px); letter-spacing: -.015em; }
.whoami h1 em { color: var(--accent); }
.whoami .lead { margin-top: 14px; }
.whoami__section { margin-top: clamp(40px, 6vw, 64px); }
.whoami__section h2 { font-size: clamp(20px, 1vw + 16px, 24px); font-weight: 800; margin-bottom: 12px; }
.whoami__section p { opacity: .92; }
.whoami__section p + p { margin-top: 12px; }
.whoami__reasons + p { margin-top: 20px; }
.whoami__reasons { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.whoami__reasons li {
  background: var(--surf1); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 16px 18px;
}
.whoami__reasons strong { display: block; margin-bottom: 4px; }
.whoami__links { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.whoami__links a {
  display: inline-block; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(79, 191, 168, .35);
  font-weight: 700; text-decoration: none; overflow-wrap: anywhere;
}
.whoami__links a:hover { background: #1d3e37; }
@media (min-width: 640px) {
  .whoami__intro { grid-template-columns: auto 1fr; }
  .whoami__photo img { width: 200px; height: 200px; }
}
