/* ==========================================================================
   Jeffrey Long: personal site
   Colour pairs used for text are checked against WCAG 2.2 AA (4.5:1+).
   ========================================================================== */

:root {
  --bg: #07070c;
  --panel: #0e0e15;
  --text: #f3eeee;       /* 16:1 on panel */
  --muted: #b9b0b4;      /* 8.8:1 on panel */
  --red: #ff3b41;        /* 5.7:1 with --bg as text colour */
  --red-light: #ff6b6f;  /* 7.2:1 on --bg, used for links */
  --rose: #ff8a8d;
  --peach: #f7a07a;
  --amber: #ffb04a;
  --red-deep: #8f1418;   /* decorative only, never behind text */
  --focus: #ffd166;

  --font-display: "Antonio", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-pill: 999px;
  --gap: clamp(1rem, 3vw, 2rem);
  --max: 72rem;
  --header-h: 0px;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

.motion-off,
.motion-off * { scroll-behavior: auto !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(143, 20, 24, 0.35), transparent 55%),
    radial-gradient(ellipse at 90% 80%, rgba(255, 59, 65, 0.12), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
}

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

a { color: var(--red-light); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--rose); text-decoration-thickness: 0.15em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
main:focus { outline: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--focus);
  color: var(--bg);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--bg); }

.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ---------- Starfield ---------- */
.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Background flybys ---------- */
.flybys {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.flyby {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.flyby svg { width: 100%; height: auto; overflow: visible; }
.flyby--starship { width: clamp(170px, 20vw, 290px); filter: drop-shadow(0 0 10px rgba(255, 59, 65, 0.35)); }
.flyby--box { width: clamp(58px, 6vw, 86px); filter: drop-shadow(0 0 16px rgba(120, 170, 255, 0.7)); }
.flyby--rover { width: clamp(120px, 13vw, 180px); filter: drop-shadow(0 0 8px rgba(247, 160, 122, 0.35)); }
.flyby--probe { width: clamp(110px, 12vw, 170px); filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.35)); }
.flyby--rover .wheel { transform-box: fill-box; transform-origin: center; animation: spin 1.8s linear infinite; }
.flyby--cow { width: clamp(110px, 11vw, 160px); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25)); }
.flyby--rocky { width: clamp(90px, 9vw, 130px); filter: drop-shadow(0 0 10px rgba(255, 176, 74, 0.35)); }
.flyby--ufo { width: clamp(130px, 13vw, 190px); filter: drop-shadow(0 0 10px rgba(156, 255, 156, 0.35)); }
.flyby--anvil { width: clamp(80px, 8vw, 120px); filter: drop-shadow(0 0 8px rgba(255, 59, 65, 0.3)); }
.ufo-beam { animation: beam-pulse 2.4s ease-in-out infinite; }
@keyframes beam-pulse { 50% { opacity: 0.45; } }
.motion-off .flybys { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.6rem 1.6rem;
  border: 2px solid var(--red);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  transition: box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.btn svg { width: 1.4em; height: 1.4em; flex: none; }

.btn--primary { background: var(--red); color: var(--bg); }
.btn--primary:hover { background: var(--red-light); border-color: var(--red-light); color: var(--bg); }

.btn--ghost { background: rgba(7, 7, 12, 0.6); color: var(--red-light); border-color: var(--red-light); }
.btn--ghost:hover { background: var(--red-light); color: var(--bg); }

.btn:hover,
.btn:focus-visible {
  box-shadow: 0 0 0 4px rgba(255, 59, 65, 0.25), 0 0 28px rgba(255, 59, 65, 0.65);
}
.motion-on .btn:hover { transform: translateY(-2px); }

.btn--large { font-size: clamp(1.15rem, 3.5vw, 1.6rem); padding-inline: 1.75rem; overflow-wrap: anywhere; }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 10;
  background: rgba(7, 7, 12, 0.92);
  padding: 0.75rem var(--gap) 0;
}

