:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-body: #424245;
  --text-muted: #86868b;
  --accent: #c5050c;
  --border: #d2d2d7;
  --accent-soft: #f5f5f7;
  --shadow-sm: none;
  --shadow-md: none;
  --card-border: 1px solid rgba(0, 0, 0, 0.08);
  --card-radius: 18px;
  --card-shadow: none;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: var(--font-sans);
  --font-hand: var(--font-sans);
  --font-mono: var(--font-sans);
  --text-xs: 0.72rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.9rem;
  --ink-blue: #86868b;
  --grid-line: rgba(105, 133, 148, 0.09);
  --max-width: min(1040px, 100%);
  --section-space: clamp(0.75rem, 1.6vw, 1.1rem);
  --section-gap: clamp(2.5rem, 5vw, 3.75rem);
  --card-gap: 12px;
  --container-pad: clamp(16px, 4vw, 24px);
  --nav-height: 56px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 12px);
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

p,
li,
dd {
  text-wrap: pretty;
}

/* Sections — one screen feel */
.section {
  width: 100%;
  padding-bottom: var(--section-space);
}

#skills {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.section--screen {
  min-height: auto;
  display: block;
  padding: var(--section-gap) 0 0;
}

.section--contact {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.container {
  width: 100%;
  max-width: min(1040px, 100%);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.container--narrow {
  max-width: var(--max-width);
}

.container--center {
  margin-left: auto;
  margin-right: auto;
}

.container--full {
  max-width: none;
}

/* Navbar */
.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px var(--container-pad) 0;
  pointer-events: none;
}

.navbar-wrapper {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.left-nav {
  flex-shrink: 0;
}

.right-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-brand {
  padding: 4px 6px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 5px 9px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-current {
  color: var(--accent);
  background: transparent;
}

.nav-link.nav-btn {
  margin-left: 4px;
  padding: 5px 14px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
}

.nav-link.nav-btn:hover {
  background: var(--accent);
  color: #fff;
}

.links-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

/* Hero + about (combined home) */
.section--hero {
  position: relative;
  min-height: auto;
  padding: 0;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.5rem);
  padding-top: calc(var(--nav-height) + clamp(2.25rem, 5vw, 3.75rem));
  padding-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

.hero-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.75fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.hero-copy {
  width: 100%;
  min-width: 0;
}

.notebook-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, 510px);
  margin-bottom: 0.85rem;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notebook-meta__label {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.hero-title {
  font-family: var(--font-serif);
  max-width: 620px;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}

.hero-lead {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.hero-lead em {
  color: var(--accent);
  font-style: italic;
}

.hero-summary {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.65;
}

.hero-summary strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.btn--primary:hover {
  background: #a3040a;
}

.text-btn--muted {
  color: var(--text-muted);
}

.hero-photo {
  width: min(100%, 280px);
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 0;
  background: #f5f5f7;
  box-shadow: none;
  transform: none;
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 42%;
}

.hero-photo figcaption {
  padding: 0.55rem 0.75rem 0.7rem;
  border-top: 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.hero-visual {
  position: relative;
  justify-self: end;
  width: min(100%, 280px);
  padding: 1.2rem 0.4rem 1.6rem 0;
}

.hero-visual::before,
.hero-visual::after,
.robot-doodle,
.journey-origin__doodle {
  display: none;
}

.hero-visual::before {
  top: 0.8rem;
  left: -0.65rem;
  transform: rotate(-8deg);
}

.hero-visual::after {
  right: -0.35rem;
  bottom: 1.2rem;
  transform: rotate(-5deg);
}

.robot-doodle {
  position: absolute;
  z-index: 4;
  right: -2.45rem;
  top: 58%;
  width: 49px;
  height: 67px;
  color: var(--accent);
  transform: rotate(5deg);
}

.robot-doodle__head,
.robot-doodle__body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid currentColor;
  background: var(--bg);
}

.robot-doodle__head {
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 34px;
  height: 23px;
  border-radius: 8px;
}

.robot-doodle__head i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.robot-doodle__antenna {
  position: absolute;
  top: 3px;
  left: 23px;
  width: 2px;
  height: 10px;
  background: currentColor;
}

.robot-doodle__antenna::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.robot-doodle__body {
  top: 38px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 23px;
  border-radius: 5px 5px 9px 9px;
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 600;
}

.robot-doodle__arm {
  position: absolute;
  top: 43px;
  width: 11px;
  height: 16px;
  border-top: 2px solid currentColor;
}

.robot-doodle__arm--left {
  left: 0;
  border-left: 2px solid currentColor;
  transform: rotate(-12deg);
}

.robot-doodle__arm--right {
  right: 0;
  border-right: 2px solid currentColor;
  transform: rotate(12deg);
}

.robot-doodle__feet {
  position: absolute;
  left: 16px;
  bottom: 0;
  width: 18px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

/* The robot waves and blinks when you hover the photo. */
.robot-doodle__arm--right {
  transform-origin: top left;
}

.robot-doodle__head i {
  transform-origin: center;
}

.hero-visual:hover .robot-doodle__arm--right {
  animation: robot-wave 0.9s ease-in-out infinite;
}

.hero-visual:hover .robot-doodle__head i {
  animation: robot-blink 1.8s ease-in-out infinite;
}

@keyframes robot-wave {
  0%,
  100% {
    transform: rotate(12deg);
  }
  30% {
    transform: rotate(-42deg);
  }
  55% {
    transform: rotate(0deg);
  }
  80% {
    transform: rotate(-42deg);
  }
}

@keyframes robot-blink {
  0%,
  76%,
  92%,
  100% {
    transform: scaleY(1);
  }
  82%,
  88% {
    transform: scaleY(0.12);
  }
}

/* Typography */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0 0 1.15rem;
  text-align: left;
}

.section-title::after {
  content: "";
  display: block;
  width: 1.75rem;
  height: 2px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
}

.editorial-body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  text-align: left;
}

.editorial-body a,
.in-depth-body a,
.hero-about a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.editorial-body a:hover,
.in-depth-body a:hover,
.hero-about a:hover {
  opacity: 0.8;
}

.editorial-body strong,
.in-depth-body strong,
.hero-about strong {
  color: var(--text);
  font-weight: 600;
}

.introduction-text {
  color: var(--text-muted);
}

/* Buttons */
.text-btn,
.primary-btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.text-btn:hover,
.primary-btn:hover {
  opacity: 0.75;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.text-btn--sm,
.primary-btn--sm {
  font-size: var(--text-xs);
}

.primary-btn {
  margin-top: 0.5rem;
  padding: 8px 14px;
  background: var(--text);
  color: var(--bg-elevated);
  border-radius: 6px;
}

.primary-btn:hover {
  opacity: 0.88;
}

/* In-depth */
.in-depth-section-heading {
  padding-top: var(--section-gap);
}

.in-depth-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.in-depth-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2.25rem);
  width: calc(100% - 2 * var(--container-pad));
  max-width: calc(1040px - 2 * var(--container-pad));
  padding: clamp(1rem, 2.2vw, 1.45rem);
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.in-depth-now {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.6rem;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: rgba(47, 158, 91, 0.09);
  color: #1f7a45;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.in-depth-now i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f9e5b;
}

.in-depth-item--text-only .in-depth-layout {
  grid-template-columns: minmax(0, 1fr);
}

.in-depth-media {
  position: static;
  width: 100%;
  max-width: 380px;
  margin-bottom: 0;
}

/* Image carousel */
.image-carousel {
  position: relative;
  width: 100%;
}

.image-carousel--empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elevated));
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elevated));
}

