/* ---------- Fonts (self-hosted, latin + latin-ext) ---------- */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --bg: oklch(0.12 0.008 260);
  --bg-raised: oklch(0.15 0.01 260);
  --fg: oklch(0.96 0.005 80);
  --accent: oklch(0.8 0.1 250);
  --text-2: oklch(0.82 0.008 260);
  --text-3: oklch(0.78 0.008 260);
  --label: oklch(0.72 0.01 260);
  --dim: oklch(0.62 0.01 260);
  --footer: oklch(0.65 0.01 260);
  --rule: oklch(0.3 0.01 260);
  --rule-soft: oklch(0.24 0.01 260);
  --link-rule: oklch(0.6 0.01 260);
  --gutter: clamp(20px, 4vw, 56px);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', serif;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
img { display: block; }
h1, h2, p, figure { margin: 0; }

.serif { font-family: var(--serif); font-weight: 400; }
.label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.meta { font-size: 13px; color: var(--text-3); }
.link-rule { font-size: 13px; border-bottom: 1px solid var(--link-rule); padding-bottom: 2px; align-self: flex-start; white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--fg); color: var(--bg); padding: 8px 12px; font-size: 12px; }
.skip:focus { left: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero nav {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px var(--gutter);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.hero nav div { display: flex; flex-wrap: wrap; gap: clamp(16px, 2.4vw, 32px); }
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to top, var(--bg) 12%, transparent);
  pointer-events: none;
}
.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 5vw, 56px);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px;
}
.hero-title { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero-title .label { color: var(--accent); }
.hero h1 { font-size: clamp(56px, 9vw, 132px); line-height: 0.9; letter-spacing: -0.015em; }
.hero-aside { display: flex; flex-direction: column; gap: 14px; max-width: 300px; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.hero-aside p { text-wrap: pretty; }

/* ---------- Sections ---------- */
.section {
  max-width: 1440px; margin: 0 auto;
  padding: clamp(100px, 12vw, 160px) var(--gutter) 0;
  display: flex; flex-direction: column; gap: clamp(32px, 4vw, 56px);
  scroll-margin-top: 0;
}
#favourites { padding-top: clamp(80px, 10vw, 140px); gap: clamp(40px, 5vw, 72px); }
#catalogue { gap: 32px; }
#about { padding-bottom: clamp(100px, 12vw, 160px); }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--rule); padding-top: 20px;
}
.section-head h2 { font-size: clamp(40px, 5vw, 64px); line-height: 1; }

/* ---------- Image frames ---------- */
.frame {
  display: block; width: 100%; position: relative; overflow: hidden;
  background: var(--bg-raised); cursor: zoom-in;
}
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.4s ease; }
.frame:hover img { transform: scale(1.015); }
@media (prefers-reduced-motion: reduce) { .frame img { transition: none; } .frame:hover img { transform: none; } }
.r-3-2 { aspect-ratio: 3 / 2; }
.r-4-5 { aspect-ratio: 4 / 5; }
.r-16-10 { aspect-ratio: 16 / 10; }
.r-4-3 { aspect-ratio: 4 / 3; }
.r-1-1 { aspect-ratio: 1 / 1; }
.pos-flame img { object-position: 55% 50%; }
.pos-veil img { object-position: 75% 50%; }
.pos-gear img { object-position: 50% 80%; }
.pos-portrait img { object-position: 50% 30%; }

/* ---------- Favourites ---------- */
.feature { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 24px; }
.feature-name { font-family: var(--serif); font-size: 32px; line-height: 1.1; }
.caption-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 32px; align-items: baseline; }
.caption-split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.caption-split > div { display: flex; flex-direction: column; gap: 8px; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(32px, 4vw, 56px); }

/* ---------- Catalogue ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters[hidden] { display: none; }
.filters button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid oklch(0.4 0.01 260); background: transparent; color: oklch(0.9 0.005 80);
}
.filters button:hover { border-color: var(--fg); }
.filters button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: oklch(0.14 0.01 260); }
.filters span { opacity: 0.7; }
.rows { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 140px) minmax(0, 160px) 28px;
  gap: 16px; align-items: baseline; padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft); cursor: pointer;
}
.row:hover { background: var(--bg-raised); color: var(--fg); }
.row-num { font-size: 12px; color: var(--dim); }
.row-name { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; }
.row-cat { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.row-detail { font-size: 13px; color: var(--text-2); }
.row-icon { font-size: 14px; color: var(--accent); text-align: right; }
@media (max-width: 640px) {
  .row { grid-template-columns: 32px minmax(0, 1fr) 20px; grid-template-areas: "num name icon" ". meta meta"; gap: 6px 12px; }
  .row-num { grid-area: num; }
  .row-name { grid-area: name; }
  .row-icon { grid-area: icon; }
  .row-cat, .row-detail { grid-area: meta; }
  .row-cat { justify-self: start; }
  .row-detail { justify-self: end; text-align: right; }
}

/* ---------- Eclipse ---------- */
.eclipse-top { display: flex; flex-wrap: wrap; gap: clamp(32px, 4vw, 56px); align-items: flex-start; }
.eclipse-main { display: flex; flex-direction: column; gap: 14px; flex: 2 1 560px; min-width: 0; }
.eclipse-side { display: flex; flex-direction: column; gap: 20px; flex: 1 1 300px; min-width: 0; }
.prose { font-size: 13px; line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.gear-list { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.gear-list li { padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(20px, 3vw, 40px); }
.trio figure { display: flex; flex-direction: column; gap: 12px; }
.trio figcaption { display: flex; flex-direction: column; gap: 6px; }
.trio .serif { font-size: 24px; }
.trio .meta { line-height: 1.6; text-wrap: pretty; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: clamp(32px, 5vw, 80px); align-items: start; }
.about .frame { cursor: default; }
.about .frame:hover img { transform: none; }
.about-copy { display: flex; flex-direction: column; gap: 32px; }
.about-lede { font-family: var(--serif); font-size: clamp(32px, 3.6vw, 48px); line-height: 1.15; text-wrap: pretty; }
.about-body { font-size: 14px; line-height: 1.7; color: var(--text-2); max-width: 520px; text-wrap: pretty; }
.contacts { display: flex; flex-direction: column; }
.contacts a { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.contacts a:last-child { border-bottom: 1px solid var(--rule); }
.contacts a span:last-child { text-align: right; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
footer {
  max-width: 1440px; margin: 0 auto; padding: 32px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-size: 12px; letter-spacing: 0.06em; color: var(--footer);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: oklch(0.08 0.006 260); color: var(--fg);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--gutter); }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--gutter); }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity 0.3s ease; }
.lb-stage img.loaded { opacity: 1; }
.lb-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 32px;
  padding: 18px var(--gutter) 24px;
}
.lb-bar > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; min-width: 0; }
.lb-title { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); line-height: 1.1; }
.lightbox button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  background: transparent; color: var(--fg); border: 0; padding: 8px 0; cursor: pointer;
}
.lightbox button:hover { color: var(--accent); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 96px; font-size: 22px !important; letter-spacing: 0 !important;
}
.lb-prev { left: 4px; }
.lb-next { right: 4px; }
.lb-nav[hidden] { display: none; }
@media (max-width: 640px) { .lb-nav { display: none; } }
html:has(.lightbox[open]) { overflow: hidden; }
