:root {
  color-scheme: dark;
  --canvas: #070a12;
  --surface: #0e1420;
  --surface-hover: #141d2f;
  --line: #263247;
  --text: #f3f6fd;
  --muted: #aeb9cc;
  --accent: #a7c3ff;
  --blue: #3158dc;
  --gutter: clamp(20px, 5.6vw, 88px);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}

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

body {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.6;
}

main { flex: 1; }

h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  line-height: 1.12;
  font-weight: 670;
}

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

a { color: inherit; }

button { font: inherit; }

:focus-visible {
  outline: 2px solid #b3ceff;
  outline-offset: 4px;
}

.shell {
  width: min(1248px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: var(--gutter);
  padding: 9px 15px;
  transform: translateY(-200%);
  border-radius: 6px;
  background: var(--text);
  color: var(--canvas);
}

.skip-link:focus { transform: none; }

/* Site navigation */
.site-header {
  position: relative;
  z-index: 3;
  background: #090d16;
  border-bottom: 1px solid #1e293d;
}

.header-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  font-size: 0.94rem;
  font-weight: 780;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-domain { color: var(--muted); font-weight: 590; }

.saber-mark {
  position: relative;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: #e1f3ff;
  box-shadow: 0 0 5px 1px #568cff, 0 0 13px 2px #255def;
}

.saber-mark::before {
  position: absolute;
  inset: -1px auto -1px 0;
  width: 6px;
  border-right: 1px solid #c1d3f6;
  border-radius: 2px 0 0 2px;
  background: #455575;
  content: "";
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(6px, 1.8vw, 27px);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 570;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current] { color: var(--text); }

.nav-links a[aria-current] {
  box-shadow: inset 0 -2px var(--accent);
}

.site-nav .nav-contact {
  padding-inline: 17px;
  border: 1px solid #364865;
  border-radius: 8px;
  color: var(--text);
}

.site-nav .nav-contact:hover,
.site-nav .nav-contact[aria-current] {
  border-color: #7297e7;
  background: #16243f;
}

/* Home */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 23%, #5485ed 75%, transparent);
  pointer-events: none;
  content: "";
}

.hero-scene {
  position: relative;
  width: min(100%, 1580px);
  margin-inline: auto;
}

.hero-art {
  position: absolute;
  inset: 50% 0 auto auto;
  width: min(73vw, 980px);
  max-width: none;
  transform: translateY(-50%);
  mask-image: linear-gradient(90deg, transparent, #000 27%, #000 87%, transparent);
}

.hero-scene::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(0deg, var(--canvas), transparent 16%, transparent 93%, var(--canvas));
  pointer-events: none;
  content: "";
}

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: clamp(518px, 41vw, 580px);
  display: flex;
  align-items: center;
}

.hero-copy { padding-block: 55px 62px; }

.hero h1 {
  font-size: clamp(5rem, 9vw, 8rem);
  font-weight: 740;
  line-height: 0.89;
  letter-spacing: -0.047em;
}