@media (min-width: 60em) {
  .site-header { position: sticky; top: 0; backdrop-filter: blur(6px); }
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand__block {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem 0 1.25rem;
  background: var(--red);
  color: var(--bg);
  border-radius: var(--radius-pill) 0.4rem 0.4rem var(--radius-pill);
  font-size: 1.25rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.25rem 1.1rem;
  border-radius: 0.4rem;
  background: var(--peach);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.site-nav li:nth-child(2) a { background: var(--rose); }
.site-nav li:nth-child(3) a { background: var(--amber); }
.site-nav li:nth-child(4) a { background: var(--red); }
.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0 18px rgba(255, 59, 65, 0.7);
}

.site-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; }
html:not(.js) .site-controls { display: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.9rem;
  border: 2px solid var(--muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 600 1rem/1.2 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.toggle:hover { border-color: var(--red-light); box-shadow: 0 0 14px rgba(255, 59, 65, 0.55); }
.toggle__light {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
}
.toggle__state {
  min-width: 2.2em;
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  background: #2a2a33;
  color: var(--text);
  text-align: center;
}
.toggle[aria-pressed="true"] { border-color: var(--red); }
.toggle[aria-pressed="true"] .toggle__light {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 10px var(--red);
}
.toggle[aria-pressed="true"] .toggle__state { background: var(--red); color: var(--bg); }

/* Segmented readout strip under the header */
.readouts {
  max-width: var(--max);
  margin: 0.75rem auto 0;
  display: flex;
  gap: 0.35rem;
  height: 1.4rem;
}
.readout {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.5rem;
  min-width: 3.5rem;
  color: var(--bg);
  font: 600 0.9rem/1 var(--font-display);
  letter-spacing: 0.1em;
}
.readout:first-child { border-radius: var(--radius-pill) 0 0 var(--radius-pill); min-width: 4rem; }
.readout--grow { flex: 1; min-width: 1rem; }
.readout--end { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; min-width: 2rem; }
.readout--red { background: var(--red); }
.readout--peach { background: var(--peach); }
.readout--amber { background: var(--amber); }
.readout--rose { background: var(--rose); }
.readout.is-blink { background: var(--text); }

@media (max-width: 30em) {
  .readout--amber, .readout--rose { display: none; }
}

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap) 3rem;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--gap);
  padding-top: clamp(2rem, 6vw, 4.5rem);
}
@media (min-width: 56em) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.hero__text { text-shadow: 0 2px 12px var(--bg); }
.hero__text .btn { text-shadow: none; }

