/* ============================================================
   BLUE MERIDIAN — one page per panel
   ------------------------------------------------------------
   Tokens + fonts: blue-meridian.css. The fixed seam is the only glow.
   ============================================================ */

/* Home-only layout; tokens and fonts live in blue-meridian.css. */

/* ============================================================
   Base
   ============================================================ */

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

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 28% 18%, #0b1e34 0%, #07111f 52%, #040a12 100%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

::selection {
  background: var(--halo-blue);
  color: var(--bg-deep);
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg-deep);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ============================================================
   The meridian — the only light on the page
   ============================================================ */

.meridian {
  position: fixed;
  top: 10vh;
  left: var(--seam-left);
  z-index: 0;
  width: 1px;
  height: 90vh;
  pointer-events: none;
}

/* Bottom-nav jumps put the light away for the whole trip, so it does not
   hang motionless on screen while the panels pass underneath. */
.meridian.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.meridian__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(300px, 32vw, 520px);
  height: min(96vh, 1040px);
  transform: translate(-50%, -50%);
  background:
    radial-gradient(
      ellipse 26% 34% at center,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(234, 244, 255, 0.32) 38%,
      transparent 72%
    ),
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.54) 0%,
      rgba(191, 227, 255, 0.4) 16%,
      rgba(111, 182, 255, 0.22) 38%,
      transparent 70%
    );
  filter: blur(38px);
}

.meridian__line {
  position: absolute;
  inset: 0;
  top: calc(var(--header-h) - 10vh);
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(191, 227, 255, 0.26) 0%,
    rgba(191, 227, 255, 0.34) 10%,
    rgba(191, 227, 255, 0.48) 20%,
    rgba(222, 240, 255, 0.78) 34%,
    var(--halo-white) 44%,
    var(--halo-white) 50%,
    var(--halo-white) 56%,
    rgba(222, 240, 255, 0.78) 66%,
    rgba(191, 227, 255, 0.48) 80%,
    rgba(191, 227, 255, 0.34) 90%,
    rgba(191, 227, 255, 0.26) 100%
  );
  transform-origin: top;
}

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--header-h);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: rgba(6, 14, 26, 0.96);
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}

.brand,
.topbar__links {
  pointer-events: auto;
}


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

.brand__mark {
  width: 14px;
  height: 24px;
  flex: 0 0 auto;
}

