/* ===================================================
   n8n Taiwan Open Hackathon - Stylesheet
   =================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --pink: #F0648C;
  --pink-deep: #EA4B71;
  --pink-soft: #FFF5F5;
  --pink-bg: #FFECF2;
  --orange: #FF6B35;
  --orange-hover: #FF8359;
  --amber: #E8A93C;
  --amber-light: #FFC547;
  --silver: #94A3B8;
  --silver-light: #CBD5E1;
  --bronze: #B45309;
  --bronze-light: #D97706;
  --purple: #B8A1E3;

  --white: #FFFFFF;
  --offwhite: #FAFAFA;
  --lightgray: #F3F4F6;
  --gray-50: #F9FAFB;
  --gray-100: #F9FAFB;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --black: #0A0A0A;

  --font-display: 'Satoshi', 'Noto Sans TC', -apple-system, system-ui, sans-serif;
  --font-body: 'Noto Sans TC', 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Satoshi', monospace;

  --container-max: 1200px;
  --container-narrow: 860px;
  --section-py: 160px;
  --section-py-mobile: 100px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(240, 100, 140, 0.12);
  --shadow-pink: 0 8px 24px rgba(240, 100, 140, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --t-fast: 0.15s ease;
  --t-normal: 0.3s ease;
  --t-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Force hidden attribute to work over display: grid/flex */
[hidden] { display: none !important; }

/* ---------- Icon Base (Lucide) ---------- */
svg.lucide,
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  flex-shrink: 0;
}

/* When lucide creates svg, it replaces [data-lucide] with svg; style both */

/* ---------- Layout Utilities ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow { max-width: var(--container-narrow); }

.section { padding: var(--section-py) 0; }
.section-alt { background: var(--offwhite); }

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 80px;
}

.section-kicker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--pink);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--t-normal);
  white-space: nowrap;
  cursor: pointer;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--pink);
  border: 2px solid var(--pink);
}

.btn-secondary:hover {
  background: var(--pink);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-white {
  background: var(--white);
  color: var(--black);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.btn-disabled {
  background: var(--lightgray);
  color: var(--gray-400);
  cursor: not-allowed;
}

.btn-disabled svg { width: 14px; height: 14px; }
.btn-disabled:hover { transform: none; }

.btn-lg { padding: 18px 36px; font-size: 16px; }
.btn-xl { padding: 22px 48px; font-size: 18px; }
.btn-full { width: 100%; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all var(--t-normal);
}

.nav.scrolled {
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--gray-200);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.nav-logo-mark {
  font-size: 24px;
  font-weight: 900;
  color: var(--pink);
  letter-spacing: -0.04em;
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
}

.nav-menu {
  display: flex;
  gap: 32px;
  flex: 1;
  justify-content: center;
}

.nav-menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: color var(--t-fast);
  position: relative;
}

.nav-menu a:hover { color: var(--pink); }

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0; right: 0;
  height: 2px;
  background: var(--pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-normal);
}

.nav-menu a.active::after { transform: scaleX(1); }

.nav-cta { flex-shrink: 0; }
.nav-cta svg { width: 16px; height: 16px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--black);
  transition: all var(--t-normal);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 160px 0 80px;
  overflow: hidden;
  background: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.hero-glow-1 {
  background: var(--pink);
  top: -100px;
  right: -100px;
}

.hero-glow-2 {
  background: var(--orange);
  bottom: -150px;
  left: -100px;
  opacity: 0.25;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 100, 140, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 100, 140, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: center;
  min-height: calc(100vh - 240px);
}

.hero-content { max-width: 620px; }

.hero-kicker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--pink);
  margin-bottom: 28px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
}

.hero-mega {
  display: block;
  color: var(--gray-600);
  animation: fadeInUp 0.7s ease both;
}

.hero-mega:nth-child(1) { animation-delay: 0.2s; }
.hero-mega:nth-child(2) { animation-delay: 0.3s; }
.hero-mega:nth-child(3) { animation-delay: 0.4s; }

.hero-mega-accent { color: var(--pink); }

.hero-subtitle {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  animation: fadeInUp 0.7s ease 0.55s both;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

.hero-subname {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 500;
  color: var(--gray-400);
}

.hero-tagline {
  font-size: 22px;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 16px;
  animation: fadeInUp 0.7s ease 0.65s both;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 40px;
  max-width: 560px;
  animation: fadeInUp 0.7s ease 0.75s both;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.85s both;
}

.hero-info {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--gray-200);
  animation: fadeInUp 0.7s ease 0.95s both;
}

.info-item {
  font-size: 14px;
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.info-item svg {
  width: 16px;
  height: 16px;
  color: var(--pink);
  stroke-width: 2;
}

/* Hero Visual (Workflow SVG) */
.hero-visual {
  position: relative;
  animation: fadeIn 1s ease 0.5s both;
}