.carousel-slide__media {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  object-position: center;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elevated));
}

.carousel-slide--video {
  border: 0;
  background: #000;
}

.carousel-slide--video .carousel-slide__media {
  background: #000;
}

.carousel-annotation {
  position: absolute;
  left: 50%;
  top: 8px;
  z-index: 2;
  max-width: calc(100% - 4.5rem);
  padding: 0.22rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  transform: translateX(-50%);
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(28px, 8vw, 34px);
  height: clamp(28px, 8vw, 34px);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.carousel-nav:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}

.carousel-nav--prev {
  left: 10px;
}

.carousel-nav--next {
  right: 10px;
}

.carousel-counter {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.in-depth-image {
  width: 100%;
  max-width: min(420px, 100%);
  border-radius: 10px;
  display: block;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
}

.in-depth-image--placeholder {
  display: grid;
  place-items: center;
  min-height: 140px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.in-depth-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.in-depth-affiliation {
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
}

.in-depth-org,
.in-depth-role {
  display: inline-block;
}

.in-depth-org::after {
  content: "·";
  margin: 0 0.45em;
  color: var(--text-muted);
  font-weight: 400;
}

.in-depth-role {
  color: var(--text-body);
  font-weight: 500;
}

.in-depth-title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.case-notes {
  margin: 1rem 0 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--ink-blue) 24%, var(--border));
  border-bottom: 1px solid color-mix(in srgb, var(--ink-blue) 18%, var(--border));
}

