/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  /* colour: warm paper base, olive/cadet green, mustard patch accent, rust */
  --cream:      #FBF8F1;
  --paper:      #F1ECDC;
  --paper-soft: #E9E2CC;
  --ink:        #23281C;
  --ink-soft:   #5B5A46;
  --olive:      #4A5D3A;
  --olive-deep: #2F3D24;
  --olive-mist: #DCE3D1;
  --mustard:    #E3A857;
  --mustard-deep: #C88A34;
  --rust:       #C1592B;
  --stitch:     #B7AD8C;
  --card-bg:    #FFFFFF;
  --shadow:     0 10px 30px rgba(47, 61, 36, 0.12);
  --shadow-sm:  0 4px 14px rgba(47, 61, 36, 0.10);

  --font-display: 'Fredoka', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-stencil: 'Staatliches', sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --max-width: 1120px;
  --nav-height: 76px;
}

[data-theme="dark"] {
  --cream:      #1B1E15;
  --paper:      #22261A;
  --paper-soft: #2A2F1F;
  --ink:        #F1ECDC;
  --ink-soft:   #C3BE9F;
  --olive:      #8FAE72;
  --olive-deep: #A9C98A;
  --olive-mist: #2C331F;
  --mustard:    #E9B565;
  --mustard-deep: #F0C57E;
  --rust:       #E38357;
  --stitch:     #454A34;
  --card-bg:    #262B1C;
  --shadow:     0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm:  0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

::selection { background: var(--mustard); color: var(--olive-deep); }

/* ==========================================================================
   SHARED LAYOUT HELPERS
   ========================================================================== */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.section { padding: 6.5rem 0; position: relative; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-stencil);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .85rem;
  color: var(--rust);
  margin-bottom: .6rem;
}

.eyebrow-icon {
  width: 18px;
  height: 18px;
  filter: none;
}
[data-theme="dark"] .eyebrow-icon { filter: invert(1) brightness(1.6) sepia(1) saturate(3) hue-rotate(320deg); }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  color: var(--olive-deep);
  margin-bottom: 1.1rem;
}
[data-theme="dark"] .section-title { color: var(--olive-deep); }

.section-lead {
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 2.75rem;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   PATCH / BADGE SIGNATURE ELEMENT
   ========================================================================== */
.patch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2.5px dashed var(--stitch);
  background: var(--paper-soft);
  text-align: center;
  padding: .4rem;
  transition: transform .3s ease, border-color .3s ease;
}
.patch:hover { transform: rotate(-4deg) scale(1.05); border-color: var(--mustard-deep); }

.patch-icon {
  font-size: 1.35rem;
  color: var(--mustard-deep);
  line-height: 1;
}
.patch-label {
  font-family: var(--font-stencil);
  font-size: .62rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--olive-deep);
  line-height: 1.15;
}

.patch--small {
  width: 44px;
  height: 44px;
  border-width: 2px;
  background: var(--olive);
  border-color: var(--mustard);
}
.patch-initials {
  font-family: var(--font-stencil);
  color: var(--cream);
  font-size: 1.1rem;
  letter-spacing: .03em;
}

.patch--add {
  border-color: var(--olive);
  cursor: default;
  opacity: .7;
}
.patch--add .patch-icon { color: var(--olive); }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stitch);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo { flex-shrink: 0; display: flex; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0 auto;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .98rem;
  color: var(--ink);
  position: relative;
  padding: .3rem 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--mustard-deep);
  transition: width .25s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.is-active { color: var(--rust); }
.nav-link.is-active::after { width: 100%; }

.nav-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--stitch);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: transform .3s ease, border-color .3s ease;
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--mustard-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
}
.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
  margin: 0 auto;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO / HOME
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .5;
}
.hero-shape--1 {
  width: 340px; height: 340px;
  background: var(--olive-mist);
  top: -80px; left: -100px;
}
.hero-shape--2 {
  width: 220px; height: 220px;
  border: 3px dashed var(--stitch);
  background: transparent;
  bottom: 40px; right: -60px;
  opacity: .6;
}
.hero-shape--3 {
  width: 120px; height: 120px;
  background: var(--mustard);
  opacity: .18;
  bottom: -40px; left: 12%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo-frame {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 3px dashed var(--stitch);
  padding: 10px;
  margin-bottom: 1.75rem;
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}
.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cream);
}

.eyebrow {
  font-family: var(--font-stencil);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .85rem;
  color: var(--rust);
  margin-bottom: .75rem;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  color: var(--olive-deep);
  line-height: 1.05;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
}

.hero-username {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--mustard-deep);
  letter-spacing: .01em;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 480px;
  margin-bottom: 2.5rem;
}

.hero-scroll-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  color: var(--olive-deep);
  border: 2px solid var(--olive);
  border-radius: 999px;
  padding: .7rem 1.4rem;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.hero-scroll-cta:hover {
  background: var(--olive);
  color: var(--cream);
  transform: translateY(-2px);
}
.hero-scroll-arrow { display: inline-block; animation: bob 1.8s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* load-in entrance animation */
.load-in {
  opacity: 0;
  transform: translateY(22px);
  animation: loadIn .8s cubic-bezier(.2,.7,.3,1) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes loadIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 180px 1.3fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-photo-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px dashed var(--stitch);
  padding: 8px;
  background: var(--paper-soft);
  box-shadow: var(--shadow-sm);
}
.about-photo-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cream);
}

