:root {
  --paper: #f2f7fb;
  --paper-2: #e3edf6;
  --white: #ffffff;
  --ink: #123b57;
  --ink-2: #071f33;
  --muted: #587084;
  --line: rgba(18, 59, 87, 0.16);
  --line-strong: rgba(18, 59, 87, 0.34);
  --orange: #2f6fea;
  --yellow: #8dc9e5;
  --serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --shell: min(1120px, calc(100vw - 64px));
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

button {
  color: inherit;
  font: inherit;
}

::selection {
  color: var(--white);
  background: var(--orange);
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 14px;
  color: var(--white);
  background: var(--ink-2);
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px 32px;
  border-bottom: 1px solid transparent;
  transition:
    min-height 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease;
}

.topbar.is-scrolled {
  min-height: 62px;
  border-color: var(--line);
  background: rgba(242, 247, 251, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: -0.04em;
}

.nav {
  display: flex;
  gap: 27px;
  justify-self: center;
}

.nav a {
  position: relative;
  padding: 8px 0;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 200ms ease;
}

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

.nav a.is-active {
  color: var(--orange);
}

.topbar-mail {
  justify-self: end;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.topbar-mail:hover {
  color: var(--orange);
}

.menu-button {
  display: none;
}

.hero {
  display: flex;
  align-items: center;
  min-height: 88svh;
  padding: 108px 0 64px;
  background:
    radial-gradient(circle at 85% 18%, rgba(47, 111, 234, 0.12), transparent 24rem),
    linear-gradient(180deg, rgba(227, 237, 246, 0.58), transparent 78%);
}

.hero-grid {
  display: block;
}

.hero-copy {
  max-width: 860px;
}

.eyebrow,
.section-number,
.mini-label {
  margin: 0;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(50px, 5.4vw, 70px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.role {
  margin: 13px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-summary {
  max-width: 780px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hero .tag-list {
  margin-top: 24px;
}

.tag-list span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}

.primary-button {
  display: inline-flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  min-width: 152px;
  min-height: 46px;
  padding: 0 17px;
  color: var(--paper);
  background: var(--ink);
  font-size: 12px;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.primary-button:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

.text-button {
  padding: 11px 4px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
}

.text-button span {
  margin-left: 20px;
}

.first-page-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 48px;
}

.hero-fact {
  min-height: 215px;
  padding: 23px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--orange);
  background: rgba(255, 255, 255, 0.72);
}

.hero-fact-label {
  margin: 0;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-fact h2 {
  margin: 14px 0 24px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.hero-fact-list {
  display: grid;
  gap: 14px;
}

.hero-fact-list p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.hero-fact strong,
.hero-fact-emphasis {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
}

.hero-fact-list span,
.hero-fact-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.hero-fact-emphasis {
  margin: 0 0 8px;
}

.hero-fact-note {
  margin: 0;
}

.hero-fact-meta {
  margin: 20px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.section {
  padding: 110px 0;
  border-top: 1px solid var(--line);
}

.section-grid {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 70px;
  align-items: start;
}

.section-grid > *,
.credential-layout > *,
.project-grid > * {
  min-width: 0;
}

.section-heading {
  position: sticky;
  top: 100px;
}

.section-heading h2 {
  margin: 15px 0 18px;
  font-family: var(--serif);
  font-size: 42px;
  letter-spacing: -0.05em;
  line-height: 1.18;
}

.section-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.section-heading-wide {
  position: static;
  display: grid;
  grid-template-columns: 1fr minmax(270px, 0.48fr);
  gap: 70px;
  align-items: end;
  margin-bottom: 42px;
}

.section-heading-wide h2 {
  margin-bottom: 0;
}

.section-heading-wide > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.education-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 100px;
  gap: 25px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line-strong);
}

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

.row-date {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.experience-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.row-kicker {
  margin: 0;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row-main h3,
.experience-body h3 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.row-title {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 13px;
}

.row-description {
  max-width: 560px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.school-mark {
  display: grid;
  place-items: center;
  width: 100px;
  height: 76px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.school-mark img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}

.experience {
  color: var(--ink);
  background: linear-gradient(135deg, #dbeaf5, #edf5fa);
}

.experience .section-number {
  color: var(--orange);
}

.experience .section-heading > p:last-child {
  color: var(--muted);
}

.experience-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 30px;
  padding: 35px 0;
  border-top: 1px solid var(--line-strong);
}

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

.experience-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.experience-body h3 {
  color: var(--ink);
  font-size: 30px;
}

.experience-role {
  margin: 8px 0 0;
  color: var(--orange);
  font-size: 13px;
}

.experience-body ul {
  max-width: 710px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.experience-body li {
  position: relative;
  margin: 9px 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.experience-body li::before {
  position: absolute;
  top: 11px;
  left: 0;
  width: 6px;
  height: 1px;
  content: "";
  background: var(--orange);
}

.tag-list-dark {
  margin-top: 22px;
}

.tag-list-dark span {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.8);
}

.experience .tag-list-dark span {
  color: #28516e;
  border-color: rgba(18, 59, 87, 0.28);
  background: rgba(255, 255, 255, 0.48);
}

.credential-layout {
  display: flex;
  flex-direction: column;
  gap: 46px;
}

.rail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.rail-head h3 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.rail-controls {
  display: flex;
  gap: 6px;
}

.rail-controls button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.rail-controls button:hover:not(:disabled) {
  color: var(--paper);
  background: var(--ink);
}

.rail-controls button:disabled {
  opacity: 0.28;
  cursor: default;
}

.rail {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  cursor: grab;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 38px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 38px), transparent 100%);
  transition: mask-image 180ms ease;
}

.rail.is-at-end {
  mask-image: none;
  -webkit-mask-image: none;
}

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

.rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.rail-track {
  display: flex;
  gap: 12px;
  width: max-content;
}

.cert-card {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 12px;
  width: 300px;
  min-height: 205px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  scroll-snap-align: start;
}

.cert-card.cert-card-image {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 10px 14px;
  overflow: hidden;
}

.cert-image-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #eaf1f6;
  aspect-ratio: 0.7;
}

.cert-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 300ms ease;
}

.cert-image-frame:hover img {
  transform: scale(1.015);
}

.cert-view {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  color: var(--white);
  background: rgba(7, 31, 51, 0.82);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.cert-image-frame:hover .cert-view,
.cert-image-frame:focus-visible .cert-view {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .cert-view {
    opacity: 0.9;
    transform: none;
  }
}

.cert-copy {
  padding: 15px 4px 2px;
  text-align: center;
}

.cert-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.cert-meta span:first-child {
  color: var(--orange);
  text-align: left;
}

.cert-meta span:last-child {
  text-align: right;
}

.cert-card.cert-card-image h4 {
  margin: 12px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.cert-card.cert-card-image p {
  margin-top: 5px;
}

.cert-index {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.cert-badge {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-top: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
}

.cert-card h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
}

.cert-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cert-date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.rail-hint {
  margin: 11px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.skills-column {
  padding-top: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 17px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.skill-group {
  min-height: 165px;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.skill-group > span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 9px;
}

.skill-group h3 {
  margin: 20px 0 8px;
  font-family: var(--serif);
  font-size: 20px;
}

.skill-group p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.projects {
  background: var(--paper-2);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 315px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--white);
}

.project-card-large {
  grid-column: 1 / -1;
  min-height: 290px;
  color: var(--paper);
  background: var(--ink);
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.project-card-large .project-topline {
  color: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.18);
}

.project-card h3 {
  margin: 55px 0 14px;
  font-family: var(--serif);
  font-size: 29px;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.project-card-large h3 {
  font-size: 36px;
}

.project-card p {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.project-card-large p {
  color: rgba(255, 255, 255, 0.64);
}

.project-card .tag-list {
  margin-top: auto;
  padding-top: 24px;
}

.student-leadership {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 50px;
  margin-top: 14px;
  padding: 32px;
  border: 1px solid var(--line-strong);
}

.student-leadership h3 {
  margin: 9px 0 4px;
  font-family: var(--serif);
  font-size: 24px;
}

.student-leadership > div > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.student-leadership ul {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
  line-height: 2;
}

.student-leadership li + li {
  margin-top: 5px;
}

.rail-large .rail-track {
  gap: 14px;
}

.honor-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 260px;
  min-height: 0;
  padding: 10px 10px 15px;
  border: 1px solid var(--line);
  background: var(--white);
  text-align: center;
  scroll-snap-align: start;
}

.honor-image-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #eaf1f6;
  aspect-ratio: 0.7;
}

.honor-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 280ms ease;
}

.honor-image-frame:hover img {
  transform: scale(1.015);
}

.honor-image-stack {
  display: grid;
  gap: 8px;
}

.honor-image-wide {
  aspect-ratio: 1.4;
}

.honor-view {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  color: var(--white);
  background: rgba(7, 31, 51, 0.82);
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.honor-image-frame:hover .honor-view,
.honor-image-frame:focus-visible .honor-view {
  opacity: 1;
  transform: translateY(0);
}

.honor-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  gap: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.honor-meta span:first-child {
  color: var(--orange);
  text-align: left;
}

.honor-meta span:last-child {
  text-align: right;
}

.honor-card strong {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.honor-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (hover: none) {
  .honor-view {
    opacity: 0.9;
    transform: none;
  }
}

.profile {
  color: var(--paper);
  background: var(--ink);
}

.profile .section-number {
  color: var(--yellow);
}

.profile .section-heading-wide > p {
  color: rgba(255, 255, 255, 0.5);
}

.traits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.trait {
  min-height: 250px;
  padding: 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.trait > span {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 9px;
}

.trait h3 {
  margin: 72px 0 12px;
  font-family: var(--serif);
  font-size: 26px;
}

.trait p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.85;
}

.profile-quote {
  margin: 65px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.8vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.5;
}

.footer {
  padding: 65px 0 24px;
  color: var(--paper);
  background: var(--ink-2);
}

.footer-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.footer-grid p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.48);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.footer-grid a {
  font-family: var(--serif);
  font-size: clamp(24px, 3.8vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.footer-grid a:hover {
  color: var(--yellow);
}

.footer-grid button {
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 55px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.36);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px) {
  :root {
    --shell: calc(100% - 48px);
  }

  .nav {
    gap: 18px;
  }

  .section-grid {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 45px;
  }

  .credential-layout {
    gap: 38px;
  }

  .education-row {
    grid-template-columns: 100px minmax(0, 1fr) 78px;
    gap: 18px;
  }

  .school-mark {
    width: 78px;
    height: 62px;
    padding: 0;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  :root {
    --shell: calc(100% - 36px);
  }

  html {
    scroll-padding-top: 70px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding: 9px 18px;
  }

  .menu-button {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-self: end;
    width: 38px;
    height: 38px;
    padding: 11px 8px;
    border: 1px solid var(--line);
    background: transparent;
  }

  .menu-button > span:not(.sr-only) {
    width: 100%;
    height: 1px;
    background: var(--ink);
    transition:
      transform 180ms ease,
      opacity 180ms ease;
  }

  .menu-button[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 8px 18px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(242, 247, 251, 0.98);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  .nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a {
    width: 100%;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar-mail {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 88px 0 44px;
  }

  .hero-grid {
    display: block;
  }

  .hero h1 {
    font-size: clamp(46px, 12vw, 64px);
  }

  .first-page-facts {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .hero-fact {
    min-height: 0;
  }

  .section {
    padding: 76px 0;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-heading {
    position: static;
  }

  .section-heading h2 {
    margin-bottom: 12px;
    font-size: 37px;
  }

  .section-heading-wide {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 32px;
  }

  .experience-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .experience-meta {
    flex-direction: row;
    justify-content: space-between;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card-large {
    grid-column: auto;
  }

  .student-leadership {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .traits-grid {
    grid-template-columns: 1fr;
  }

  .trait {
    min-height: 180px;
  }

  .trait h3 {
    margin-top: 42px;
  }

  .profile-quote {
    margin-top: 48px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 520px) {
  :root {
    --shell: calc(100% - 30px);
  }

  .hero h1 {
    font-size: 44px;
  }

  .role {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .section {
    padding: 66px 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .education-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 23px 0;
  }

  .school-mark {
    justify-self: start;
    width: 84px;
    height: 64px;
  }

  .row-main h3,
  .experience-body h3 {
    font-size: 25px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-group {
    min-height: 125px;
  }

  .project-card {
    min-height: 290px;
    padding: 23px;
  }

  .project-card h3,
  .project-card-large h3 {
    margin-top: 40px;
    font-size: 25px;
  }

  .cert-card {
    width: min(300px, calc(100vw - 72px));
  }

  .honor-card {
    width: calc(100vw - 78px);
  }

  .student-leadership {
    padding: 22px;
  }

  .footer-grid a {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

@media print {
  :root {
    --paper: #fff;
    --paper-2: #f2f2f2;
    --white: #fff;
    --ink: #111;
    --ink-2: #000;
    --muted: #444;
    --line: #ccc;
    --line-strong: #999;
  }

  @page {
    margin: 11mm;
    size: A4;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 9pt;
  }

  body::before,
  .topbar,
  .hero-actions,
  .rail-controls,
  .rail-hint,
  .footer-grid button {
    display: none !important;
  }

  .shell {
    width: 100%;
  }

  .hero {
    min-height: 0;
    padding: 0 0 8mm;
  }

  .hero-grid {
    display: block;
  }

  .hero h1 {
    margin-top: 3mm;
    font-size: 30pt;
  }

  .hero-summary {
    font-size: 8pt;
  }

  .first-page-facts {
    grid-template-columns: repeat(3, 1fr);
    gap: 3mm;
    margin-top: 6mm;
  }

  .hero-fact {
    min-height: 0;
    padding: 3mm;
    border-color: #bbb;
    border-top-color: #111;
  }

  .hero-fact h2 {
    margin: 3mm 0;
    font-size: 12pt;
  }

  .hero-fact strong,
  .hero-fact-emphasis {
    color: #111;
    font-size: 9pt;
  }

  .hero-fact-list span,
  .hero-fact-note,
  .hero-fact-meta {
    color: #444;
  }

  .section {
    padding: 7mm 0;
    color: #111 !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .section-grid,
  .section-heading-wide,
  .credential-layout {
    display: block;
  }

  .section-heading {
    position: static;
    margin-bottom: 5mm;
  }

  .section-heading h2,
  .experience-body h3 {
    color: #111;
    font-size: 19pt;
  }

  .section-heading > p:last-child,
  .section-heading-wide > p,
  .experience .section-heading > p:last-child {
    color: #444;
  }

  .experience-row {
    grid-template-columns: 80px 1fr;
    padding: 5mm 0;
  }

  .experience-body li,
  .project-card p,
  .trait p {
    color: #444;
  }

  .experience-body li::before {
    background: #111;
  }

  .tag-list-dark span {
    color: #444;
    border-color: #bbb;
  }

  .credential-layout {
    gap: 6mm;
  }

  .rail {
    overflow: visible;
  }

  .rail-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .cert-card,
  .honor-card {
    width: auto;
    min-height: 30mm;
    color: #111;
    background: #fff;
    border-color: #bbb;
  }

  .rail-large .rail-track {
    grid-template-columns: repeat(4, 1fr);
  }

  .skills-column {
    margin-top: 6mm;
  }

  .project-grid {
    gap: 4mm;
  }

  .project-card,
  .project-card-large {
    min-height: 0;
    color: #111;
    background: #fff;
    border-color: #bbb;
  }

  .project-card-large .project-topline {
    color: #444;
    border-color: #bbb;
  }

  .profile {
    color: #111;
    background: #fff;
  }

  .trait {
    min-height: 35mm;
    border-color: #bbb;
  }

  .footer {
    padding: 5mm 0 0;
    color: #111;
    background: #fff;
  }

  .footer-grid p,
  .footer-bottom {
    color: #444;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