.case-note {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
}

.case-note + .case-note {
  border-top: 1px solid var(--border);
}

.case-note dt {
  padding-top: 0.2rem;
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.case-note dd {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.55;
}

.in-depth-body {
  position: relative;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.in-depth-body--collapsed {
  max-height: 10rem;
}

.in-depth-body--collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.4rem;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.78) 46%,
    #fff 100%
  );
}

.in-depth-body.is-expanded {
  max-height: 60rem;
}

.in-depth-body p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-body);
  text-align: left;
}

.in-depth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 0.6rem;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.stack-tag {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.5;
}

.stack-tag--sm {
  font-size: 0.7rem;
}

/* Activity list */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}

.activity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 0.95rem 1rem;
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #ffffff;
  box-shadow: var(--card-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.activity-card:hover {
  transform: none;
  border-color: rgba(0, 0, 0, 0.16);
}

.activity-card__body {
  min-width: 0;
}

.activity-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.7rem;
}

.activity-type {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-blue);
  margin-bottom: 0.45rem;
}

.activity-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 0.75rem;
}

.activity-period {
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.activity-card h3 {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.activity-card h3:has(+ .activity-role) {
  margin-bottom: 0.2rem;
}

.activity-role {
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.activity-preview {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-body);
  text-align: left;
}

.activity-preview strong,
.modal-bullets strong {
  color: var(--text);
  font-weight: 600;
}

/* Skills */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--card-gap);
}

.skill-card {
  position: relative;
  padding: 0.95rem 1rem;
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #ffffff;
  box-shadow: var(--card-shadow);
}

.skill-card h3 {
  margin-bottom: 0.75rem;
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, #fff);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-body);
  line-height: 1.4;
}

/* Contact */
.section--contact {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.section--contact .section-title,
.footer-container {
  text-align: center;
}

.section--contact .section-title::after {
  margin-left: auto;
  margin-right: auto;
}

.footer-subheading {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-body);
  margin: 0 0 0.6rem;
}

.email-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.8rem;
}

.contact-resume-link {
  display: block;
  width: fit-content;
  margin: -0.45rem auto 1rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
}

.contact-resume-link:hover {
  color: var(--accent);
}

.email-link:hover {
  text-decoration: underline;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.social-icons img {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

.social-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.social-icons a {
  text-decoration: none;
}

.social-icons a:hover .social-fallback {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.footer-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Modal */
body.modal-open {
  overflow: hidden;
}

.explore-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  place-items: center;
  padding: var(--container-pad);
}

.explore-modal.is-open {
  display: grid;
}

.is-hidden,
[hidden] {
  display: none !important;
}

.explore-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 36, 48, 0.35);
}

.explore-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(90vh, 700px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(28, 36, 48, 0.12);
}

.explore-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 1.1rem;
  cursor: pointer;
}

.explore-modal__media {
  flex-shrink: 0;
  background: #f5ebe9;
}

.modal-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(360px, 45vh);
  overflow: hidden;
}

.modal-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}

.modal-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.modal-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #f5ebe9;
}

.modal-carousel:has(.modal-slide--video) {
  aspect-ratio: 16 / 9;
}

.modal-slide--video {
  background: #000;
}

.modal-slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.modal-slide__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: #f5ebe9;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(26px, 7vw, 30px);
  height: clamp(26px, 7vw, 30px);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  cursor: pointer;
}

.modal-nav--prev {
  left: 8px;
}

.modal-nav--next {
  right: 8px;
}

.modal-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.modal-dot {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(28, 36, 48, 0.25);
  cursor: pointer;
}

.modal-dot.is-active {
  background: var(--accent);
}

.explore-modal__content {
  flex: none;
  padding: 1rem 1.1rem 1.1rem;
}

.explore-modal__title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  margin: 0.2rem 0 0.45rem;
}

.modal-lead {
  margin: 0.75rem 0 0.6rem;
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.modal-lead strong {
  font-weight: 600;
}

.modal-bullets {
  padding-left: 1rem;
}

.modal-bullets li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* Resume page */
.section--resume-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--nav-height) + 2rem) 0 3rem;
}

.resume-page-header {
  text-align: left;
  margin-bottom: 1.5rem;
}

.resume-page-header .section-title {
  margin-top: 0;
}

.resume-page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
}