.hero h1 {
  font-size: clamp(3rem, 9vw, 5.75rem);
  color: var(--text);
}
.hero__hello {
  display: block;
  font-size: 0.42em;
  color: var(--red-light);
  letter-spacing: 0.12em;
}
.hero__role {
  margin: 0.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rose);
}
.hero__lede { max-width: 38rem; margin: 0 0 1.75rem; color: var(--text); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Portal ---------- */
.portal {
  position: relative;
  width: min(100%, 28rem);
  aspect-ratio: 1;
  margin-inline: auto;
}
.portal__photo,
.portal__horizon {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  overflow: hidden;
}
.portal__photo {
  background: #000;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}
.portal__img {
  position: absolute;
  inset: 0;
  transition: opacity 0.9s ease, filter 0.9s ease;
}
.portal__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portal__img--real img { transform: scale(1.2) translateY(4%); }
.portal__img--toon img { transform: scale(1.25) translateY(8%); }
.portal__img--toon,
.portal--toon .portal__img--real { opacity: 0; }
.portal--toon .portal__img--toon { opacity: 1; }

/* Transporter shimmer while switching between photos */
.portal__sparkles {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle, #fff 0 1.5px, transparent 2px) 0 0 / 18px 22px,
    radial-gradient(circle, #ffd6d7 0 1px, transparent 1.5px) 9px 11px / 14px 17px,
    linear-gradient(90deg, transparent 10%, rgba(255, 107, 111, 0.45) 50%, transparent 90%);
}
.motion-on .portal--beaming .portal__sparkles { animation: beam 1.1s ease-in-out; }
.motion-on .portal--beaming .portal__img { filter: brightness(1.35) saturate(0.7); }
@keyframes beam {
  0%       { opacity: 0; background-position: 0 40px, 9px 60px, 0 0; }
  35%, 65% { opacity: 0.85; }
  100%     { opacity: 0; background-position: 0 -40px, 9px -60px, 0 0; }
}

.hero__portal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
html:not(.js) .portal-toggle { display: none; }
/* The swap button is visually hidden, so show its focus on the portal itself */
.hero__portal:has(.portal-toggle:focus-visible) .portal {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
  border-radius: 50%;
}
.portal__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 22px rgba(255, 59, 65, 0.35));
}

.ring__base { fill: none; stroke: #23232c; stroke-width: 30; }
.ring__edge { fill: none; stroke: #4a4a57; stroke-width: 2.5; }
.ring__ticks {
  fill: none;
  stroke: #5b5b69;
  stroke-width: 12;
  stroke-dasharray: 2 9;
}
.ring__ticks--long { stroke: var(--red-deep); stroke-width: 5; stroke-dasharray: 14 26; }

.portal__glyphs {
  transform-box: view-box;
  transform-origin: 200px 200px;
}
.motion-on .portal__glyphs { animation: spin 90s linear infinite; }
.motion-on .portal--dialing .portal__glyphs { animation-duration: 8s; }

.chevron__frame { fill: #3a3a45; stroke: #6b6b78; stroke-width: 2; }
.chevron__light {
  fill: var(--red);
  filter: url(#glow);
  transition: fill 0.2s ease;
}
.portal--dialing .chevron:not(.is-lit) .chevron__light { fill: #3d1416; filter: none; }

/* Event horizon: shown only while dialing, then bursts open */
.portal__horizon {
  display: none;
  background: radial-gradient(circle, #ffc2c3 0%, var(--red-light) 25%, var(--red) 50%, var(--red-deep) 78%, #2a0507 100%);
}
.portal__horizon::before {
  content: "";
  position: absolute;
  inset: -25%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, 0.2) 0 2%, transparent 2% 7%);
  animation: ripple 2.5s linear infinite;
}
.portal--dialing .portal__horizon,
.portal--kawoosh .portal__horizon { display: block; }
.portal--kawoosh .portal__horizon { animation: kawoosh 1s ease-out forwards; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { from { transform: scale(1); } to { transform: scale(1.3); } }
@keyframes kawoosh {
  0%   { opacity: 1; transform: scale(1); }
  30%  { opacity: 1; transform: scale(1.12); filter: brightness(1.4); }
  100% { opacity: 0; transform: scale(1); }
}

/* ---------- Console panels ---------- */
.panel {
  --rail: 6.5rem;
  --bar: 1.1rem;
  --elbow: 3.25rem;
  --c: var(--red);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--elbow) 1fr var(--elbow);
  background: var(--panel);
  border-radius: 2.5rem 1rem 1rem 2.5rem;
  box-shadow: 0 0 0 1px rgba(255, 59, 65, 0.12), 0 20px 50px rgba(0, 0, 0, 0.55);
}

.panel__top,
.panel__bottom {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.35rem;
}
.panel__top { grid-row: 1; align-items: flex-start; }
.panel__bottom { grid-row: 3; align-items: flex-end; }

.panel__elbow {
  position: relative;
  flex: 0 0 calc(var(--rail) + 2.5rem);
  height: 100%;
  background: var(--c);
}
.panel__elbow::after {
  content: "";
  position: absolute;
  left: var(--rail);
  right: 0;
  background: var(--panel);
  height: calc(100% - var(--bar));
}
.panel__top .panel__elbow { border-top-left-radius: 2.5rem; }
.panel__top .panel__elbow::after { bottom: 0; border-top-left-radius: 1.5rem; }
.panel__bottom .panel__elbow { border-bottom-left-radius: 2.5rem; }
.panel__bottom .panel__elbow::after { top: 0; border-bottom-left-radius: 1.5rem; }

.panel__bar { height: var(--bar); background: var(--c); }
.panel__bar--short { flex: 0 0 3rem; background: var(--peach); }
.panel__bar--grow { flex: 1 1 auto; }
.panel__bar--accent { flex: 0 0 clamp(2rem, 12%, 8rem); background: var(--amber); }
.panel__bar--end { flex: 0 0 1.75rem; border-radius: 0 var(--radius-pill) var(--radius-pill) 0; background: var(--rose); }

.panel__rail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0;
}
.rail-block {
  flex: 1 1 3rem;
  min-height: 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.25rem 0.6rem;
  background: var(--c);
  color: var(--bg);
  font: 600 1.05rem/1 var(--font-display);
  letter-spacing: 0.08em;
}
.rail-block--tall { flex-grow: 3; }
.rail-block--peach { background: var(--peach); }
.rail-block--rose { background: var(--rose); }
.rail-block--amber { background: var(--amber); }

.panel__body {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 0.5rem clamp(1.25rem, 3vw, 2.5rem);
}
.panel h2 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin-bottom: 1.25rem;
}

@media (max-width: 40em) {
  .panel { --rail: 1.25rem; --bar: 0.8rem; --elbow: 2.25rem; border-radius: 1.5rem 0.75rem 0.75rem 1.5rem; }
  .panel__elbow { flex-basis: calc(var(--rail) + 1.5rem); }
  .panel__top .panel__elbow { border-top-left-radius: 1.5rem; }
  .panel__bottom .panel__elbow { border-bottom-left-radius: 1.5rem; }
  .panel__top .panel__elbow::after { border-top-left-radius: 0.9rem; }
  .panel__bottom .panel__elbow::after { border-bottom-left-radius: 0.9rem; }
  .rail-block { font-size: 0; padding: 0; }
  .panel__bar--short { flex-basis: 1.5rem; }
}

.prose { max-width: 44rem; }
.prose p { margin: 0 0 1.1rem; }

/* ---------- Stats ---------- */
.stats {
  list-style: none;
  margin: 2rem 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0.75rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border-left: 0.5rem solid var(--red);
  border-radius: 0 0.75rem 0.75rem 0;
  background: rgba(255, 59, 65, 0.07);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.stat:nth-child(2) { border-color: var(--peach); }
.stat:nth-child(3) { border-color: var(--amber); }
.stat:nth-child(4) { border-color: var(--rose); }
.stat:hover { background: rgba(255, 59, 65, 0.14); box-shadow: 0 0 22px rgba(255, 59, 65, 0.3); }
.stat__value {
  font: 700 clamp(2.5rem, 6vw, 3.25rem)/1 var(--font-display);
  color: var(--red-light);
  font-variant-numeric: tabular-nums;
}
.stat__label { color: var(--muted); font-size: 1rem; line-height: 1.4; }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 48rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0.55rem;
  width: 3px;
  background: linear-gradient(var(--red), var(--amber));
  border-radius: 3px;
}
.timeline__item {
  position: relative;
  padding: 0 0 1.75rem 2.5rem;
}
.timeline__item:last-child { padding-bottom: 0.5rem; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--red);
}
.timeline__item--current::before {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 59, 65, 0.3), 0 0 16px var(--red);
}
.motion-on .timeline__item--current::before { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(255, 59, 65, 0.12), 0 0 26px var(--red); }
}
.timeline__when {
  margin: 0;
  font: 600 1.05rem/1.4 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.timeline__title { font-size: 1.6rem; margin: 0.15rem 0 0.4rem; }
.timeline__item p:last-child { margin: 0; color: var(--muted); }

/* ---------- Interest cards ---------- */
.cards {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}
.card {
  padding: 1.5rem;
  border: 2px solid rgba(255, 107, 111, 0.35);
  border-radius: 1.75rem 0.5rem 1.75rem 0.5rem;
  background: rgba(255, 59, 65, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  border-color: var(--red-light);
  box-shadow: 0 0 26px rgba(255, 59, 65, 0.35), inset 0 0 18px rgba(255, 59, 65, 0.12);
}
.motion-on .card:hover { transform: translateY(-4px); }
.card__icon { width: 3rem; height: 3rem; color: var(--red-light); margin-bottom: 0.75rem; }
.card h3 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--muted); }

