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

:root {
  --bg: #2e2a3a;
  --bg-alt: #363043;
  --bg-beyond: #3a3548;
  --ink: #ede8df;
  --ink-soft: #cbc4b8;
  --ink-muted: #9a94a8;
  --accent: #dba045;
  --accent-light: #a896d4;
  --accent-hover: #c89038;
  --accent-glow: rgba(168, 150, 212, 0.16);
  --line: rgba(237, 232, 223, 0.1);
  --font: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --text-base: 1.125rem;
  --text-sm: 1rem;
  --text-xs: 0.8125rem;
  --leading: 1.65;
  --leading-tight: 1.25;
  --page-bg: #333040;
  --page-bg-alt: #3b3749;
  --max-width: 720px;
  --header-height: 4rem;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: inherit;
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--ink);
}

.hero-eyebrow,
.section-label,
.publication-title,
.skills-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-label {
  color: var(--accent);
}

.publication-title,
.skills-label,
.hero-eyebrow {
  color: var(--ink-muted);
}

h3.publication-title {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(219, 160, 69, 0.1);
  top: -8%;
  right: -10%;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: var(--accent-glow);
  bottom: 15%;
  left: -8%;
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  background: rgba(46, 42, 58, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.pixel-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pixel-icon-logo {
  width: 1.35rem;
  height: 1.35rem;
}

.pixel-icon-hero {
  width: 2.75rem;
  height: 2.75rem;
  margin-top: 0.15rem;
}

.hero-portrait {
  flex-shrink: 0;
  margin: 0.15rem 0 0;
  padding: 3px;
  background: var(--accent);
  line-height: 0;
  box-shadow:
    3px 3px 0 #1e1b28,
    inset -2px -2px 0 var(--accent-hover),
    inset 2px 2px 0 #f0d080;
}

.hero-portrait img {
  display: block;
  width: 128px;
  height: 128px;
  max-width: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.section-heading .section-label {
  margin-bottom: 0;
}

.hero-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.site-header nav {
  display: flex;
  gap: clamp(0.75rem, 3vw, 1.5rem);
}

.site-header nav a {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: var(--accent);
}

/* Hero */

.hero {
  padding-top: var(--header-height);
}

.hero-banner {
  width: 100%;
  aspect-ratio: 2 / 1;
  max-height: min(52vh, 560px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-body {
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem);
}

.hero-lead {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: var(--text-sm);
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.pixel-icon-link {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pixel-icon-link-email {
  width: auto;
  height: 1.125rem;
}

.hero-links .link-chip {
  color: var(--accent);
}

.hero-links .link-chip:hover {
  color: var(--accent-hover);
}

/* Sections */

.section {
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem);
}

.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 4rem);
  font-weight: 500;
  line-height: 1.08;
  margin-bottom: 0;
}

.section-label {
  margin-bottom: 0;
}

/* About */

.about-lead {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 2rem;
}

.about-body p + p {
  margin-top: 1.25rem;
}

/* Timeline */

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

.timeline-date {
  color: var(--ink-muted);
}

.timeline-place {
  color: var(--accent-light);
}

.timeline-place a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 150, 212, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.timeline-place a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.timeline-item h3 {
  font-size: 1.375rem;
  margin-bottom: 0.35rem;
}

.timeline-role {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.timeline-details {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline-details li {
  position: relative;
  padding-left: 1rem;
  font-size: var(--text-base);
  color: var(--ink-soft);
  line-height: 1.6;
}

.timeline-details li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.timeline-item p {
  font-size: var(--text-base);
}

/* Publication */

.publication {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.publication-title {
  margin-bottom: 0.75rem;
}

.publication-name {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  line-height: var(--leading-tight);
  margin-bottom: 1rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.publication-resource {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.publication-resource .pixel-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.publication-resource:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

.publication-resource .arrow {
  transition: transform 0.2s;
}

.publication-resource:hover .arrow {
  transform: translateX(4px);
}

/* Education */

.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.edu-degree {
  font-size: 1.375rem;
}

.edu-school {
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

.edu-detail {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.skills-label {
  margin-bottom: 1rem;
}

.skills-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skills-tags li {
  font-size: var(--text-sm);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(219, 160, 69, 0.1);
}

/* Beyond */

.section-beyond {
  background: var(--bg-beyond);
}

.beyond-quote {
  border: none;
}

.beyond-quote p {
  font-size: 1.375rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink);
}

.beyond-quote p + p {
  margin-top: 1.5rem;
  font-size: var(--text-base);
  font-style: normal;
  color: var(--ink-soft);
}

.beyond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.beyond-card {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
}

.beyond-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.beyond-card-lead {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.beyond-card-lead a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(219, 160, 69, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.beyond-card-lead a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.beyond-stats {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.beyond-stat-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.beyond-favorite {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.beyond-favorite-cover {
  flex-shrink: 0;
  display: block;
  width: 4.5rem;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.beyond-favorite-cover:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.beyond-favorite-cover img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.beyond-favorite-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.15rem;
}

.beyond-favorite-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.beyond-favorite-title {
  font-size: 1.125rem;
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.beyond-favorite-author {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.beyond-playlists {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.beyond-playlists li + li {
  margin-top: 0.75rem;
}

.beyond-playlists a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-base);
  transition: color 0.2s;
}

.beyond-playlists a:hover {
  color: var(--accent);
}

.beyond-playlist-note {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.beyond-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.beyond-profile-link:hover {
  color: var(--accent-hover);
}

.beyond-profile-link .arrow {
  margin-left: 0.1rem;
}

.beyond-embed {
  margin-top: 2rem;
  max-width: 100%;
}

/* Contact */

.section-contact {
  padding-bottom: 6rem;
}

.contact-lead {
  margin-bottom: 2rem;
  max-width: 40ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.contact-links .link-chip {
  font-size: var(--text-sm);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #2e2a3a;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 2px;
  transition: background 0.2s, transform 0.2s;
}

.contact-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.contact-link.link-chip {
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.contact-link.link-chip:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

/* Footer */

.site-footer {
  padding: 2rem clamp(1.25rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* Reveal animation */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Roadmap progress rail */

.roadmap {
  position: fixed;
  top: 50%;
  right: clamp(0.85rem, 2vw, 1.85rem);
  transform: translateY(-50%);
  z-index: 90;
  pointer-events: none;
}

.roadmap-track {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.4rem;
}

.roadmap-track::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  right: calc(1.1rem - 1px);
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line) 0,
    var(--line) 4px,
    transparent 4px,
    transparent 8px
  );
}

.roadmap-fill-wrap {
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  right: calc(1.1rem - 1px);
  width: 2px;
}

.roadmap-fill {
  display: block;
  width: 100%;
  height: 0;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(219, 160, 69, 0.6);
  transition: height 0.25s ease;
}

.roadmap-stop {
  position: relative;
  z-index: 1;
}

.roadmap-stop a {
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 0.6rem;
  text-decoration: none;
}

.roadmap-node {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 rgba(14, 10, 24, 0.5);
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.roadmap-node .pixel-icon {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.roadmap-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(46, 42, 58, 0.94);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(0.5rem);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.roadmap-stop a:hover .roadmap-label,
.roadmap-stop a:focus-visible .roadmap-label,
.roadmap-stop a.is-active .roadmap-label {
  opacity: 1;
  transform: translateX(0);
}

.roadmap-stop a:hover .roadmap-node,
.roadmap-stop a:focus-visible .roadmap-node {
  border-color: var(--accent-light);
  transform: translateX(-2px);
}

.roadmap-stop a.is-visited .roadmap-node {
  border-color: rgba(219, 160, 69, 0.5);
}

.roadmap-stop a.is-visited .roadmap-node .pixel-icon {
  opacity: 0.8;
}

.roadmap-stop a.is-active .roadmap-node {
  border-color: var(--accent);
  background: rgba(219, 160, 69, 0.16);
  box-shadow: 2px 2px 0 rgba(14, 10, 24, 0.5), 0 0 12px rgba(219, 160, 69, 0.45);
  transform: scale(1.08);
}

.roadmap-stop a.is-active .roadmap-node .pixel-icon {
  opacity: 1;
}

@media (max-width: 1024px) {
  .roadmap {
    display: none;
  }
}

/* Book page turns */

.book-stage {
  perspective: 2000px;
  max-width: calc(var(--max-width) + 8rem);
  width: 100%;
  margin: 0 auto;
}

.book-sheet {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(-92deg);
  opacity: 0.15;
  background: var(--page-bg);
  border-radius: 0 8px 8px 0;
  padding: 3.25rem 2.5rem 3.25rem 2.85rem;
  box-shadow: -16px 0 32px rgba(14, 10, 24, 0.45);
  transition:
    transform 2s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 1.1s ease,
    box-shadow 2s ease;
}

.book-sheet.scroll-driven {
  transition: box-shadow 0.6s ease;
  will-change: transform, opacity;
}

.section-alt .book-sheet,
.section-beyond .book-sheet {
  background: var(--page-bg-alt);
}

.book-sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(219, 160, 69, 0.3);
  border-radius: 4px 0 0 4px;
}

.book-sheet::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: rgba(237, 232, 223, 0.12);
  opacity: 1;
  transition: opacity 2s ease;
}

.book-sheet.turned {
  transform: rotateY(0deg);
  opacity: 1;
  box-shadow:
    0 8px 28px rgba(14, 10, 24, 0.35),
    inset 6px 0 14px rgba(0, 0, 0, 0.18);
}

.book-sheet.turned::after {
  opacity: 0;
}

/* Reveal animation */

@media (max-width: 640px) {
  .site-header nav a:nth-child(n+4) {
    display: none;
  }

  .hero-body {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .book-sheet {
    padding: 2.5rem 1.5rem 2.5rem 2rem;
  }

  .hero-banner {
    max-height: 40vh;
  }
}

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

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

  .page-reveal,
  .book-sheet {
    opacity: 1;
    transform: none;
    transition: none;
    box-shadow: none;
  }
}
