:root {
  --red: #e11d2e;
  --red-deep: #9b1020;
  --blue: #1a3a6b;
  --blue-bright: #2f6fb3;
  --ink: #12080c;
  --paper: #f4f6f8;
  --mist: rgba(244, 246, 248, 0.86);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 18px 50px rgba(9, 4, 8, 0.35);
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --topbar-h: 3.5rem;
  --todo-w: min(22rem, calc(100vw - 1.5rem));
  --radius: 0;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--paper);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(225, 29, 46, 0.35), transparent 60%),
    radial-gradient(900px 500px at 0% 20%, rgba(26, 58, 107, 0.55), transparent 55%),
    linear-gradient(165deg, #1a1020 0%, var(--blue) 38%, #0d1524 72%, #1a0a10 100%);
  background-attachment: fixed;
  cursor: crosshair;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--red);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

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

#web-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0.65rem clamp(0.9rem, 3vw, 1.75rem);
  background: rgba(10, 8, 14, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.topbar__brand span,
.hero__brand span {
  color: var(--red);
}

.topbar__nav {
  display: none;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 600;
}

.topbar__nav a {
  text-decoration: none;
  opacity: 0.85;
}

.topbar__nav a:hover,
.topbar__nav a:focus-visible {
  opacity: 1;
  color: #ffd0d5;
}

.todo-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(225, 29, 46, 0.55);
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: white;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.todo-toggle__count {
  min-width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
}

.todo-toggle.is-pulse {
  animation: pulse-mission 0.6s var(--ease);
}

@keyframes pulse-mission {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
}

.todo-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 0.65rem);
  right: 0.75rem;
  width: var(--todo-w);
  max-height: calc(100dvh - var(--topbar-h) - 1.5rem);
  display: flex;
  flex-direction: column;
  background: rgba(12, 10, 16, 0.94);
  border: 1px solid rgba(225, 29, 46, 0.45);
  box-shadow: var(--shadow);
  z-index: 45;
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.todo-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.todo-panel__head {
  position: relative;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.todo-panel__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.03em;
}

.todo-panel__head p {
  margin: 0.25rem 0 0;
  color: rgba(244, 246, 248, 0.7);
  font-size: 0.88rem;
}

.todo-panel__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem;
  overflow: auto;
  flex: 1;
}

.todo-list__empty {
  padding: 0.85rem;
  color: rgba(244, 246, 248, 0.65);
  font-size: 0.92rem;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  animation: rise-in 0.45s var(--ease) both;
}

.todo-item input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--red);
  cursor: pointer;
}

.todo-item label {
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
}

.todo-item.is-done label {
  opacity: 0.55;
  text-decoration: line-through;
}

.todo-item__meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--blue-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.todo-panel__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(244, 246, 248, 0.7);
}

.btn-reset {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.todo-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 44;
}

@media (min-width: 720px) {
  .todo-backdrop {
    display: none;
  }
}

.hero {
  position: relative;
  min-height: calc(100dvh - var(--topbar-h));
  display: grid;
  align-items: end;
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(225, 29, 46, 0.42), transparent 45%),
    linear-gradient(0deg, rgba(8, 6, 12, 0.88) 8%, rgba(8, 6, 12, 0.25) 55%, rgba(8, 6, 12, 0.35) 100%),
    repeating-linear-gradient(
      -18deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.03) 14px 15px
    );
}

.hero__web {
  position: absolute;
  inset: -10% -5% auto auto;
  width: min(70vw, 640px);
  aspect-ratio: 1;
  opacity: 0.28;
  background:
    radial-gradient(circle at center, transparent 0 18%, rgba(255, 255, 255, 0.08) 18% 19%, transparent 19% 34%, rgba(255, 255, 255, 0.08) 34% 35%, transparent 35% 50%, rgba(255, 255, 255, 0.07) 50% 51%, transparent 51% 66%, rgba(255, 255, 255, 0.06) 66% 67%, transparent 67%),
    conic-gradient(from 0deg, transparent 0 8deg, rgba(255, 255, 255, 0.12) 8deg 9deg, transparent 9deg);
  mask-image: radial-gradient(circle at center, black 20%, transparent 72%);
  animation: web-spin 48s linear infinite;
}

