/* =========================================================
   Brandon Qiao: personal site
   1. Tokens & themes      4. Sections
   2. Base & utilities     5. Components
   3. Header & hero        6. Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --shell: 1180px;
  --radius: 16px;
  --radius-sm: 10px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .6s;

  /* dark theme (default) */
  --bg: #080b12;
  --bg-2: #0c111b;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --ink: #eef2f8;
  --ink-2: #b6c0d0;
  --ink-3: #8592a6;
  --accent: #5b9df9;
  --accent-2: #7fd1c8;
  --gold: #d9a961;
  --shadow: 0 30px 70px -40px rgba(0, 0, 0, .9);
  --grid-line: rgba(255, 255, 255, .045);
  --node: 91, 157, 249;
}

html[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-2: #ffffff;
  --surface: rgba(11, 20, 38, .028);
  --surface-2: rgba(11, 20, 38, .05);
  --line: rgba(11, 20, 38, .1);
  --line-strong: rgba(11, 20, 38, .2);
  --ink: #101725;
  --ink-2: #414d61;
  --ink-3: #64708a;
  --accent: #1c62d6;
  --accent-2: #167f78;
  --gold: #a2701d;
  --shadow: 0 26px 60px -38px rgba(16, 27, 48, .55);
  --grid-line: rgba(16, 27, 48, .05);
  --node: 28, 98, 214;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(3rem, 8.2vw, 5.6rem); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.85rem); }
h3 { font-size: 1.12rem; letter-spacing: -.012em; }
p { margin: 0; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.shell { width: min(100% - 2.6rem, var(--shell)); margin-inline: auto; }

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink); }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 200;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem;
  border-radius: 8px; font-size: .85rem; font-weight: 600; text-decoration: none;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* reveal-on-scroll. Two calibrations keep this from reading as mechanical:
   the fade runs longer than the movement, so opacity leads and the travel
   settles under it; and large blocks move a fraction of the distance small
   text does, because a big rectangle sliding a long way is what reads clunky. */
