/* ============================================================
   Xiaoyu Ye — Design tokens
   Accent sampled directly from breezy-hero.jpg (Breezy power button)
   ============================================================ */
:root {
  --ink: #121110;
  --ink-soft: #171514;
  --surface: #1a1817;
  --surface-raised: #201d1b;
  --hairline: #2e2a27;
  --hairline-soft: #221f1d;
  --red: #b2272a;
  --red-bright: #d6483f;
  --bone: #ede6d8;
  --bone-dim: #cfc7b8;
  --taupe: #9c9086;
  --taupe-dim: #6f665d;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --container: 1240px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--red);
  color: var(--bone);
  padding: 12px 20px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 14px;
}
.skip-link:focus { left: 16px; top: 16px; }

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

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}

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

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 12px;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(18, 17, 16, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav-inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-mark {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.04em;
  border: 1px solid var(--hairline);
  padding: 6px 11px;
  border-radius: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-links {
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--taupe);
  padding: 10px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-links a:hover { color: var(--bone); border-color: var(--red); }

.nav-contact {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--red);
  color: var(--bone);
  padding: 10px 18px;
  border-radius: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease;
}
.nav-contact:hover { background: var(--red); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: 62%;
  object-fit: cover;
  object-position: 60% center;
  filter: grayscale(0.15) contrast(1.05) brightness(0.62) saturate(1.15);
}
.hero-bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--ink) 0%, var(--ink) 28%, rgba(18,17,16,0.88) 42%, rgba(18,17,16,0.35) 62%, rgba(18,17,16,0.15) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(18,17,16,0) 22%, rgba(18,17,16,0) 78%, var(--ink) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 56px 32px 72px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}
.hero-photo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(178, 39, 42, 0.6);
  flex-shrink: 0;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}
.hero-name-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
  color: var(--bone);
}
.hero-name-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: rgba(237, 230, 216, 0.65);
}

.hero-title {
  margin: 0 0 28px;
  font-weight: 400;
}
.hero-line {
  display: block;
}
.hero-line--serif {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 400;
  color: var(--bone);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.hero-line--accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 58px;
  line-height: 1.15;
  color: var(--red-bright);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.hero-dek {
  max-width: 560px;
  font-size: 17px;
  color: var(--bone-dim);
  margin: 0 0 36px;
}
.hero-dek strong { color: var(--bone); font-weight: 600; }

/* Signature readout strip */
.readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 720px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  margin-bottom: 40px;
  background: rgba(26, 24, 23, 0.55);
}
.readout-item {
  padding: 16px 20px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.readout-item:last-child { border-right: none; }
.readout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--taupe-dim);
}
.readout-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--bone);
  min-height: 18px;
}
.readout-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 10px;
  background: rgba(237, 230, 216, 0.15);
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 15px 26px;
  border-radius: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: var(--red);
  color: var(--bone);
  border: 1px solid var(--red);
}
.btn-primary:hover { background: var(--red-bright); border-color: var(--red-bright); }
.btn-ghost {
  border: 1px solid var(--hairline);
  color: var(--bone-dim);
  background: rgba(18, 17, 16, 0.55);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { border-color: var(--bone-dim); color: var(--bone); }

/* ============================================================
   Two tracks
   ============================================================ */
.tracks {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.tracks-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.track-card {
  padding: 56px 48px;
  border-right: 1px solid var(--hairline);
  transition: background 0.25s ease;
}
.track-card:last-child { border-right: none; }
.track-card:hover { background: var(--surface); }
.track-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--taupe-dim);
  display: block;
  margin-bottom: 14px;
}
.track-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin: 0 0 14px;
  color: var(--bone);
}
.track-card p {
  color: var(--taupe);
  margin: 0 0 22px;
  max-width: 42ch;
}
.track-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red-bright);
  letter-spacing: 0.03em;
}

/* ============================================================
   Project sidebar nav — secondary, in-page section jump list
   (sits alongside the primary top nav; not a replacement for it)
   ============================================================ */
.project-nav-layout {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
  padding: 0 32px;
}
.project-nav-content {
  min-width: 0;
}