.workflow-svg {
  width: 100%;
  height: auto;
  max-width: 440px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(240, 100, 140, 0.15));
}

.wf-node {
  animation: nodeAppear 0.5s ease both, nodePulse 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transform-origin: center;
  transform-box: fill-box;
}

.wf-node rect {
  transition: stroke var(--t-normal), fill var(--t-normal);
}

.wf-node-title,
.wf-node-sub,
.wf-node-dot {
  transition: opacity 0.25s ease, fill 0.4s ease;
}

.wf-node.changing .wf-node-title,
.wf-node.changing .wf-node-sub {
  opacity: 0;
}

.wf-node.flash rect {
  stroke: #F0648C;
  stroke-width: 2.5;
}

.wf-line {
  stroke-dashoffset: 100;
  animation: lineAppear 0.6s ease 0.8s both, lineBreath 3s ease-in-out infinite;
}

.flowing-dots { opacity: 0; animation: fadeIn 1s ease 1.2s forwards; }

/* Countdown Bar */
.countdown-bar {
  margin-top: 60px;
  padding: 24px 0;
  background: var(--pink-soft);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  animation: fadeInUp 0.7s ease 1.1s both;
}

.countdown-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.countdown-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 10px;
}

.countdown-label svg {
  width: 18px;
  height: 18px;
  color: var(--pink);
  stroke-width: 2;
}

.countdown-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
}

.countdown-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.countdown-item span {
  font-size: 36px;
  font-weight: 900;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 50px;
  text-align: center;
  display: inline-block;
}

.countdown-item label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
}

.countdown-sep {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-400);
  opacity: 0.5;
}

/* ---------- About (Feature Grid) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  transition: all var(--t-normal);
}

.feature-card:hover {
  border-color: var(--pink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--pink-soft);
  color: var(--pink);
  margin-bottom: 28px;
  transition: all var(--t-normal);
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.feature-card:hover .feature-icon {
  background: var(--pink);
  color: var(--white);
  transform: scale(1.05);
}

.feature-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--black);
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.feature-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
  width: 100%;
  justify-content: space-between;
  transition: color var(--t-fast);
}

.feature-more svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-normal);
  stroke-width: 2.5;
}

.feature-card:hover .feature-more {
  color: var(--pink-deep);
}

.feature-card:hover .feature-more svg {
  transform: translate(3px, -3px);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 80px);
  margin: 40px auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.open .modal-panel {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lightgray);
  color: var(--gray-600);
  transition: all var(--t-normal);
  z-index: 1;
}

.modal-close:hover {
  background: var(--black);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.modal-header {
  padding: 40px 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink-soft) 0%, #FFE5EE 100%);
  color: var(--pink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 0 40px 40px;
  overflow-y: auto;
  flex: 1;
}

.modal-body section {
  margin-bottom: 24px;
}

.modal-body section:last-child {
  margin-bottom: 0;
}

.modal-body h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body h4::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--pink);
  border-radius: 100px;
  display: inline-block;
}

.modal-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.modal-body ul {
  padding-left: 0;
}

.modal-body ul li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-600);
  padding: 4px 0 4px 18px;
  position: relative;
}

.modal-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 2px;
  background: var(--pink);
}

.modal-body ul li strong {
  color: var(--black);
  font-weight: 700;
}

.modal-highlight {
  background: linear-gradient(135deg, var(--pink-soft) 0%, #FFFAEC 100%);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--pink);
  margin-top: 32px !important;
}

.modal-highlight strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--pink-deep);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-highlight p {
  font-size: 14px;
  color: var(--gray-800);
  margin-bottom: 0;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .modal-panel {
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    border-radius: 20px;
  }

  .modal-header {
    padding: 32px 24px 20px;
  }

  .modal-body {
    padding: 0 24px 32px;
  }

  .modal-title {
    font-size: 22px;
  }
}


/* ===========================================
   Form Modals (Registration)
   =========================================== */

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.form-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.form-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.form-modal-panel {
  position: relative;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 60px);
  margin: 30px auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-modal.open .form-modal-panel {
  transform: scale(1) translateY(0);
}

