:root {
  /* Graphite / navy / glossy-black palette with burgundy accents */
  --bg: #060709;
  --bg-panel: rgba(13, 15, 19, 0.74);
  --bg-card: rgba(19, 22, 28, 0.72);
  --paper: #e8eaee;
  --body: #c4c9d1;
  --muted: #8d939c;
  --dim: #5b616b;
  --line: rgba(196, 205, 220, 0.12);
  --line-strong: rgba(196, 205, 220, 0.24);
  --signal: #9db3d8;
  --signal-soft: rgba(70, 98, 150, 0.16);
  --navy: #14213d;
  --navy-bright: #2a3f6b;
  --wine: #6e1a2c;
  --burgundy: #a3324c;
  --burgundy-soft: rgba(163, 50, 76, 0.14);
  --gloss: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.012) 38%, rgba(0, 0, 0, 0) 60%);
  --teal: #4a5f88;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --nastaliq: "Noto Nastaliq Urdu", "IranNastaliq", "Nastaliq Navees", serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--paper);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--burgundy);
  color: var(--paper);
}

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

a {
  color: inherit;
  text-decoration-color: rgba(157, 179, 216, 0.45);
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--signal);
}

a:focus-visible,
.skip:focus {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--signal);
  color: var(--bg);
  padding: 0.45rem 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
}

.skip:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
 * Fixed 3D WebGL2 Canvas & Scrim
 * -------------------------------------------------------------------------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(3, 4, 6, 0.6) 100%),
    linear-gradient(180deg, rgba(6, 7, 9, 0.6) 0%, transparent 14%, transparent 86%, rgba(6, 7, 9, 0.78) 100%);
}

/* --------------------------------------------------------------------------
 * Top Navigation Bar
 * -------------------------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.25rem;
  background: linear-gradient(180deg, rgba(20, 22, 27, 0.78) 0%, rgba(6, 7, 9, 0.7) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--paper);
}

.brand:hover {
  color: var(--paper);
}

.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--navy) 0%, #08090c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--paper);
}

.brand-mark i:nth-child(1) {
  top: 5px;
  left: 6px;
}

.brand-mark i:nth-child(2) {
  bottom: 5px;
  left: 8px;
}

.brand-mark i:nth-child(3) {
  top: 10px;
  right: 5px;
  width: 5px;
  height: 5px;
  background: var(--burgundy);
  box-shadow: 0 0 8px rgba(163, 50, 76, 0.8);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-fa {
  margin-left: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--line-strong);
  font-family: var(--nastaliq);
  font-size: 0.82rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--signal);
  vertical-align: 0.15em;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topnav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
  border: 1px solid transparent;
}

.topnav a span {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
}

.topnav a:hover {
  color: var(--paper);
  border-color: var(--line);
}

.topnav a[aria-current="page"] {
  color: var(--paper);
  background: linear-gradient(160deg, rgba(42, 63, 107, 0.55) 0%, rgba(20, 33, 61, 0.5) 100%);
  border-color: rgba(157, 179, 216, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topnav a[aria-current="page"] span {
  color: var(--burgundy);
}

/* --------------------------------------------------------------------------
 * Right Scroll-Progress Rail & Bottom-Left Telemetry HUD
 * -------------------------------------------------------------------------- */
.progress {
  position: fixed;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  padding: 0.4rem 0;
}

.progress-track {
  position: absolute;
  right: 5px;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 1px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--signal) 0%, var(--navy-bright) 70%, var(--burgundy) 100%);
  transform-origin: top;
  transform: scaleY(0);
}

.progress a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pg-label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.progress:hover .pg-label {
  opacity: 0.7;
  transform: translateX(0);
}

.pg-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--dim);
  background: var(--bg);
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.progress a:hover .pg-label,
.progress a.on .pg-label,
.progress:hover a.on .pg-label {
  opacity: 1;
  color: var(--paper);
  transform: translateX(-2px);
}

.progress a.past .pg-dot {
  border-color: var(--teal);
  background: rgba(42, 63, 107, 0.7);
}

.progress a.on .pg-dot {
  border-color: var(--paper);
  background: var(--signal);
  box-shadow: 0 0 10px rgba(157, 179, 216, 0.6);
  transform: scale(1.18);
}

