:root {
  color-scheme: light dark;
  --bg: #f0f0ed;
  --bg-rgb: 240, 240, 237;
  --surface: #e5e5e0;
  --surface-deep: #d8d8d1;
  --ink: #20211f;
  --muted: #686963;
  --line: rgba(32, 33, 31, 0.18);
  --accent: #d85f40;
  --accent-rgb: 216, 95, 64;
  --accent-ink: #782a18;
  --nav-bg: rgba(240, 240, 237, 0.88);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: min(92vw, 1440px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #191a18;
    --bg-rgb: 25, 26, 24;
    --surface: #242522;
    --surface-deep: #30312d;
    --ink: #efefeb;
    --muted: #aaa9a2;
    --line: rgba(239, 239, 235, 0.18);
    --accent: #e36f50;
    --accent-rgb: 227, 111, 80;
    --accent-ink: #ffc9ba;
    --nav-bg: rgba(25, 26, 24, 0.88);
  }
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191a18;
  --bg-rgb: 25, 26, 24;
  --surface: #242522;
  --surface-deep: #30312d;
  --ink: #efefeb;
  --muted: #aaa9a2;
  --line: rgba(239, 239, 235, 0.18);
  --accent: #e36f50;
  --accent-rgb: 227, 111, 80;
  --accent-ink: #ffc9ba;
  --nav-bg: rgba(25, 26, 24, 0.88);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", "Neue Haas Grotesk Text Pro", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(4vw, 24px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color .4s var(--ease), background-color .4s var(--ease);
}
.site-header.is-scrolled { border-color: var(--line); }
.wordmark { font-size: 1.1rem; font-weight: 750; letter-spacing: -.04em; }
nav { display: flex; gap: clamp(1.25rem, 3vw, 3rem); font-size: .9rem; }
nav a { position: relative; padding: .45rem 0; color: var(--muted); transition: color .3s var(--ease); }
nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .2rem;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}
nav a:hover, nav a:focus-visible, nav a.is-active { color: var(--ink); }
nav a:hover::after, nav a:focus-visible::after, nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { background: var(--surface); border-color: var(--muted); }
.theme-toggle:active { transform: scale(.96); }
.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.theme-icon-sun { opacity: 0; transform: rotate(-35deg) scale(.75); }
.theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(35deg) scale(.75); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }
  :root:not([data-theme]) .theme-icon-moon { opacity: 0; transform: rotate(35deg) scale(.75); }
}

.has-media-hero .site-header:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(15, 16, 15, .5), transparent);
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.has-media-hero .site-header:not(.is-scrolled) .wordmark,
.has-media-hero .site-header:not(.is-scrolled) nav a { color: #efefeb; }
.has-media-hero .site-header:not(.is-scrolled) nav a::after { background: #efefeb; }
.has-media-hero .site-header:not(.is-scrolled) .theme-toggle {
  color: #efefeb;
  border-color: rgba(239, 239, 235, .42);
}
.has-media-hero .site-header:not(.is-scrolled) .theme-toggle:hover {
  background: rgba(239, 239, 235, .12);
  border-color: rgba(239, 239, 235, .72);
}

.hero {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  padding: 96px max(4vw, 24px) 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #1d1e1c;
}
.hero-media,
.hero-fallback,
.hero-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-media { z-index: -2; overflow: hidden; }
.hero-fallback {
  background:
    radial-gradient(circle at 72% 28%, rgba(216, 95, 64, .52), transparent 28%),
    radial-gradient(circle at 24% 76%, rgba(74, 92, 89, .76), transparent 36%),
    linear-gradient(135deg, #313a40, #1d1e1c 52%, #4a2e29);
}
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh;
  height: 56.25vw;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero-scrim {
  z-index: -1;
  background:
    radial-gradient(circle at center, rgba(12, 13, 12, .16), transparent 52%),
    linear-gradient(180deg, rgba(12, 13, 12, .48), rgba(12, 13, 12, .24) 42%, rgba(12, 13, 12, .62));
  pointer-events: none;
}
.hero-intro {
  width: min(100%, 1180px);
  text-align: center;
  color: #efefeb;
  text-shadow: 0 2px 28px rgba(12, 13, 12, .28);
}
.hero-year {
  margin: 0 0 1.5rem;
  color: rgba(239, 239, 235, .82);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(5rem, 11vw, 10rem);
  font-weight: 500;
  line-height: .88;
  letter-spacing: -.08em;
}
.hero-role {
  margin: 1.8rem 0 0;
  color: rgba(239, 239, 235, .9);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: .01em;
}
.hero-line {
  opacity: 0;
  transform: translateY(24px);
  animation: hero-line-in .95s var(--ease) forwards;
}
.hero h1.hero-line { animation-delay: .14s; }
.hero-role.hero-line { animation-delay: .3s; }
@keyframes hero-line-in { to { opacity: 1; transform: translateY(0); } }

.section-shell { width: var(--page); margin: 0 auto; }
.selected-video { padding: clamp(7rem, 12vw, 11rem) 0 clamp(8rem, 14vw, 13rem); }
.selected-video h2 {
  margin: 0 0 clamp(3rem, 6vw, 6rem);
  font-size: clamp(3rem, 7vw, 7.2rem);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.07em;
}
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.work { padding: clamp(7rem, 14vw, 13rem) 0; }
.section-heading { max-width: 680px; margin-bottom: clamp(4rem, 8vw, 8rem); }
.section-heading h2, .about h2, .resume h2 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 7.2rem);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.07em;
}

.project-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2.2vw, 2.5rem); row-gap: clamp(5rem, 10vw, 10rem); align-items: start; }
.project-wide { grid-column: span 7; }
.project-narrow { grid-column: span 5; }
.project-offset { margin-top: clamp(5rem, 10vw, 10rem); }
.project-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--radius); background: #10110f; }
.project-info { padding-top: 1rem; }
.project-info h3 { margin: 0; font-size: clamp(1.2rem, 1.8vw, 1.8rem); font-weight: 520; letter-spacing: -.035em; }
.project-info .category { margin: .35rem 0 0; color: var(--accent-ink); font-size: .78rem; }

