/* ==========================================================================
   Ivan Iofrida — Scientific Illustration & Paleoart
   Design system: museum-plate / natural-history monograph.
   ========================================================================== */

:root {
  --paper: #f4f0e8;
  --paper-2: #ebe5d8;
  --card: #fffdf8;
  --ink: #1b1916;
  --ink-2: #4b463e;
  --muted: #6c6659;
  --line: #d8d0c1;
  --line-2: #e6dfd1;
  --accent: #2b6a66;
  --accent-2: #8a4b1d;
  --accent-soft: #7db6b1;
  --night: #14181a;
  --night-2: #1c2225;
  --on-night: #ece7dd;
  --on-night-2: #b7b1a4;
  --shadow: 0 1px 2px rgba(27, 25, 22, .06), 0 14px 32px -18px rgba(27, 25, 22, .28);
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark surfaces re-map the tokens locally. */
.theme-dark {
  --paper: var(--night);
  --paper-2: #1a1f22;
  --card: var(--night-2);
  --ink: var(--on-night);
  --ink-2: #cdc7ba;
  --muted: #a09a8d;
  --line: rgba(236, 231, 221, .2);
  --line-2: rgba(236, 231, 221, .12);
  --accent: var(--accent-soft);
  background: var(--paper);
  color: var(--ink);
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img, svg, iframe { max-width: 100%; }
img { height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .2s;
}
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
em { font-style: italic; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 780px); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: var(--paper);
  padding: 10px 16px; text-decoration: none; font-size: .85rem; transition: top .2s;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.eyebrow {
  display: flex; align-items: center; gap: 14px; margin: 0 0 1.4em;
  font: 700 .7rem/1 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .8em; padding: 1em 1.6em;
  border: 1px solid currentColor; border-radius: 0; background: transparent; color: var(--ink);
  font: 700 .7rem/1.2 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn::after { content: "→"; font-size: 1.15em; letter-spacing: 0; transition: transform .25s var(--ease); }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:hover::after { transform: translateX(4px); }
.btn--solid { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn--solid:hover { background: #6f3a13; border-color: #6f3a13; color: #fff; }
.btn--light { color: #fff; }
.btn--light:hover { background: #fff; border-color: #fff; color: var(--night); }
.btn--small { padding: .8em 1.2em; font-size: .64rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; height: var(--header-h); border-bottom: 1px solid var(--line); }
/* The blur lives on a pseudo-element: a backdrop-filter on the header itself would trap the fixed mobile menu inside it. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
}
.site-header__inner {
  height: 100%; width: min(100% - 2 * var(--gutter), 1440px); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand__logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.brand__name { display: block; font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1; letter-spacing: .005em; }
.brand__role { display: block; margin-top: 6px; font: 700 .58rem/1 var(--font-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__list > li { position: relative; }

.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 14px 12px;
  background: none; border: 0; cursor: pointer;
  font: 700 .68rem/1 var(--font-ui); letter-spacing: .17em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; transition: color .2s;
}
.nav__link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after, .is-current > .nav__link::after { transform: scaleX(1); }
.nav__link[aria-current="page"], .is-current > .nav__link { color: var(--ink); }

.nav__chev { width: 9px; height: 9px; transition: transform .25s var(--ease); }
.has-sub:hover .nav__chev, .has-sub.is-open .nav__chev { transform: rotate(180deg); }

.sub {
  position: absolute; top: 100%; left: 0; min-width: 240px; margin: 0; padding: 8px; list-style: none;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .25s var(--ease), visibility .2s;
}
.has-sub:hover > .sub, .has-sub:focus-within > .sub, .has-sub.is-open > .sub { opacity: 1; visibility: visible; transform: none; }
.sub a {
  display: block; padding: 11px 14px; color: var(--ink-2); text-decoration: none;
  font: 400 .92rem/1.2 var(--font-ui); transition: background .2s, color .2s, padding .25s var(--ease);
}
.sub a:hover, .sub a[aria-current="page"] { background: var(--paper-2); color: var(--ink); padding-left: 20px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer; color: var(--ink);
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; margin: 6px auto; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 1040px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 55; padding: 12px var(--gutter) 48px;
    background: var(--paper); overflow-y: auto; align-items: flex-start;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility .25s;
  }
  .nav-open { overflow: hidden; }
  .nav-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; align-items: stretch; width: 100%; gap: 0; }
  .nav__list > li { border-bottom: 1px solid var(--line-2); }
  .nav__link { width: 100%; justify-content: space-between; padding: 20px 2px; font-size: .8rem; }
  .nav__link::after { display: none; }
  .sub {
    position: static; min-width: 0; padding: 0 0 12px 12px; border: 0; box-shadow: none; background: transparent;
    opacity: 1; visibility: visible; transform: none; display: none;
  }
  .has-sub.is-open > .sub { display: block; }
  .has-sub:hover > .sub { display: none; }
  .has-sub.is-open:hover > .sub { display: block; }
  .sub a { padding: 12px 8px; font-size: 1rem; }
}

/* ---------- Page hero ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: #fff;
  padding: clamp(80px, 13vw, 168px) 0 clamp(48px, 7vw, 92px);
}
.page-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 24, 26, .5) 0%, rgba(20, 24, 26, .78) 62%, rgba(20, 24, 26, .92) 100%);
}
.page-hero--light { color: var(--ink); background: var(--paper-2); }
.page-hero--light::after { background: linear-gradient(180deg, rgba(244, 240, 232, .55) 0%, rgba(244, 240, 232, .9) 78%, var(--paper) 100%); }
.page-hero--plain { background: transparent; color: var(--ink); padding-bottom: clamp(24px, 4vw, 48px); }
.page-hero--plain::after { display: none; }
.page-hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.6rem); font-weight: 500; line-height: .98; letter-spacing: -.01em;
}
.page-hero .eyebrow { color: var(--accent-soft); }
.page-hero--light .eyebrow, .page-hero--plain .eyebrow { color: var(--accent); }
.page-hero__lead { max-width: 60ch; margin: 1.4em 0 0; color: rgba(255, 255, 255, .82); font-size: 1.15rem; }
.page-hero--light .page-hero__lead, .page-hero--plain .page-hero__lead { color: var(--ink-2); }

/* ---------- Generic sections ---------- */
.section { padding: clamp(48px, 7vw, 100px) 0; }
.section--tight { padding: clamp(32px, 5vw, 64px) 0; }
.section--alt { background: var(--paper-2); }
.section-title { font-size: clamp(2rem, 3.6vw, 3rem); margin: 0 0 .5em; }
.section-head { margin-bottom: clamp(28px, 4vw, 52px); }
.section-head p { max-width: 62ch; color: var(--ink-2); }

.rule { border: 0; border-top: 1px solid var(--line); margin: clamp(32px, 5vw, 64px) 0; }

/* Chapter banner (skeletal clades, collaboration groups) */
.chapter {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; background: var(--night);
  min-height: clamp(150px, 19vw, 250px); display: flex; align-items: flex-end;
  margin: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 52px);
}
.chapter:first-child { margin-top: 0; }
.chapter__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.chapter::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20, 24, 26, .82) 0%, rgba(20, 24, 26, .3) 70%, rgba(20, 24, 26, .1) 100%); }
.chapter__inner { padding: 28px 0; }
.chapter h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 500; }
.chapter .eyebrow { color: var(--accent-soft); margin-bottom: .9em; }

/* ---------- Plates (gallery) ---------- */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: clamp(20px, 2.6vw, 36px); }
.plates--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.plates + .plates, .wrap + .wrap > .plates { margin-top: 0; }
.gallery-flow .plates { margin-bottom: clamp(20px, 2.6vw, 36px); }
.plates--flush { margin-top: clamp(20px, 2.6vw, 36px); }

.plate { margin: 0; display: flex; flex-direction: column; }
.plate--wide { grid-column: 1 / -1; }

.plate__media {
  position: relative; display: block; overflow: hidden; cursor: zoom-in; color: inherit;
  background: #fff; border: 1px solid var(--line-2); aspect-ratio: 3 / 2; padding: clamp(6px, 1.4vw, 18px);
  transition: border-color .3s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.plate__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .8s var(--ease); }
.plate__media:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); }
.plate__media:hover img { transform: scale(1.02); }
.plate__media::after {
  content: ""; position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 15px no-repeat;
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .3s var(--ease);
}
.plate__media:hover::after, .plate__media:focus-visible::after { opacity: .92; transform: none; }