.reveal {
  --ease-soft: cubic-bezier(.2, .72, .26, 1);
  --rise: 20px;
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity .95s var(--ease-soft), transform .75s var(--ease-soft);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.is-past {
  opacity: 0;
  transform: translate3d(0, calc(var(--rise) * -.4), 0);
  transition-duration: .6s;
  transition-delay: 0s;   /* leaving is uniform; only arrivals stagger */
}

/* blocks with real surface area barely move: they fade, and drift a little */
.card.reveal, .metric.reveal, .award.reveal, .edu-card.reveal,
.contact-panel.reveal, .skill-row.reveal, .hero-figure.reveal { --rise: 9px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-past { opacity: 1; transform: none; filter: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- 3. Header ---------- */
.scroll-progress {
  position: fixed; inset: 0 auto auto 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 120; transition: width .1s linear;
}

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 1.15rem 0;
  transition: padding .35s var(--ease), background-color .35s var(--ease),
              border-color .35s var(--ease), backdrop-filter .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  padding: .6rem 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  letter-spacing: .04em; color: var(--accent);
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.brand:hover .brand-mark { transform: translateY(-2px); border-color: var(--accent); }
.brand-name {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -.01em;
}

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  position: relative; padding: .45rem .8rem; border-radius: 999px;
  font-size: .88rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 50%; bottom: .18rem; translate: -50% 0;
  width: 0; height: 2px; border-radius: 2px; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { width: 16px; }

.header-actions { display: flex; align-items: center; gap: .5rem; }

/* --- Signature element: the sunrise / sunset switch --- */
.sky-toggle {
  padding: 0; border: 1px solid var(--line-strong); background: none;
  border-radius: 999px; cursor: pointer; line-height: 0;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.sky-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

.sky {
  position: relative; display: block;
  width: 64px; height: 34px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(180deg, #060b1c 0%, #101c3d 62%, #1c2c56 100%);
  transition: background 1.1s var(--ease);
}
html[data-theme="light"] .sky {
  background: linear-gradient(180deg, #7ab6f0 0%, #bcdcf7 52%, #ffd9a4 100%);
}

/* sun and moon sit on opposite ends of a dial; rotating it swaps them */
.dial {
  position: absolute; left: 50%; top: 12px;
  width: 30px; height: 30px; margin-left: -15px;
  transform: rotate(0deg);
  transition: transform 1.1s cubic-bezier(.62, .04, .3, 1);
}
html[data-theme="light"] .dial { transform: rotate(180deg); }

.sun, .moon {
  position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%;
}
.sun {
  bottom: -7px;
  background: radial-gradient(circle at 34% 32%, #fff3cd 0%, #ffc861 46%, #ff9b34 100%);
  box-shadow: 0 0 12px 3px rgba(255, 176, 74, .55);
}
.moon {
  top: -7px;
  background: radial-gradient(circle at 36% 32%, #ffffff 0%, #dfe6f6 55%, #b9c5df 100%);
  box-shadow: 0 0 10px 2px rgba(197, 214, 255, .35);
}
/* keep both bodies upright while the dial turns */
.sun { transform: rotate(0deg); }
html[data-theme="light"] .sun { transform: rotate(-180deg); }
.moon { transform: rotate(0deg); }
html[data-theme="light"] .moon { transform: rotate(-180deg); }
.sun, .moon { transition: transform 1.1s cubic-bezier(.62, .04, .3, 1); }

.horizon {
  position: absolute; inset: auto 0 0 0; height: 9px;
  background: linear-gradient(180deg, rgba(6, 10, 22, .55), rgba(6, 10, 22, .95));
  border-top: 1px solid rgba(255, 255, 255, .12);
  transition: background 1.1s var(--ease), border-color 1.1s var(--ease);
}
html[data-theme="light"] .horizon {
  background: linear-gradient(180deg, rgba(126, 92, 46, .32), rgba(96, 66, 30, .55));
  border-top-color: rgba(255, 255, 255, .5);
}

.star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #fff; opacity: .85;
  transition: opacity .7s var(--ease);
}
.star.s1 { top: 8px; left: 12px; }
.star.s2 { top: 14px; left: 24px; width: 1.5px; height: 1.5px; opacity: .55; }
.star.s3 { top: 6px; right: 14px; width: 1.5px; height: 1.5px; opacity: .65; }
html[data-theme="light"] .star { opacity: 0; }

/* a brief wash of sky color across the page as the sun crosses the horizon */
.sky-wash {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 176, 74, .34), rgba(255, 122, 89, .12) 45%, transparent 78%);
}
.sky-wash.is-rising { animation: wash 1.15s var(--ease); }
.sky-wash.is-setting {
  animation: wash 1.15s var(--ease);
  background: linear-gradient(180deg, rgba(58, 74, 148, .4), rgba(20, 26, 58, .18) 48%, transparent 80%);
}
@keyframes wash {
  0% { opacity: 0; }
  32% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .dial, .sun, .moon, .horizon { transition: none; }
  .sky-wash.is-rising, .sky-wash.is-setting { animation: none; }
}

.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; padding: 11px 10px;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 1.6px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(8rem, 15vh, 11rem) 0 clamp(4rem, 8vh, 6rem); overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.hero-glow {
  position: absolute; top: -18%; right: -12%; width: 60vw; height: 60vw; max-width: 780px; max-height: 780px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 66%);
  filter: blur(30px); pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-size: .73rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 1.5rem;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent); animation: pulse 2.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 { margin-bottom: 1.2rem; }
.hero-role {
  font-family: var(--font-display); font-size: clamp(1.02rem, 1.7vw, 1.25rem); font-weight: 500;
  color: var(--accent); margin-bottom: 1.4rem; letter-spacing: -.01em;
}
.hero-lede { max-width: 46ch; color: var(--ink-2); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.1rem; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem;
  margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.hero-meta li { font-size: .9rem; color: var(--ink-2); }
.hero-meta span {
  display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem;
}

.hero-figure { position: relative; margin: 0; justify-self: end; width: min(100%, 440px); }
.figure-frame {
  position: relative; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--bg-2); box-shadow: var(--shadow);
  transform: translateZ(0);
}
.figure-frame img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
  transition: transform .9s var(--ease);
}
.hero-figure:hover .figure-frame img { transform: scale(1.03); }
.figure-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, color-mix(in srgb, var(--bg) 72%, transparent) 100%);
}
.figure-accent {
  position: absolute; inset: auto -14px -14px auto; width: 62%; height: 62%; z-index: -1;
  border-radius: 22px;
  background-image: radial-gradient(circle at 1px 1px, var(--line-strong) 1px, transparent 0);
  background-size: 13px 13px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .78rem 1.3rem; border-radius: 12px;
  font-family: var(--font-body); font-size: .9rem; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), background-color .25s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--accent) 85%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn-primary svg { transition: transform .3s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--accent); color: var(--ink); }

