/* ==========================================================
   CodeWeek 2026 — Design tokens
   Palette taken from the logo:
   deep navy screen, HTML-blue, CSS-pink, JS-yellow, purple ribbon
   ========================================================== */
:root {
  --navy-950: #0a0e2a;
  --navy-900: #0f1338;
  --navy-800: #161b4a;
  --purple-600: #6c4fe0;
  --purple-500: #8468f0;
  --blue-html: #2f7fe0;
  --pink-css: #e0327f;
  --yellow-js: #f2c230;
  --green-ok: #7fd858;
  --ink-100: #f4f5ff;
  --ink-300: #c7cbef;
  --ink-500: #8b8fc4;

  --font-display: "Press Start 2P", "Courier New", monospace;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;

  --radius-notch: 10px;
  --edge: 3px solid var(--navy-950);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy-950);
  color: var(--ink-100);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.section-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { margin: 0 0 0.5em; }

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { color: var(--ink-300); max-width: 60ch; }

:focus-visible {
  outline: 3px solid var(--yellow-js);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  border: var(--edge);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 0.95rem;
}
.btn-primary {
  background: var(--yellow-js);
  color: var(--navy-950);
  box-shadow: 0 4px 0 var(--navy-950);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--navy-950);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-100);
  border-color: var(--purple-500);
}
.btn-ghost:hover { background: rgba(132, 104, 240, 0.15); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 42, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--ink-100);
}
.brand-year { color: var(--pink-css); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
}
.main-nav a { text-decoration: none; color: var(--ink-300); }
.main-nav a:hover { color: var(--ink-100); }
.nav-cta {
  background: var(--purple-600);
  color: var(--ink-100) !important;
  padding: 9px 18px;
  border-radius: 6px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink-100);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, var(--navy-800) 0%, var(--navy-950) 65%);
  padding: 80px 24px 40px;
}
.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
}
.hero-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 8px;
  opacity: 0;
  animation: pop-in 0.6s ease forwards;
}
.hero-title {
  font-family: var(--font-display);
  line-height: 1.35;
  font-size: clamp(2rem, 7vw, 3.4rem);
}
.hero-line {
  display: block;
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 0.55s ease forwards;
}
.hero-line[data-line="1"] { color: var(--ink-100); animation-delay: 0.15s; }
.hero-line[data-line="2"] { color: var(--pink-css); animation-delay: 0.35s; }
.hero-line[data-line="3"] { color: var(--yellow-js); animation-delay: 0.55s; }

.hero-sub {
  margin: 24px auto 32px;
  color: var(--ink-300);
  font-size: 1.1rem;
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
  animation-delay: 0.8s;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise-in 0.6s ease forwards;
  animation-delay: 0.95s;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-500);
  animation: bob 2s ease-in-out infinite;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.7) rotate(-6deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes rise-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- About ---------- */
.about { padding: 96px 0; background: var(--navy-950); }
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: var(--pink-css);
  margin-top: 12px;
  border-radius: 2px;
}
.about-stat-card {
  background: var(--navy-900);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-notch);
  padding: 28px;
}
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stat-row:last-child { border-bottom: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--yellow-js);
  min-width: 56px;
}
.stat-label { color: var(--ink-300); font-size: 0.92rem; }

/* ---------- Levels ---------- */
.levels {
  padding: 96px 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
}
.levels-heading { text-align: center; }
.levels-intro {
  text-align: center;
  margin: 0 auto 56px;
}
.level-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.level-card {
  position: relative;
  background: var(--navy-800);
  padding: 32px 24px 28px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  border: 1px solid rgba(255,255,255,0.08);
}
.level-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.level-1 .level-tag { background: rgba(132,104,240,0.2); color: var(--purple-500); }
.level-2 .level-tag { background: rgba(47,127,224,0.2); color: var(--blue-html); }
.level-3 .level-tag { background: rgba(224,50,127,0.2); color: var(--pink-css); }
.level-card h3 { font-size: 1.3rem; }
.level-card p { color: var(--ink-300); font-size: 0.95rem; max-width: none; }
.level-1 { border-top: 3px solid var(--purple-500); }
.level-2 { border-top: 3px solid var(--blue-html); }
.level-3 { border-top: 3px solid var(--pink-css); }

/* ---------- Tech badges ---------- */
.tech { padding: 96px 0; text-align: center; }
.tech h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: var(--yellow-js);
  margin: 12px auto 0;
  border-radius: 2px;
}
.badge-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.tech-badge { max-width: 220px; }
.badge-shape {
  width: 120px;
  height: 130px;
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
}
.badge-html {
  --shape-color: var(--blue-html);
}
.badge-css {
  --shape-color: var(--pink-css);
}
.badge-js {
  --shape-color: var(--yellow-js);
}
.badge-html .badge-shape {
  background: var(--shape-color);
  clip-path: polygon(50% 0%, 100% 22%, 92% 100%, 50% 88%, 8% 100%, 0% 22%);
}
.badge-css .badge-shape {
  background: var(--shape-color);
  clip-path: polygon(50% 0%, 100% 38%, 80% 100%, 20% 100%, 0% 38%);
}
.badge-js .badge-shape {
  background: var(--shape-color);
  color: var(--navy-950);
  border-radius: 14px;
}
.badge-code { font-size: 1rem; }
.badge-version { font-size: 1.6rem; margin-top: 4px; }
.tech-badge p { margin: 0 auto; text-align: center; font-size: 0.92rem; }

/* ---------- Signup / countdown ---------- */
.signup {
  padding: 96px 0 120px;
  background: var(--navy-900);
}
.signup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.countdown-panel {
  background: var(--navy-950);
  border: var(--edge);
  border-radius: var(--radius-notch);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.countdown-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}
.countdown-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--ink-500);
  letter-spacing: 1px;
}
.countdown-screen {
  display: flex;
  gap: 18px;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.countdown-unit span {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--green-ok);
}
.countdown-unit small {
  color: var(--ink-500);
  font-size: 0.7rem;
}
.countdown-date { color: var(--ink-300); margin: 0; font-size: 0.9rem; }

.signup-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.signup-form {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.signup-form input {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--navy-950);
  color: var(--ink-100);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.signup-form input::placeholder { color: var(--ink-500); }

/* Honeypot: hidden from real visitors (and out of the tab order via
   tabindex="-1" in the markup), but still present for simple bots to fill in. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.signup-feedback {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--green-ok);
  min-height: 1.4em;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.footer-brand p { margin: 0; font-size: 0.85rem; max-width: 32ch; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.9rem; }
.footer-nav a { text-decoration: none; color: var(--ink-300); }
.footer-nav a:hover { color: var(--ink-100); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-logo, .hero-line, .hero-sub, .hero-actions, .scroll-hint {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid, .signup-grid { grid-template-columns: 1fr; }
  .level-track { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-900);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    display: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero-logo { width: 110px; height: 110px; }
}