/* Header */
.form-modal-header {
  padding: 32px 40px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.form-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.form-modal-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.form-modal-icon-teacher {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  box-shadow: 0 8px 20px rgba(240, 100, 140, 0.3);
}

.form-modal-icon-student {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.form-modal-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.form-modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.form-modal-sub {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* Form itself */
.reg-form {
  padding: 24px 40px 32px;
  overflow-y: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-bottom: 24px;
}

.form-section {
  animation: fadeInSlide 0.35s ease;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-full { grid-column: 1 / -1; }

.form-row label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: 0.01em;
}

.req {
  color: var(--pink);
  margin-left: 2px;
}

.hint {
  color: var(--gray-400);
  font-weight: 500;
  font-size: 11px;
  margin-left: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  transition: all var(--t-fast);
  outline: none;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--gray-400);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(240, 100, 140, 0.1);
}

.form-row input:invalid:not(:placeholder-shown),
.form-row select:invalid:not([value=""]) {
  /* Only style invalid when user has interacted */
}

.form-row textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-body);
}

.form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-row-highlight {
  padding: 16px;
  background: var(--pink-soft);
  border-radius: 12px;
  margin-bottom: 4px;
}

.form-row-highlight label {
  color: var(--pink-deep);
}

.form-row-highlight input {
  background: var(--white);
  border-color: var(--pink);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Radio toggle group */
.form-toggle-group {
  margin-bottom: 28px;
}

.form-toggle-label {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.form-toggle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-toggle-option {
  cursor: pointer;
  position: relative;
}

.form-toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.form-toggle-card {
  padding: 18px 16px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--t-fast);
}

.form-toggle-option:hover .form-toggle-card {
  border-color: var(--gray-400);
}

.form-toggle-option input[type="radio"]:checked + .form-toggle-card {
  border-color: var(--pink);
  background: var(--pink-soft);
  box-shadow: 0 4px 12px rgba(240, 100, 140, 0.15);
}

.form-toggle-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--lightgray);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.form-toggle-option input[type="radio"]:checked + .form-toggle-card .form-toggle-icon {
  background: var(--pink);
  color: var(--white);
}

.form-toggle-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.form-toggle-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 2px;
}

.form-toggle-text span {
  font-size: 12px;
  color: var(--gray-500);
}

/* Info card (for students without code) */
.form-info-card {
  display: flex;
  gap: 14px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #EBF5FF 0%, #DBEAFE 100%);
  border-left: 3px solid #3B82F6;
  border-radius: 12px;
  margin-bottom: 20px;
}

.form-info-icon {
  color: #2563EB;
  flex-shrink: 0;
  padding-top: 2px;
}

.form-info-icon svg {
  width: 20px;
  height: 20px;
}

.form-info-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #1E40AF;
  margin-bottom: 4px;
}

.form-info-card p {
  font-size: 13px;
  color: #1E40AF;
  line-height: 1.6;
}