/* Paintings: no mat, floating on the dark gallery wall; never cropped. */
.plate--art .plate__media { aspect-ratio: 4 / 3; padding: 0; background: transparent; border-color: transparent; }
.plate--art .plate__media img { object-fit: contain; }
.plate--art .plate__media:hover { border-color: transparent; box-shadow: none; }
.plate--art .plate__media::after { right: 8px; bottom: 8px; }
.process .plate__media { aspect-ratio: auto; padding: 0; background: transparent; border-color: var(--line-2); }
.process .plate__media img { width: 100%; height: auto; }

.plate__cap { padding: 16px 2px 0; }
.plate__title { font-size: clamp(1.4rem, 2.1vw, 1.75rem); font-weight: 500; line-height: 1.15; }
.plate__title em { font-style: italic; }
.plate__cap p { margin: .55em 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.6; }
.plate__cap p:first-of-type { margin-top: .6em; }
.plate__cap .btn { margin-top: 1.1em; }

/* Justified rows for paintings */
.wall { display: flex; flex-wrap: wrap; gap: clamp(18px, 2.4vw, 34px); }
.wall::after { content: ""; flex-grow: 1000; }
.wall .plate { flex: var(--ar) 1 calc(var(--ar) * var(--row-h, 300px)); min-width: min(100%, 240px); }
.wall .plate__media { aspect-ratio: auto; height: auto; }
.wall .plate__media img { height: auto; object-fit: cover; }
.wall--dark .plate__media { background: transparent; border-color: transparent; }