.brand__mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand__name {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar__links {
  display: flex;
  align-items: center;
  gap: 1.65rem;
}

.topbar__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding-block: 0.3rem;
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.topbar__links a::after {
  content: "";
  position: absolute;
  inset: auto 0 -0.05rem;
  height: 1px;
  background: linear-gradient(90deg, var(--halo-white), var(--signal));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.topbar__link--out svg {
  width: 10px;
  height: 10px;
  opacity: 0.7;
}

.topbar__links a:hover,
.topbar__links a.is-active {
  color: var(--ink);
}

.topbar__links a:hover::after,
.topbar__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (max-width: 1219.98px) {
  :root {
    --header-h: 58px;
  }

  .topbar__links {
    gap: 1.05rem;
  }

  .topbar__links a.topbar__link--out {
    display: none;
  }
}

/* ============================================================
   Deck
   ============================================================ */

.deck {
  position: relative;
  z-index: 1;
  height: 100svh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

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

.panel {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 28px) 0 calc(var(--nav-h) + 28px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.panel__inner {
  width: min(var(--content-w), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.6rem, 4vw, 4.5rem);
  align-items: center;
  transform: translateX(var(--content-shift));
}

.panel__copy {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

@media (min-width: 981px) {
  .panel__copy {
    transform: translateX(clamp(14px, 1.4vw, 22px));
  }
}

.panel__object {
  width: 100%;
  max-width: 480px;
  min-width: 0;
  justify-self: end;
  grid-column: 2;
  grid-row: 1;
}

.panel__object--end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.4rem;
  text-align: right;
}

/* ============================================================
   Type
   ============================================================ */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.6rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--signal);
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.65;
}

.display {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: clamp(2.8rem, 4.8vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.display--xl {
  max-width: 9ch;
  font-size: 3.75rem;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.thesis {
  max-width: 32ch;
  margin: 1.6rem 0 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: clamp(1.28rem, 1.7vw, 1.6rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.thesis em {
  font-style: italic;
  color: var(--halo-blue);
}

.body-copy {
  max-width: 36ch;
  margin: 1.5rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--mist);
}

.meta-line {
  margin: 1.8rem 0 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 2;
  letter-spacing: 0.05em;
  color: var(--mist);
}

.text-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.7rem;
  margin-top: 2.4rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    text-shadow 0.3s var(--ease);
}

.text-link span {
  transition: transform 0.3s var(--ease);
}

.text-link:hover {
  color: var(--signal);
  border-color: var(--signal);
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.50);
}

.text-link:hover span {
  transform: translateX(3px);
}

.contact-handle {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.8rem;
}

/* ============================================================
   Portrait — always in colour
   ============================================================ */

.portrait {
  justify-self: end;
  grid-column: 2;
  grid-row: 1;
  width: min(420px, 100%, 46vh);
  margin: 0;
}

.portrait__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(234, 244, 255, 0.22);
  background: #0a1828 url("../assets/img/portrait.jpg") center / cover no-repeat;
  box-shadow:
    0 0 12px rgba(243, 247, 255, 0.36),
    0 0 34px rgba(191, 227, 255, 0.16),
    0 40px 90px -54px rgba(0, 0, 0, 0.95);
  transition:
    border-color 0.35s var(--ease),
    box-shadow 0.5s var(--ease);
}

.portrait:hover .portrait__frame {
  border-color: rgba(234, 244, 255, 0.4);
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.46),
    0 0 46px rgba(191, 227, 255, 0.22),
    0 40px 90px -54px rgba(0, 0, 0, 0.95);
}

.portrait__frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

.portrait:hover .portrait__frame img {
  transform: scale(1.025);
}

.portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mist);
}

/* ============================================================
   Objects
   ============================================================ */

.thread-list,
.index-list,
.timeline,
.award-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-list {
  border-top: 1px solid var(--line);
}

.thread {
  position: relative;
  isolation: isolate;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.35s var(--ease);
}

.thread::before {
  content: "";
  position: absolute;
  inset: 0.25rem -1rem;
  z-index: -1;
  border-radius: 6px;
  background: radial-gradient(
    ellipse 55% 120% at 12% 45%,
    rgba(255, 255, 255, 0.16),
    transparent 72%
  );
  box-shadow: 0 0 38px rgba(255, 255, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.thread:hover {
  border-color: rgba(243, 247, 255, 0.34);
}

.thread:hover::before {
  opacity: 1;
}

.thread h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: text-shadow 0.35s var(--ease);
}

.thread:hover h3 {
  text-shadow: 0 0 26px rgba(255, 255, 255, 0.30);
}

.thread p {
  max-width: 32ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--mist);
}

/* Course notes */
.index-list {
  border-top: 1px solid var(--line);
}

.index-list li {
  border-bottom: 1px solid var(--line);
}

.index-list a {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  color: var(--ink);
  text-decoration: none;
}

.index-list a::before {
  content: "";
  position: absolute;
  inset: 0.05rem -1.25rem;
  z-index: -1;
  border-radius: 8px;
  background: radial-gradient(
    ellipse 62% 130% at 28% 50%,
    rgba(255, 255, 255, 0.20),
    rgba(255, 255, 255, 0.07) 46%,
    transparent 76%
  );
  box-shadow: 0 0 38px rgba(255, 255, 255, 0.16);
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(0, 0, 0, 0.7) 14%,
    #000 30%,
    #000 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(0, 0, 0, 0.7) 14%,
    #000 30%,
    #000 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.index-list a:hover::before {
  opacity: 1;
}