/* ---------- 4. Sections ---------- */
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.section-head {
  max-width: 62ch; margin: 0 auto clamp(2.5rem, 5vw, 3.8rem);
  text-align: center;
}
.section-kicker {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .95rem;
}
.section-head h2 { margin-bottom: 1.1rem; }
.section-lede { color: var(--ink-2); font-size: 1.02rem; }

/* metrics */
.metrics { padding: 0 0 clamp(3rem, 6vw, 4.5rem); position: relative; }
/* Dividers live on the cells, not as a background showing through 1px gaps:
   the cells start transparent while revealing, and a background-gap grid
   renders as one solid grey block until they fade in. */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.metric {
  padding: 1.7rem 1.5rem; border-left: 1px solid var(--line);
  transition: background-color .3s var(--ease);
}
.metric:first-child { border-left: 0; }
.metric:hover { background: var(--surface); }
/* Solid colour, not gradient-clipped text: the reveal's filter creates a
   compositing layer that breaks background-clip on some engines, which showed
   up as flat grey numbers until the next repaint. */
.metric-value {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.03em; line-height: 1;
  color: var(--ink);
  margin-bottom: .6rem;
  font-variant-numeric: tabular-nums;
}
.metric:hover .metric-value { color: var(--accent); transition: color .3s var(--ease); }
.metric-label { font-size: .84rem; color: var(--ink-3); line-height: 1.45; display: block; }

/* practice cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card {
  position: relative; padding: 1.9rem 1.7rem 1.7rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s var(--ease), background-color .4s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .4s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card-icon {
  width: 42px; height: 42px; padding: 10px; margin-bottom: 1.3rem;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.card h3 { margin-bottom: .8rem; }
.card p { color: var(--ink-2); font-size: .95rem; }
.card-list { margin-top: 1.3rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); display: grid; gap: .55rem; }
.card-list li {
  position: relative; padding-left: 1.15rem;
  font-family: var(--font-mono); font-size: .76rem; color: var(--ink-3); line-height: 1.5;
}
.card-list li::before {
  content: ""; position: absolute; left: 0; top: .48em;
  width: 5px; height: 5px; border-radius: 1px; background: var(--accent-2); rotate: 45deg;
}

/* timeline: markers grow toward the present, so seniority reads up the page */
.timeline { position: relative; display: grid; gap: 2.4rem; padding-left: 2.1rem; }

.tl-spine {
  position: absolute; left: 6px; top: .6rem; bottom: .6rem; width: 2px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
/* a light that falls down the line as you read, rather than a bar filling up */
.tl-spine i {
  position: absolute; left: 0; right: 0; height: 92px; border-radius: 2px;
  top: 0; transform: translate3d(0, var(--tl-drop, 0px), 0);
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--accent) 45%, transparent) 40%,
    var(--accent) 82%,
    var(--accent-2) 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.tl-item { position: relative; }
