@font-face {
  font-family: Barlow Condensed;
  src: url("fonts/barlow-condensed-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: IBM Plex Mono;
  src: url("fonts/ibm-plex-mono.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080e19;
  --ink: #f3eee5;
  --muted: #a9bdce;
  --accent: #a6f5ab;
  --line: #293e52;
  --display: "Barlow Condensed", Impact, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", monospace;
  --gutter: clamp(24px, 5.35vw, 96px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, sans-serif;
}

::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, p, figure { margin: 0; }

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

.skip {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 10;
  transform: translateY(-180%);
  padding: 10px 18px;
  color: var(--bg);
  background: var(--ink);
}

.skip:focus { transform: none; }

.masthead {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: #080e19;
}

.masthead-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 75px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font: 700 29px/.95 var(--display);
  letter-spacing: .035em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-dot { color: var(--accent); }
.mark {
  display: inline-block;
  width: 31px;
  height: 31px;
  margin-right: 9px;
  background: url("mark.svg") center/cover no-repeat;
  border-radius: 4px;
}

nav { display: flex; gap: clamp(15px, 3vw, 51px); }
nav a, .back-link {
  padding-block: 8px;
  color: var(--muted);
  text-decoration: none;
  font: 12px/1.3 var(--mono);
}

nav a:hover, .back-link:hover { color: var(--accent); }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #080e19;
  border-bottom: 1px solid var(--line);
}

.hero-picture, .hero-shade { position: absolute; inset: 0; z-index: -1; }
.hero-picture, .hero-shade { left: auto; width: min(56%, 720px); }
.hero-picture img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero-shade {
  background:
    linear-gradient(90deg, #080e19 0%, #080e19cf 10%, #080e1952 27%, transparent 55%),
    linear-gradient(0deg, #080e19e6, transparent 28%);
}

.hero-layout {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(600px, 49vw, 790px);
  padding-block: 65px 110px;
}

.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font: 400 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .115em;
}

.point {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px #87fbaf63;
}

.hero h1 {
  margin: 13px 0 5px -0.032em;
  font: 700 clamp(98px, 15.7vw, 248px)/.83 var(--display);
  letter-spacing: -.025em;
}

.hero h1 span { color: var(--accent); }
.hero-subtitle {
  font: italic 400 clamp(35px, 4.35vw, 69px)/1.05 var(--serif);
  letter-spacing: -.014em;
  margin-top: 20px;
}

.hero-description { max-width: 35ch; color: #e0e7ef; margin-top: 15px; }
.hero-link {
  display: inline-flex;
  gap: 34px;
  align-items: center;
  margin-top: 31px;
  padding: 13px 15px;
  border: 1px solid #73bfa8;
  text-decoration: none;
  text-transform: uppercase;
  font: 11px/1 var(--mono);
  letter-spacing: .06em;
  transition: background-color 180ms, color 180ms;
}

.hero-link span { font: 18px/1 system-ui, sans-serif; }
.hero-link:hover { background: var(--accent); color: var(--bg); }

.hero-index {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 15px;
  border-top: 1px solid #8bbacd65;
  color: #c0dce3;
  font: 10px/1.4 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hero-index > span:last-child { display: inline-flex; align-items: center; gap: 9px; }
.index-line { width: 26px; height: 1px; background: #9cd8de80; }

.studies, .gallery { padding-block: clamp(62px, 7vw, 112px); }

.study-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.study-controls[hidden], .gallery-open[hidden] { display: none; }
.study-controls button, .gallery-open, .viewer-controls button {
  min-height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: 12px var(--mono);
  cursor: pointer;
}

.study-controls button:hover, .gallery-open:hover, .viewer-controls button:not([aria-disabled="true"]):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-open {
  margin-bottom: 20px;
  border-color: #73bfa8;
}

.study-carousel {
  --study-gap: clamp(14px, 2vw, 28px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--study-gap)) / 2);
  gap: var(--study-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.study-carousel .study { scroll-snap-align: start; }
.study-carousel img { aspect-ratio: 4 / 5; object-fit: cover; }

@media (max-width: 540px) {
  .study-carousel { grid-auto-columns: 85%; }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 25px;
  margin-bottom: 30px;
}

.section-header h1, .section-header h2, .project h2, .book h2 {
  font: 700 clamp(52px, 7.1vw, 108px)/.88 var(--display);
  text-transform: uppercase;
  letter-spacing: -.015em;
  margin-top: 14px;
}

.section-note {
  max-width: 28ch;
  color: var(--muted);
  text-align: right;
  font: 12px/1.6 var(--mono);
}

.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 2.4vw, 36px);
}

.gallery { border-top: 1px solid var(--line); }
.study { min-width: 0; }
.study-image {
  position: relative;
  display: block;
  overflow: hidden;
  background: #10243a;
}

.study-image img { width: 100%; height: auto; transition: transform 350ms; }
@media (hover: hover) {
  .study-image:hover img { transform: scale(1.035); }
}
.study-image span {
  position: absolute;
  right: 13px;
  bottom: 13px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: #071421e8;
  border: 1px solid #668ca0;
  color: var(--ink);
  font-size: 19px;
}

.study-image:hover span { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.study figcaption { padding-block: 18px 20px; border-bottom: 1px solid var(--line); }
.study h3 { margin-block: 7px 2px; font: 400 clamp(30px, 3.1vw, 50px)/1 var(--serif); }
.study figcaption > p:last-child { color: var(--muted); font-size: 14px; }

.essay {
  overflow: hidden;
  border-block: 1px solid #2c455c;
  background: #0c1b2b;
}

.essay-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  padding-block: clamp(56px, 7vw, 116px);
}

.essay h2 {
  margin-block: 18px 24px;
  font: 400 clamp(53px, 6.1vw, 102px)/.9 var(--serif);
  letter-spacing: -.025em;
}

.essay h2 em { display: inline-block; color: var(--accent); }
.essay-copy > p:not(.eyebrow), .project-copy {
  max-width: 59ch;
  color: #c4d2dc;
  line-height: 1.75;
}

.essay-copy > p + p, .project-copy > p + p { margin-top: 15px; }
.curve-plate { position: relative; }
.curve-plate canvas { width: 100%; height: auto; display: block; }

.project {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: 32px;
  padding-block: clamp(62px, 7vw, 112px);
}

.book {
  border-block: 1px solid var(--line);
  background: #0c1b2b;
}

.book-inner {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(35px, 8vw, 130px);
  align-items: center;
  padding-block: clamp(58px, 7vw, 106px);
}

.book-cover {
  aspect-ratio: 5 / 6;
  width: min(100%, 340px);
  justify-self: center;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(14px, 2.9vw, 40px);
  background:
    linear-gradient(0deg, #060d19 4%, #0a162bb8 34%, #05213700 79%),
    url("art/earbud-detail.webp") 44% 20% / cover;
  border: 1px solid #436880;
  border-left: 8px solid #243b50;
  box-shadow: 9px 9px 0 #080e19, 10px 10px 0 #293e52, 16px 20px 32px #02060cb0;
}

.book-cover > span:first-child { font: 700 clamp(30px, 5vw, 71px)/.9 var(--display); }
.book-cover > span:last-child { margin-top: 6px; color: var(--muted); font: 11px/1.35 var(--mono); }
.book-copy > p:not(.eyebrow) { max-width: 52ch; color: #c4d2dc; line-height: 1.75; margin-top: 16px; }

.footer-domain { font: 11px/1.3 var(--mono); color: var(--muted); }
.back-link span { margin-left: 5px; color: var(--accent); }

dialog {
  width: fit-content;
  max-width: min(94vw, 780px);
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #668ca0;
  color: var(--ink);
  background: #102132;
}

dialog::backdrop { background: #050b16ed; }
body:has(dialog[open]) { overflow: hidden; }
.viewer-content { padding: 12px; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 0 0 10px 6px; }
.viewer-bar h2 { font: 400 35px/1 var(--serif); }
.viewer-bar button {
  border: 1px solid #668ca0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  width: 40px;
  height: 40px;
  font-size: 25px;
  line-height: 1;
}

.viewer-bar button:hover { background: var(--accent); color: var(--bg); }
#viewer-image:not([src]) { display: none; }
#viewer-image { max-height: 73dvh; object-fit: contain; margin-inline: auto; }
#viewer-caption { color: var(--muted); font-size: 14px; padding: 10px 6px 2px; }

.gallery-viewer {
  width: min(94vw, 780px);
  height: min(94dvh, 900px);
}

.gallery-viewer .viewer-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
}

.gallery-viewer #viewer-image {
  width: 100%;
  height: 100%;
  max-height: none;
  touch-action: pan-y pinch-zoom;
}

@media (width > 820px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .gallery-grid .study-image img {
    height: min(48dvh, 420px);
    object-fit: contain;
  }

  .gallery-viewer { height: min(94dvh, 740px); }
}

.gallery-viewer .viewer-bar button { width: 44px; height: 44px; flex-shrink: 0; }
.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font: 12px var(--mono);
}

.viewer-controls button[aria-disabled="true"] { opacity: .45; cursor: default; }

@media (max-width: 820px) {
  .essay-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 8px; }
  .project { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .masthead-inner, .footer-inner { min-height: 62px; gap: 9px; }
  .brand { font-size: 24px; }
  .mark { width: 26px; height: 26px; margin-right: 4px; }
  nav { gap: clamp(9px, 2.5vw, 20px); }
  nav a, .back-link { font-size: 10px; }
  .hero-picture {
    display: block;
    position: relative;
    width: 100%;
    height: clamp(260px, 100vw, 425px);
    background: #100f16;
  }
  .hero-picture img { object-fit: contain; object-position: center; }
  .hero-shade { display: none; }
  .hero-layout { min-height: 0; padding-block: 28px 73px; }
  .hero h1 { font-size: clamp(68px, 19vw, 124px); }
  .hero-subtitle { margin-top: 15px; }
  .hero-description { font-size: 14px; }
  .hero-link { margin-top: 23px; }
  .hero-index { font-size: 9px; }
  .index-line { width: 13px; }
  .section-header { display: block; margin-bottom: 23px; }
  .section-note { margin-top: 13px; text-align: left; max-width: none; }
  .gallery-grid { grid-template-columns: 1fr; gap: 28px; }
  .gallery-viewer { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; }
  .essay-inner, .project, .book-inner { grid-template-columns: 1fr; }
  .book-copy { grid-row: 1; }
  .book-cover { max-width: 240px; }
  .curve-plate { max-width: 375px; margin-inline: auto; }
  .project { gap: 22px; }
  .footer-domain { font-size: 10px; }
}

@media (max-width: 365px) {
  .masthead-inner { flex-wrap: wrap; gap: 0; padding-block: 12px 5px; }
  nav { flex-basis: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

#age-form { padding: clamp(20px, 5vw, 42px); }
#age-form h2 { margin: 0 0 12px; font: 400 35px/1 var(--serif); }
#age-form .hero-link { cursor: pointer; }

#gallery-password-step p { margin-block: 12px; }
#gallery-password-step label { display: block; }
#gallery-password {
  display: block;
  width: min(100%, 24rem);
  min-height: 44px;
  padding: 8px 12px;
  margin-top: 6px;
  font: inherit;
}