/* Error message */
.form-error {
  padding: 14px 16px;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  border-radius: 10px;
  color: #991B1B;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Submit button */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

.btn-submit {
  width: 100%;
  max-width: 320px;
  position: relative;
}

.btn-submit[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-submit.loading .btn-label,
.btn-submit.loading .btn-arrow {
  opacity: 0;
}

.btn-submit.loading .btn-spinner {
  display: flex !important;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.btn-spinner {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  animation: spinnerRotate 1s linear infinite;
}

.spinner circle {
  stroke: var(--white);
  stroke-linecap: round;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  animation: spinnerDash 1.5s ease-in-out infinite;
}

@keyframes spinnerRotate {
  100% { transform: rotate(360deg); }
}

@keyframes spinnerDash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.form-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-privacy svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

/* Success state */
.form-success {
  text-align: center;
  padding: 56px 40px 48px;
}

.form-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.3);
  animation: successBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-success-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 2.5;
}

@keyframes successBounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.form-success-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.form-success-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 28px;
}

.form-success-desc strong {
  color: var(--pink-deep);
  font-weight: 700;
}

/* Mobile */
@media (max-width: 640px) {
  .form-modal-panel {
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    border-radius: 20px;
    width: calc(100% - 24px);
  }

  .form-modal-header {
    padding: 24px 24px 20px;
    gap: 14px;
  }

  .form-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .form-modal-icon svg {
    width: 24px;
    height: 24px;
  }

  .form-modal-title {
    font-size: 22px;
  }

  .reg-form {
    padding: 20px 24px 28px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-toggle-options {
    grid-template-columns: 1fr;
  }

  .form-success {
    padding: 40px 24px 32px;
  }

  .form-success-title {
    font-size: 24px;
  }
}

/* ---------- Funnel ---------- */
.funnel-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto 60px;
}

.funnel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: all var(--t-normal);
}

.funnel-dot.active {
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(240, 100, 140, 0.2);
}

.funnel-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.funnel-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  transition: all var(--t-normal);
  display: flex;
  flex-direction: column;
}

.funnel-active {
  border-color: var(--pink);
  background: linear-gradient(180deg, var(--pink-soft) 0%, var(--white) 100%);
  box-shadow: 0 16px 48px rgba(240, 100, 140, 0.15);
}

.funnel-semi-active {
  border-color: var(--pink);
  border-style: solid;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(240, 100, 140, 0.08);
}

.funnel-locked {
  opacity: 0.85;
}

/* Audience labels on top of each funnel card */
.funnel-audience {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.funnel-audience svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.funnel-audience-teacher {
  background: linear-gradient(135deg, rgba(240, 100, 140, 0.15) 0%, rgba(255, 107, 53, 0.15) 100%);
  color: var(--pink-deep);
}

.funnel-audience-student {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
}

.funnel-audience-final {
  background: linear-gradient(135deg, rgba(232, 169, 60, 0.15) 0%, rgba(255, 197, 71, 0.15) 100%);
  color: #B45309;
}

.funnel-step {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--pink);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.funnel-step-locked { color: var(--gray-400); }

.funnel-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--pink-soft);
  color: var(--pink);
  margin-bottom: 24px;
}

.funnel-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 2;
}

.funnel-icon-locked {
  background: var(--lightgray);
  color: var(--gray-400);
}