.about {
  min-height: 100dvh;
  padding: clamp(7rem, 12vw, 11rem) 0;
  display: grid;
  grid-template-columns: minmax(250px, 4fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(3rem, 8vw, 9rem);
  row-gap: clamp(3rem, 6vw, 6rem);
  align-content: center;
}
.about-heading { grid-column: 1; }
.about-visual {
  grid-column: 1;
  position: relative;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-deep);
}
.about-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.about-copy {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  max-width: 800px;
}
.about-copy p { max-width: 65ch; margin: 0; }
.about-lead { font-size: clamp(1.75rem, 3.1vw, 3.25rem); line-height: 1.12; letter-spacing: -.045em; }
.about-copy p:not(.about-lead) { margin-top: 2.2rem; color: var(--muted); font-size: 1rem; line-height: 1.75; }

.resume { padding: clamp(7rem, 12vw, 11rem) 0 clamp(9rem, 15vw, 14rem); border-top: 1px solid var(--line); }
.resume-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: clamp(5rem, 9vw, 9rem);
}
.resume-header p { max-width: 48ch; margin: 1.4rem 0 0; color: var(--muted); line-height: 1.6; }
.resume-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: .85rem 1.3rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: .88rem;
  font-weight: 650;
  white-space: nowrap;
  transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.resume-button:hover { transform: translateY(-2px); background: transparent; color: var(--ink); }
.resume-button:active { transform: scale(.98); }
.resume-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); gap: clamp(4rem, 9vw, 10rem); align-items: start; }
.resume-main, .resume-sidebar { display: grid; gap: clamp(4.5rem, 8vw, 7rem); }
.resume-block { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.resume-block h3 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -.02em; }
.resume-entry { margin-top: 2.5rem; }
.resume-entry + .resume-entry { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--line); }
.resume-entry h4, .project-list h4 { margin: 0; font-size: clamp(1.2rem, 1.7vw, 1.55rem); font-weight: 540; letter-spacing: -.035em; }
.resume-position, .resume-organization { margin: .5rem 0 0; color: var(--accent-ink); font-size: .9rem; }
.resume-meta, .resume-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.resume-meta { margin-top: 1.2rem; color: var(--muted); font-size: .82rem; }
.resume-meta > span:last-child { text-align: right; }
.resume-entry-heading > span { flex: 0 0 auto; color: var(--muted); font-size: .8rem; }
.resume-entry ul { max-width: 62ch; margin: 1.5rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.resume-entry li + li { margin-top: .6rem; }
.project-list { display: grid; gap: 2rem; margin-top: 2.5rem; }
.project-list article { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(0, 1.8fr) auto; gap: 1.5rem; align-items: baseline; padding-left: 1.2rem; border-left: 2px solid var(--accent); }
.project-list p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.project-list time { color: var(--muted); font-size: .78rem; }
.compact-list { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.compact-list li { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.compact-list-inline { grid-template-columns: auto auto; justify-content: start; gap: 2rem; }
.site-footer { min-height: 160px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.site-footer a { color: var(--ink); font-weight: 700; }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-on-load { animation: load-in .95s var(--ease) both; }
@keyframes load-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 900px) {
  .resume-layout { grid-template-columns: 1fr; }
  .resume-sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
  .resume-sidebar .compact-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  :root { --page: calc(100vw - 32px); --radius: 12px; }
  .site-header { height: 64px; padding: 0 16px; }
  nav { gap: .95rem; font-size: .8rem; }
  .theme-toggle { width: 32px; height: 32px; flex-basis: 32px; }
  .hero { padding: 88px 16px 32px; }
  .hero h1 { font-size: clamp(4rem, 20vw, 5.4rem); line-height: .88; }
  .hero-year { margin-bottom: 1.2rem; }
  .hero-role { margin-top: 1.4rem; }
  .selected-video { padding: 7rem 0 8rem; }
  .selected-video h2 { margin-bottom: 3.5rem; }
  .work { padding: 7rem 0; }
  .section-heading { margin-bottom: 4.5rem; }
  .project-grid { display: block; }
  .project-card { margin: 0 0 5rem; }
  .project-card:last-child { margin-bottom: 0; }
  .about { min-height: auto; padding: 7rem 0; display: block; }
  .about-visual { width: min(100%, 380px); margin-top: 3.5rem; }
  .about-copy { margin-top: 3.5rem; }
  .about-lead { font-size: clamp(1.9rem, 8.5vw, 2.75rem); }
  .resume { padding: 7rem 0 8rem; }
  .resume-header { display: block; margin-bottom: 5rem; }
  .resume-button { width: 100%; margin-top: 2.5rem; }
  .resume-sidebar { grid-template-columns: 1fr; gap: 4.5rem; }
  .resume-entry-heading, .resume-meta { display: block; }
  .resume-entry-heading > span, .resume-meta span { display: block; margin-top: .9rem; }
  .resume-meta > span:last-child { text-align: left; }
  .project-list article { grid-template-columns: minmax(0, 1fr) auto; gap: .65rem 1rem; }
  .project-list p { grid-column: 1 / -1; }
  .compact-list { grid-template-columns: 1fr 1fr; }
  .compact-list-inline { grid-template-columns: auto auto; }
  .site-footer { min-height: 180px; grid-template-columns: 1fr auto; }
  .site-footer p:first-of-type { grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .hero-line { opacity: 1; transform: none; }
  .hero-video { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
