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

:root {
  --bg:       #00251f;
  --card:     #00453b;
  --card-hi:  rgba(255,255,255,0.04);
  --border:   rgba(255,255,255,0.09);
  --accent:   #abff00;
  --accent-d: #8fd400;
  --text:     #ffffff;
  --muted:    rgba(255,255,255,0.55);
  --r-sm:     16px;
  --display:  'Norwester', 'Impact', sans-serif;
  --body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Consistent spacing token used across all breakpoints */
  --gap: 32px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Brickwork ── */
#brickwork {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
#brickwork span {
  position: absolute;
  font-family: var(--display);
  color: rgba(255,255,255,0.028);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.02em;
}

/* ── App shell ── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 20px var(--gap);
  display: flex;
  align-items: center;
}
.nfm-logo {
  display: inline-flex;
  text-decoration: none;
}
.nfm-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

/* ════════════════════════════════════════════════════════
   PAGE LAYOUT
   Desktop  ≥1024px : row — hero left, card right
   Tablet   600–1023px : column — hero top, card below
   Phone    <600px  : column, tighter gutter
════════════════════════════════════════════════════════ */
.page {
  display: none;
  min-height: 100vh;
}
.page.active { display: flex; }

/* Default (mobile-first): stacked column, centred */
#page-main {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px var(--gap) var(--gap);
  gap: 16px;
}

.page-hero {
  width: 100%;
  max-width: 480px;
}

.card-wrapper {
  width: 100%;
  max-width: 480px;
}

/* ── Desktop  ≥1024px ── */
@media (min-width: 1024px) {
  #page-main {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: calc(var(--gap) * 2);
    padding: 0 var(--gap);
  }

  .page-hero {
    width: 420px;
    max-width: none;
    flex-shrink: 0;
  }

  .card-wrapper {
    width: 420px;
    max-width: none;
    flex-shrink: 0;
  }
}

/* ── Tablet  600–1023px ── */
@media (min-width: 600px) and (max-width: 1023px) {
  .card-wrapper { padding: 0; }
}

/* ── Phone  <600px ── */
@media (max-width: 599px) {
  .card-content { padding: 20px; }
}

/* ── Hero (title outside card) ── */
.page-hero { position: relative; z-index: 1; }

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.93;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: left;
}

/* Prevent "Adopt Your" from wrapping internally — always line 1 */
.title-line1 { white-space: nowrap; }

/* ── Card ── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
}
/* Top-left gradient highlight */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, var(--card-hi) 0%, transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}

.card-content {
  position: relative;
  z-index: 1;
  padding: calc(var(--gap) * 1.25);
}

.skip-wrap {
  text-align: center;
  margin-top: 20px;
}

/* ── Form reveal — JS-animated height ── */
#form-section { display: none; overflow: hidden; }

.form-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: var(--gap);
  margin-bottom: calc(var(--gap) * 0.875);
}

.form-sub2 {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: calc(var(--gap) * 0.875);
}

/* ── Fields ── */
.field { margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--r-sm);
  padding: 15px 16px;
  color: #fff;
  font-size: 16px;
  font-family: var(--body);
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, background 0.2s;
}
.field-input::placeholder { color: rgba(255,255,255,0.28); }
.field-input:focus { border-color: var(--accent); background: rgba(255,255,255,0.1); }
.field-input.err { border-color: #ff5757; }

.field-err { font-size: 12px; color: #ff7070; margin-top: 6px; display: none; }
.field-err.show { display: block; }

/* ── Checkbox ── */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px 16px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-bottom: var(--gap);
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.check-row:hover { background: rgba(255,255,255,0.07); }
.check-row input[type="checkbox"] {
  width: 20px; height: 20px; min-width: 20px;
  accent-color: var(--accent); cursor: pointer; margin-top: 2px;
}
.check-copy { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.check-copy strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 100px;
  padding: 17px 34px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.14s ease, background 0.14s ease, opacity 0.14s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover  { background: var(--accent-d); transform: scale(1.025); }
.btn:active { transform: scale(0.97); }
.btn-full   { width: 100%; }

.btn.loading { opacity: 0.65; pointer-events: none; }
.btn.loading .btn-text { opacity: 0; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-skip:hover { color: var(--text); }

/* ════════════════════════════════════════════════════════
   REVEAL PAGE
════════════════════════════════════════════════════════ */
#page-reveal {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
  padding-top: 88px;
}

.reveal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 52px 36px 44px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.reveal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, var(--card-hi) 0%, transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}

#drumroll-view { display: block; }

.dr-title {
  font-family: var(--display);
  font-size: 24px;
  color: var(--muted);
  margin-bottom: var(--gap);
  letter-spacing: 0.02em;
}

.slot-box {
  background: rgba(0,0,0,0.35);
  border-radius: 18px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.slot-text {
  font-family: var(--display);
  font-size: clamp(32px, 8vw, 48px);
  color: var(--accent);
  transition: opacity 0.06s;
  letter-spacing: 0.01em;
}

#reveal-view { display: none; }

.reveal-pretext {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--gap);
}

.flag-stage {
  position: relative;
  width: min(240px, 72vw);
  margin: 0 auto calc(var(--gap) * 0.75);
}

.flag-frame {
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 2px rgba(255,255,255,0.12);
  aspect-ratio: 10 / 11;
  clip-path: url(#shield-clip);
  -webkit-clip-path: url(#shield-clip);
  transform: scale(0.04);
  opacity: 0;
  filter: blur(10px);
  transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, filter 0.75s ease;
}
.flag-frame.pop { transform: scale(1); opacity: 1; filter: blur(0px); }
.flag-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.team-name {
  font-family: var(--display);
  font-size: clamp(44px, 11vw, 68px);
  line-height: 1;
  color: var(--text);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s;
}
.team-name.on { opacity: 1; transform: translateY(0); }

.team-conf {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 0.5s ease 0.55s;
}
.team-conf.on { opacity: 1; }

.reveal-msg {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  opacity: 0;
  transition: opacity 0.5s ease 0.75s;
}
.reveal-msg.on { opacity: 1; }


/* ── Page enter animation ── */
@keyframes page-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-in { animation: page-in 0.38s ease forwards; }


/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--display);
  font-size: 20px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-body h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 7px;
}
.modal-body h3:first-child { margin-top: 0; }

.modal-body p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 4px;
}

.modal-content        { display: none; }
.modal-content.active { display: block; }

/* Links inside check-row labels */
.modal-links a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 12.5px;
}
.modal-links a:hover { opacity: 0.8; }
