@font-face {
  font-family: 'Gochi Hand';
  src: url('../vendor/fonts/GochiHand-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  background: radial-gradient(ellipse at top, #1e293b, #0f172a 60%) fixed;
  background-color: #0f172a;
  color: #f1f5f9;
  min-height: 100vh;
  min-height: 100dvh;
}

a,
button,
summary,
label[for] {
  cursor: pointer;
}

a {
  color: #7dd3fc;
}

:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
  border-radius: 0.4rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: #fbbf24;
  color: #0f172a;
  font-weight: 800;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  padding-top: calc(0.9rem + env(safe-area-inset-top));
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand-coin {
  font-size: 1.5rem;
  display: inline-block;
  animation: coin-spin 6s ease-in-out infinite;
}

.brand-name {
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-login {
  padding: 0.5rem 1.1rem;
  border: 1px solid #475569;
  border-radius: 999px;
  color: #f1f5f9;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.header-login:hover {
  background: #1e293b;
  border-color: #94a3b8;
}

@keyframes coin-spin {
  0%, 80%, 100% { transform: rotateY(0); }
  90% { transform: rotateY(180deg); }
}

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

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0 4rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  font-weight: 700;
  font-size: 0.9rem;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.shine {
  background: linear-gradient(90deg, #fbbf24, #f472b6, #a78bfa, #fbbf24);
  background-size: 300% 100%;
  animation: shine 8s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes shine {
  to { background-position: 300% 50%; }
}

.hero-sub {
  margin: 0 0 1.75rem;
  color: #cbd5e1;
  font-size: 1.15rem;
  max-width: 36rem;
}

.login-box {
  max-width: 32rem;
  padding: 1.25rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  scroll-margin-top: 6rem;
}

.login-title {
  margin: 0;
  font-size: 1.2rem;
}

.login-help {
  margin: 0.25rem 0 0.9rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.email-input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 2px solid #334155;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 1.05rem;
}

.email-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border: 0;
  border-radius: 0.75rem;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.4);
}

.cta-btn:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.form-status {
  flex-basis: 100%;
  margin: 0;
  min-height: 1.2em;
  font-size: 0.95rem;
  color: #94a3b8;
}

.form-status.is-error {
  color: #fca5a5;
}

.login-sent-title {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  font-weight: 800;
}

.login-sent p {
  margin: 0;
  color: #cbd5e1;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  color: #86efac;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- "Prøv selv" chalkboard ---------- */

.hero-demo {
  position: relative;
}

.demo-wallet {
  position: absolute;
  top: -1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #422006;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.35);
}

.demo-wallet-amount {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.demo-wallet-amount.bump {
  animation: bump 0.5s ease;
}

@keyframes bump {
  40% { transform: scale(1.35); }
}

.demo-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 20rem;
  padding: 2rem 1.25rem 1.5rem;
  font-family: 'Gochi Hand', 'Comic Sans MS', 'Segoe Script', cursive;
  text-align: center;
  background:
    radial-gradient(ellipse 28rem 9rem at 25% 30%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(ellipse 20rem 8rem at 78% 62%, rgba(255, 255, 255, 0.035), transparent 70%),
    #202428;
  border: 0.8rem solid transparent;
  border-image: linear-gradient(160deg, #a97a4f, #7c4f2c 35%, #96633a 65%, #5f3b20) 1;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(0, 0, 0, 0.45);
  transform: rotate(-1deg);
}

.demo-title {
  margin: 0;
  color: #fde68a;
  font-weight: 400;
  font-size: 1.6rem;
}

.demo-question {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.9rem, 5.5vw, 2.8rem);
  line-height: 1.15;
  text-wrap: balance;
}

.demo-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.demo-option {
  min-width: 5rem;
  padding: 0.6rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.75rem;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1.7rem;
  transition: transform 0.15s, background 0.15s;
}

.demo-option:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-2deg);
  background: rgba(255, 255, 255, 0.08);
}

.demo-option.is-correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.2);
}

.demo-option.is-wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  animation: shake 0.35s;
  cursor: not-allowed;
}