.project-nav {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
  align-self: start;
  width: 240px;
  max-height: calc(100vh - var(--nav-h) - 64px);
  overflow-y: auto;
  padding: 100px 16px 40px 0;
  font-family: var(--font-body);
}
.project-nav::-webkit-scrollbar { width: 3px; }
.project-nav::-webkit-scrollbar-thumb { background: var(--hairline); }

.nav-level-1 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-project {
  border-left: 1px solid var(--hairline);
  transition: border-color 0.2s ease;
}

.nav-project-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--taupe);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-project-toggle:hover { color: var(--bone); }

.nav-project-tag {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 2px;
}

.nav-project.is-active { border-left-color: var(--red-bright); }
.nav-project.is-active > .nav-project-toggle { color: var(--bone); }

.nav-level-2 {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.nav-project.is-expanded .nav-level-2 { max-height: 320px; }

.nav-sub-link {
  display: block;
  padding: 6px 0 6px 28px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--taupe-dim);
  text-decoration: none;
  border-left: 1px solid transparent;
  margin-left: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-sub-link:hover { color: var(--bone-dim); }
.nav-sub-link.is-current {
  color: var(--bone);
  font-weight: 500;
  border-left-color: var(--red-bright);
}

@media (max-width: 900px) {
  .project-nav-layout { display: block; padding: 0; }
  .project-nav {
    position: sticky;
    top: var(--nav-h);
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    padding: 14px 20px;
    background: rgba(18, 17, 16, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--hairline);
    z-index: 10;
  }
  .nav-level-1 { flex-direction: row; gap: 24px; white-space: nowrap; }
  .nav-project { border-left: none; flex-shrink: 0; }
  .nav-project-toggle { padding: 4px 0; }
  .nav-project.is-active { border-left: none; border-bottom: 2px solid var(--red-bright); }
  .nav-level-2 { display: none; }
  .project-nav-content { padding: 0 20px; }
}

/* ============================================================
   Case study
   ============================================================ */
.case {
  max-width: var(--container);
  margin: 0 auto;
  padding: 100px 32px 60px;
}
.case-header {
  max-width: 720px;
  margin-bottom: 48px;
}
.case-header h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  color: var(--bone);
  margin: 0 0 14px;
  line-height: 1.12;
}
.case-sub {
  color: var(--taupe);
  font-size: 17px;
  margin: 0 0 16px;
}
.case-role {
  color: var(--bone-dim);
  font-size: 15px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  max-width: 62ch;
}

.case-award,
.case-photo {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  aspect-ratio: 3 / 2;
}
.case-award {
  margin-bottom: 16px;
}
.case-photo {
  margin: 0 0 80px;
}
.case-award img,
.case-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.case-award-badge {
  position: absolute;
  left: 28px;
  bottom: 28px;
  background: rgba(18, 17, 16, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.badge-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
}
.badge-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--bone);
}
.badge-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--taupe);
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.case-block {
  max-width: 78%;
  margin: 0 auto;
}
.case-block p {
  color: var(--bone-dim);
  margin: 0;
  max-width: none;
}

/* Research artifact frame — marks white/light-background source
   documents (journey maps, hardware diagrams) as preserved
   originals rather than native site design, and softens the
   brightness jump against the dark page. */
.artifact-frame {
  max-width: 78%;
  margin: 0 auto;
}
.artifact-image-wrap {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 4px;
  background: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}
.artifact-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  filter: brightness(0.94) contrast(0.97);
}
.artifact-image-wrap::after {
  content: '';
  position: absolute;
  inset: -24px;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(237, 230, 216, 0.06) 0%, rgba(237, 230, 216, 0) 70%);
  pointer-events: none;
}
/* ============================================================
   Deep-dive tracks (spatial / healthcare)
   ============================================================ */
.deep {
  border-top: 1px solid var(--hairline);
  background: var(--ink);
}
.deep--alt { background: var(--ink-soft); }
.deep-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 88px 32px;
}
.deep-inner > h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  color: var(--bone);
  margin: 0 0 40px;
  max-width: 20ch;
  line-height: 1.15;
}
.deep-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
}
.deep-cols p {
  color: var(--bone-dim);
  margin: 0 0 20px;
  max-width: 58ch;
}
.deep-cols p:last-child { margin-bottom: 0; }
.deep-note {
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--taupe) !important;
  font-size: 15px;
}
.deep-note strong { color: var(--red-bright); }

