:root {
  --ink: #111827;
  --night: #101a2c;
  --paper: #dedad3;
  --white: #f8f8f6;
  --pad: clamp(1.25rem, 7vw, 8rem);
  --ease: cubic-bezier(.22,.68,.25,1);
  font-family: "Instrument Sans", system-ui, sans-serif;
  --editorial: "Instrument Serif", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; color: var(--white); background: var(--night); }
html:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid #668fd2; outline-offset: 5px; }
.skip { position: fixed; z-index: 50; left: 1rem; top: -5rem; padding: .7rem; color: white; background: var(--night); }
.skip:focus { top: .8rem; }

.header { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: clamp(.65rem,2vw,1.35rem) var(--pad); color: white; pointer-events: none; }
.header a { pointer-events: auto; }
.brand { display: grid; place-items: center; min-height: 2.6rem; padding: 0 .82rem; border-radius: 2rem; font-size: .95rem; font-weight: 800; letter-spacing: -.055em; background: #111724ed; }
.header nav { display: flex; gap: .1rem; border-radius: 3rem; padding: .2rem; background: #111724ed; backdrop-filter: blur(18px); }
.header nav a { padding: .52rem clamp(.62rem, 1.35vw, 1rem); border-radius: 3rem; font-size: .875rem; transition: background .2s; }
.header nav a:hover { background: #ffffff23; }
.header nav a:last-child { color: #111827; background: #e9e6df; }

.hero { --hero-scroll: 0; position: relative; isolation: isolate; min-height: max(35rem, 100svh); display: flex; align-items: center; overflow: clip; color: #151717; background: #c8c4bd; }
.hero-portrait { position: absolute; width: 100%; height: 100%; inset: 0; z-index: -3; object-fit: cover; object-position: 61% 43%; transform: scale(calc(1 + var(--hero-scroll) * .085)) translateY(calc(var(--hero-scroll) * 4%)); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, #e4dfd489 0%, #ded9ce65 26%, transparent 52%); }
.hero-wash { position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: calc(.4 + var(--hero-scroll) * .6); transform: translateY(calc(38% - var(--hero-scroll) * 45%)); background: linear-gradient(0deg, #142747 0%, #223e66b2 27%, #64799626 59%, transparent 75%); }
.hero-content { margin-left: var(--pad); max-width: 42%; padding: 4rem 0; transform: translateY(calc(var(--hero-scroll) * -2rem)); }
.hero h1 { font: 400 clamp(4rem, 8.2vw, 8.5rem)/.83 var(--editorial); letter-spacing: -.03em; }
.hero h1 span { color: #2c4772; }
.hero-content p { margin-top: 1.25rem; font-size: clamp(1rem, 1.55vw, 1.4rem); letter-spacing: -.02em; }
.hero-link { position: absolute; bottom: 2rem; left: var(--pad); padding: .65rem 0; min-height: 2.6rem; font-size: .9rem; font-weight: 700; border-bottom: 1px solid currentColor; }
.hero-link span { margin-left: .55rem; }

.work-section { color: var(--white); background: var(--night); }
.section-heading { padding: clamp(5rem, 10vw, 9.5rem) var(--pad) clamp(1rem,3vw,2.5rem); }
.section-heading h2, .contact h2 { font: 400 clamp(3.5rem, 8vw, 8rem)/.9 var(--editorial); letter-spacing: -.035em; }
.project-scene { --entry: 1; --scale: 0; min-height: 122svh; position: relative; }
.project-scene:nth-child(odd) { --direction: 1; }
.project-scene:nth-child(even) { --direction: -1; }
.scene-stage { position: sticky; top: 0; min-height: 100svh; overflow: clip; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(1rem,4vw,5rem); padding: 4.75rem var(--pad) 3rem; border-top: 1px solid #f2f4fe32; }
.project-scene:nth-child(even) .scene-copy { order: 2; }
.scene-copy { position: relative; z-index: 1; opacity: calc(.22 + var(--entry) * .78); transform: translateY(calc((1 - var(--entry)) * 1.1rem)); }
.scene-copy h3 { font: 400 clamp(2.4rem, 5vw, 5.5rem)/.91 var(--editorial); letter-spacing: -.022em; max-width: 12ch; text-wrap: balance; }
.scene-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .98rem; margin-top: clamp(1rem, 2vw, 1.5rem); border-radius: 2rem; border: 1px solid currentColor; background: transparent; font-size: .9rem; transition: background .2s, color .2s; }
.scene-link:hover { color: var(--night); background: var(--white); }
.work-card { justify-self: center; width: min(100%, 24rem, 41svh); border: 0; padding: 0; background: none; transform: translateX(calc(var(--direction) * (1 - var(--entry)) * clamp(1.5rem, 5vw, 4.5rem))) scale(calc(.94 + var(--entry) * .06 + var(--scale) * .055)); }
.work-media { position: relative; display: block; }
.scene-cover { position: relative; z-index: 1; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: .35rem; box-shadow: 0 1.15rem 3rem #05091370; }
.open-mark { position: absolute; display: grid; place-items: center; right: .8rem; bottom: .8rem; z-index: 2; width: 2.7rem; aspect-ratio: 1; font-size: 1rem; border-radius: 50%; color: white; background: #10141bdc; transition: transform .3s var(--ease), background .3s; }
.work-card:hover .open-mark { transform: scale(1.13); background: #1f3d68; }

.designs { color: var(--ink); background: #e8e5dd; }
.designs .scene-stage { border-color: #171c2333; }
.designs .scene-link:hover { color: var(--white); background: var(--night); }
.designs .work-card { width: min(79%, 23rem, 47svh); }
.designs .scene-cover { object-fit: contain; background: #252322; aspect-ratio: 3 / 4; }
.slide-behind { position: absolute; inset: 5% 0 auto; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: .3rem; box-shadow: 0 .8rem 2rem #11182742; opacity: .75; }
.slide-behind.left { transform: translateX(calc(-14% - var(--scale) * 8%)) rotate(calc(-4deg - var(--scale) * 3deg)) scale(.91); }
.slide-behind.right { transform: translateX(calc(14% + var(--scale) * 8%)) rotate(calc(4deg + var(--scale) * 3deg)) scale(.91); }
.contact { min-height: 58svh; padding: clamp(4.5rem,9vw,8.5rem) var(--pad) 3rem; }
.contact a { display: inline-block; margin-top: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid; font-size: clamp(1.15rem, 2.6vw, 1.85rem); }
.contact a span { margin-left: .5rem; }

.project-dialog { color: var(--white); background: transparent; width: min(48rem, calc(100% - 1.5rem)); max-width: none; max-height: none; padding: 0; border: 0; overflow: visible; }
.project-dialog::backdrop { background: #080c15db; backdrop-filter: blur(8px); }
.dialog-panel { background: #151d2a; border: 1px solid #ffffff49; border-radius: .7rem; max-height: calc(100dvh - 1.5rem); overflow: auto; overscroll-behavior: contain; }
.dialog-header { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: start; gap: .75rem; padding: clamp(.75rem, 2vw, 1.25rem); background: #151d2a; }
.dialog-header h2 { padding-top: .3rem; font: 400 clamp(1.8rem, 4vw, 3.3rem)/.94 var(--editorial); letter-spacing: -.01em; }
.dialog-media { padding: 0 clamp(.55rem, 2vw, 1.25rem) .75rem; }
.icon-button { display: grid; place-items: center; width: 2.75rem; aspect-ratio: 1; flex: none; padding: 0; border: 1px solid #ffffff51; border-radius: 50%; background: #0e1521; color: white; font-size: 1.55rem; line-height: 1; }
.icon-button:hover { color: #151d2a; background: #e7e9ed; }
.dialog-media video { width: auto; height: min(72dvh, 46rem); max-width: 100%; margin: 0 auto; display: block; border-radius: .3rem; background: black; }
.video-player { position: relative; display: grid; justify-items: center; }
.video-play { position: absolute; top: 48%; left: 50%; translate: -50% -50%; width: 3.75rem; background: #0e1521da; font-size: 1.2rem; }
.video-play[hidden] { display: none; }
.project-gallery { display: grid; justify-items: center; gap: .5rem; }
.gallery-image { width: 100%; height: min(61dvh, 42rem); padding: 0; border: 0; border-radius: .3rem; background: #0e1521; overflow: hidden; cursor: zoom-in; touch-action: pan-y; }
.gallery-image img { width: 100%; height: 100%; object-fit: contain; }
.gallery-image.expanded { overflow: auto; cursor: zoom-out; touch-action: auto; }
.gallery-image.expanded img { height: auto; width: min(150%, 1100px); max-width: none; }
.gallery-controls { width: min(100%, 28rem); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem; text-align: center; }
.gallery-status { font-size: .875rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero-portrait { animation: portrait-enter 1050ms var(--ease) both; }
  .hero h1 { animation: hero-enter 920ms 90ms var(--ease) both; }
  .hero-content p, .hero-link { animation: hero-enter 850ms 200ms var(--ease) both; }
  .hero-link { animation-delay: 270ms; }
}
@keyframes hero-enter { from { opacity: 0; translate: 0 .7rem; } to { opacity: 1; translate: 0; } }
@keyframes curtain-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes curtain-out { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 740px) {
  :root { --pad: clamp(1.08rem,5vw,2.7rem); }
  .hero { align-items: start; min-height: max(35rem, 97svh); }
  .hero-portrait { top: 15%; height: 85%; object-position: 65% center; }
  .hero::before { background: linear-gradient(180deg, #c8c4bd 15%, #c8c4bd00 39%), linear-gradient(90deg, #dcd8d07d, transparent 52%); }
  .hero-wash { opacity: calc(.61 + var(--hero-scroll) * .39); transform: translateY(calc(13% - var(--hero-scroll) * 26%)); }
  .hero-content { margin-top: 5.3rem; padding: 0; max-width: 86%; }
  .hero h1 { font-size: clamp(3.6rem, 13.8vw, 5.75rem); }
  .hero-content p { margin-top: .8rem; }
  .hero-link { color: white; bottom: 1.5rem; }
  .section-heading { padding-top: 5rem; }
  .project-scene { min-height: 108svh; }
  .scene-stage { grid-template-columns: minmax(0,1fr); align-content: center; gap: 1.25rem; padding-top: 4.5rem; padding-bottom: 2rem; }
  .project-scene:nth-child(even) .scene-copy { order: 0; }
  .scene-copy h3 { max-width: 16ch; }
  .work-card { width: min(75%, 19rem, 33svh); }
  .designs .work-card { width: min(63%, 21rem, 41svh); }
  .work-card { transform: translateX(calc(var(--direction) * (1 - var(--entry)) * clamp(1rem, 6vw, 2.1rem))) scale(calc(.95 + var(--entry) * .05 + var(--scale) * .045)); }
}
@media (max-height: 490px) and (orientation: landscape) {
  .project-scene { min-height: auto; }
  .scene-stage { position: relative; grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project-scene { min-height: auto; }
  .scene-stage { position: relative; min-height: min(100svh, 52rem); }
  .work-card, .scene-copy { transform: none; opacity: 1; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.catalog-toggle {
  flex: none;
  min-height: 2.75rem;
  padding: .5rem 0 .4rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-weight: 550;
  transition: opacity .25s var(--ease);
}
.catalog-toggle:hover { opacity: .7; }
.catalog-toggle > [aria-hidden] { margin-left: .45rem; }
.catalog[hidden] { display: none; }
.catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1.4rem clamp(.8rem, 2.2vw, 2.4rem);
  padding: .9rem var(--pad) clamp(2rem,5vw,4rem);
}
.catalog-card {
  display: grid;
  gap: .3rem;
  align-content: start;
  min-width: 0;
  text-align: start;
  line-height: 1.2;
  padding: 0 0 .9rem;
  border: 0;
  border-bottom: 1px solid #9a9ba77d;
  background: none;
}
.catalog-card > span:not(.catalog-cover) { font-weight: 550; }
.catalog-card small { font-size: .84rem; opacity: .75; }
.catalog-cover { display: block; overflow: hidden; aspect-ratio: 4 / 5; margin-bottom: .38rem; background: #252c3930; }
.catalog-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 540ms var(--ease); }
.designs .catalog-cover img { object-fit: contain; }
.catalog-card:hover img { transform: scale(1.035); }
.gallery-controls { width: min(100%, 26rem); grid-template-columns: 2.1rem minmax(0,1fr) 2.1rem; gap: .3rem; }
.gallery-rail { display: flex; align-items: center; justify-content: center; gap: .28rem; min-width: 0; padding: .35rem .15rem; }
.gallery-rail button {
  display: block;
  flex: 0 1 2.65rem;
  min-width: 0;
  padding: .13rem;
  border: 1px solid transparent;
  border-radius: .19rem;
  background: transparent;
  opacity: .58;
  transition: opacity 240ms var(--ease), border-color 240ms var(--ease);
}
.gallery-rail button[aria-current], .gallery-rail button:hover { opacity: 1; border-color: #d5e3fb; }
.gallery-rail img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.gallery-arrow { width: 2.1rem; height: 2.8rem; padding: 0; border: 0; background: transparent; font-size: 1.25rem; }
.gallery-arrow:hover { color: #a3bff0; }
@keyframes portrait-enter { from { opacity: .25; scale: 1.025; } to { opacity: 1; scale: 1; } }
.project-dialog[open]::backdrop { animation: curtain-in .45s var(--ease) both; }
.project-dialog.closing::backdrop { animation: curtain-out .3s ease-in-out both; }
@media (prefers-reduced-motion: reduce) {
  .hero-portrait { animation: curtain-in .26s ease-out both; }
  .project-dialog[open]::backdrop { animation-duration: .23s; }
  .project-dialog.closing::backdrop { animation-duration: .17s; }
}
@media (max-width: 740px) {
  .catalog { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-toggle { font-size: .9rem; }
}
.catalog-transition { overflow: clip; }


/* One field of light per section, behind the heading, catalog, and featured work. */
@property --glow-phase {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0turn;
}
:root {
  --page-night: #111a2b;
  --page-paper: #e5ded2;
  --night-light: #6695d6;
  --paper-light: #fff4e1;
}
:is(.hero, .work-section, .about, .contact) {
  isolation: isolate;
  overflow: clip;
  --glow-color: var(--night-light);
  --glow-strength: .63;
}
.work-section, .contact { position: relative; background: var(--page-night); }
.work-section.designs, .about {
  background: var(--page-paper);
  --glow-color: var(--paper-light);
  --glow-strength: .76;
}
.hero { --glow-strength: .22; }

:is(.hero, .work-section, .about, .contact)::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -20%;
  opacity: calc(var(--glow-strength) * (.89 + sin(var(--glow-phase)) * .11));
  background:
    radial-gradient(ellipse 46% 55% at 11% 61%,
      var(--glow-color),
      color-mix(in srgb, var(--glow-color) 65%, transparent) 25%,
      color-mix(in srgb, var(--glow-color) 22%, transparent) 61%,
      transparent 100%);
  mask-image: linear-gradient(transparent 9%, black 34%, black 70%, transparent 92%);
  --orbit-x: clamp(24px, 6vw, 86px);
  --orbit-y: clamp(20px, 4vw, 56px);
  transform: translate3d(calc(cos(var(--glow-phase)) * var(--orbit-x)), calc(sin(var(--glow-phase)) * var(--orbit-y)), 0);
  animation: glow-drift 16s linear infinite;
  translate: var(--glow-x, 0px) var(--glow-y, 0px);
  transition: translate 630ms cubic-bezier(.18,.68,.29,1);
}
.work-section::after {
  inset: calc(var(--glow-scroll, 0px) - 4rem) -20% auto;
  height: calc(100svh + 8rem);
}
.hero::after { mask-image: linear-gradient(black 45%, transparent 79%); }
@keyframes glow-drift { to { --glow-phase: 1turn; } }
@media (prefers-reduced-motion: reduce) {
  :is(.hero, .work-section, .about, .contact)::after {
    --orbit-x: clamp(12px, 3vw, 40px);
    --orbit-y: clamp(5px, 1.7vw, 19px);
    animation-duration: 22s;
    transition-duration: 630ms !important;
  }
}
.lights-managed :is(.hero, .work-section, .about, .contact):not(.lights-visible)::after {
  animation-play-state: paused;
}

.hero::before {
  background: linear-gradient(0deg, var(--page-night), transparent 30%),
    linear-gradient(90deg, #e4dfd489 0%, #ded9ce65 26%, transparent 52%);
}
.hero-wash { background: linear-gradient(0deg, var(--page-night), transparent 60%); }
.hero-link { color: var(--white); }
.scene-stage, .designs .scene-stage { border-top: 0; }
.section-fade { height: clamp(10rem, 37svh, 23rem); }
.to-designs { background: linear-gradient(var(--page-night), var(--page-paper)); }
.to-contact { background: linear-gradient(var(--page-paper), var(--page-night)); }

.about {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(1.5rem,4vw,4rem);
  padding: clamp(5.25rem,10vw,9rem) var(--pad) clamp(3.75rem,8vw,7rem);
  color: var(--ink);
}
.about h2 { font: 400 clamp(3.5rem,8vw,8rem)/.9 var(--editorial); letter-spacing: -.035em; }
.about-copy { max-width: 30rem; }
.about-copy > p:first-child { font: 400 clamp(1.6rem,3.4vw,3rem)/1.05 var(--editorial); }
.about-copy strong { font-weight: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .13em; }
.about-note { margin: clamp(1.8rem,4vw,3.15rem) 0 .65rem; font-size: .88rem; font-weight: 600; }
.about-tools { padding: 0; margin: 0; list-style: none; }
.about-tools li { padding: .58rem 0; border-top: 1px solid #383b4c42; font-size: clamp(.95rem,1.55vw,1.19rem); }

@media (max-width: 740px) {
  .hero::before {
    background: linear-gradient(0deg, var(--page-night), transparent 28%),
      linear-gradient(180deg,#c8c4bd 15%,#c8c4bd00 39%),
      linear-gradient(90deg,#dcd8d07d,transparent 52%);
  }
  .about { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 430px) {
  .header { padding-inline: .55rem; gap: .25rem; }
  .header nav { white-space: nowrap; gap: 0; }
  .header nav a { padding-inline: .48rem; font-size: .79rem; }
  .brand { padding-inline: .55rem; white-space: nowrap; font-size: .8rem; }
}
@media (max-width: 350px) {
  .header { padding-inline: .4rem; }
  .header nav a { padding-inline: .25rem; }
  .brand { padding-inline: .4rem; }
}