/* Credit / advice block */
.credit {
  margin-top: 18px; padding: 18px 20px; background: color-mix(in srgb, var(--paper-2) 70%, transparent); border-left: 2px solid var(--accent);
}
.credit__label { margin: 0 0 12px; font: 700 .64rem/1.2 var(--font-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.credit__people { display: flex; flex-wrap: wrap; gap: 18px 26px; }
.person { display: flex; align-items: center; gap: 12px; }
.person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.person span { font-size: .95rem; line-height: 1.3; color: var(--ink); }
.credit__ref { margin: 14px 0 0; font-size: .88rem; color: var(--ink-2); line-height: 1.55; }

/* Thesis / reference credit line under plate */
.plate__ref { margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--line); font-size: .88rem; color: var(--ink-2); line-height: 1.55; }
.plate__ref p { margin: 0; }

/* Study sets (anatomical) + process */
.study { padding: clamp(32px, 4.4vw, 56px) 0; border-top: 1px solid var(--line); }
.study:first-child { border-top: 0; padding-top: 0; }
.study__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(18px, 2.4vw, 30px); }
.study__no { font: 700 .7rem/1 var(--font-ui); letter-spacing: .24em; color: var(--accent); }
.study__title { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }

.process { list-style: none; margin: clamp(20px, 3vw, 34px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2vw, 28px); counter-reset: step; }
.process li { counter-increment: step; }
.process__label { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 0; }
.process__label::before { content: counter(step, decimal-leading-zero); font: 700 .68rem/1 var(--font-ui); letter-spacing: .2em; color: var(--accent); }
.process__label h3 { font-size: 1.4rem; }