.funnel-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.funnel-sub {
  font-size: 15px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.funnel-list {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.funnel-list li {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.funnel-list li svg {
  width: 14px;
  height: 14px;
  color: var(--pink);
  flex-shrink: 0;
  stroke-width: 2.2;
}

.funnel-desc {
  margin-bottom: 28px;
  flex: 1;
}

.funnel-desc p {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 8px;
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}

.funnel-desc p::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pink);
}

/* ---------- Themes ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.theme-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 40px;
  transition: all var(--t-normal);
}

.theme-card:hover {
  border-color: var(--pink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.theme-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.theme-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--pink-soft);
  color: var(--pink);
  transition: all var(--t-normal);
}

.theme-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.theme-card:hover .theme-icon {
  background: var(--pink);
  color: var(--white);
}

.theme-difficulty {
  padding: 6px 14px;
  background: var(--pink-soft);
  color: var(--pink);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.theme-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 6px;
}

.theme-sub {
  font-size: 14px;
  color: var(--pink);
  font-weight: 600;
  margin-bottom: 16px;
}

.theme-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 24px;
}

.theme-learn {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.theme-learn strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.theme-learn ul li {
  font-size: 13px;
  color: var(--gray-700, #374151);
  padding: 4px 0;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-learn ul li svg {
  width: 14px;
  height: 14px;
  color: var(--pink);
  stroke-width: 2.5;
  flex-shrink: 0;
}

.theme-examples {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
  padding-top: 20px;
  border-top: 1px dashed var(--gray-200);
}

/* ---------- Community ---------- */
.community-main {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 80px;
}

.community-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--lightgray);
  box-shadow: var(--shadow-md);
}

.community-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 4px;
}

.community-name-zh {
  font-size: 18px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.community-role {
  font-size: 15px;
  color: var(--pink);
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.community-cred { margin-bottom: 32px; }

.community-cred li {
  font-size: 14px;
  color: var(--gray-600);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.community-cred li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 2px;
  background: var(--pink);
}

.community-quote {
  background: var(--pink-soft);
  border-left: 4px solid var(--pink);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-800);
  font-style: italic;
}

.community-quote cite {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-500);
  font-style: normal;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.stat-block { text-align: center; }

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--pink);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}

.stat-caption {
  font-size: 13px;
  color: var(--gray-500);
}

/* ---------- Prizes ---------- */
.section-prizes {
  background: linear-gradient(180deg, var(--white) 0%, #FFF8F5 100%);
}

.prizes-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 24px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto 60px;
}

.prize-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  transition: all var(--t-normal);
  border: 2px solid;
}

.prize-card:hover {
  transform: translateY(-6px);
}

.prize-gold {
  border-color: var(--amber);
  background: linear-gradient(180deg, #FFFAEC 0%, var(--white) 100%);
  box-shadow: 0 20px 60px rgba(232, 169, 60, 0.25);
  padding: 48px 36px;
}

.prize-silver {
  border-color: var(--silver-light);
  padding: 36px 28px;
}

.prize-bronze {
  border-color: #E9A876;
  padding: 36px 28px;
}

.prize-ribbon {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: var(--white);
  padding: 6px 20px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.prize-rank {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: transform var(--t-normal);
}

.prize-card:hover .prize-rank {
  transform: scale(1.05);
}

.prize-rank svg {
  width: 40px;
  height: 40px;
  color: var(--white);
  stroke-width: 2;
}

.prize-gold .prize-rank {
  width: 104px;
  height: 104px;
  background: linear-gradient(135deg, var(--amber-light) 0%, var(--amber) 100%);
  box-shadow: 0 12px 32px rgba(232, 169, 60, 0.4);
}

.prize-gold .prize-rank svg {
  width: 48px;
  height: 48px;
}

.prize-silver .prize-rank {
  background: linear-gradient(135deg, var(--silver-light) 0%, var(--silver) 100%);
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.35);
}

.prize-bronze .prize-rank {
  background: linear-gradient(135deg, #E9A876 0%, var(--bronze-light) 100%);
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.3);
}

.prize-level {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.prize-item {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}

.prize-gold .prize-item {
  font-size: 26px;
  color: var(--amber);
}

.prize-desc {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 24px;
}

.prize-extras {
  padding-top: 20px;
  border-top: 1px dashed var(--gray-200);
}

.prize-extras li {
  font-size: 13px;
  color: var(--gray-600);
  padding: 4px 0;
  position: relative;
  padding-left: 18px;
}

.prize-extras li::before {
  content: '＋';
  position: absolute;
  left: 0;
  color: var(--pink);
  font-weight: 700;
}

.prizes-all {
  max-width: 820px;
  margin: 0 auto 40px;
  padding: 32px;
  background: var(--pink-soft);
  border-radius: var(--radius-lg);
  text-align: center;
}

.prizes-all-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.15em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.prizes-all-items {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.prizes-all-items span {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prizes-all-items svg {
  width: 16px;
  height: 16px;
  color: var(--pink);
  stroke-width: 2;
}

.prizes-more {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
}

/* ---------- Judges ---------- */
.judges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.judge-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--t-normal);
}

.judge-card:hover {
  border-color: var(--pink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.judge-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
  background: var(--lightgray);
}

.judge-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.judge-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lightgray);
  color: var(--gray-400);
}

.judge-placeholder svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}