.index-list__name {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  transition: color 0.25s var(--ease), text-shadow 0.35s var(--ease);
}

.index-list__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--mist);
  transition: color 0.25s var(--ease);
}

.index-list .arrow {
  color: var(--signal);
  transition:
    transform 0.3s var(--ease),
    filter 0.3s var(--ease);
}

.index-list a:hover .index-list__name {
  color: var(--signal);
  text-shadow: 0 0 26px rgba(255, 255, 255, 0.45);
}

.index-list a:hover .index-list__meta {
  color: var(--ink);
}

.index-list a:hover .arrow {
  transform: translateX(4px);
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.82));
}

/* Timeline */
.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 1px;
  background: var(--line-strong);
}

.timeline__item {
  --timeline-pad-y: 0.65rem;
  position: relative;
  padding: var(--timeline-pad-y) 0 var(--timeline-pad-y) 1.6rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  transition:
    background-color 0.35s var(--ease),
    box-shadow 0.4s var(--ease);
}

.timeline__item:hover {
  background-color: rgba(255, 255, 255, 0.035);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 34px rgba(255, 255, 255, 0.14),
    0 0 64px rgba(255, 255, 255, 0.06);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--timeline-pad-y) + 0.5rem);
  z-index: 2;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    background-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.timeline__item::after {
  content: "";
  position: absolute;
  left: 3px;
  top: calc(var(--timeline-pad-y) + 0.85rem);
  bottom: 0.2rem;
  z-index: 1;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(191, 227, 255, 0.28) 55%,
    transparent 100%
  );
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.58),
    0 0 30px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
  transition:
    transform 0.5s var(--ease-out),
    opacity 0.3s var(--ease);
}

.timeline__item:hover::before {
  border-color: var(--halo-white);
  background: var(--halo-white);
  transform: scale(1.4);
  box-shadow:
    0 0 12px 2px rgba(255, 255, 255, 0.70),
    0 0 32px 7px rgba(255, 255, 255, 0.22);
}

.timeline__item:hover::after {
  opacity: 1;
  transform: scaleY(1);
}

.timeline__item h3,
.timeline__item .timeline__when {
  transition: text-shadow 0.35s var(--ease);
}

.timeline__item:hover h3,
.timeline__item:hover .timeline__when {
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.34);
}

.timeline--education .timeline__item {
  --timeline-right-room: 1.5rem;
  padding-right: var(--timeline-right-room);
  margin-right: calc(-1 * var(--timeline-right-room));
}

.timeline--education .timeline__item:hover .timeline__logo {
  opacity: 1;
  filter:
    drop-shadow(0 0 12px rgba(243, 247, 255, 0.65))
    drop-shadow(0 0 28px rgba(255, 255, 255, 0.22));
}

.timeline__item:first-child::before {
  border-color: var(--halo-blue);
  background: var(--halo-blue);
}

.timeline__when {
  margin: 0 0 0.32rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}

.timeline__when--now {
  color: var(--halo-blue);
}

.timeline h3 {
  margin: 0 0 0.22rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.timeline p {
  max-width: 48ch;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--mist);
}

.timeline p a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.timeline p a:hover {
  color: var(--signal);
  border-color: var(--signal);
}

.timeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.32rem;
}

.timeline__head .timeline__when {
  margin: 0;
}

.timeline__logo {
  flex: 0 0 auto;
  width: auto;
  height: 34px;
  max-width: 182px;
  object-fit: contain;
  opacity: 0.8;
  transition:
    opacity 0.3s var(--ease),
    filter 0.3s var(--ease);
}

.timeline__logo--wide {
  height: 31px;
  max-width: 205px;
}

/* ZJU and NJU marks share the same rendered width. */
.timeline__logo--equal {
  width: 123px;
  height: auto;
}