/* ---------- Entries (exhibitions, awards, collaborations) ---------- */
.entries { display: grid; gap: clamp(36px, 5vw, 72px); }
.entry {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start;
  padding-top: clamp(28px, 4vw, 56px); border-top: 1px solid var(--line);
}
.entry:first-child { border-top: 0; padding-top: 0; }
.entry--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.entry--flip .entry__media { order: 2; }
.entry__media { display: grid; gap: 14px; }
.entry__media a, .entry__media > img { display: block; overflow: hidden; background: #fff; border: 1px solid var(--line-2); }
.entry__media img { width: 100%; transition: transform .8s var(--ease); }
.entry__media a:hover img { transform: scale(1.03); }
.entry__meta { margin: 0 0 .7em; font: 700 .68rem/1.5 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.entry__title { font-size: clamp(1.9rem, 3.2vw, 2.7rem); margin-bottom: .5em; }
.entry__body p { color: var(--ink-2); }
.entry__body .btn { margin: .4em .8em .4em 0; }
.entry__sub { font-size: 1.2rem; font-family: var(--font-display); font-style: italic; color: var(--ink-2); margin: 0 0 .9em; }

@media (max-width: 860px) {
  .entry, .entry--flip { grid-template-columns: 1fr; }
  .entry--flip .entry__media { order: 0; }
}

/* Awards timeline */
.years { display: grid; gap: 0; }
.year { display: grid; grid-template-columns: minmax(96px, 1.2fr) minmax(0, 8fr); gap: clamp(16px, 3vw, 48px); padding: clamp(32px, 4.4vw, 60px) 0; border-top: 1px solid var(--line); }
.year__no { font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .9; color: var(--accent); font-variant-numeric: lining-nums; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.year__org { margin: 0 0 1.2em; font: 700 .68rem/1.6 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.year__org span { display: block; }
.year__lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px 40px; margin-bottom: 1.6em; }
.year__lists h3 { font: 700 .66rem/1 var(--font-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin: 0 0 .9em; }
.year__entry { margin: 0 0 1em; }
.year__entry strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1.15; }
.year__entry span { color: var(--ink-2); font-size: .95rem; }
.year__badge { display: inline-block; margin: 0 0 1.4em; padding: .7em 1.1em; background: var(--accent-2); color: #fff; font: 700 .66rem/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; }
.year__figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 440px)); gap: 18px; margin-top: 8px; }
.year__actions { margin-top: 1.4em; display: flex; flex-wrap: wrap; gap: 10px; }
.year__logo { display: block; width: 104px; margin-bottom: 1.4em; padding: 8px; background: #fff; border: 1px solid var(--line-2); }
@media (max-width: 720px) {
  .year { grid-template-columns: 1fr; }
  .year__no { position: static; }
}

/* ---------- Logos, social, tools ---------- */
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 18px; }
.logo-card {
  display: grid; place-items: center; aspect-ratio: 3 / 2; padding: 22px; background: #fff; border: 1px solid var(--line-2);
  transition: border-color .3s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.logo-card img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: grayscale(1) contrast(1.05); opacity: .82; transition: filter .4s, opacity .4s; }
a.logo-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
a.logo-card:hover img { filter: none; opacity: 1; }

.social { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; margin: 0; padding: 0; }
.social a {
  display: grid; place-items: center; width: 68px; height: 68px; padding: 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 50%;
  transition: border-color .3s, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.social a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
.social img { width: 100%; height: 100%; object-fit: contain; }

.tools { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; margin: 0; padding: 0; }
.tools li { width: 76px; height: 76px; padding: 12px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; }
.tools img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Prose ---------- */
.prose { font-size: 1.12rem; line-height: 1.8; color: var(--ink-2); }
.prose p { margin-bottom: 1.25em; }
.prose > p:first-child { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.35; color: var(--ink); }
.prose h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 2.2em 0 .6em; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose strong { color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.split--rev { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split__media { position: sticky; top: calc(var(--header-h) + 28px); }
.split__media img { width: 100%; border: 1px solid var(--line-2); box-shadow: var(--shadow); background: #fff; }
@media (max-width: 860px) {
  .split, .split--rev { grid-template-columns: 1fr; }
  .split__media { position: static; order: -1; }
  .split--rev .split__media { order: -1; }
}

/* Licensing */
.terms { display: grid; gap: 0; }
.term { display: grid; grid-template-columns: minmax(150px, 3fr) minmax(0, 9fr); gap: clamp(16px, 4vw, 64px); padding: clamp(26px, 3.6vw, 48px) 0; border-top: 1px solid var(--line); }
.term:first-child { border-top: 0; padding-top: 0; }
.term h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.term p { color: var(--ink-2); }
.term p:last-child { margin-bottom: 0; }
.term dl { margin: 0; display: grid; gap: 1.4em; }
.term dt { font: 700 .68rem/1.5 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: .4em; }
.term dd { margin: 0; color: var(--ink-2); }
.term dd p { margin-bottom: .8em; }
.term--notice p { font-family: var(--font-display); font-size: clamp(1.4rem, 2.2vw, 1.85rem); line-height: 1.35; color: var(--ink); }
@media (max-width: 760px) { .term { grid-template-columns: 1fr; gap: 12px; } }

/* ---------- References (publications) ---------- */
.refgroup { display: grid; grid-template-columns: minmax(200px, 3fr) minmax(0, 9fr); gap: clamp(20px, 4vw, 64px); padding: clamp(32px, 4.4vw, 60px) 0; border-top: 1px solid var(--line); }
.refgroup:first-child { border-top: 0; padding-top: 0; }
.refgroup__head { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; }
.refgroup__head h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.refgroup__count { margin-top: .7em; font: 700 .66rem/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.refs { list-style: none; margin: 0; padding: 0; counter-reset: ref; }
.refs li { counter-increment: ref; position: relative; padding: 14px 0 14px 3.2rem; border-top: 1px solid var(--line-2); font-size: .97rem; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.refs li:first-child { border-top: 0; padding-top: 0; }
.refs li::before { content: counter(ref, decimal-leading-zero); position: absolute; left: 0; top: 16px; font: 700 .68rem/1.9 var(--font-ui); letter-spacing: .14em; color: var(--accent); }
.refs li:first-child::before { top: 2px; }
.refs em { color: var(--ink); }
@media (max-width: 860px) {
  .refgroup { grid-template-columns: 1fr; gap: 20px; }
  .refgroup__head { position: static; }
}

/* ---------- 3D models ---------- */
.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: clamp(20px, 3vw, 40px); }
.model { margin: 0; }
.model__frame {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, #2a3236 0%, var(--night) 70%);
  border: 1px solid var(--line);
}
.model__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.model__start {
  position: absolute; inset: 0; width: 100%; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px;
  background: none; border: 0; cursor: pointer; color: var(--on-night); font: inherit; text-align: center;
}
.model__start svg { width: 68px; height: 68px; transition: transform .4s var(--ease); }
.model__start:hover svg { transform: scale(1.1) rotate(-6deg); }
.model__start span { font: 700 .66rem/1.4 var(--font-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--on-night-2); }
.model__cap { padding: 16px 2px 0; }
.model__cap h3 { font-size: 1.7rem; }
.links-row { display: flex; flex-wrap: wrap; gap: 28px 44px; align-items: center; }
.link-tile { display: grid; gap: 14px; justify-items: start; }
.link-tile p { margin: 0; font: 700 .68rem/1.4 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.link-tile a { display: block; width: 190px; padding: 18px; background: #fff; border: 1px solid var(--line-2); transition: border-color .3s, box-shadow .35s var(--ease), transform .35s var(--ease); }
.link-tile a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.contact-side h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: .6em; }
.contact-side p { color: var(--ink-2); }
.mail-link { font-family: var(--font-display); font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 500; overflow-wrap: anywhere; }
.form-card { background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: clamp(6px, 1vw, 14px); }
.form-card iframe { display: block; width: 100%; height: 808px; border: 0; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.home-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: #fff; padding: clamp(44px, 6vw, 84px) 0 clamp(36px, 5vw, 64px); }
.home-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 24, 26, .62) 0%, rgba(20, 24, 26, .55) 45%, rgba(20, 24, 26, .96) 100%); }
.home-hero__head { text-align: center; margin-bottom: clamp(30px, 4vw, 56px); }
.home-hero .eyebrow { justify-content: center; color: var(--accent-soft); }
.home-hero .eyebrow::after { content: ""; width: 34px; height: 1px; background: currentColor; }
.home-hero h1 { font-size: clamp(2.5rem, 6.4vw, 5.4rem); font-weight: 500; line-height: 1; letter-spacing: -.005em; }
.home-hero h1 span { display: block; font-style: italic; color: var(--accent-soft); font-weight: 400; }

.folio { display: flex; gap: clamp(8px, 1.1vw, 16px); height: clamp(460px, 72vh, 760px); }
.tile { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; color: #fff; text-decoration: none; }
.tile:hover, .tile:focus-visible { color: #fff; }
.tile__media { position: relative; flex: 1; overflow: hidden; }
.tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; filter: saturate(.3) brightness(.95); transition: filter .6s; }
.tile:hover img, .tile:focus-visible img { filter: saturate(1.05) brightness(1.05); }
.tile__label { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .35); transition: border-color .4s; }
.tile:hover .tile__label { border-color: var(--accent-soft); }
.tile__no { font: 700 .64rem/1 var(--font-ui); letter-spacing: .22em; color: var(--accent-soft); }
.tile__name { font-family: var(--font-display); font-size: clamp(1.2rem, 1.9vw, 1.7rem); line-height: 1.05; }

@media (max-width: 760px) {
  .folio { flex-direction: column; height: auto; gap: 14px; }
  .tile { flex: none; }
  .tile__media { flex: none; aspect-ratio: 27 / 8; }
  .tile__label { margin-top: 10px; padding-top: 10px; }
  .tile__media img { filter: saturate(.6); }
}

.intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.intro h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
.intro p { font-size: 1.15rem; color: var(--ink-2); }
.intro .btn { margin-top: .6em; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }

/* ---------- CTA + footer ---------- */
.cta { background: var(--night); color: var(--on-night); padding: clamp(56px, 8vw, 104px) 0; text-align: center; position: relative; isolation: isolate; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 120% at 50% 0%, rgba(125, 182, 177, .16), transparent 70%); }
.cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.8rem); font-weight: 500; margin: 0 auto 1.1em; max-width: 26ch; }
.cta h2 a { white-space: nowrap; }
@media (max-width: 520px) { .cta h2 a { white-space: normal; overflow-wrap: anywhere; } }
.cta h2 a { color: var(--accent-soft); text-decoration-color: rgba(125, 182, 177, .4); }
.cta h2 a:hover { color: #fff; }

.site-footer { background: var(--night); color: var(--on-night-2); border-top: 1px solid rgba(236, 231, 221, .1); font-size: .9rem; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.4fr)); gap: clamp(24px, 4vw, 56px); padding: clamp(44px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); }
.site-footer .brand { color: var(--on-night); }
.site-footer .brand__role { color: var(--on-night-2); }
.site-footer h3 { font: 700 .64rem/1 var(--font-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--accent-soft); margin: 0 0 1.4em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7em; }
.site-footer a { color: var(--on-night-2); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__brand p { margin: 1.4em 0 0; max-width: 36ch; }
.site-footer__legal { border-top: 1px solid rgba(236, 231, 221, .1); padding: 22px 0 30px; font-size: .8rem; color: #8c8679; }
.site-footer__legal p { margin: 0; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 120; display: none; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(11, 14, 15, .985); color: var(--on-night); }
.lb.is-open { display: grid; animation: lbIn .3s var(--ease); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(14px, 3vw, 28px); }
.lb__count { font: 700 .68rem/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--on-night-2); }
.lb__btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 1px solid rgba(236, 231, 221, .25); border-radius: 50%; color: var(--on-night); cursor: pointer; transition: background .2s, border-color .2s; }
.lb__btn:hover { background: rgba(236, 231, 221, .12); border-color: rgba(236, 231, 221, .6); }
.lb__btn svg { width: 18px; height: 18px; }
.lb__stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 0 clamp(52px, 8vw, 96px); touch-action: pan-y; }
.lb__scroller { width: 100%; height: 100%; display: grid; place-items: center; overflow: auto; }
.lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; cursor: zoom-in; transition: opacity .25s; }
.lb__img.is-dark { background: transparent; }
.lb.is-zoom .lb__scroller { place-items: start center; }
.lb.is-zoom .lb__img { max-width: none; max-height: none; cursor: zoom-out; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: clamp(6px, 1.6vw, 20px); }
.lb__nav--next { right: clamp(6px, 1.6vw, 20px); }
.lb__cap { padding: 16px clamp(16px, 4vw, 40px) 24px; text-align: center; font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.55rem); min-height: 3.6em; }
.lb__cap small { display: block; margin-top: .3em; font: 400 .85rem/1.5 var(--font-ui); color: var(--on-night-2); }
@media (max-width: 640px) { .lb__stage { padding: 0 8px; } .lb__nav { top: auto; bottom: 8px; transform: none; } .lb__nav--prev { left: 12px; } .lb__nav--next { right: 12px; } }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .cta, .site-footer__grid, .nav-toggle, .lb, .model__start { display: none !important; }
  body { background: #fff; color: #000; }
  .refgroup { grid-template-columns: 1fr; }
  .refgroup__head { position: static; }
}


