/* ==========================================================================
   Sagun B. Pradhan — portfolio
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --ink:        #202825;
  --ink-deep:   #151c1a;
  --ink-soft:   #2a332f;
  --ink-line:   rgba(238, 222, 193, 0.14);

  --cream:      #eedec1;
  --cream-dim:  rgba(238, 222, 193, 0.66);
  --cream-face: #ecdfbf;

  --gold:       #a8945c;
  --gold-lit:   #c7b074;

  --teal:       #217793;
  --teal-deep:  #1a5f76;

  --purple:     #a7839c;
  --red:        #d7212c;
  --orange:     #db6635;
  --yellow:     #f7d30e;

  --on-face:        #1c231f;
  --on-face-dim:    rgba(28, 35, 31, 0.72);
  --on-face-faint:  rgba(28, 35, 31, 0.14);

  --shell:      1240px;
  --gutter:     clamp(16px, 4vw, 48px);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pixel: "Press Start 2P", var(--mono);   /* retro labels (fonts.css) */
  --lcd: "VT323", var(--mono);              /* retro screen text */
}

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

html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--yellow); color: var(--ink); }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* visible to screen readers and search engines, not on screen */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--yellow);
  color: var(--ink);
  padding: 12px 20px;
  font: 700 14px/1 var(--mono);
}
.skip-link:focus { left: 12px; top: 12px; }

/* --- Shared type ---------------------------------------------------------- */
.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-lit);
  margin: 0 0 18px;
}

.section-head { margin-bottom: clamp(32px, 5vw, 56px); }

.section-head h2 {
  font-size: clamp(2.1rem, 6vw, 3.9rem);
  letter-spacing: -0.015em;
  word-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 900;
}

.section-head p {
  margin-top: 16px;
  max-width: 58ch;
  color: var(--cream-dim);
  font-size: 1.02rem;
}

section { padding-block: clamp(64px, 9vw, 120px); }

/* --- Nav: an 8-bit window with a Poké Ball ------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
}

.nav__inner {
  pointer-events: auto;
  max-width: calc(var(--shell) - 2 * var(--gutter));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding: 12px 20px;
  background: #242d29;                     /* a step lighter than the page, so it reads as a window */
  color: var(--cream);
  border: 4px solid #0e1311;
  box-shadow: inset 0 0 0 2px rgba(199, 176, 116, 0.55), 6px 6px 0 rgba(0, 0, 0, 0.45);
  font-family: var(--pixel);
}