.resume-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}

#resume-pdf {
  display: block;
  width: 100%;
  height: min(75vh, 900px);
  min-height: 420px;
  border: 0;
}

/* Research journey */
.journey-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + clamp(2.5rem, 6vw, 4rem)) 0 clamp(3rem, 6vw, 4.25rem);
  background: rgba(255, 255, 255, 0.58);
}

.journey-back {
  display: inline-block;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-left: clamp(0.65rem, 3vw, 1.35rem);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.journey-back:hover {
  color: var(--accent);
  transform: translateX(-2px);
}

.journey-eyebrow,
.journey-hero h1,
.journey-intro {
  margin-inline: clamp(0.65rem, 3vw, 1.35rem);
}

.journey-eyebrow {
  margin-bottom: 0.85rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.journey-hero h1 {
  max-width: 22rem;
  margin-bottom: 1.35rem;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.journey-intro {
  max-width: 36rem;
  color: var(--text-body);
  font-size: 0.975rem;
  line-height: 1.75;
}

.journey-intro strong {
  color: var(--text);
  font-weight: 600;
}

.journey-prelude {
  max-width: 900px;
  margin-top: clamp(2.75rem, 6vw, 3.75rem);
  overflow: hidden;
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.journey-prelude__label {
  padding: 0.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 48%, #fff);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.journey-prelude__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
}

.journey-origin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.35rem;
}

.journey-origin h2 {
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.journey-origin__copy > p:last-child {
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.journey-origin__doodle {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 72px;
  padding-top: 18px;
  color: #496273;
}

.journey-origin__note {
  color: var(--accent);
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-4deg);
}

.journey-origin__eyes {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 64px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 12px;
  transform: rotate(3deg);
}

.journey-origin__eyes::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 30px;
  width: 2px;
  height: 13px;
  background: currentColor;
}

.journey-origin__eyes::after {
  content: "";
  position: absolute;
  top: -18px;
  left: 27px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.journey-origin__eyes i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.journey-pause {
  display: flex;
  align-items: center;
  padding: 1.35rem;
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 58%, #fff);
}

.journey-pause h2 {
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.journey-pause div > p:last-child {
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.journey-arc {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(2rem, 5vw, 3.2rem);
  list-style: none;
}

.journey-arc li {
  position: relative;
  min-width: 0;
  padding: 1rem 0.5rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--ink-blue) 42%, var(--border));
}

.journey-arc li::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--accent);
}

.journey-arc li:last-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.journey-arc span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.journey-arc p {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.4;
}

.journey-flow {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.38);
}

.journey-stage {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
}

.journey-stage__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.journey-stage__rail::after {
  content: "";
  position: absolute;
  top: 46px;
  bottom: -4rem;
  width: 1px;
  background: color-mix(in srgb, var(--ink-blue) 34%, var(--border));
}

.journey-stage:last-of-type .journey-stage__rail::after {
  bottom: 0;
}

.journey-stage__rail span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--border));
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--bg) 84%, #fff);
}

.journey-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.3rem, 3vw, 2rem);
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.journey-card__heading {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.journey-card__org {
  margin-bottom: 0.5rem;
  color: var(--ink-blue);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.journey-card h2 {
  max-width: 620px;
  font-family: var(--font-serif);
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
}

.journey-card__question {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 48%, #fff);
}

.journey-card__question span,
.journey-insight span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journey-card__question p {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.journey-card__narrative {
  max-width: 68ch;
}

.journey-card__narrative > p,
.journey-insight p {
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.75;
}

.journey-insight {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--ink-blue) 20%, var(--border));
}

.journey-insight span {
  color: var(--ink-blue);
}

.journey-bridge {
  position: relative;
  width: min(620px, calc(100% - 72px));
  margin: clamp(1.8rem, 4vw, 2.75rem) 0 clamp(1.8rem, 4vw, 2.75rem) auto;
  padding: 0.35rem 1.2rem;
  border-left: 1px solid var(--accent);
}

.journey-bridge span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journey-bridge p {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.5;
}

.journey-direction {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.54);
}

.journey-direction__header {
  max-width: 860px;
}

.journey-direction__header > p:last-child {
  max-width: 720px;
}

.journey-direction h2 {
  margin-bottom: 0.6rem;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.18;
}

.journey-direction__header > p:last-child {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.65;
}

.journey-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: clamp(1.6rem, 4vw, 2.5rem) 0 2rem;
}

