/* ============================================================
   Jia Xie — personal site
   Bento grid: the whole person on one quiet, tiled screen.
   ============================================================ */

:root {
  --bg: #f4f3ef;
  --tile: #fbfbf9;
  --tile-hover: #ffffff;
  --ink: #16160f;
  --ink-soft: #54534b;
  --ink-faint: #98968d;
  --line: #e4e2da;
  --accent: #b0492d;
  --radius: 18px;
  --gap: 0.9rem;
  --max: 56rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Type scale — keep the whole site on these few sizes. */
  --fs-label: 0.72rem;  /* uppercase eyebrows / tags */
  --fs-meta: 0.875rem;  /* secondary & meta text */
  --fs-body: 1rem;      /* body copy */
  --fs-title: 1.1rem;   /* card / item titles */
  --fs-lead: clamp(1.02rem, 2vw, 1.18rem);  /* hero lead text & news */
}

[data-theme="dark"] {
  --bg: #0c0c0a;
  --tile: #161613;
  --tile-hover: #1c1c18;
  --ink: #f0efe8;
  --ink-soft: #a3a299;
  --ink-faint: #65645c;
  --line: #262620;
  --accent: #e08a5f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* ---------- Grid ---------- */
.grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.4rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(10px, auto);
  grid-auto-flow: row dense;
  gap: var(--gap);
}

/* ---------- Tile base ---------- */
.tile {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.tile-label {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}

/* ---------- Tile placement ---------- */
.tile--intro    {
  grid-column: span 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head side" "body side";
  align-items: center;
  column-gap: clamp(1.4rem, 4vw, 2.8rem);
  padding: clamp(1.8rem, 4vw, 2.6rem);
}
.intro-head { grid-area: head; }
.intro-body { grid-area: body; }
.intro-side { grid-area: side; align-self: center; }
.tile--news     { grid-column: span 4; }
.tile--research { grid-column: span 4; }
.tile--journey  { grid-column: span 4; }
.tile--misc     { grid-column: span 4; }
.tile--projects { grid-column: span 4; }
.tile--footer   {
  grid-column: span 4;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
}

/* ---------- Intro ---------- */
.intro-text { min-width: 0; }
.intro-affil {
  margin: 0 0 0.5rem;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34rem;
}
.intro-affil a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 2px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.intro-affil a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Portrait + social icons stacked on the right. */
.intro-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
.socials { display: flex; gap: 0.55rem; list-style: none; margin: 0; padding: 0; }
.socials a {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--tile);
  color: var(--ink-soft);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.25s var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.socials svg { fill: currentColor; }

/* Portrait — works for a real <img class="portrait"> or the placeholder. */
.portrait {
  flex: 0 0 auto;
  width: clamp(140px, 26vw, 224px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}
.portrait--placeholder {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 9px, var(--line) 9px, var(--line) 10px),
    var(--tile-hover);
  border: 1px dashed var(--line);
  color: var(--ink-faint);
}
.portrait--placeholder svg { stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.portrait--placeholder span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; }

.greeting {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}
.wave { display: inline-block; transform-origin: 70% 70%; }
.tile--intro:hover .wave { animation: wave 1.6s var(--ease); }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(16deg); } 30% { transform: rotate(-10deg); }
  45% { transform: rotate(16deg); } 60% { transform: rotate(-6deg); }
  75% { transform: rotate(10deg); }
}