.deep-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.deep-facts li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.fact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe-dim);
}
.fact-value {
  color: var(--bone);
  font-size: 15px;
}

/* ============================================================
   Timeline / education / skills
   ============================================================ */
.timeline {
  border-top: 1px solid var(--hairline);
}
.timeline-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 96px 32px;
}
.timeline-inner > h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  color: var(--bone);
  margin: 0 0 48px;
}

.timeline-list {
  list-style: none;
  margin: 0 0 72px;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.timeline-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red-bright);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.tl-body h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  color: var(--bone);
  margin: 0 0 8px;
}
.tl-body h3 em { color: var(--taupe); font-style: italic; font-weight: 500; }
.tl-body p {
  color: var(--taupe);
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
}

.edu-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.edu ul, .skills ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.edu li {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.edu-deg { color: var(--bone); font-weight: 500; font-size: 15px; }
.edu-school { color: var(--taupe); font-size: 14px; }
.edu-date { font-family: var(--font-mono); color: var(--taupe-dim); font-size: 12px; }

.skills li {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--bone-dim);
  font-size: 14.5px;
}
.skill-cat {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe-dim);
  margin-bottom: 6px;
}

/* ============================================================
   Contact footer
   ============================================================ */
.contact {
  border-top: 1px solid var(--hairline);
  background: var(--ink-soft);
}
.contact-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 96px 32px 48px;
  text-align: center;
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--bone);
  margin: 0 0 16px;
}
.contact-lead {
  color: var(--taupe);
  font-size: 17px;
  margin: 0 0 40px;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.contact-link {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--bone);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-link:hover { color: var(--red-bright); border-color: var(--red-bright); }
.contact-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--taupe-dim);
  margin: 0 0 32px;
}
.contact-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--taupe-dim);
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

/* ============================================================
   Scroll reveal (single orchestrated pass, not per-element noise)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .tracks-inner { grid-template-columns: 1fr; }
  .track-card { border-right: none; border-bottom: 1px solid var(--hairline); }
  .track-card:last-child { border-bottom: none; }
  .deep-cols { grid-template-columns: 1fr; gap: 32px; }
  .deep-facts { border-top: 1px solid var(--hairline); }
  .edu-skills { grid-template-columns: 1fr; gap: 8px; }
  .hero-bg-img { width: 78%; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 18px; }
  .nav-links { display: none; }
  .nav-contact { font-size: 12px; padding: 9px 14px; }

  .hero-content { padding: 40px 20px 56px; }
  .hero-bg-img { width: 100%; object-position: 68% center; }
  .hero-bg-scrim {
    background:
      linear-gradient(180deg, rgba(18,17,16,0.55) 0%, var(--ink) 62%, var(--ink) 100%),
      linear-gradient(90deg, rgba(18,17,16,0.5) 0%, rgba(18,17,16,0.2) 100%);
  }
  .hero-kicker { gap: 16px; margin-bottom: 28px; }
  .hero-photo { width: 72px; height: 72px; }
  .hero-name { font-size: 20px; }
  .hero-name-subtitle { font-size: 13px; }
  .hero-line--serif { font-size: 40px; }
  .hero-line--accent { font-size: 36px; }
  .hero-dek { font-size: 15.5px; }

  .readout { grid-template-columns: 1fr; }
  .readout-item { border-right: none; border-bottom: 1px solid var(--hairline); }
  .readout-item:last-child { border-bottom: none; }

  .hero-ctas { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }

  .case, .deep-inner, .timeline-inner, .contact-inner { padding-left: 20px; padding-right: 20px; }
  .case { padding-top: 72px; }
  .case-award-badge { left: 16px; right: 16px; bottom: 16px; padding: 12px 16px; }
  .badge-title { font-size: 18px; }

  .case-block { max-width: 100%; }
  .artifact-frame { max-width: 100%; }
  .artifact-image-wrap { padding: 3px; }

  .timeline-list li { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { padding-top: 0; }

  .contact-links { gap: 20px; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .hero-photo { width: 88px; height: 88px; }
  .hero-name { font-size: 24px; }
  .hero-line--serif { font-size: 52px; }
  .hero-line--accent { font-size: 46px; }
}