.tl-marker {
  position: absolute; left: calc(-2.1rem + 7px); top: .55rem; translate: -50% 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
  transition: border-color .6s var(--ease), box-shadow .6s var(--ease),
              width .6s var(--ease), height .6s var(--ease);
}
.section-alt .tl-marker { background: var(--bg-2); }
.tl-item[data-level="2"] .tl-marker { width: 10px; height: 10px; }
.tl-item[data-level="3"] .tl-marker { width: 11px; height: 11px; }
.tl-item[data-level="4"] .tl-marker { width: 13px; height: 13px; }
.tl-item[data-level="5"] .tl-marker { width: 15px; height: 15px; }
.tl-item.is-visible .tl-marker { border-color: var(--accent); }
.tl-item[data-level="5"].is-visible .tl-marker {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent);
}
.tl-item[data-level="4"].is-visible .tl-marker {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.tl-period {
  font-family: var(--font-mono); font-size: .71rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: .45rem;
}
.tl-body h3 { font-size: 1.22rem; margin-bottom: .3rem; }
.tl-org { font-size: .88rem; color: var(--accent); margin-bottom: .95rem; font-weight: 500; }
.tl-body ul { display: grid; gap: .5rem; max-width: 76ch; }
.tl-body ul li {
  position: relative; padding-left: 1.25rem; font-size: .95rem; color: var(--ink-2);
}
.tl-body ul li::before {
  content: ""; position: absolute; left: .1rem; top: .68em; width: 8px; height: 1px; background: var(--line-strong);
}

/* skills: a spec sheet, not a bag of pills. Label on the left, the list
   itself set as text, hairlines carrying the structure. */
.skills { border-top: 1px solid var(--line); }
.skill-row {
  display: grid; grid-template-columns: minmax(0, 15rem) 1fr;
  gap: 1rem clamp(1.5rem, 4vw, 3.5rem);
  padding: 1.5rem .25rem;
  border-bottom: 1px solid var(--line);
  transition: background-color .4s var(--ease);
}
.skill-row:hover { background: var(--surface); }
.skill-row dt {
  font-family: var(--font-mono); font-size: .72rem; line-height: 1.6;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  padding-top: .3rem; transition: color .4s var(--ease);
}
.skill-row:hover dt { color: var(--accent); }
.skill-row dd {
  margin: 0; display: flex; flex-wrap: wrap;
  column-gap: 0; row-gap: .45rem;
}
.skill-row dd span {
  font-size: 1.02rem; color: var(--ink-2);
  transition: color .3s var(--ease);
}
/* separators drawn between items rather than boxes around them */
.skill-row dd span + span::before {
  content: "\00B7"; color: var(--ink-3); opacity: .55; margin: 0 .75rem;
}
.skill-row dd span:hover { color: var(--ink); }

/* recognition */
/* awards run as a row of three; education spans the full width beneath them */
.awards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem;
  margin-bottom: 1.4rem;
}
.award {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 1.7rem 1.6rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .45s var(--ease), border-color .45s var(--ease), background-color .45s var(--ease);
}
.award:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--surface-2); }
.award-year {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  color: var(--gold); margin: 1.1rem 0 .55rem;
}
.award h3 { font-size: 1.06rem; margin-bottom: .3rem; }
.award-org {
  font-size: .84rem; color: var(--accent); font-weight: 500; margin-bottom: .8rem;
}
.award-note { font-size: .88rem; color: var(--ink-3); }

/* the trophy lifts onto its base, then catches the light */
.trophy { display: block; width: 28px; height: 28px; position: relative; color: var(--gold); }
.trophy svg {
  stroke-width: 1.5;
  transform: translateY(9px) scale(.62); opacity: 0;
  transition: transform .8s cubic-bezier(.3, 1.5, .55, 1), opacity .5s var(--ease);
}
.award.is-visible .trophy svg { transform: none; opacity: 1; }
.trophy::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3.6h8v4.6a4 4 0 0 1-8 0Z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3.6h8v4.6a4 4 0 0 1-8 0Z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
}
.award.is-visible .trophy::after { animation: gleam 1.5s var(--ease) .55s; }
.award:hover .trophy::after { animation: gleam 1.1s var(--ease); }
@keyframes gleam {
  0% { opacity: 0; transform: translateX(-90%); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: translateX(90%); }
}

/* the certificate opens like a book */
.book {
  display: block; position: relative; width: 30px; height: 22px;
  perspective: 340px;
}
/* both panels stack on the right half; the cover is hinged at the spine
   and swings left, so the closed book opens into a two-page spread */