.judge-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.judge-name span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: 2px;
}

.judge-role {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 16px;
  min-height: 40px;
}

.judge-field {
  font-size: 12px;
  color: var(--pink);
  font-weight: 600;
  padding: 8px 14px;
  background: var(--pink-soft);
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 20px;
}

.judge-quote {
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-600);
  font-style: italic;
  padding-top: 16px;
  border-top: 1px dashed var(--gray-200);
}

.judge-placeholder-card {
  background: var(--offwhite);
  border-style: dashed;
}

.judge-placeholder-card .judge-field {
  background: transparent;
  color: var(--gray-400);
}

/* ---------- Evaluation Criteria ---------- */
.criteria-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.criteria-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-normal);
}

.criteria-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.criteria-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.criteria-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.01em;
}

.criteria-weight {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  color: var(--pink);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.criteria-weight span {
  font-size: 18px;
  color: var(--gray-400);
  font-weight: 500;
  margin-left: 2px;
}

.criteria-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
}

.criteria-fill {
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--pink) 0%, var(--orange) 100%);
  border-radius: 100px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s ease;
}

.criteria-item.in-view .criteria-fill { transform: scaleX(1); }

.criteria-desc {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.criteria-note {
  text-align: center;
  margin-top: 48px;
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
}

/* ---------- Sponsors ---------- */
.sponsor-tier {
  margin-bottom: 60px;
  text-align: center;
}

.sponsor-tier:last-child { margin-bottom: 0; }

.sponsor-tier-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.2em;
  margin-bottom: 32px;
}

.sponsor-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 64px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-normal);
  filter: grayscale(40%);
  opacity: 0.85;
}

.sponsor-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: translateY(-2px);
}

.sponsor-logo img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}

.sponsor-logo-lg img {
  max-height: 80px;
  max-width: 220px;
}

.sponsor-logo-md img {
  max-height: 60px;
  max-width: 160px;
}

.sponsor-note {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 8px;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--t-normal);
}

.faq-item.open {
  border-color: var(--pink);
  background: var(--pink-soft);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
  text-align: left;
  transition: color var(--t-fast);
}

.faq-item.open .faq-question { color: var(--pink-deep); }

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  transition: transform var(--t-normal), color var(--t-normal);
  flex-shrink: 0;
  margin-left: 16px;
  stroke-width: 2;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--pink);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-normal);
}

.faq-item.open .faq-answer { max-height: 300px; }

.faq-answer p {
  padding: 0 24px 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-600);
}

/* ---------- Final CTA ---------- */
.final-cta {
  padding: 120px 0;
  background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
}

.final-cta > .container {
  position: relative;
  z-index: 1;
}

.final-cta-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.final-cta-sub {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 40px;
  line-height: 1.7;
}

.final-cta-note {
  margin-top: 32px;
  font-size: 13px;
  opacity: 0.8;
}

.final-cta-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 780px;
  margin: 0 auto;
}

.final-cta-card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  color: var(--black);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  text-align: left;
  transition: all var(--t-normal);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.final-cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(240, 100, 140, 0.08) 0%, rgba(255, 107, 53, 0.08) 100%);
  opacity: 0;
  transition: opacity var(--t-normal);
}

.final-cta-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.final-cta-card:hover::before { opacity: 1; }