.timeline__logo:hover {
  opacity: 1;
  filter:
    drop-shadow(0 0 8px rgba(243, 247, 255, 0.4))
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
}

/* Awards */
.award-group {
  margin-bottom: 1.25rem;
}

.award-group:last-of-type {
  margin-bottom: 0;
}

.group-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.award-list li {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--mist);
  transition:
    background-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.award-list li:hover {
  background-color: rgba(255, 255, 255, 0.009);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.032);
}

.award-list li::before {
  content: "";
  position: absolute;
  inset: 0.02rem -0.85rem;
  z-index: -1;
  border-radius: 4px;
  background:
    radial-gradient(
      ellipse 72% 150% at 25% 50%,
      rgba(255, 255, 255, 0.18),
      rgba(255, 255, 255, 0.05) 55%,
      transparent 80%
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 88%);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.12);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24%, #000 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.award-list li:hover::before {
  opacity: 1;
}

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

.award-year {
  padding-top: 0.08rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--signal);
}

.award-list strong {
  font-weight: 500;
  color: var(--ink);
}

.also {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--mist);
}

/* Work */
.project {
  position: relative;
  isolation: isolate;
  padding: 0 0 1.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.35s var(--ease);
}

.project::before {
  content: "";
  position: absolute;
  inset: -0.75rem -1rem;
  z-index: -1;
  border-radius: 6px;
  background: radial-gradient(
    ellipse 55% 110% at 10% 45%,
    rgba(255, 255, 255, 0.16),
    transparent 72%
  );
  box-shadow: 0 0 38px rgba(255, 255, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.project:hover {
  border-color: rgba(243, 247, 255, 0.34);
}

.project:hover::before {
  opacity: 1;
}

.project:last-child {
  margin-bottom: 0;
}

.panel__object p a {
  transition: color 0.25s var(--ease), text-shadow 0.3s var(--ease);
}

.panel__object p a:hover {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.50);
}

.project__tag {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

.project h3 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.9rem, 2.8vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.project p {
  max-width: 38ch;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--mist);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 0.9rem;
}

.project__links a {
  padding-bottom: 0.12rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition:
    color 0.25s var(--ease),
    text-shadow 0.3s var(--ease);
}

.project__links a:hover {
  color: var(--signal);
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.50);
}

/* Contact */
.email,
.contact-handle {
  position: relative;
  isolation: isolate;
}

.email::before,
.contact-handle::before {
  content: "";
  position: absolute;
  inset: -1rem -1.6rem;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 58% 95% at 50% 50%,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.06) 52%,
    transparent 74%
  );
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.email:hover::before,
.contact-handle:hover::before {
  opacity: 1;
}

.email {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.35rem;
  overflow-wrap: anywhere;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    text-shadow 0.3s var(--ease);
}

.email:hover {
  color: var(--signal);
  border-color: var(--signal);
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.50),
    0 0 32px rgba(255, 255, 255, 0.30),
    0 0 70px rgba(191, 227, 255, 0.20);
}

.contact-handle:hover {
  border-color: var(--signal);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.58),
    0 0 26px rgba(255, 255, 255, 0.38),
    0 0 54px rgba(191, 227, 255, 0.22);
}

/* ============================================================
   Bottom navigation
   ============================================================ */

.deck-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  height: var(--nav-h);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 0;
  pointer-events: none;
}

.deck-nav__dots {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: auto;
}

.deck-nav__dots a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 28px;
}