.journey-pillar {
  min-height: 165px;
  padding: 1.25rem;
  border: var(--card-border);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.journey-pillar span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.journey-pillar h3 {
  margin: 0.65rem 0 0.3rem;
  font-family: var(--font-serif);
  font-size: 1rem;
}

.journey-pillar p {
  color: var(--text-body);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.7fr);
    gap: clamp(1.5rem, 4vw, 2.5rem);
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 768px) {
  :root {
    --nav-height: 48px;
    --section-gap: 2.15rem;
    --container-pad: 16px;
  }

  .navbar-wrapper {
    flex-wrap: wrap;
    align-items: center;
    border-radius: 16px;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .right-nav {
    display: none;
    width: 100%;
    order: 3;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--border);
  }

  .right-nav.is-open {
    display: block;
  }

  .links-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .links-wrapper {
    align-items: stretch;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.875rem;
  }

  .nav-link.nav-btn {
    margin: 6px 0 2px;
    text-align: center;
  }

  .in-depth-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .in-depth-content {
    order: 2;
  }

  .in-depth-media {
    order: 1;
    position: static;
    max-width: none;
    width: 100%;
    margin-bottom: 0;
  }

  #in-depth .carousel-viewport {
    aspect-ratio: 16 / 10;
    max-height: none;
  }

  .modal-carousel {
    aspect-ratio: 16 / 9;
    max-height: min(240px, 42vh);
  }

  .hero-inner {
    align-items: stretch;
    padding-top: calc(var(--nav-height) + 1.15rem);
    padding-bottom: 0.25rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .hero-visual {
    justify-self: center;
    width: min(236px, 68vw);
    order: -1;
    margin-left: 0;
    padding: 0.35rem 0 0.15rem;
  }

  .notebook-meta {
    width: 100%;
    margin-bottom: 0.65rem;
  }

  .hero-photo {
    width: 100%;
    transform: none;
    box-shadow: none;
  }

  .robot-doodle {
    right: -0.85rem;
    top: 64%;
    transform: rotate(4deg) scale(0.78);
  }

  .activity-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .explore-modal__dialog {
    max-height: 92dvh;
  }

  .carousel-nav--prev {
    left: 6px;
  }

  .carousel-nav--next {
    right: 6px;
  }

  .journey-pillars {
    grid-template-columns: 1fr;
  }

  .journey-pillar {
    min-height: 0;
  }

  .journey-prelude__grid {
    grid-template-columns: 1fr;
  }

  .journey-origin {
    grid-template-columns: minmax(0, 1fr);
  }

  .journey-pause {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 480px) {
  .case-note {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.5rem 0;
  }

  .case-note dt {
    padding-top: 0;
  }

  .notebook-meta {
    align-items: flex-start;
    gap: 0.35rem;
  }

  .robot-doodle {
    right: -0.7rem;
    transform: rotate(4deg) scale(0.72);
  }

  .modal-carousel {
    max-height: min(200px, 36vh);
  }

  .in-depth-body--collapsed {
    max-height: 9.5rem;
  }

  .email-link {
    font-size: 0.95rem;
    word-break: break-all;
  }

  .journey-hero {
    padding-top: calc(var(--nav-height) + 2.5rem);
  }

  .journey-arc {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 0.1rem;
  }

  .journey-arc li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    min-height: 44px;
    padding: 0 0 0 1rem;
    border-top: 0;
    border-left: 1px solid color-mix(in srgb, var(--ink-blue) 42%, var(--border));
  }

  .journey-arc li::before {
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
  }

  .journey-stage {
    grid-template-columns: 1fr;
  }

  .journey-stage__rail {
    justify-content: flex-start;
  }

  .journey-stage__rail::after {
    left: 21px;
    top: 42px;
    bottom: -1.5rem;
  }

  .journey-card__question {
    margin: 0.9rem 0;
    padding: 0.7rem 0.8rem;
  }

  .journey-card__question p {
    font-size: 0.95rem;
  }

  .journey-bridge {
    width: calc(100% - 18px);
    margin-top: 1.8rem;
    margin-bottom: 1.8rem;
  }

  .journey-origin {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .journey-origin__doodle {
    min-height: 76px;
  }

  .journey-pause {
    margin-top: 0;
  }
}

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

  .hero-visual:hover .robot-doodle__arm--right,
  .hero-visual:hover .robot-doodle__head i,
  .carousel-track,
  .modal-track,
  .activity-card,
  .hero-photo {
    transition: none;
  }

  .hero-photo {
    transform: none;
  }
}