.hero h1 span {
  display: block;
  padding-bottom: 0.11em;
  color: #d0dfff;
  background: linear-gradient(100deg, #eef4ff 12%, #9fbaff 98%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 28ch;
  margin-top: 17px;
  color: #bac6dd;
  font-size: clamp(1.125rem, 1.7vw, 1.375rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 27px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.button-primary {
  background: var(--blue);
  border-color: #5378f4;
  color: #fff;
  box-shadow: 0 4px 20px #224be037;
}

.button-primary:hover { background: #3e63e7; }

.button-quiet { border-color: #35425c; background: #0b1220db; }

.button-quiet:hover { border-color: #748bb6; background: #152139; }

.play-icon {
  width: 0;
  height: 0;
  border-block: 5px solid transparent;
  border-left: 8px solid var(--accent);
}

.featured-section { padding-block: clamp(41px, 5vw, 68px) clamp(54px, 7vw, 98px); }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px 20px;
  margin-bottom: 21px;
}

.section-heading h2 {
  font-size: clamp(1.85rem, 3.3vw, 2.85rem);
  letter-spacing: -0.033em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 32px;
  color: var(--accent);
  font-size: 0.94rem;
  font-weight: 620;
  text-decoration: none;
}

.text-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.featured-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.featured-card,
.project-card,
.profile-card,
.file-card,
.resource-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.featured-card { overflow: hidden; text-decoration: none; }

.featured-card:hover,
.file-card:hover { border-color: #6181bd; background: var(--surface-hover); }

.featured-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #020407;
}

.featured-card:hover img { filter: brightness(1.13); }

.featured-card-info {
  position: relative;
  padding: 16px 53px 19px 18px;
  border-top: 1px solid #27344b;
}

.featured-card-info h3 { margin-top: 6px; font-size: clamp(1.18rem, 2vw, 1.48rem); letter-spacing: -0.026em; }

.project-category { color: var(--muted); font-size: 0.83rem; font-weight: 560; }

.featured-arrow {
  position: absolute;
  right: 17px;
  bottom: 18px;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid #33425e;
  border-radius: 50%;
  color: var(--accent);
  line-height: 1;
}

.intro-dialog {
  width: min(800px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #455a81;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 100px #000a;
}

.intro-dialog::backdrop { background: #02040bd9; }

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 20px;
}

.dialog-heading h2 { font-size: 1.18rem; }

.dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151f31;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { border-color: #7896c6; }

.intro-dialog video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 100px);
  background: #020407;
}

/* Interior pages */
.page { padding-block: clamp(39px, 6vw, 83px) clamp(58px, 8vw, 104px); }

.page-intro { margin-bottom: clamp(24px, 4vw, 43px); }

.page-intro::before {
  display: block;
  width: 48px;
  height: 2px;
  margin-bottom: 22px;
  border-radius: 2px;
  background: #c4deff;
  box-shadow: 0 0 6px 1px #416bf5, 0 0 17px #2154eb;
  content: "";
}

.page-intro h1 {
  font-size: clamp(2.8rem, 7.4vw, 6.25rem);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.048em;
  overflow-wrap: break-word;
}

.page-intro p {
  max-width: 60ch;
  margin-top: 15px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: clamp(36px, 5vw, 61px);
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 13px;
  border: 1px solid #364661;
  border-radius: 8px;
  background: #0f1726;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 560;
  text-decoration: none;
}

.section-nav a:hover { border-color: #7799df; background: #172644; }

.work-section { scroll-margin-top: 24px; }

.work-section + .work-section { margin-top: clamp(42px, 6vw, 76px); }

.work-section > h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: -0.033em;
}

.work-section > h2::after {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #3d5684, #182132);
  content: "";
}

.project-grid { align-items: start; }

.project-card { min-width: 0; scroll-margin-top: 24px; }

.project-card:target {
  border-color: #8caeff;
  box-shadow: 0 0 0 2px #527ee643;
}

.project-video,
.project-image {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 5;
  background: #020407;
}

.project-video { object-fit: contain; }
.project-image { object-fit: cover; }

.project-card > .project-video,
.project-card > .project-image { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }

.project-content { padding: 16px 17px 5px; }

.project-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.project-content h3 { font-size: 1.21rem; letter-spacing: -0.025em; }

.project-heading time,
.clip-meta time {
  flex: none;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.project-download { margin-top: 4px; font-size: 0.85rem; }

.project-notes { margin-top: 6px; border-top: 1px solid var(--line); }

.project-notes summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 580;
  list-style: none;
  cursor: pointer;
}

.project-notes summary::-webkit-details-marker { display: none; }
.project-notes summary:hover { color: var(--text); }

.project-notes summary::after {
  width: 7px;
  height: 7px;
  margin-inline-end: 4px;
  transform: rotate(45deg);
  border: solid var(--accent);
  border-width: 0 1px 1px 0;
  content: "";
}

.project-notes[open] summary::after { transform: rotate(225deg); }

.project-notes p { padding: 4px 0 13px; color: var(--muted); font-size: 0.92rem; }

.project-stills {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.project-stills img {
  width: min(46%, 118px);
  height: auto;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.back-link { margin-bottom: 14px; }

.clip-page { max-width: 860px; }
.clip-page .page-intro { margin-bottom: 23px; }
.clip-page .project-video { max-height: 65vh; border: 1px solid var(--line); border-radius: var(--radius); }

.clip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.clip-notes { margin-top: 28px; }

.clip-notes .project-stills { margin-top: 18px; }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 710px) minmax(260px, 340px);
  align-items: start;
  justify-content: space-between;
  gap: clamp(30px, 6vw, 78px);
}

.prose { max-width: 70ch; color: var(--muted); }

.prose h2,
.profile-card h2,
.contact-card h2 { margin-bottom: 13px; color: var(--text); font-size: 1.38rem; letter-spacing: -0.025em; }

.prose p + p { margin-top: 1em; }

.bio-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.bio-photos img { align-self: start; border-radius: 7px; }

.profile-card { padding: clamp(19px, 3vw, 27px); }

.portrait { max-width: 100%; margin-bottom: 21px; border-radius: 9px; }

.profile-card dl { margin: 0; }

.profile-card dl > div { padding-block: 10px; border-top: 1px solid var(--line); }

.profile-card dl > div:last-child { padding-bottom: 0; }

.profile-card dt { font-weight: 650; }

.profile-card dd { margin: 2px 0 0; color: var(--muted); font-size: 0.94rem; }

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 820px;
}

.file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 104px;
  padding: 19px;
  text-decoration: none;
}

.file-icon {
  display: grid;
  width: 45px;
  height: 54px;
  place-items: center;
  border: 1px solid #516b99;
  border-radius: 6px;
  background: #152340;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 680;
}

.file-info { display: grid; gap: 2px; }
.file-info strong { font-size: 1.14rem; font-weight: 650; line-height: 1.25; }
.file-info span { color: var(--muted); font-size: 0.91rem; }
.file-arrow { color: var(--accent); }

.resource-list { display: grid; gap: 14px; max-width: 940px; }

.resource-card {
  display: grid;
  grid-template-columns: minmax(120px, 175px) minmax(0, 1fr);
  align-items: start;
  gap: 21px;
  padding: 19px;
}

.resource-card img { width: 100%; border-radius: 6px; }
.resource-card h2 { font-size: 1.23rem; }
.resource-card h2 a { display: inline-block; padding-block: 3px; text-decoration: none; }
.resource-card h2 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.resource-card h2 span { padding-left: 4px; color: var(--accent); }
.resource-card p { margin-top: 6px; color: var(--muted); }

.contact-card {
  max-width: 850px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 38px;
  padding: clamp(21px, 4vw, 42px);
  background: radial-gradient(ellipse at 95% 20%, #152747, transparent 60%), var(--surface);
}

.contact-card img { border-radius: 8px; }

.contact-email {
  color: var(--accent);
  font-size: clamp(1.15rem, 3vw, 1.9rem);
  font-weight: 660;
  text-underline-offset: 5px;
  overflow-wrap: anywhere;
}

.contact-email:hover { color: var(--text); }
.contact-note { margin-block: 17px 13px; color: var(--muted); }
.contact-note p + p { margin-top: 4px; }

.sample-list {
  display: grid;
  gap: 10px;
  max-width: 70ch;
  margin-block: 21px;
  padding: 0;
  list-style: none;
}

.sample-list a {
  display: block;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 580;
  text-decoration: none;
}

.sample-list a:hover { border-color: #6181bd; text-decoration: underline; text-underline-offset: 4px; }
.sample-signature img { width: auto; margin-top: 8px; border-radius: 5px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; text-decoration: none; }
.footer-inner a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.footer-inner a span { color: var(--accent); }

@media (max-width: 990px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 6px;
  }

  .site-brand { align-self: flex-start; }
  .site-nav, .nav-links { display: flex; gap: 5px; }
  .site-nav { justify-content: space-between; }
  .nav-links { flex: 1; justify-content: space-between; }
  .site-nav a { padding-inline: 5px; font-size: 0.875rem; }

  .site-nav .nav-contact {
    padding-inline: 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
  }

  .site-nav .nav-contact[aria-current] { box-shadow: inset 0 -2px var(--accent); }

  .hero-scene { display: flex; flex-direction: column; }

  .hero-art {
    position: relative;
    inset: auto;
    align-self: end;
    width: min(118%, 620px);
    margin-block: -23px -12px;
    transform: none;
    mask-image: linear-gradient(0deg, transparent, #000 12%, #000 86%, transparent);
  }

  .hero-scene::after { display: none; }
  .hero-inner { min-height: 0; order: -1; }
  .hero-copy { padding-block: 45px 0; }
  .hero h1 { font-size: clamp(3.5rem, 16.5vw, 6.6rem); }
  .hero p { margin-top: 15px; }
  .hero-actions { margin-top: 21px; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 550px) {
  .featured-grid,
  .project-grid,
  .download-grid,
  .contact-card { grid-template-columns: minmax(0, 1fr); }

  .resource-card { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .resource-card img { max-width: 175px; }
  .contact-card img { max-width: min(100%, 180px); }
}

@media (forced-colors: active) {
  .hero h1 span { -webkit-text-fill-color: currentColor; }
  .nav-links a[aria-current],
  .site-nav .nav-contact[aria-current] { text-decoration: underline; }
}