@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.demo-cta {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.demo-feedback {
  margin: 0;
  min-height: 1.6em;
  color: #e2e8f0;
  font-size: 1.35rem;
}

.demo-marks {
  display: flex;
  gap: 0.35rem;
  min-height: 1.6rem;
}

.mark {
  font-size: 1.4rem;
  font-weight: 700;
}

.mark.ok { color: #4ade80; }
.mark.bad { color: #f87171; }

.coin-fly {
  position: fixed;
  z-index: 50;
  font-size: 1.8rem;
  pointer-events: none;
  translate: -50% -50%;
  animation: coin-fly 0.8s cubic-bezier(0.5, -0.4, 0.6, 1) forwards;
}

@keyframes coin-fly {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.6) rotate(360deg);
    opacity: 0.2;
  }
}

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

.section {
  padding: 3.5rem 0;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 900;
  text-align: center;
}

.section-sub {
  margin: 0 auto 2rem;
  max-width: 36rem;
  color: #94a3b8;
  text-align: center;
}

.steps {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1.25rem;
  text-align: center;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 0.8rem;
  left: 1rem;
  color: #475569;
  font-weight: 900;
  font-size: 1.4rem;
}

.step-icon {
  display: block;
  font-size: 2.6rem;
}

.step h3,
.parent-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.2rem;
}

.step p,
.parent-card p {
  margin: 0;
  color: #cbd5e1;
}

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic {
  --glow: rgba(255, 255, 255, 0.3);
  padding: 1.1rem 1rem;
  border-radius: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.topic:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 12px 28px var(--glow);
}

.topic h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 900;
}

.topic p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Same gradients as the game's category cards */
.topic.plus { --glow: rgba(74, 222, 128, 0.45); background-image: linear-gradient(160deg, #4ade80, #10b981 45%, #0d9488); }
.topic.minus { --glow: rgba(251, 146, 60, 0.5); background-image: linear-gradient(160deg, #fbbf24, #f97316 45%, #e11d48); }
.topic.gange { --glow: rgba(192, 132, 252, 0.45); background-image: linear-gradient(160deg, #c084fc, #8b5cf6 45%, #4f46e5); }
.topic.dividere { --glow: rgba(103, 232, 249, 0.45); background-image: linear-gradient(160deg, #67e8f9, #0ea5e9 45%, #2563eb); }
.topic.ligninger { --glow: rgba(253, 164, 175, 0.45); background-image: linear-gradient(160deg, #fda4af, #f472b6 45%, #a21caf); }
.topic.broeker { --glow: rgba(251, 191, 36, 0.45); background-image: linear-gradient(160deg, #fcd34d, #f59e0b 45%, #b45309); }
.topic.decimaltal { --glow: rgba(45, 212, 191, 0.45); background-image: linear-gradient(160deg, #5eead4, #14b8a6 45%, #0f766e); }
.topic.negative { --glow: rgba(251, 113, 133, 0.5); background-image: linear-gradient(160deg, #fda4af, #f43f5e 45%, #9f1239); }
.topic.procent { --glow: rgba(165, 180, 252, 0.45); background-image: linear-gradient(160deg, #a5b4fc, #6366f1 45%, #3730a3); }
.topic.enheder { --glow: rgba(163, 230, 53, 0.45); background-image: linear-gradient(160deg, #a3e635, #65a30d 45%, #3f6212); }
.topic.sprog { --glow: rgba(132, 204, 22, 0.5); background-image: linear-gradient(160deg, #bef264, #84cc16 45%, #15803d); }
.topic.datotid { --glow: rgba(148, 163, 184, 0.5); background-image: linear-gradient(160deg, #e2e8f0, #64748b 45%, #1e293b); }
.topic.viden { --glow: rgba(255, 255, 255, 0.5); background-image: linear-gradient(160deg, #f87171, #c8102e 45%, #7f1d1d); }

.parent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.parent-card {
  padding: 1.25rem 1.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1.1rem;
}

.faq {
  max-width: 46rem;
  margin: 0 auto;
}

.faq h2 {
  margin-bottom: 1.5rem;
}

.faq details {
  margin-bottom: 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.9rem;
}

.faq summary {
  padding: 1rem 1.25rem;
  font-weight: 800;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  float: right;
  color: #7dd3fc;
  font-weight: 900;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0;
  padding: 0 1.25rem 1.1rem;
  color: #cbd5e1;
}

.final-cta {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.final-cta h2 {
  margin-bottom: 1.25rem;
}

.final-cta .login-form {
  justify-content: center;
}

.final-cta .login-sent {
  padding: 1.25rem;
  background: #1e293b;
  border-radius: 1rem;
}

.site-footer {
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
  color: #64748b;
  text-align: center;
  font-size: 0.9rem;
}

/* Scroll reveal — only hidden when JS is running, so crawlers and no-JS
   visitors always see everything */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Larger screens ---------- */

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    padding: 4rem 0 5rem;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 30rem) {
  .brand-name {
    font-size: 1rem;
  }

  .cta-btn {
    flex: 1 1 100%;
  }

  .demo-option {
    min-width: 4rem;
    font-size: 1.7rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