.telemetry {
  position: fixed;
  left: 2.25rem;
  bottom: 1.65rem;
  z-index: 15;
  display: flex;
  gap: 1.25rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(22, 25, 31, 0.8) 0%, rgba(7, 8, 10, 0.82) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.t-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.t-key {
  color: var(--dim);
  text-transform: uppercase;
}

.t-val {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.t-state {
  color: var(--signal);
}

.t-state.flash {
  animation: stateFlash 0.55s ease;
}

@keyframes stateFlash {
  0% {
    color: #fff;
    text-shadow: 0 0 12px var(--burgundy);
  }
  100% {
    color: var(--signal);
    text-shadow: none;
  }
}

/* --------------------------------------------------------------------------
 * Story Panels (Scroll Choreography Layout)
 * -------------------------------------------------------------------------- */
main#content {
  position: relative;
  z-index: 5;
}

.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 5.5rem 5rem;
  position: relative;
}

.panel-hero {
  justify-content: flex-start;
  min-height: 100vh;
}

.panel-left {
  justify-content: flex-start;
}

.panel-right {
  justify-content: flex-end;
}

.panel-inner {
  position: relative;
  width: 100%;
  max-width: 540px;
  padding: 2.35rem 2.5rem;
  border-radius: 14px;
  background: var(--gloss), linear-gradient(165deg, rgba(22, 25, 31, 0.78) 0%, rgba(11, 12, 15, 0.8) 55%, rgba(6, 7, 9, 0.86) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 28px 70px rgba(0, 0, 0, 0.6);
}

.panel-hero .panel-inner {
  background: var(--gloss), linear-gradient(165deg, rgba(18, 21, 27, 0.6) 0%, rgba(6, 7, 9, 0.66) 100%);
  border-color: rgba(196, 205, 220, 0.1);
}

/* State tag: sits on the panel's top edge like a label on a case */
.state-tag {
  position: absolute;
  top: 0;
  right: 1.6rem;
  transform: translateY(-50%);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(26, 30, 38, 0.96) 0%, rgba(9, 10, 13, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
  transition: color 0.35s ease, border-color 0.35s ease;
}

.st-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.state-tag.past .st-dot {
  background: var(--teal);
}

.state-tag.on {
  color: var(--signal);
  border-color: rgba(157, 179, 216, 0.4);
}

.state-tag.on .st-dot {
  background: var(--burgundy);
  box-shadow: 0 0 8px rgba(163, 50, 76, 0.9);
  animation: pulseDot 1.6s ease-in-out infinite;
}

.state-tag.done {
  color: var(--paper);
  border-color: rgba(157, 179, 216, 0.7);
  box-shadow: 0 0 20px rgba(157, 179, 216, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.state-tag.done .st-dot {
  background: var(--signal);
  box-shadow: 0 0 10px rgba(157, 179, 216, 0.95);
  animation: none;
}

/* Access granted: the contact links light up one after another */
html.is-granted .find a {
  animation: grantIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}

@keyframes grantIn {
  0% {
    border-color: var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  35% {
    border-color: rgba(157, 179, 216, 0.85);
    box-shadow: 0 0 26px rgba(157, 179, 216, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  100% {
    border-color: rgba(157, 179, 216, 0.32);
    box-shadow: 0 0 10px rgba(157, 179, 216, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

/* Reveal animation when panels enter viewport */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
 * Typography & Section Elements
 * -------------------------------------------------------------------------- */
.eyebrow {
  margin: 0 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
}

.eyebrow .idx {
  color: var(--muted);
}

.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--burgundy);
  box-shadow: 0 0 10px rgba(163, 50, 76, 0.85);
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.hero-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 7.2vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.hero-name .line {
  display: block;
}

.hero-name em {
  font-style: italic;
  color: var(--signal);
}

.hero-fa-row {
  margin: 0.55rem 0 -0.4rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.hero-fa {
  font-family: var(--nastaliq);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 2.1;
  letter-spacing: 0;
  color: var(--signal);
  text-shadow: 0 0 22px rgba(157, 179, 216, 0.25);
}

.fa-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.fa-label::before {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: var(--line-strong);
}

.hero-dek {
  margin: 1.15rem 0 0;
  font-size: 1.18rem;
  line-height: 1.48;
  color: var(--body);
  max-width: 34ch;
}

.hero-meta {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-cue {
  position: absolute;
  left: 5.5rem;
  bottom: 2.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.scroll-cue i {
  width: 18px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  position: relative;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 6px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: var(--signal);
  animation: scrollWheel 1.8s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

.big {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.35rem, 4.5vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.big em {
  font-style: italic;
  color: var(--signal);
}

.lead {
  margin: 0 0 1.25rem;
  color: var(--body);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
 * About Grid & Portrait Frame
 * -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.portrait {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: #101216;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--burgundy);
  border-style: solid;
  pointer-events: none;
}

.c-tl { top: 6px; left: 6px; border-width: 1.5px 0 0 1.5px; }
.c-tr { top: 6px; right: 6px; border-width: 1.5px 1.5px 0 0; }
.c-bl { bottom: 6px; left: 6px; border-width: 0 0 1.5px 1.5px; }
.c-br { bottom: 6px; right: 6px; border-width: 0 1.5px 1.5px 0; }

.about-text h2 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
}

.about-text p {
  margin: 0;
  color: var(--body);
  font-size: 0.99rem;
}

.about-text p + p {
  margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
 * Tags, CTA, Timeline, Links, Jumps
 * -------------------------------------------------------------------------- */
.tags,
.roles {
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tags li,
.roles li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  background: var(--signal-soft);
  color: var(--signal);
  border: 1px solid rgba(157, 179, 216, 0.22);
}

.tags li:nth-child(4n + 3),
.roles li:nth-child(4n + 2) {
  background: var(--burgundy-soft);
  color: #d27a8e;
  border-color: rgba(163, 50, 76, 0.38);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--paper);
  background: var(--gloss), linear-gradient(160deg, rgba(42, 63, 107, 0.35) 0%, rgba(10, 12, 16, 0.7) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.cta:hover {
  border-color: rgba(163, 50, 76, 0.7);
  background: linear-gradient(160deg, rgba(110, 26, 44, 0.45) 0%, rgba(20, 33, 61, 0.55) 100%);
  color: var(--paper);
  box-shadow: 0 0 22px rgba(163, 50, 76, 0.22);
}

.timeline {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.timeline li.now .stage {
  color: var(--burgundy);
}

.stage {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--paper);
}

.timeline p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--body);
}

.pending {
  margin: 0;
  color: var(--muted);
}

.find {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.find a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--gloss), var(--bg-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--paper);
}

.find a:hover {
  border-color: rgba(157, 179, 216, 0.45);
  background: var(--gloss), linear-gradient(160deg, rgba(42, 63, 107, 0.45) 0%, rgba(13, 16, 22, 0.85) 100%);
  color: var(--paper);
}

.find a:hover i {
  color: var(--burgundy);
}

.find svg,
.mono {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.mono {
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
}

.find a i {
  margin-left: auto;
  font-style: normal;
  color: var(--dim);
  font-size: 0.82rem;
}

.label,
.num {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.jumps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jumps li {
  border-top: 1px solid var(--line);
}

.jumps a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.5rem;
  padding: 0.7rem 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--paper);
}

.jumps a .idx {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--burgundy);
  align-self: center;
}

.jumps a small {
  grid-column: 2;
  margin-top: 0.2rem;
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
}

.lock-note {
  margin: 1.15rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.lock-text::before {
  content: "Padlock shackle open · scroll to bottom to engage lock";
}

html.is-locked .lock-dot {
  background: var(--burgundy);
  box-shadow: 0 0 10px rgba(163, 50, 76, 0.9);
}

html.is-locked .lock-note {
  color: #d27a8e;
}

html.is-locked .lock-text::before {
  content: "Padlock engaged · perimeter secured";
}

/* Unlock finale (homepage): locked padlock, key turns, shackle pops open */
html.finale-unlock .lock-dot {
  background: var(--burgundy);
  box-shadow: 0 0 10px rgba(163, 50, 76, 0.9);
}

html.finale-unlock .lock-text::before {
  content: "Padlock locked · scroll to the bottom to turn the key";
}

html.is-granted .lock-dot {
  background: var(--signal);
  box-shadow: 0 0 12px rgba(157, 179, 216, 0.95);
}

html.is-granted .lock-note {
  color: var(--signal);
}

html.is-granted .lock-text::before {
  content: "Access granted · padlock open";
}

/* --------------------------------------------------------------------------
 * Subpage Elements (Service & Personal)
 * -------------------------------------------------------------------------- */
.event,
.interest {
  padding: 1rem 0 1.15rem;
  border-top: 1px solid var(--line);
}

.event:first-of-type,
.interest:first-of-type {
  border-top: none;
  padding-top: 0.25rem;
}

.event h2,
.interest h2 {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.2vw, 2.4rem);
  line-height: 1.02;
}

.meta {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.made {
  margin-top: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 210px));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.piece {
  margin: 0;
}

.piece-frame {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 0.85rem;
  text-align: center;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: rgba(196, 205, 220, 0.03);
  color: var(--muted);
  font-size: 0.88rem;
}

.piece figcaption {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.endnote {
  margin: 1.4rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
 * Footer
 * -------------------------------------------------------------------------- */
.foot {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.4rem 2.25rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 11, 14, 0.82) 0%, rgba(4, 5, 6, 0.9) 100%);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.foot a {
  text-decoration: none;
  color: var(--signal);
}

/* --------------------------------------------------------------------------
 * Responsive Breakpoints
 * -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .topbar {
    padding: 0.85rem 1.15rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .progress,
  .telemetry {
    display: none;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a {
    flex: none;
  }

  .panel {
    padding: 6rem 1.15rem 3.5rem;
    min-height: auto;
  }

  .panel-hero {
    min-height: 88vh;
  }

  .panel-inner {
    max-width: 100%;
    padding: 1.65rem 1.4rem;
  }

  .state-tag {
    right: 1rem;
    font-size: 0.6rem;
  }

  .scroll-cue {
    left: 1.25rem;
    bottom: 1.25rem;
  }

  .about,
  .timeline li,
  .find {
    grid-template-columns: 1fr;
  }

  .portrait {
    max-width: 180px;
  }
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.is-granted .find a,
  .state-tag.on .st-dot {
    animation: none;
  }
}

/* ------------------------------------------------------------------
   Memories: photo grid inside a panel + full-screen viewer
   ------------------------------------------------------------------ */
.memories {
  margin-top: 1.25rem;
}

.mem-count {
  margin-left: 0.5rem;
  color: var(--dim);
}

.mem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.mem-grid:has(.mem:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
}

.mem {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(196, 205, 220, 0.04);
  cursor: zoom-in;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.mem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) brightness(0.9);
  transition: filter 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mem:hover,
.mem:focus-visible {
  border-color: rgba(157, 179, 216, 0.6);
  box-shadow: 0 0 18px rgba(157, 179, 216, 0.18);
  outline: none;
}

.mem:hover img,
.mem:focus-visible img {
  filter: saturate(1) brightness(1);
  transform: scale(1.05);
}

.mem[hidden] {
  display: none;
}

.mem-more::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 8, 11, 0.62);
  backdrop-filter: blur(2px);
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--paper);
}

/* viewer */
html.lb-open,
html.lb-open body {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 4rem 1fr 4rem;
  grid-template-rows: auto 1fr;
  align-items: center;
  background: rgba(5, 6, 9, 0.9);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.lb-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lb-title {
  margin: 0;
  flex: 1;
  color: var(--signal);
}

.lb-count {
  margin: 0;
}

.lb-close,
.lb-nav {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(20, 23, 30, 0.8);
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lb-close:hover,
.lb-nav:hover,
.lb-close:focus-visible,
.lb-nav:focus-visible {
  border-color: rgba(157, 179, 216, 0.7);
  background: rgba(40, 46, 60, 0.9);
  outline: none;
}

.lb-nav {
  justify-self: center;
  grid-row: 2;
}

.lb-prev {
  grid-column: 1;
}

.lb-next {
  grid-column: 3;
}

.lb-figure {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0 0 1.5rem;
}

.lb-frame {
  min-height: 0;
  max-height: calc(100% - 3rem);
  display: flex;
}

.lb-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease;
}

.lightbox.loading .lb-frame img {
  opacity: 0.35;
}

.lb-cap {
  font-size: 0.95rem;
  color: var(--paper);
  text-align: center;
}

@media (max-width: 700px) {
  .lightbox {
    grid-template-columns: 0 1fr 0;
  }

  .lb-nav {
    position: fixed;
    bottom: 1.1rem;
  }

  .lb-prev {
    left: 1.1rem;
  }

  .lb-next {
    right: 1.1rem;
  }

  .lb-figure {
    padding-bottom: 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mem img,
  .lightbox,
  .lb-frame img {
    transition: none;
  }
}

/* ------------------------------------------------------------------
   Publications and talks
   ------------------------------------------------------------------ */
.pubs {
  list-style: none;
  margin: 1.1rem 0 1.4rem;
  padding: 0;
}

.pub {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0 0.9rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.pub:last-child {
  border-bottom: 1px solid var(--line);
}

.pub-year {
  padding-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.pub p {
  margin: 0;
}

.pub-title {
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--paper);
}

.pub-title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.pub-title a:hover,
.pub-title a:focus-visible {
  color: var(--signal);
  background-size: 100% 1px;
}

.pub-authors {
  margin-top: 0.3rem !important;
  font-size: 0.86rem;
  color: var(--muted);
}

.pub-authors strong {
  font-weight: 500;
  color: var(--paper);
}

.pub-venue {
  margin-top: 0.3rem !important;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--signal);
}

.pub-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(163, 50, 76, 0.55);
  color: #d98a9c;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .pub {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem !important;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pub-links a:hover,
.pub-links a:focus-visible {
  border-color: rgba(157, 179, 216, 0.7);
  color: var(--signal);
}

.pub-title a::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.8em;
  color: var(--dim);
  transition: color 0.2s ease, transform 0.2s ease;
}

.pub-title a:hover::after,
.pub-title a:focus-visible::after {
  color: var(--signal);
  transform: translate(1px, -1px);
}