.nav__brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.nav__name { display: block; font-size: 13px; line-height: 1.3; color: #f0666c; letter-spacing: 0.04em; }
.nav__level { display: block; margin-top: 6px; font-size: 9px; color: var(--cream-dim); }
/* the brand Poké Ball wobbles like one mid-catch: rock left, right, left, settle, pause */
.nav__brand .pokeball {
  transform-origin: 50% 85%;
  animation: pokeball-wobble 3.2s ease-in-out infinite;
}
.nav__brand .pokeball::after { animation: pokeball-blink 3.2s steps(1, end) infinite; }
.nav__brand:hover .pokeball,
.nav__brand:hover .pokeball::after { animation-duration: 1.2s; }

.nav__tab { display: flex; align-items: center; gap: clamp(22px, 3vw, 44px); }

.nav__link {
  position: relative;
  padding: 6px 0;
  font-size: 10px;
  line-height: 1;
  color: var(--cream-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav__link:hover { color: var(--cream); }
.nav__link.is-active { color: #f0666c; }
/* small Poké Ball that bounces beside the hovered or current link */
.nav__link .pokeball {
  position: absolute;
  left: -24px;
  top: 50%;
  margin-top: -8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.nav__link:hover .pokeball,
.nav__link.is-active .pokeball { opacity: 1; animation: pokeball-bounce 0.4s ease-in-out infinite alternate; }

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  background: var(--ink-soft);
  color: var(--cream);
  border: 3px solid #0e1311;
  box-shadow: inset 0 0 0 2px rgba(199, 176, 116, 0.55);
  cursor: pointer;
}
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle:active { transform: translate(2px, 2px); }

/* Poké Ball in pure CSS: red and white halves, a dark band and a button */
.pokeball {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border: 4px solid #0e1311;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(238, 222, 193, 0.35);
  background: linear-gradient(to bottom, var(--red) 50%, #fff 50%);
}
.pokeball::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: var(--on-face);
}
.pokeball::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;                            /* border-box: includes the 3px ring */
  height: 14px;
  margin: -7px 0 0 -7px;
  background: #fff;
  border: 3px solid var(--on-face);
  border-radius: 50%;
}
.pokeball--sm { width: 16px; height: 16px; border-width: 2px; }
.pokeball--sm::before { left: -2px; right: -2px; height: 2px; margin-top: -1px; }
.pokeball--sm::after { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-width: 2px; }

@keyframes pokeball-bounce { from { transform: translateY(2px); } to { transform: translateY(-3px); } }
@keyframes pokeball-wobble {
  0%, 8%   { transform: rotate(0); }
  14%      { transform: rotate(-22deg); }
  22%      { transform: rotate(0); }
  30%      { transform: rotate(22deg); }
  38%      { transform: rotate(0); }
  46%      { transform: rotate(-14deg); }
  54%, 100% { transform: rotate(0); }
}
/* the centre button flashes red between wobbles */
@keyframes pokeball-blink {
  0%, 56%, 64%, 72% { background: #fff; }
  60%, 68%          { background: #ff8a8f; }
}

@media (max-width: 960px) {
  .nav { padding-inline: 12px; }
  .nav__inner { padding: 10px 14px; }
  .nav__toggle { display: grid; }
  .nav__tab {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 0 8px 30px;
  }
  .nav__tab.is-open { display: flex; }
}

@media (max-width: 420px) {
  .nav__name { font-size: 10px; }
  .nav__level { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav__link .pokeball, .nav__brand .pokeball, .nav__brand .pokeball::after { animation: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--ink-deep);
  min-height: min(84vh, 720px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(140px, 18vw, 200px) clamp(72px, 10vw, 120px);
  overflow: hidden;
}

/* graph-paper grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(238, 222, 193, 0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 222, 193, 0.075) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

.hero .shell { position: relative; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px 16px 8px 14px;
  background: rgba(247, 211, 14, 0.1);
  border: 1px solid rgba(247, 211, 14, 0.4);
  color: var(--yellow);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.18s ease;
}
.status:hover { background: rgba(247, 211, 14, 0.18); }

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 211, 14, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(247, 211, 14, 0); }
}

/* soot sprite that wanders along the bottom of the hero (assets/js/pet.js) */
.pet {
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 64px;
  height: 64px;
  background: url("../img/pet/soot.png") 0 0 no-repeat;
  /* cream halo so the black sprite reads on the dark hero */
  filter: drop-shadow(0 0 1px rgba(238, 222, 193, 0.7)) drop-shadow(0 0 8px rgba(238, 222, 193, 0.25));
  transition: transform 1200ms linear;
}
.pet.is-pettable { cursor: pointer; }

/* stack the status pill above the nameplate */
.hero .shell > .status + .nameplate { display: table; margin-inline: auto; }

.nameplate {
  display: inline-block;
  border: 1.5px solid var(--gold);
  color: var(--gold-lit);
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 12px 30px;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.hero h1 {
  font-size: clamp(2.9rem, 12.5vw, 8.2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  word-spacing: 0.1em;
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--cream);
  text-wrap: balance;
}

.hero__sub {
  margin: clamp(24px, 4vw, 34px) auto 0;
  max-width: 62ch;
  color: var(--cream-dim);
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
}

.hero__meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-lit);
}

/* --- Retro stripes + marquee ---------------------------------------------- */
.stripes { background: var(--ink-deep); padding-top: 6px; }
.stripes span { display: block; }
/* stripes and skills band use the classic Pokémon logo palette */
.stripes .s1 { height: 9px;  background: #ff0000; }
.stripes .s2 { height: 10px; background: #cc0000; margin-top: 7px; }
.stripes .s3 { height: 11px; background: #ffde00; margin-top: 7px; }
.stripes .s4 { height: 15px; background: #b3a125; margin-top: 7px; }

.marquee {
  background: #3b4cca;
  overflow: hidden;
  padding-block: 16px;
  display: flex;
}

.marquee__track {
  display: flex;
  flex-shrink: 0;
  min-width: 100%;
  gap: 0;
  animation: slide 38s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee ul {
  display: flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
  flex-shrink: 0;
}

.marquee li {
  font-size: clamp(0.95rem, 2vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cream);
}
.marquee li::after {
  content: "•";
  margin-left: 34px;
  color: rgba(238, 222, 193, 0.7);
}

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --- Work cards ----------------------------------------------------------- */
.work { background: var(--ink); }

.cards { display: grid; gap: clamp(24px, 3.5vw, 38px); }

.card {
  background: var(--cream-face);
  color: var(--on-face);
  padding: clamp(20px, 2.6vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: center;
}

.card__body { padding: clamp(6px, 1.6vw, 22px); }

.tag {
  display: inline-block;
  border: 1.5px solid var(--gold);
  color: #6e6033;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 16px;
  margin-bottom: 22px;
}

.card h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--on-face);
}

.card__note {
  margin-top: 8px;
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.06em;
  color: var(--on-face-dim);
}

.card p.card__text {
  margin-top: 18px;
  color: var(--on-face-dim);
  font-size: 0.98rem;
  max-width: 46ch;
}

.card__points {
  margin-top: 18px;
  display: grid;
  gap: 9px;
  max-width: 48ch;
}
.card__points li {
  position: relative;
  padding-left: 20px;
  font-size: 0.93rem;
  color: var(--on-face-dim);
}
.card__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--teal);
}

.chips {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chips span {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 11px;
  background: rgba(28, 35, 31, 0.07);
  color: var(--on-face-dim);
}

.btn {
  display: inline-block;
  margin-top: 26px;
  background: var(--teal);
  color: var(--cream);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 15px 26px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--teal-deep); transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--on-face);
  border: 2px solid var(--on-face);
}
.btn--ghost:hover { background: var(--on-face); color: var(--cream-face); }

.card__art {
  background: var(--ink);
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 26px);
  min-height: 300px;
}
.card__art svg { width: 100%; height: auto; }

@media (max-width: 900px) {
  .card { grid-template-columns: 1fr; }
  .card__art { order: -1; min-height: 240px; }
}

/* --- Experience ----------------------------------------------------------- */
.exp { background: var(--ink-deep); }

.exp__list { display: grid; gap: clamp(28px, 4vw, 46px); }

.job {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  padding-top: 28px;
  border-top: 1px solid var(--ink-line);
}

.job__when {
  font: 500 12px/1.7 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-lit);
}
.job__when span { display: block; color: var(--cream-dim); letter-spacing: 0.06em; }

.job h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.job__org {
  margin-top: 6px;
  color: var(--gold-lit);
  font-size: 1rem;
  font-weight: 500;
}
.job ul { margin-top: 18px; display: grid; gap: 11px; }
.job li {
  position: relative;
  padding-left: 22px;
  color: var(--cream-dim);
  font-size: 0.96rem;
}
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 2px;
  background: var(--orange);
}

@media (max-width: 700px) {
  .job { grid-template-columns: 1fr; gap: 14px; }
}

/* --- About ---------------------------------------------------------------- */
.about { background: var(--ink); }

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.portrait {
  position: relative;
  padding: 14px;
  background: var(--cream-face);
  position: sticky;
  top: 112px;
}
.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 16%;
}
.portrait::after {
  content: "";
  position: absolute;
  inset: auto -14px -14px auto;
  width: 96px;
  height: 96px;
  border: 2px solid var(--gold);
  z-index: -1;
}

.about__lede {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.5;
  color: var(--cream);
  font-weight: 500;
}
.about__body { margin-top: 20px; display: grid; gap: 16px; }
.about__body p { color: var(--cream-dim); }

.panel {
  margin-top: 34px;
  border-top: 1px solid var(--ink-line);
  padding-top: 26px;
}
.panel h3 {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-lit);
  margin-bottom: 18px;
}

.edu h4 { font-size: 1.12rem; font-weight: 700; }
.edu p { color: var(--cream-dim); font-size: 0.95rem; margin-top: 5px; }
.edu .when {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--gold-lit);
  margin-top: 9px;
}

.skills { display: grid; gap: 18px; }
.skills__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.skills__label {
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-top: 7px;
  border-left: 3px solid var(--accent, var(--teal));
  padding-left: 12px;
}
.skills__set { display: flex; flex-wrap: wrap; gap: 7px; }
.skills__set span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
  padding: 7px 12px 7px 9px;
  background: var(--ink-soft);
  color: var(--cream);
}
/* 16×16 pixel-art icon (assets/img/skills, made by scripts/make-skill-icons.mjs), tinted with the row's accent */
.skill-icon {
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  -webkit-mask: var(--icon) center / 16px 16px no-repeat;
  mask: var(--icon) center / 16px 16px no-repeat;
}