.hero__copy {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  animation: rise-in 0.8s var(--ease) both;
}

.hero__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb7bf;
}

.hero__brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 12vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .hero__brand {
    white-space: normal;
    font-size: clamp(3.2rem, 18vw, 4.4rem);
  }
}

.hero__lede {
  margin: 1rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  line-height: 1.45;
  color: var(--mist);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero__hint {
  margin: 1.1rem 0 0;
  font-size: 0.9rem;
  color: rgba(244, 246, 248, 0.65);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: white;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

.section-inner {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.section-inner h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

.section-lede {
  margin: 0.75rem 0 0;
  max-width: 38rem;
  font-size: 1.08rem;
  line-height: 1.5;
  color: rgba(244, 246, 248, 0.78);
}

.rules {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(225, 29, 46, 0.12));
  border-block: 1px solid var(--line);
}

.rules__grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.rules__grid li {
  padding: 1.15rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 0.35rem;
}

.rules__grid strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  color: #ffc2c8;
}

.rules__grid span {
  color: rgba(244, 246, 248, 0.8);
  line-height: 1.45;
}

.timeline__list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  position: relative;
}

.timeline__list::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg, var(--red), var(--blue-bright));
}

.timeline__item {
  position: relative;
  padding: 0 0 2rem 2rem;
  opacity: 0.42;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

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

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.2);
}

.timeline__year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #ff9aa5;
  letter-spacing: 0.06em;
}

.timeline__item h3 {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: 0.02em;
}

.timeline__detail,
.timeline__lesson {
  margin: 0.55rem 0 0;
  line-height: 1.5;
  color: rgba(244, 246, 248, 0.82);
}

.timeline__lesson {
  padding-left: 0.85rem;
  border-left: 2px solid var(--blue-bright);
  color: #d7e7ff;
}

.timeline__lesson strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8eb8ff;
}

.week {
  background:
    linear-gradient(180deg, rgba(26, 58, 107, 0.35), rgba(225, 29, 46, 0.18)),
    rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--line);
}

.week__days {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
  counter-reset: day;
}

.week__days li {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1.45;
}

.week__days strong {
  display: inline-block;
  min-width: 5.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: #ffb7bf;
}

.week__close {
  margin: 2rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  max-width: 30rem;
}

.footer {
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem;
  border-top: 1px solid var(--line);
  color: rgba(244, 246, 248, 0.55);
  font-size: 0.88rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes web-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .topbar__nav {
    display: flex;
  }

  .todo-toggle {
    margin-left: 0;
  }

  .rules__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
  }

  .timeline__list::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: min(28rem, 46%);
    padding: 0 0 2.75rem;
  }

  .timeline__item:nth-child(odd) {
    margin-right: auto;
    padding-right: 2.5rem;
    text-align: right;
  }

  .timeline__item:nth-child(odd)::before {
    left: auto;
    right: -0.35rem;
  }

  .timeline__item:nth-child(odd) .timeline__lesson {
    border-left: 0;
    border-right: 2px solid var(--blue-bright);
    padding-left: 0;
    padding-right: 0.85rem;
  }

  .timeline__item:nth-child(even) {
    margin-left: auto;
    padding-left: 2.5rem;
  }

  .timeline__item:nth-child(even)::before {
    left: -0.35rem;
  }
}

@media (min-width: 960px) {
  .todo-panel {
    right: 1.25rem;
  }
}

@media (max-width: 719px) {
  .todo-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: min(72dvh, 34rem);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: translateY(110%);
  }

  .todo-panel.is-open {
    transform: translateY(0);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__web {
    animation: none;
  }
}
