:root {
  color-scheme: light;
  --rose: #c85567;
  --coral: #ef765f;
  --gold: #d6a84f;
  --teal: #216f73;
  --ink: #241d27;
  --plum: #563045;
  --cream: #fff5e8;
  --paper: #fffaf4;
  --line: rgba(36, 29, 39, 0.16);
  --shadow: 0 22px 60px rgba(36, 29, 39, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body.is-gate-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  position: relative;
  min-height: 92vh;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 6rem clamp(1.2rem, 4vw, 4rem) 5rem;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% center;
}

.hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(36, 29, 39, 0.72) 0%, rgba(36, 29, 39, 0.34) 48%, rgba(36, 29, 39, 0.08) 100%),
    linear-gradient(180deg, rgba(36, 29, 39, 0.26) 0%, rgba(36, 29, 39, 0.02) 44%, rgba(255, 250, 244, 0.16) 100%);
}

.topbar {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  top: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  color: white;
}

.topbar button,
.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(36, 29, 39, 0.28);
  color: white;
  min-height: 42px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  cursor: pointer;
}

.hero__content {
  width: min(720px, 100%);
  color: white;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.42);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.7rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffe0a5;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  overflow-wrap: normal;
  word-break: normal;
}

p {
  line-height: 1.7;
  overflow-wrap: break-word;
}

.hero__copy {
  width: min(620px, 100%);
  margin: 1.25rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero__actions,
.center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  padding: 0.85rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.button--primary {
  background: var(--coral);
  color: white;
  box-shadow: 0 14px 34px rgba(239, 118, 95, 0.35);
}

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  background: rgba(255, 255, 255, 0.13);
}

.button--dark {
  background: var(--ink);
  color: white;
}

.button--light {
  background: white;
  color: var(--ink);
}

.band,
.finale {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem);
}

.band--light {
  background: #fffaf4;
}

.band--rose {
  background: #ffe7df;
}

.band--ink {
  background: var(--ink);
  color: white;
}

.band--ink .section-kicker {
  color: #ffd98b;
}

.band--cream {
  background: var(--cream);
}

.section-heading {
  width: min(860px, 100%);
  margin-bottom: 2rem;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.mission-card,
.compliment-card,
.letter,
.diploma {
  border-radius: 8px;
}

.mission-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(36, 29, 39, 0.08);
}

.mission-card__code {
  color: var(--coral);
  font-weight: 900;
  font-size: 0.85rem;
}

.deck-layout,
.letter-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(1.2rem, 5vw, 4rem);
  align-items: center;
}

.deck-layout > div,
.letter-layout > div {
  max-width: 620px;
}

.compliment-card {
  min-height: 360px;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(33, 111, 115, 0.15), rgba(216, 168, 79, 0.24)),
    white;
  border: 1px solid rgba(36, 29, 39, 0.12);
  box-shadow: var(--shadow);
}

.compliment-card__label {
  margin: 0 0 0.8rem;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

#complimentTitle {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
  font-weight: 900;
}

#complimentDeck {
  margin-top: 1.35rem;
}

.compliment-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.35rem 0 0;
}

.compliment-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(36, 29, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.compliment-list dt {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.compliment-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.18;
}

.letter {
  padding: clamp(1.5rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}

.letter p {
  margin: 0 0 1.2rem;
}

.letter p:last-child {
  margin-bottom: 0;
}

.letter-song {
  display: grid;
  gap: 0.45rem;
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.letter-song span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.letter-song a {
  color: white;
  font-weight: 900;
  text-decoration-color: rgba(255, 255, 255, 0.46);
  text-underline-offset: 0.25rem;
}

.letter-song a:hover {
  text-decoration-color: var(--gold);
}

.letter[hidden],
.finale__message[hidden] {
  display: none;
}

[data-stage][hidden] {
  display: none;
}

.diploma {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 4rem);
  text-align: center;
  background:
    linear-gradient(90deg, rgba(216, 168, 79, 0.2), transparent 20%, transparent 80%, rgba(216, 168, 79, 0.2)),
    white;
  border: 2px solid rgba(214, 168, 79, 0.55);
  box-shadow: var(--shadow);
}

.diploma__top {
  margin-top: 0;
  color: var(--plum);
  font-weight: 900;
  text-transform: uppercase;
}

.diploma h3 {
  margin: 0.3rem 0 1rem;
  color: var(--rose);
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
}

.diploma__seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 0;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(200, 85, 103, 0.36);
  border-radius: 8px;
  color: var(--teal);
  font-weight: 900;
}

.center-actions {
  justify-content: center;
}

.finale {
  text-align: center;
  background: var(--plum);
  color: white;
}

.finale .section-kicker {
  color: #ffd98b;
}

.finale p {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.finale__message {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: var(--color);
  transform: rotate(var(--angle));
  animation: fall var(--duration) linear forwards;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(36, 29, 39, 0.72);
  backdrop-filter: blur(12px);
}

.gate[hidden] {
  display: none;
}

.gate__card {
  width: min(520px, 100%);
  padding: clamp(1.5rem, 5vw, 2.6rem);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 231, 223, 0.85), rgba(255, 250, 244, 0.96)),
    var(--paper);
  box-shadow: var(--shadow);
}

.gate__card h2 {
  font-size: clamp(2rem, 8vw, 3.4rem);
}

.gate__card p {
  margin-bottom: 0;
}

.gate__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.gate__message {
  margin: 1rem 0 0;
  padding: 1rem;
  color: var(--plum);
  font-weight: 900;
  border: 1px solid rgba(200, 85, 103, 0.28);
  border-radius: 8px;
  background: white;
}

@keyframes fall {
  to {
    transform: translate3d(var(--drift), 106vh, 0) rotate(680deg);
    opacity: 0.85;
  }
}

@media (max-width: 980px) {
  .mission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-layout,
  .letter-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: 88vh;
    padding-top: 7rem;
  }

  .topbar {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 3.2rem);
    line-height: 0.96;
  }

  .hero__image {
    object-position: 70% center;
  }

  .gate__actions,
  .compliment-list div,
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .mission-card {
    min-height: auto;
  }
}

@media print {
  body > *:not(main),
  main > *:not(#diploma),
  #diploma .section-heading,
  #diploma .center-actions {
    display: none !important;
  }

  #diploma {
    padding: 0;
    background: white;
  }

  .diploma {
    box-shadow: none;
    min-height: 92vh;
    display: grid;
    align-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