.activities { display: grid; gap: 14px; }
.activities li { color: var(--cream-dim); font-size: 0.94rem; }
.activities strong { color: var(--cream); font-weight: 700; }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .portrait { max-width: 340px; position: relative; top: 0; }
  .skills__row { grid-template-columns: 1fr; gap: 10px; }
  .skills__label { border-left: 0; border-top: 3px solid var(--accent, var(--teal)); padding: 10px 0 0; }
}

/* --- Contact -------------------------------------------------------------- */
/* --- Writing -------------------------------------------------------------- */
.writing { background: var(--ink-deep); }

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.post {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 26px 24px;
  background: var(--cream-face);
  color: var(--on-face);
  text-decoration: none;
  border-top: 6px solid var(--teal);
  transition: transform 0.18s ease;
}
.post:nth-child(2) { border-top-color: var(--red); }
.post--series { background: transparent; color: var(--cream); border: 1.5px solid var(--gold); border-top-width: 6px; }
.post:hover { transform: translateY(-3px); }

.post__kind {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6e6033;
}
.post--series .post__kind { color: var(--gold-lit); }
.post__title { font-size: 1.4rem; font-weight: 800; line-height: 1.15; }
.post__text { color: var(--on-face-dim); font-size: 0.97rem; }
.post--series .post__text { color: var(--cream-dim); }
.post__more { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--teal-deep); }
.post--series .post__more { color: var(--yellow); }