.about-text p { color: var(--ink-soft); margin-bottom: 1.1rem; font-size: 1.05rem; }
.about-text strong { color: var(--olive-deep); }

.about-facts {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border: 1px solid var(--stitch);
}
.about-facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--stitch);
}
.about-facts li:last-child { border-bottom: none; padding-bottom: 0; }

.about-fact-label {
  font-family: var(--font-stencil);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rust);
}
.about-fact-value {
  font-weight: 600;
  color: var(--olive-deep);
  text-align: right;
}

/* ==========================================================================
   CADETS
   ========================================================================== */
.cadets {
  background: var(--olive-deep);
  color: var(--cream);
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 14px);
}
.cadets .section-title { color: var(--cream); }
.cadets .section-lead { color: color-mix(in srgb, var(--cream) 80%, transparent); }
.cadets .section-eyebrow { color: var(--mustard); }
[data-theme="dark"] .cadets .eyebrow-icon { filter: none; }
.cadets .eyebrow-icon { filter: brightness(0) invert(1); }

.cadet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.dogtag {
  background: var(--mustard);
  color: var(--olive-deep);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.dogtag::before {
  content: "";
  position: absolute;
  top: -8px; left: 26px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 3px solid var(--olive-deep);
  background: var(--mustard);
}
.dogtag-title {
  font-family: var(--font-stencil);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .8rem;
  margin-bottom: .4rem;
}
.dogtag p { font-weight: 600; font-size: 1.05rem; }
.dogtag-sub { font-weight: 500 !important; font-size: .95rem !important; opacity: .8; }

.cadet-subhead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--mustard);
  margin: 1.75rem 0 .9rem;
}
.cadet-info .cadet-subhead:first-of-type { margin-top: 0; }

.cadet-list li {
  padding: .6rem 0 .6rem 1.5rem;
  border-bottom: 1px dashed rgba(255,255,255,.18);
  position: relative;
  color: color-mix(in srgb, var(--cream) 88%, transparent);
}
.cadet-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--mustard);
}
.cadet-list li:last-child { border-bottom: none; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.cadets .patch {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.35);
}
.cadets .patch-label { color: var(--cream); }
.cadets .patch-icon { color: var(--mustard); }
.cadets .patch--add { border-color: rgba(255,255,255,.35); }
.cadets .patch--add .patch-icon { color: rgba(255,255,255,.6); }

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.photo-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .3s ease;
}
.photo-card:hover { transform: translateY(-4px); }
.photo-card img { aspect-ratio: 1/1; object-fit: cover; }
.photo-card figcaption {
  padding: .6rem .8rem;
  font-size: .82rem;
  font-family: var(--font-stencil);
  letter-spacing: .03em;
  color: var(--mustard);
}

/* ==========================================================================
   GAMING
   ========================================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--stitch);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease;
  position: relative;
  overflow: hidden;
}
.game-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--olive), var(--mustard));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.game-card:hover {
  transform: translateY(-8px) rotate(-0.5deg);
  box-shadow: var(--shadow);
  border-color: var(--mustard-deep);
}
.game-card:hover::after { transform: scaleX(1); }

.game-card-art {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: transform .35s ease;
}
.game-card:hover .game-card-art { transform: scale(1.08) rotate(-3deg); }

.game-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--olive-deep);
  margin-bottom: .2rem;
}
.game-card-genre {
  font-family: var(--font-stencil);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--rust);
  margin-bottom: .75rem;
}
.game-card-blurb { color: var(--ink-soft); font-size: .92rem; }

.game-card--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 2px dashed var(--stitch);
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
  min-height: 180px;
}
.game-card--add:hover { transform: none; border-color: var(--mustard-deep); color: var(--mustard-deep); }
.game-card-add-icon { font-size: 1.8rem; font-family: var(--font-display); }

/* ==========================================================================
   LINKS
   ========================================================================== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--stitch);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.link-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-color: var(--mustard-deep);
  background: var(--olive-mist);
}

.link-icon {
  width: 26px;
  height: 26px;
  color: var(--olive-deep);
  flex-shrink: 0;
}
[data-theme="dark"] .link-icon { color: var(--olive-deep); }

.link-label {
  font-family: var(--font-display);
  font-weight: 600;
  display: block;
  color: var(--ink);
}
.link-handle {
  display: block;
  font-size: .82rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-family: var(--font-stencil);
  letter-spacing: .05em;
  font-size: .85rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-frame { margin: 0 auto; }
  .cadet-grid { grid-template-columns: 1fr; }
  .cadet-photos { order: -1; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--stitch);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 1.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
  }
  .nav-links.is-open {
    max-height: 320px;
    padding: 1rem 1.75rem 1.5rem;
  }
  .nav-links li { width: 100%; }
  .nav-link { display: block; padding: .8rem 0; width: 100%; }
  .nav-toggle { display: flex; }

  .section { padding: 4.5rem 0; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-photo-frame { width: 130px; height: 130px; }
  .about-facts li { flex-direction: column; gap: .2rem; }
  .about-fact-value { text-align: left; }
  .dogtag { padding: 1.2rem 1.4rem; }
}