.final-cta-card > * {
  position: relative;
  z-index: 1;
}

.final-cta-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-bottom: 12px;
}

.final-cta-teacher .final-cta-card-icon {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
}

.final-cta-student .final-cta-card-icon {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.final-cta-card-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.final-cta-card-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gray-500);
  text-transform: uppercase;
}

.final-cta-card-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.final-cta-card-desc {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.final-cta-card-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lightgray);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all var(--t-normal);
}

.final-cta-card:hover .final-cta-card-arrow {
  background: var(--orange);
  color: var(--white);
  transform: translate(4px, -4px);
}

.final-cta-card-arrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

@media (max-width: 768px) {
  .final-cta-buttons {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Footer ---------- */
.footer {
  padding: 80px 0 32px;
  background: var(--black);
  color: var(--gray-400);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid #1F2937;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

.footer-logo-mark {
  font-size: 24px;
  font-weight: 900;
  color: var(--pink);
}

.footer-logo-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-200);
}

.footer-tagline {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 20px;
}

.footer-meta {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.footer-links li {
  font-size: 13px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links li svg {
  width: 14px;
  height: 14px;
  color: var(--pink);
  flex-shrink: 0;
}

.footer-links a {
  color: var(--gray-400);
  transition: color var(--t-fast);
}

.footer-links a:hover { color: var(--pink); }

.footer-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-form input {
  flex: 1;
  padding: 12px 16px;
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
}

.footer-form input:focus {
  outline: none;
  border-color: var(--pink);
}

.footer-form button {
  padding: 12px 20px;
  font-size: 14px;
}

.footer-bottom {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links-inline {
  display: flex;
  gap: 20px;
}

.footer-links-inline a {
  color: var(--gray-500);
  transition: color var(--t-fast);
}

.footer-links-inline a:hover { color: var(--gray-200); }

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nodeAppear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes lineAppear {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

@keyframes dotFlow {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes nodePulse {
  0%, 100% { filter: url(#wfShadow); }
  50% { filter: url(#wfShadow) drop-shadow(0 0 12px rgba(240, 100, 140, 0.25)); }
}

@keyframes lineBreath {
  0%, 100% { stroke-opacity: 0.5; }
  50% { stroke-opacity: 0.8; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid,
  .theme-grid { grid-template-columns: repeat(2, 1fr); }

  .judges-grid { grid-template-columns: repeat(2, 1fr); }

  .community-main {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .community-photo {
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
  }

  .community-cred li { padding-left: 0; }
  .community-cred li::before { display: none; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .section { padding: var(--section-py-mobile) 0; }
  .section-header { margin-bottom: 48px; }
  .section-title { font-size: 32px; }
  .section-subtitle { font-size: 16px; }

  /* Nav */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    padding: 20px;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--gray-200);
  }

  .nav-menu.open { display: flex; }

  .nav-menu li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
  }

  .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  /* Hero */
  .hero { padding: 120px 0 40px; }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
  }

  .hero-visual {
    order: -1;
    max-width: 300px;
    margin: 0 auto;
  }

  .hero-title { font-size: 52px; }

  .hero-subtitle {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn { width: 100%; }

  .hero-info { flex-direction: column; gap: 12px; }

  .countdown-container {
    flex-direction: column;
    text-align: center;
  }

  .countdown-item span {
    font-size: 28px;
    min-width: 40px;
  }

  /* Grids to single column */
  .feature-grid,
  .theme-grid,
  .funnel-grid,
  .judges-grid { grid-template-columns: 1fr; }

  .prizes-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .prize-gold { order: -1; }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .prizes-all-items {
    flex-direction: column;
    gap: 10px;
  }

  .sponsor-logos { gap: 32px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .final-cta { padding: 80px 0; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 42px; }
  .criteria-weight { font-size: 32px; }
  .countdown-display { gap: 4px; }
  .countdown-sep { font-size: 20px; }
  .countdown-item span { font-size: 22px; min-width: 32px; }
  .countdown-item label { font-size: 11px; }
}