.favorites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2rem;
}
.favorites h3 { font-size: 1.75rem; }
.favorites__subhead {
  margin: 1.5rem 0 0.75rem;
  font: 600 1.2rem/1.2 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.favorites__note { margin: 0.1rem 0 1rem; color: var(--muted); font-style: italic; font-size: 1rem; }

.ranked {
  list-style: none;
  counter-reset: rank;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.ranked li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.ranked li::before {
  content: counter(rank, decimal-leading-zero);
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.2rem;
  border-radius: var(--radius-pill) 0.3rem 0.3rem var(--radius-pill);
  background: var(--red);
  color: var(--bg);
  font: 700 1.05rem/1 var(--font-display);
}
.ranked li:hover { background: rgba(255, 59, 65, 0.14); box-shadow: 0 0 16px rgba(255, 59, 65, 0.3); }

.pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pills li {
  padding: 0.45rem 1.1rem;
  border: 2px solid var(--peach);
  border-radius: var(--radius-pill);
  color: var(--text);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.pills li:hover { background: rgba(247, 160, 122, 0.12); box-shadow: 0 0 16px rgba(247, 160, 122, 0.45); }

/* ---------- Contact ---------- */
.contact__intro { max-width: 40rem; margin: 0 0 1.5rem; }
.contact__primary { margin: 0 0 2rem; }
.contact__subhead { font-size: 1.4rem; color: var(--muted); margin-bottom: 0.75rem; }
.links {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gap) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  color: var(--muted);
  font-size: 1rem;
  border-top: 1px solid rgba(255, 59, 65, 0.25);
}
.site-footer p { margin: 0; }

/* ---------- Scroll reveal (only when animations are on) ---------- */
.motion-on .reveal,
.motion-on .reveal-item {
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.motion-on .reveal:not(.is-visible) { opacity: 0; transform: translateY(2.5rem); }
.motion-on .reveal:not(.is-visible) .reveal-item { opacity: 0; transform: translateX(-1.5rem); }
.motion-on .reveal.is-visible .reveal-item { transition-delay: calc(0.25s + var(--i, 0) * 0.08s); }

/* Belt and braces: users who ask the OS for reduced motion and haven't
   opted back in get no transitions at all. */
.motion-off *,
.motion-off *::before,
.motion-off *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0s !important;
}

@media (forced-colors: active) {
  .btn, .toggle, .site-nav a { border: 2px solid ButtonText; }
  .panel__top, .panel__bottom, .panel__rail, .readouts { forced-color-adjust: none; }
}

/* ---------- Easter eggs ---------- */

/* Message popup for discovered secrets */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 60;
  max-width: min(36rem, calc(100vw - 2rem));
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--red);
  border-radius: 1.5rem;
  background: var(--bg);
  color: var(--text);
  font: 600 1.15rem/1.35 var(--font-display);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 0 28px rgba(255, 59, 65, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast:empty { display: none; }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Red alert: a red glow around the screen edges, slow pulse */
.alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 140px 40px rgba(255, 0, 20, 0.55);
  transition: opacity 0.4s ease;
}
.red-alert .alert-overlay { opacity: 1; animation: alert-pulse 1.6s ease-in-out infinite; }
.red-alert .readout { background: var(--red); }
@keyframes alert-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* The ring itself is clickable (redials the gate) */
.portal__ring .ring__base,
.portal__chevrons { cursor: pointer; }

/* Googly eye */
.googly {
  position: absolute;
  left: 50%;
  top: 21%;
  width: 17%;
  aspect-ratio: 1;
  display: none;
  border: 2px solid #1d1d22;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f2f2f2 60%, #d6d6d6);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}
.portal--googly .googly { display: grid; place-items: center; }
.motion-on .portal--googly .googly { animation: googly-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.googly__pupil {
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #111;
}
@keyframes googly-pop { from { transform: translate(-50%, -50%) scale(0); } }

/* Psych pineapple, tucked in a corner */
.panel__body { position: relative; }
.panel__body:has(.pineapple) { padding-bottom: 2.75rem; }
.pineapple {
  position: absolute;
  right: 0.75rem;
  bottom: 0.25rem;
  width: 1.75rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.pineapple svg { width: 100%; height: 100%; }
.pineapple:hover { filter: drop-shadow(0 0 8px rgba(255, 201, 60, 0.8)); transform: rotate(-12deg) scale(1.15); }
.motion-on .pineapple.is-found { animation: pineapple-spin 0.8s ease; }
@keyframes pineapple-spin { 50% { transform: scale(1.6) rotate(180deg); } 100% { transform: rotate(360deg); } }

.site-footer__hint { flex-basis: 100%; order: 3; font-style: italic; }

/* ---------- Easter eggs page ---------- */
.eggs-intro { padding-top: clamp(2rem, 6vw, 4rem); max-width: 48rem; }
.eggs-intro h1 { font-size: clamp(3rem, 9vw, 5rem); margin-bottom: 1rem; }
.eggs-intro p { margin: 0 0 1rem; }
.eggs-note { max-width: 48rem; margin: 0 0 1.25rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin-bottom: 0.5rem; }
.egg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}
.egg-table th,
.egg-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 107, 111, 0.25);
}
.egg-table thead th {
  font: 600 1rem/1.2 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 2px solid var(--red);
}
.egg-table tbody th { font-weight: 600; color: var(--text); }
.egg-table td:last-child { color: var(--muted); }
.egg-table tbody tr { transition: background-color 0.2s ease; }
.egg-table tbody tr:hover { background: rgba(255, 59, 65, 0.08); }

@media (max-width: 40em) {
  .egg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .egg-table, .egg-table tbody, .egg-table tr, .egg-table th, .egg-table td { display: block; width: 100%; }
  .egg-table tr { padding: 0.75rem 0; border-bottom: 1px solid rgba(255, 107, 111, 0.25); }
  .egg-table th, .egg-table td { padding: 0.15rem 0; border: 0; }
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border: 2px solid var(--red);
  border-radius: 0.4rem;
  background: rgba(255, 59, 65, 0.1);
  color: var(--text);
  font: 600 1.05rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

.eggs-list { margin: 0; padding-left: 1.25rem; max-width: 48rem; }
.eggs-list li { margin-bottom: 0.6rem; }
.eggs-list li::marker { color: var(--red); }