@media (prefers-reduced-motion: reduce) {
  .post:hover { transform: none; }
}

.contact {
  background: var(--cream-face);
  color: var(--on-face);
  position: relative;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(28, 35, 31, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 35, 31, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
}
.contact .shell { position: relative; }
.contact .eyebrow { color: #6e6033; }
.contact .section-head h2 { color: var(--on-face); }
.contact .section-head p { color: var(--on-face-dim); }

/* left: heading + contact details; right: the battle box, level with the heading */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.contact__list { display: grid; gap: 2px; margin: 0; }   /* no default <dl> margin: the battle box ends on the last row */
.contact__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--on-face-faint);
  align-items: baseline;
}
.contact__row dt {
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-face-dim);
}
.contact__row dd {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.contact__row a { text-decoration: none; border-bottom: 2px solid var(--gold); }
.contact__row a:hover { border-bottom-color: var(--teal); color: var(--teal); }

.contact__cta {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(26px, 4vw, 40px);
}
.contact__cta h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.contact__cta p { margin-top: 14px; color: var(--cream-dim); font-size: 0.97rem; }

/* on wide screens start the battle box level with "CONTACT ME" (below the eyebrow line) */
@media (min-width: 801px) {
  /* start level with the heading, end level with the last contact row (GitHub) */
  .contact__grid .contact__cta {
    margin-top: 46px;                       /* eyebrow (12px + 18px margin) + the heading's top leading */
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  .contact__grid .battle__menu { margin-top: auto; padding-top: 20px; }   /* buttons sit at the bottom */
}

@media (max-width: 800px) {
  .contact__grid { grid-template-columns: 1fr; }
}

/* --- Footer --------------------------------------------------------------- */
.footer {
  background: var(--ink-deep);
  border-top: 1px solid var(--ink-line);
  padding-block: 40px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
}
.footer p {
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.08em;
  color: var(--cream-dim);
}
.footer__social { display: flex; gap: 10px; }
.footer p.footer__legal { flex-basis: 100%; order: 3; font-size: 10.5px; letter-spacing: 0.04em; color: rgba(238, 222, 193, 0.45); }
.footer__social a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--ink-soft);
  color: var(--cream);
  transition: background 0.18s ease, color 0.18s ease;
}
.footer__social a:hover { background: var(--yellow); color: var(--ink); }
.footer__social svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Reveal on scroll ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; justify-content: center; width: 100%; min-width: 0; }
  .marquee ul { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; justify-content: center; row-gap: 10px; padding-inline: 16px; }
  .marquee ul + ul { display: none; }         /* the second copy only exists for the loop */
  .status__dot { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* --- DDIA progress HUD (assets/js/ddia-hud.js) ---------------------------- */
.hud {
  --hp-high: #3fbf5f;
  --hp-mid:  var(--yellow);
  --hp-low:  var(--red);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 480px;
}

.hud__box {
  flex: 1;
  min-width: 0;
  background: var(--cream-face);
  color: var(--on-face);
  border: 2px solid var(--on-face);
  box-shadow: 5px 5px 0 var(--gold);
  padding: 12px 16px 10px;
  font-family: var(--mono);
}

.hud__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hud__name { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__lv { font-size: 12px; font-weight: 700; white-space: nowrap; }
.hud__lv b { font-size: 16px; margin-left: 2px; }

.hud__hp { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hud__hp-label {
  font: 700 11px/1 var(--mono);
  color: var(--yellow);
  background: var(--on-face);
  padding: 3px 6px;
}
.hud__track {
  flex: 1;
  height: 12px;
  background: #3a4640;
  border: 2px solid var(--on-face);
}
.hud__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--hp-low);
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hud--mid  .hud__fill { background: var(--hp-mid); }
.hud--high .hud__fill { background: var(--hp-high); }

.hud__xp { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hud__xp-label {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--on-face-dim);
  width: 26px;
  text-align: right;
}
.hud__xp-track {
  flex: 1;
  height: 6px;
  background: #3a4640;
  border: 1.5px solid var(--on-face);
}
.hud__xp-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #3fa7e0;
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s;
}

.hud__box { position: relative; }
.hud__levelup {
  position: absolute;
  top: -13px;
  right: 12px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.12em;
  background: var(--yellow);
  color: var(--on-face);
  border: 2px solid var(--on-face);
  padding: 4px 8px;
  animation: hud-levelup 0.9s steps(2, jump-none) 4;
}
@keyframes hud-levelup { 50% { background: var(--cream-face); } }

.hud__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}
.hud__next { color: var(--on-face-dim); }
.hud__count { font-weight: 700; font-size: 15px; white-space: nowrap; }

.hud__mon {
  flex: none;
  display: block;
  background: none;
  border: 0;
  padding: 0;
  line-height: 0;
}
button.hud__mon { cursor: pointer; }
.hud__mon img {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
  animation: hud-bob 2.4s ease-in-out infinite;
}
button.hud__mon:hover img { animation-duration: 0.6s; }

@keyframes hud-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.hud[data-variant="compact"] .hud__mon img { width: 84px; height: 84px; }
.hud[data-variant="compact"] .hud__box { box-shadow: 4px 4px 0 var(--gold); }

.post__hud { margin-top: 6px; }

@media (max-width: 420px) {
  .hud__mon img { width: 96px; height: 96px; }
  .hud[data-variant="compact"] .hud__mon img { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud__mon img { animation: none; }
  .hud__fill, .hud__xp-fill { transition: none; }
  .hud__levelup { animation: none; }
}