.deck-nav__dots a::before {
  content: "";
  display: block;
  width: 4px;
  height: 2px;
  background: var(--mist);
  opacity: 0.45;
  transition:
    width 0.35s var(--ease),
    opacity 0.35s var(--ease),
    background-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.deck-nav__dots a::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translate(-50%, 4px);
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.deck-nav__dots a:hover::before,
.deck-nav__dots a:focus-visible::before {
  width: 14px;
  background: var(--halo-blue);
  opacity: 1;
  box-shadow: 0 0 10px rgba(191, 227, 255, 0.5);
}

.deck-nav__dots a:hover::after,
.deck-nav__dots a:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.deck-nav__dots a.is-active::before {
  width: 24px;
  background: var(--halo-white);
  opacity: 1;
  box-shadow:
    0 0 12px 2px rgba(214, 236, 255, 0.72),
    0 0 34px 8px rgba(111, 182, 255, 0.36);
}


/* ============================================================
   Panel reveals
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  /* Matches the seam's entrance: 1.5s on the Index, 1s elsewhere. */
  transition:
    opacity 1.5s var(--ease-out),
    transform 1.5s var(--ease-out);
}

/* Non-Index destinations replay the light at 1.5×; their copy settles
   over the same shortened entrance. */
.deck.is-fast .reveal {
  transition-duration: 1s;
}

.js .panel.is-active .reveal {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 75ms + 80ms);
}