.name {
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
}
.name-zh {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 500;
  font-size: 1em;
  letter-spacing: 0;
  color: var(--ink);
  margin-left: 0.4em;
  align-self: center;
}
.caret {
  display: inline-block;
  width: 0.42em; height: 0.8em;
  margin-left: 0.16em;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(0.04em);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.tagline {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0;
}
.tagline strong { color: var(--ink); font-weight: 600; }

/* ---------- Links ---------- */
.tile--links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.tile--links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.tile--links a span { color: var(--ink-faint); transition: transform 0.25s var(--ease), color 0.2s var(--ease); }
.tile--links a:hover { color: var(--accent); }
.tile--links a:hover span { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- About ---------- */
.tile--about p { margin: 0 0 0.85rem; color: var(--ink-soft); }
.tile--about p:last-child { margin-bottom: 0; }
.tile--about em { color: var(--ink); font-style: italic; }
.tile--about a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s var(--ease);
}
.tile--about a:hover { text-decoration-color: var(--accent); color: var(--accent); }

/* ---------- Journey / timeline ---------- */
.tile--journey { position: relative; overflow: hidden; }
.tile--journey > * { position: relative; z-index: 1; }
.tile--journey p { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: var(--fs-body); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: 50%; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}
.timeline li:first-child { border-top: 0; }
.t-when {
  flex: 0 0 5.2rem;
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.t-what { font-weight: 500; color: var(--ink); transition: color 0.2s var(--ease); }

/* Clickable timeline rows (open a photo). */
.t-trigger {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.t-view {
  margin-left: auto;
  align-self: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.t-trigger:hover .t-view,
.t-trigger:focus-visible .t-view { opacity: 1; transform: none; color: var(--accent); }
.t-trigger:hover .t-what { color: var(--accent); }
.t-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Right-aligned photo backdrop — defaults to RoboMaster, swaps as you hover a
   competition row. Fades into the timeline text on its left edge. */
.journey-peek {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 62%);
  mask-image: linear-gradient(to right, transparent 0%, #000 62%);
}
[data-theme="dark"] .journey-peek { opacity: 0.38; }

/* ---------- Stat tiles ---------- */
.stat-emoji { font-size: 1.7rem; line-height: 1; }
.stat-big {
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: var(--fs-title);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stat-sub { font-size: var(--fs-meta); color: var(--ink-faint); line-height: 1.4; }
.stat-tags {
  margin-top: 0.55rem;
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.stat-tags strong { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Misc tile: pilot + badminton as two cards ---------- */
.misc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.misc-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 1.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.misc-card:hover { transform: translateY(-3px); border-color: var(--accent); }

/* Student pilot — faint looping landing clip, same quiet idea as the journey photo. */
.tile--pilot { position: relative; overflow: hidden; }
.pilot-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  opacity: 0.12;
  filter: grayscale(0.3) contrast(1.05);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
  pointer-events: none;
  z-index: 0;
}
.tile--pilot > span { position: relative; z-index: 1; }
[data-theme="dark"] .pilot-video { opacity: 0.18; filter: grayscale(0.4) brightness(0.85); }
.tile--pilot:hover .pilot-video { opacity: 0.22; }

/* Full-tile toggle: click to peek, click again to dismiss. Stays above the
   playing video so a click anywhere on the tile reverts it. */
.pilot-trigger {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.6rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.pilot-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }
.pilot-badge {
  display: grid;
  place-items: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 50%;
  transition: transform 0.25s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.pilot-badge--play {
  background: var(--tile);
  border: 1px solid var(--line);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.pilot-badge--play svg { fill: currentColor; margin-left: 1px; }
.pilot-trigger:hover .pilot-badge--play,
.pilot-trigger:focus-visible .pilot-badge--play {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.1);
}
.pilot-badge--close {
  display: none;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}
.pilot-badge--close svg { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.pilot-trigger:hover .pilot-badge--close { background: rgba(0, 0, 0, 0.75); transform: rotate(90deg); }
.tile--pilot.playing .pilot-badge--play { display: none; }
.tile--pilot.playing .pilot-badge--close { display: grid; }

/* In-place peek: same tile size — the clip just comes forward and unmutes. */
.tile--pilot.playing { border-color: var(--accent); }
.tile--pilot.playing:hover { transform: none; }
.tile--pilot.playing .pilot-video {
  opacity: 1;
  filter: none;
  object-position: center;
  -webkit-mask-image: none;
  mask-image: none;
  z-index: 2;
}
.tile--pilot.playing > span { opacity: 0; visibility: hidden; }

/* Custom seek bar — shown only while peeking, sits above everything else. */
.pilot-scrub {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: none;
  padding: 1.5rem 0.75rem 0.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  cursor: pointer;
  touch-action: none;
}
.tile--pilot.playing .pilot-scrub { display: block; }
.pilot-scrub-track {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.32);
  transition: height 0.15s var(--ease);
}
.pilot-scrub:hover .pilot-scrub-track { height: 6px; }
.pilot-scrub-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 4px;
  background: var(--accent);
}
.pilot-scrub-fill::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  transform: translate(50%, -50%);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s var(--ease);
}
.pilot-scrub:hover .pilot-scrub-fill::after { transform: translate(50%, -50%) scale(1.18); }

/* ---------- Projects ---------- */
.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-item { border-top: 1px solid var(--line); }
.proj-item:first-child { border-top: 0; }
.proj-link { display: flex; align-items: center; gap: 1.1rem; padding: 0.85rem 0; text-decoration: none; }
.proj-media {
  flex: 0 0 auto;
  width: 200px;
  height: 125px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.proj-media img, .proj-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-media--split { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.proj-media--split img { object-position: center top; }
.proj-media--empty { border: 0; background: transparent; }
.proj-info { flex: 1 1 auto; min-width: 0; }
.proj-row { display: flex; align-items: baseline; gap: 0.5rem; }
.proj-name {
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--fs-title);
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.proj-arrow { color: var(--accent); opacity: 0; transform: translate(-3px, 1px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
a.proj-link:hover .proj-arrow { opacity: 1; transform: none; }
a.proj-link:hover .proj-name { color: var(--accent); }
.proj-meta { display: block; font-size: var(--fs-meta); color: var(--ink-faint); margin-top: 0.15rem; }

/* ---------- Research / publications ---------- */
.pub-item { display: flex; gap: 1.3rem; align-items: stretch; }
.pub-media {
  flex: 0 0 clamp(280px, 38%, 380px);
  min-height: 200px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  display: block;
}
.pub-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-info { flex: 1 1 auto; min-width: 0; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { padding: 0.15rem 0; border-top: 1px solid var(--line); }
.pub-list li:first-child { border-top: 0; }
.pub-list li + li { padding-top: 0.7rem; margin-top: 0.55rem; }
.pub-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--fs-title);
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.pub-arrow { color: var(--accent); font-size: 0.9em; transform: translate(-3px, 0); opacity: 0; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
a.pub-name:hover { color: var(--accent); }
a.pub-name:hover .pub-arrow { opacity: 1; transform: none; }
.pub-meta { display: block; font-size: var(--fs-body); line-height: 1.45; color: var(--ink-soft); margin-top: 0.2rem; }
.pub-authors { display: block; font-size: var(--fs-meta); line-height: 1.55; color: var(--ink-faint); margin-top: 0.4rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-authors sup { color: var(--accent); font-size: 0.7em; }
.pub-note { display: block; font-size: var(--fs-label); color: var(--ink-faint); margin-top: 0.25rem; }
.pub-note sup { color: var(--accent); }
.pub-tldr { display: block; font-size: var(--fs-body); line-height: 1.55; color: var(--ink-soft); margin-top: 0.65rem; }
.pub-tldr strong { color: var(--ink); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.pub-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 1rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; }
.news-date { flex: 0 0 7.5rem; white-space: nowrap; color: var(--ink-faint); font-size: var(--fs-lead); }
.news-body { color: var(--ink-soft); font-size: var(--fs-lead); }
.news-body strong { color: var(--ink); font-weight: 600; }
.news-body a {
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s var(--ease);
}
.news-body a strong { transition: color 0.2s var(--ease); }
.news-body a:hover { text-decoration-color: var(--accent); }
.news-body a:hover strong { color: var(--accent); }

/* ---------- Footer ---------- */
.tile--footer p { margin: 0; font-size: var(--fs-meta); color: var(--ink-soft); }
.tile--footer .muted { color: var(--ink-faint); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 1rem; right: 1rem;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  z-index: 10;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(20deg); }
.theme-toggle svg { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; fill: none; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- Reveal (staggered) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .grid .reveal:nth-child(2) { transition-delay: 0.05s; }
.js .grid .reveal:nth-child(3) { transition-delay: 0.10s; }
.js .grid .reveal:nth-child(4) { transition-delay: 0.15s; }
.js .grid .reveal:nth-child(5) { transition-delay: 0.20s; }
.js .grid .reveal:nth-child(6) { transition-delay: 0.25s; }
.js .grid .reveal:nth-child(7) { transition-delay: 0.30s; }
.js .grid .reveal:nth-child(8) { transition-delay: 0.35s; }
.js .grid .reveal:nth-child(9) { transition-delay: 0.40s; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tile--intro, .tile--journey, .tile--news, .tile--misc,
  .tile--research, .tile--projects, .tile--footer { grid-column: span 2; }
}
@media (max-width: 560px) {
  /* Stack the hero: greeting + name, then photo, then bio. */
  .tile--intro { grid-template-columns: 1fr; grid-template-areas: "head" "side" "body"; row-gap: 1.1rem; justify-items: start; }
  .intro-side { align-items: flex-start; align-self: start; }
  .portrait { width: clamp(168px, 52vw, 232px); }
  .proj-media { width: 150px; height: 94px; }
  .pub-item { flex-direction: column; gap: 0.9rem; align-items: stretch; }
  .pub-media { flex: none; width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
  .misc-grid { grid-template-columns: 1fr; }
  .timeline { max-width: 72%; }
}
@media (max-width: 460px) {
  .grid { grid-template-columns: 1fr; }
  .tile, .tile--intro, .tile--journey, .tile--misc,
  .tile--news, .tile--research, .tile--projects, .tile--footer { grid-column: span 1; }
  .tile--footer { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .caret { opacity: 1; }
  html { scroll-behavior: auto; }
  /* No autoplaying clip for users who prefer reduced motion. */
  .pilot-video { display: none; }
}

/* ============================================================
   Open layout — sections are boxless, separated by hairline
   rules and whitespace; only the Misc pair stays carded.
   ============================================================ */
.grid { max-width: 50rem; gap: clamp(1.6rem, 3.5vw, 2.6rem); }
.tile { background: transparent; border: 0; border-radius: 0; padding: 0; }
.tile--news, .tile--research, .tile--projects,
.tile--journey, .tile--misc, .tile--footer {
  border-top: 1px solid var(--line);
  padding-top: clamp(1.5rem, 3vw, 2.1rem);
}
.tile--footer { padding-bottom: 0; }
/* Misc keeps its two cards (pilot + badminton). */
.misc-card { background: var(--tile); }
.tile--journey { overflow: hidden; }