/* ---------- Additions: solo plates, video, slides, collaboration text ---------- */
.plates--solo { grid-template-columns: 1fr; }
.plates--solo .plate { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(20px, 3.4vw, 56px); align-items: center; }
.plates--solo .plate__cap { padding: 0; }
@media (max-width: 860px) { .plates--solo .plate { grid-template-columns: 1fr; } .plates--solo .plate__cap { padding-top: 16px; } }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(16px, 2.4vw, 32px); margin-top: 28px; }
.slides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: clamp(20px, 3vw, 40px); }
.collab-text { max-width: 72ch; margin-bottom: clamp(24px, 3vw, 40px); }
.collab-text p { color: var(--ink-2); }
.tools-group + .tools-group { margin-top: clamp(28px, 4vw, 48px); }
.tools-group .eyebrow { margin-bottom: 1.2em; }
.caption-inline { color: var(--ink-2); }

.gallery-flow .study { margin-top: clamp(20px, 3vw, 44px); }
.gallery-flow .study:first-child { margin-top: 0; }

.chapter a { color: #fff; text-decoration-color: rgba(255, 255, 255, .55); }
.chapter a:hover { color: var(--accent-soft); }

.logo-card--dark { background: var(--night-2); border-color: transparent; }
.logo-card--dark img { filter: none; opacity: .92; }

/* ---------- Cookie banner ---------- */
.cookie { position: fixed; z-index: 90; left: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); width: min(440px, calc(100% - 24px)); padding: 18px 20px; background: var(--card); color: var(--ink-2); border: 1px solid var(--line); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .5); font-size: .88rem; line-height: 1.55; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0 0 14px; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie .btn::after { display: none; }
.linklike { margin-left: .6em; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.linklike:hover { color: #fff; }
@media print { .cookie { display: none !important; } }