@keyframes seamGrow {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes haloIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes breathe {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0.82;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .meridian__line {
    animation: seamGrow 1.5s var(--ease-out) both;
  }

  .meridian__halo {
    animation:
      haloIn 1.8s ease 0.2s both,
      breathe 11s ease-in-out 2s infinite alternate;
  }

  /* Panel-to-panel replays run the entrance at 1.5×. Only seamGrow/haloIn are
     shortened; the ambient breathe cycle keeps its own timing. */
  .meridian.is-fast .meridian__line {
    animation-duration: 1s;
  }

  .meridian.is-fast .meridian__halo {
    animation-duration: 1.2s, 11s;
    animation-delay: 0.13s, 2s;
  }

  /* Applied for one style flush by home.js; clearing it restarts both
     entrance keyframes from frame zero. */
  .meridian.is-replaying .meridian__line,
  .meridian.is-replaying .meridian__halo {
    animation: none;
  }

  .topbar,
  .deck-nav {
    animation: fadeIn 0.9s ease 0.1s both;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 980px) {
  :root {
    --header-h: 58px;
    --nav-h: 60px;
    --content-shift: 12px;
  }

  .topbar__links {
    gap: 1.2rem;
  }

  .brand__name {
    font-size: 0.98rem;
  }

  .panel {
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: calc(var(--nav-h) + 2rem);
  }

  .panel__inner {
    grid-template-columns: 1fr;
    gap: 2.6rem;
    align-content: center;
    min-height: calc(100svh - var(--header-h) - var(--nav-h) - 4rem);
  }

  .panel__copy,
  .panel__object,
  .portrait {
    grid-column: auto;
    grid-row: auto;
  }

  .panel__object {
    max-width: 100%;
    justify-self: start;
  }

  .display--xl {
    max-width: none;
    font-size: clamp(1.92rem, 6.69vw, 3.26rem);
  }

  .portrait {
    justify-self: end;
    width: min(320px, 68vw, 42vh);
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 22px;
    --seam-left: 12px;
  }

  .topbar__links a {
    font-size: 0.54rem;
    letter-spacing: 0.06em;
  }

  .brand__name {
    font-size: 0.94rem;
  }

  .panel {
    padding-top: calc(var(--header-h) + 1.6rem);
    padding-bottom: calc(var(--nav-h) + 1.6rem);
  }

  .panel__inner {
    gap: 2rem;
    min-height: calc(100svh - var(--header-h) - var(--nav-h) - 3.2rem);
  }

  .eyebrow {
    margin-bottom: 1.1rem;
    font-size: 0.54rem;
  }

  .display {
    font-size: 2.5rem;
  }

  .display--xl {
    font-size: clamp(1.79rem, 8.76vw, 2.53rem);
  }

  .thesis {
    margin-top: 1.2rem;
    font-size: 1.14rem;
  }

  .body-copy {
    margin-top: 1.1rem;
    font-size: 0.92rem;
  }

  .meta-line {
    margin-top: 1.2rem;
    font-size: 0.56rem;
    line-height: 1.9;
  }

  .text-links {
    margin-top: 1.6rem;
    gap: 1.3rem;
  }

  .portrait {
    width: min(280px, 68vw, 40vh);
  }

  .index-list__name {
    min-width: 0;
  }

  .portrait figcaption {
    font-size: 0.54rem;
  }

  .thread {
    padding: 1.15rem 0;
  }

  .thread h3 {
    font-size: 1.45rem;
  }

  .thread p {
    font-size: 0.88rem;
  }

  .index-list a {
    gap: 1rem;
    padding: 0.82rem 0;
  }

  .index-list__name {
    font-size: 1.08rem;
  }

  .index-list__meta {
    font-size: 0.54rem;
    gap: 0.45rem;
  }

  .timeline__item {
    --timeline-pad-y: 0.55rem;
    margin-bottom: 0.2rem;
  }

  .timeline--education .timeline__item {
    --timeline-right-room: 0.75rem;
  }

  .timeline__when {
    font-size: 0.56rem;
  }

  .timeline h3 {
    font-size: 1.08rem;
  }

  .timeline p {
    font-size: 0.84rem;
  }

  .timeline__head {
    gap: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .timeline__logo {
    height: 26px;
    max-width: 130px;
  }

  .timeline__logo--wide {
    height: 24px;
    max-width: 160px;
  }

  .timeline__logo--equal {
    width: 94px;
    height: auto;
  }

  .award-group {
    margin-bottom: 1rem;
  }

  .award-list li {
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.6rem;
    padding: 0.45rem 0;
    font-size: 0.8rem;
  }

  .award-year {
    font-size: 0.54rem;
  }

  .also {
    font-size: 0.74rem;
  }

  .project {
    padding-bottom: 1.1rem;
    margin-bottom: 1.1rem;
  }

  .project h3 {
    font-size: 1.8rem;
  }

  .project p {
    font-size: 0.86rem;
  }

  .project__links {
    margin-top: 0.75rem;
  }

  .email {
    font-size: 1.2rem;
  }

  .contact-handle {
    font-size: 0.72rem;
  }

  .deck-nav__dots {
    gap: 0.35rem;
  }

  .deck-nav__dots a {
    width: 18px;
  }

  .deck-nav__dots a::before {
    width: 3px;
  }

  .deck-nav__dots a.is-active::before {
    width: 17px;
  }
}

@media (max-height: 740px) and (max-width: 980px) {
  .panel {
    padding-top: calc(var(--header-h) + 1rem);
    padding-bottom: calc(var(--nav-h) + 1rem);
  }

  .panel__inner {
    gap: 1.2rem;
    min-height: calc(100svh - var(--header-h) - var(--nav-h) - 2rem);
  }

  .portrait {
    width: min(220px, 54vw, 30vh);
  }

  .display--xl {
    font-size: clamp(1.52rem, 7vw, 2.1rem);
  }

  .thesis {
    margin-top: 1rem;
    font-size: 1rem;
  }

  .eyebrow {
    margin-bottom: 1rem;
  }

  .meta-line {
    margin-top: 1rem;
  }

  .text-links {
    margin-top: 1.2rem;
  }
}

@media (max-height: 720px) and (min-width: 981px) {
  .panel {
    padding-top: calc(var(--header-h) + 14px);
    padding-bottom: calc(var(--nav-h) + 14px);
  }

  .display--xl {
    font-size: clamp(1.89rem, 3.5vw, 3.04rem);
  }

  .thesis {
    margin-top: 1.1rem;
    font-size: 1.1rem;
  }

  .meta-line {
    margin-top: 1.2rem;
  }

  .text-links {
    margin-top: 1.6rem;
  }

  .portrait {
    width: min(360px, 42vh);
  }
}

/* ============================================================
   Reduced motion + no-JS
   ============================================================ */

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

  .deck {
    scroll-snap-type: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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


  .meridian__halo {
    opacity: 1;
  }
}