.book-leaf, .book-cover {
  position: absolute; top: 0; left: 50%; height: 100%; width: 50%;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-left-width: 0; border-radius: 0 3px 3px 0;
}
.book-leaf { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.book-leaf::before {
  content: ""; position: absolute; inset: 4px 3px auto 2px; height: 1px;
  background: color-mix(in srgb, var(--gold) 48%, transparent);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--gold) 34%, transparent),
              0 8px 0 color-mix(in srgb, var(--gold) 22%, transparent);
}
.book-cover {
  background: color-mix(in srgb, var(--gold) 34%, transparent);
  transform-origin: left center; transform: rotateY(0deg);
  transition: transform 1.15s cubic-bezier(.5, .05, .25, 1);
}
.award-cert.is-visible .book-cover { transform: rotateY(-162deg); }
.award-cert:hover .book-cover { transform: rotateY(-176deg); }
/* the spine */
.book::after {
  content: ""; position: absolute; left: 50%; top: 1px; bottom: 1px; width: 1px;
  background: color-mix(in srgb, var(--gold) 60%, transparent);
}

/* education spans the full width beneath the awards */
.edu-card {
  display: grid; grid-template-columns: minmax(0, 42%) 1fr;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.edu-photo { width: 100%; height: 100%; min-height: 320px; object-fit: cover; object-position: 50% 22%; }
.edu-body { padding: clamp(1.6rem, 3vw, 2.6rem); align-self: center; }
.edu-kicker {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .7rem;
}
.edu-card h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin-bottom: .6rem; }
.edu-degree { font-size: .95rem; color: var(--ink-2); margin-bottom: 1.2rem; }
.edu-honors { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.3rem; }
.edu-honors li {
  padding: .32rem .75rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  color: var(--gold); font-family: var(--font-mono); font-size: .7rem;
}
.edu-note {
  font-size: .92rem; color: var(--ink-3); font-style: italic;
  padding-top: 1.2rem; border-top: 1px dashed var(--line); max-width: 52ch;
}

/* contact */
.contact-panel {
  text-align: center;
  padding: clamp(2.4rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--line); border-radius: 22px;
  background:
    radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 58%),
    var(--surface);
  box-shadow: var(--shadow);
}
.contact-panel .section-kicker { margin-bottom: 1rem; }
.contact-panel h2 { margin-bottom: 1.1rem; }
.contact-lede { color: var(--ink-2); max-width: 54ch; margin-inline: auto; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2.2rem; }
.contact-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem 3rem;
  margin: 2.4rem auto 0; padding-top: 1.6rem; max-width: 34rem;
  border-top: 1px solid var(--line);
}
.contact-meta li { font-size: .92rem; color: var(--ink-2); }
.contact-meta span {
  display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem;
}
.contact-meta a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .25s var(--ease); }
.contact-meta a:hover { border-bottom-color: var(--accent); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.4rem; background: var(--bg-2); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { font-size: .84rem; color: var(--ink-3); }
.to-top {
  width: 36px; height: 36px; padding: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3);
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.to-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- 6. Responsive ---------- */
@media (max-width: 1040px) {
  .cards { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .awards { grid-template-columns: 1fr; }
  .edu-card { grid-template-columns: 1fr; }
  .edu-photo { min-height: 260px; max-height: 340px; }
}

@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 0 0 auto 0; z-index: -1;
    flex-direction: column; align-items: stretch; gap: .2rem;
    padding: 5.4rem 1.6rem 1.6rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-102%); opacity: 0; pointer-events: none;
    transition: transform .45s var(--ease), opacity .3s var(--ease);
  }
  .nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: .8rem .6rem; font-size: 1rem; border-radius: 10px; }
  .nav a::after { display: none; }
  .nav-toggle { display: flex; }

  .hero { padding-top: 7.5rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-figure { justify-self: start; order: -1; width: min(78%, 340px); }
  .hero-lede { max-width: none; }
  .skill-row { grid-template-columns: 1fr; gap: .6rem; }
  .skill-row dt br { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { width: calc(100% - 2rem); }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric { border-left: 0; }
  .metric + .metric { border-top: 1px solid var(--line); }
  .hero-meta { gap: 1.2rem 1.8rem; }
  .to-top { margin-left: auto; }
}

@media print {
  .site-header, .scroll-progress, .hero-canvas, .hero-glow, .to-top { display: none; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
