/* Photographer Portfolio — antjanus.com redesign 066
   Gallery wall (dark) is the default; "print" (light) is the alternate mode. */

:root {
  /* primitives */
  --black-950: #0f0f0e;
  --black-900: #181817;
  --black-850: #222220;
  --black-800: #2e2d2a;
  --bone-50: #faf9f6;
  --bone-100: #f2f0eb;
  --bone-200: #e8e5de;
  --bone-300: #d3cfc5;
  --ink-900: #171715;
  --stone-300: #a8a59d;
  --stone-600: #57554f;
  --slate-300: #9db6d0;
  --slate-700: #364f6a;
  --amber-300: #e0a458;
  --amber-700: #9a570b;

  /* semantic (dark / gallery wall) */
  --ground: var(--black-950);
  --surface: var(--black-900);
  --surface-2: var(--black-850);
  --line: var(--black-800);
  --ink: var(--bone-100);
  --dim: var(--stone-300);
  --accent: var(--slate-300);
  --on-accent: var(--black-950);
  --signal: var(--amber-300);
  --code-bg: #121211;
  --code-ink: #e6e4dd;
  --mat: #1d1d1b;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 3vw, 2.5rem);
  --maxw: 1440px;
  --bar-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ground: var(--bone-100);
  --surface: var(--bone-50);
  --surface-2: var(--bone-200);
  --line: var(--bone-300);
  --ink: var(--ink-900);
  --dim: var(--stone-600);
  --accent: var(--slate-700);
  --on-accent: #ffffff;
  --signal: var(--amber-700);
  --mat: #e4e1d9;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 1rem); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--ground); padding: .6rem 1rem; }
.skip:focus { top: 1rem; }

/* ---------- mono label (EXIF voice) ---------- */
.label, .exif {
  font: 500 .8125rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
}
.exif span + span::before { content: "·"; margin: 0 .6em; opacity: .7; }
.no { font: 500 .8125rem/1 var(--mono); letter-spacing: .06em; color: var(--dim); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.bar.is-scrolled { border-bottom-color: var(--line); }
.bar.is-hidden:not(:focus-within) { transform: translateY(-100%); }
.bar--over { position: fixed; left: 0; right: 0; background: transparent; backdrop-filter: none; color: #f4f2ec; }
.bar--over::before { content: ""; position: absolute; inset: 0 0 -40px; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; z-index: -1; transition: opacity .25s; }
.bar--over.is-scrolled { background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(10px); color: var(--ink); }
.bar--over.is-scrolled::before { opacity: 0; }
.bar--over a:hover { color: inherit; opacity: .75; }

.mark { display: flex; align-items: center; gap: .7rem; text-decoration: none; min-height: 44px; }
.mark svg { width: 30px; height: 30px; flex: none; }
.mark b { font: 400 1.35rem/1 var(--serif); letter-spacing: .01em; }
.mark small { font: 500 .8125rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .8; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  font: 500 .9375rem/1 var(--sans);
  text-decoration: none; padding: .9rem .7rem; position: relative;
}
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .55rem; height: 1px; background: currentColor; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-width: 44px; min-height: 44px; padding: 0 .6rem;
  background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: 500 .8125rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.icon-btn:hover { border-color: currentColor; }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.theme-btn .t-dark { display: none; }
:root[data-theme="light"] .theme-btn .t-dark { display: inline; }
:root[data-theme="light"] .theme-btn .t-light { display: none; }

@media (max-width: 900px) {
  .nav a { display: none; }
  .menu-btn { display: inline-flex; }
  .mark small { display: none; }
}

/* full-screen menu */
.menu { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: var(--ground); color: var(--ink); }
.menu::backdrop { background: transparent; }
.menu__inner { min-height: 100%; display: flex; flex-direction: column; padding: 1rem var(--gutter) 2rem; }
.menu__top { display: flex; justify-content: space-between; align-items: center; height: calc(var(--bar-h) - 1rem); }
.menu ol { list-style: none; margin: 2rem 0 0; padding: 0; counter-reset: m; }
.menu li { border-top: 1px solid var(--line); counter-increment: m; }
.menu li a { display: flex; align-items: baseline; gap: 1rem; padding: .9rem 0; font: 400 2.4rem/1.1 var(--serif); text-decoration: none; }
.menu li a::before { content: "0" counter(m); font: 500 .8125rem/1 var(--mono); color: var(--dim); }
.menu__foot { margin-top: auto; padding-top: 2rem; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: clamp(4rem, 9vw, 8rem); }
.section:last-of-type { padding-bottom: clamp(4rem, 9vw, 8rem); }
.sec-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem 2rem; padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
.sec-head p { grid-column: 1 / -1; margin: 0; color: var(--dim); max-width: 60ch; font-size: 1.0625rem; }
.sec-head .more { font: 500 .875rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: .8rem 0; white-space: nowrap; }
.sec-head .more:hover { text-decoration: underline; }
.sec-head .label { display: block; margin-bottom: .8rem; }

/* ---------- full-bleed hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; color: #f4f2ec; background: #1b1b1a; overflow: hidden; isolation: isolate; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(8,8,7,.86) 0%, rgba(8,8,7,.45) 38%, rgba(8,8,7,0) 65%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("assets/film-grain.png") repeat; opacity: .12; mix-blend-mode: overlay; pointer-events: none; }
.hero__inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 8rem var(--gutter) clamp(2rem, 5vw, 3.5rem); }
.hero h1 { font-size: clamp(3rem, 8.2vw, 7.6rem); max-width: 13ch; line-height: .98; }
.hero h1 em { font-style: italic; }
.hero .lede { font-size: clamp(1.125rem, 1.6vw, 1.35rem); max-width: 44ch; margin: 1.4rem 0 0; color: #dcd9d1; }
.hero .exif { color: #cfccc4; }
.hero__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.22); }
.hero--short { min-height: 78svh; }
.hero h1, .hero .lede, .hero .exif, .closing h2, .closing p { text-shadow: 0 1px 24px rgba(0,0,0,.35); }
.hero--home::after { background: linear-gradient(270deg, rgba(8,8,7,.9) 0%, rgba(8,8,7,.72) 34%, rgba(8,8,7,0) 62%), linear-gradient(0deg, rgba(8,8,7,.85) 0%, rgba(8,8,7,0) 30%); }
.hero--home .hero__copy { margin-left: auto; max-width: min(40rem, 48%); }
.hero--home h1 { font-size: clamp(3rem, 6.2vw, 6.2rem); }
@media (max-width: 860px) {
  .hero--home::after { background: linear-gradient(0deg, rgba(8,8,7,.94) 0%, rgba(8,8,7,.8) 45%, rgba(8,8,7,0) 75%); }
  .hero--home .hero__copy { max-width: none; margin-left: 0; }
  .hero--home { display: block; min-height: 0; background: #0b0b0a; }
  .hero--home > img { position: relative; height: 62svh; object-position: 30% 10% !important; }
  .hero--home::after { background: linear-gradient(0deg, #0b0b0a 0%, #0b0b0a 30%, rgba(11,11,10,0) 55%); }
  .hero--home .hero__inner { padding-top: 0; margin-top: -5rem; position: relative; }
}
.hero--page { min-height: 64svh; }
.hero--page h1 { font-size: clamp(3rem, 7vw, 6.4rem); }

.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem;
  background: var(--ink); color: var(--ground); border: 1px solid var(--ink); border-radius: 999px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: transparent; color: var(--ink); }
.hero .btn { background: #f4f2ec; color: #111; border-color: #f4f2ec; }
.hero .btn:hover { background: transparent; color: #f4f2ec; }
.link-2 { font-weight: 600; text-decoration: underline; text-underline-offset: .3em; padding: .8rem 0; }
.link-3 { opacity: .85; text-decoration: none; padding: .8rem 0; }
.link-3:hover { text-decoration: underline; }
.hero a:hover { color: #fff; }

/* ---------- plates ---------- */
.plate { margin: 0; display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.plate__frame {
  display: block; width: 100%; padding: 0; border: 0; background: var(--mat); cursor: zoom-in;
  position: relative; overflow: hidden; border-radius: 1px;
}
.plate__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
.plate__frame:hover img { transform: scale(1.025); }
.plate__frame::after {
  content: "View"; position: absolute; right: .7rem; bottom: .7rem;
  font: 500 .8125rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  background: rgba(10,10,9,.72); color: #f4f2ec; padding: .45rem .6rem; border-radius: 2px;
}
.plate__frame[data-ratio] img { position: absolute; inset: 0; }
.plate__frame[data-ratio="wide"] { aspect-ratio: 16 / 9; }
.plate__frame[data-ratio="land"] { aspect-ratio: 3 / 2; }
.plate__frame[data-ratio="port"] { aspect-ratio: 4 / 5; }
.plate__frame[data-ratio="square"] { aspect-ratio: 1; }
.plate__frame[data-ratio="pano"] { aspect-ratio: 21 / 9; }
.plate__cap { display: grid; grid-template-columns: auto 1fr; gap: .15rem 1rem; align-items: baseline; }
.plate__cap .no { grid-row: span 3; padding-top: .35rem; }
.plate__title { font: 400 1.5rem/1.15 var(--serif); margin: 0; }
.plate__title a { text-decoration: none; }
.plate__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.plate__desc { color: var(--dim); margin: .35rem 0 0; font-size: 1rem; line-height: 1.55; }
.plate__cap .exif { margin-top: .35rem; }
.plate--xl .plate__title { font-size: clamp(1.8rem, 3vw, 2.6rem); }

/* text-only frame (a caption without a photograph) */
.blank {
  aspect-ratio: 3 / 2; width: 100%; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; padding: 1.1rem 1.2rem;
  text-decoration: none; position: relative;
}
.blank::before, .blank::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background: repeating-linear-gradient(90deg, transparent 0 10px, var(--line) 10px 18px); }
.blank::before { top: 0; } .blank::after { bottom: 0; }
.blank b { font: 400 clamp(1.4rem, 2.2vw, 1.9rem)/1.1 var(--serif); }
.blank:hover { background: var(--surface-2); color: var(--ink); }

/* spread: asymmetric feature layout */
.spread { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 2.5vw, 2.5rem); }
.spread > :nth-child(1) { grid-column: 1 / span 8; }
.spread > :nth-child(2) { grid-column: 9 / span 4; align-self: end; }
.spread > :nth-child(3) { grid-column: 3 / span 7; }
.spread > :nth-child(4) { grid-column: 10 / span 3; align-self: center; }
@media (max-width: 760px) { .spread > * { grid-column: 1 / -1 !important; } }

/* wall: masonry by columns (reading order runs down each column) */
.wall { columns: 3 300px; column-gap: clamp(1rem, 2.5vw, 2.5rem); }
.wall > .plate { break-inside: avoid; margin-bottom: clamp(2rem, 4vw, 3.5rem); }

/* sheet: contact sheet grid */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 2.5rem clamp(1rem, 2vw, 2rem); }

/* filmstrip */
.strip-wrap { position: relative; }
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 460px); gap: clamp(1rem, 2vw, 2rem);
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 1.2rem; scroll-padding: 0 var(--gutter);
  scrollbar-width: thin;
}
.strip > * { scroll-snap-align: start; }
.strip-ctrl { display: flex; gap: .5rem; align-items: center; }
.strip-ctrl button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 48px; height: 48px; cursor: pointer; font-size: 1.1rem; }
.strip-ctrl button:hover { border-color: var(--ink); }
.soon { aspect-ratio: 4 / 5; border: 1px dashed var(--line); display: flex; flex-direction: column; justify-content: flex-end; padding: 1.3rem; background: var(--surface); }
.soon b { font: 400 1.5rem/1.15 var(--serif); margin: .5rem 0; }
.soon p { color: var(--dim); font-size: 1rem; margin: 0; }

/* index list (text-only archive rows) */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: grid; grid-template-columns: 5.5rem 1fr minmax(0, 14rem); gap: .3rem 1.5rem; align-items: baseline;
  padding: 1.25rem 0; text-decoration: none; transition: padding .2s var(--ease);
}
.index a:hover { color: var(--ink); padding-left: .6rem; }
.index a:hover .i-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.i-title { font: 400 1.6rem/1.15 var(--serif); }
.i-desc { grid-column: 2; color: var(--dim); font-size: 1rem; }
.i-col { text-align: right; }
@media (max-width: 700px) {
  .index a { grid-template-columns: 1fr; }
  .i-desc { grid-column: 1; }
  .i-col { text-align: left; }
}

/* stat strip (EXIF panel) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > div { background: var(--ground); padding: 1.3rem 1.4rem; }
.stats b { display: block; font: 400 clamp(2.4rem, 4vw, 3.4rem)/1 var(--serif); margin-top: .5rem; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.chip { font: 500 .8125rem/1 var(--mono); letter-spacing: .03em; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 2px; color: var(--dim); text-decoration: none; }
a.chip:hover { color: var(--ink); border-color: var(--ink); }
.badge { font: 600 .8125rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: .3rem .45rem; border: 1px solid currentColor; border-radius: 2px; color: var(--signal); }

/* filters (radio-like pills) */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pill {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  font: 500 .9375rem/1 var(--sans);
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pill .n { font-family: var(--mono); font-size: .8125rem; opacity: .75; margin-left: .35rem; }

/* dark "darkroom" band, identical in both themes */
.darkroom { background: #0b0b0a; color: #ecebe6; --line: #2d2c29; --dim: #aeaba3; --ink: #ecebe6; --ground: #0b0b0a; --surface: #151514; --accent: #9db6d0; }
.darkroom a:hover { color: #9db6d0; }

/* closing plate */
.closing { position: relative; min-height: 80svh; display: grid; align-items: end; color: #f4f2ec; isolation: isolate; overflow: hidden; background: #1b1b1a; margin-top: clamp(4rem, 9vw, 8rem); }
.closing > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.closing::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,8,7,.85), rgba(8,8,7,.35) 60%, rgba(8,8,7,.1)); }
.closing h2 { font-size: clamp(2.6rem, 6vw, 5.2rem); max-width: 14ch; }
.closing p { max-width: 46ch; font-size: 1.2rem; color: #dcd9d1; margin: 1.2rem 0 1.8rem; }
.closing .btn { background: #f4f2ec; color: #111; border-color: #f4f2ec; }
.closing .btn:hover { background: transparent; color: #f4f2ec; }

/* matted prints: small photographs shown near native size, never upscaled */
.print-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; padding-top: clamp(3rem, 7vw, 6rem); }
.print-hero h1 { font-size: clamp(3.2rem, 8vw, 7.4rem); line-height: .98; }
.print-hero .lede { font: italic 400 clamp(1.3rem, 2.2vw, 1.8rem)/1.35 var(--serif); color: var(--dim); max-width: 30ch; margin: 1.4rem 0 0; }
.print { margin: 0; background: var(--mat); padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 1rem; border: 1px solid var(--line); justify-self: end; width: 100%; max-width: 620px; }
.print img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.print figcaption { margin-top: .9rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 860px) { .print-hero { grid-template-columns: 1fr; } .print { justify-self: stretch; } }
.plate--small { max-width: 300px; }
.inset { position: absolute; right: var(--gutter); bottom: var(--gutter); margin: 0; width: 245px; background: #f4f2ec; padding: 10px 10px 12px; transform: rotate(2.5deg); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.inset img { width: 225px; height: 225px; object-fit: cover; }
.inset figcaption { font: 500 .8125rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #3a3935; margin-top: .6rem; }
@media (max-width: 760px) { .inset { position: relative; right: auto; bottom: auto; margin: 0 var(--gutter) 2rem; transform: rotate(-1.5deg); } .closing { display: flex; flex-direction: column; justify-content: flex-end; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 4rem 0 2rem; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 2.5rem; }
.foot h3 { font: 500 .8125rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 1rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li a { display: inline-block; padding: .35rem 0; text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot__blurb { color: var(--dim); max-width: 32ch; margin-top: 1rem; }
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot__grid { grid-template-columns: 1fr; } }

/* newsletter */
.signup { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.signup input[type="email"] {
  flex: 1 1 200px; min-height: 48px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 400 1rem/1 var(--sans);
}
.signup input::placeholder { color: var(--dim); }
.signup .btn { min-height: 48px; }
.signup__msg { flex-basis: 100%; margin: .4rem 0 0; font-size: 1rem; }
.signup__msg:empty { display: none; }
.signup.is-success .signup__msg { color: var(--ink); }

/* ---------- lightbox ---------- */
.lb { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: rgba(6,6,6,.97); color: #efede7; }
.lb::backdrop { background: rgba(0,0,0,.9); }
.lb[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb__top { display: flex; justify-content: space-between; align-items: center; padding: .75rem var(--gutter); }
.lb__count { font: 500 .875rem/1 var(--mono); letter-spacing: .1em; color: #bdbab2; }
.lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 clamp(3.5rem, 7vw, 6rem); }
.lb__stage img { max-width: 100%; max-height: calc(100svh - 15rem); object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb__nav { position: absolute; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 999px; border: 1px solid #55534e; background: rgba(20,20,19,.7); color: #efede7; cursor: pointer; font-size: 1.25rem; }
.lb__nav:hover { border-color: #efede7; }
.lb__prev { left: var(--gutter); } .lb__next { right: var(--gutter); }
.lb__cap { display: grid; grid-template-columns: 1fr auto; gap: .4rem 2rem; align-items: end; padding: 1rem var(--gutter) 1.4rem; border-top: 1px solid #2a2927; max-width: var(--maxw); width: 100%; margin: 0 auto; }
.lb__cap h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
.lb__cap p { margin: .3rem 0 0; color: #bdbab2; max-width: 70ch; font-size: 1rem; }
.lb__cap .exif { color: #bdbab2; }
.lb__cap a.btn { background: #efede7; color: #111; border-color: #efede7; }
.lb__cap a.btn:hover { background: transparent; color: #efede7; }
.lb .icon-btn { color: #efede7; }
.lb :focus-visible { outline-color: #9db6d0; }
@media (max-width: 700px) {
  .lb__stage { padding: 0 .75rem; }
  .lb__nav { top: auto; bottom: -3.8rem; translate: none; }
  .lb__stage img { max-height: calc(100svh - 19rem); }
  .lb__cap { grid-template-columns: 1fr; padding-top: 4.4rem; }
}

/* ---------- article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; }
.art-hero { background: #0b0b0a; padding: calc(var(--bar-h) + 1rem) 0 0; }
.art-hero figure { margin: 0 auto; max-width: 1600px; }
.art-hero img { width: 100%; max-height: 78svh; object-fit: cover; }
.art-hero figcaption { max-width: var(--maxw); margin: 0 auto; padding: .8rem var(--gutter); color: #aeaba3; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.art-head { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 0; display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; }
.art-head h1 { font-size: clamp(2.8rem, 6.4vw, 5.8rem); line-height: 1; max-width: 16ch; }
.art-head .lede { font-size: clamp(1.2rem, 1.8vw, 1.45rem); color: var(--dim); margin: 1.3rem 0 0; max-width: 40ch; font-family: var(--serif); font-style: italic; }
.art-head__side { display: flex; flex-direction: column; gap: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.art-head__side a { text-decoration: none; }
.art-head__side dl { margin: 0; display: grid; gap: .8rem; }
.art-head__side dt { font: 500 .8125rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.art-head__side dd { margin: .3rem 0 0; }
.art-body { max-width: var(--maxw); margin: 0 auto; padding: 3rem var(--gutter) 0; display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; }
.toc { position: sticky; top: calc(var(--bar-h) + 1.5rem); align-self: start; }
.toc ol { list-style: none; padding: 0; margin: 1rem 0 0; border-left: 1px solid var(--line); counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: .5rem 0 .5rem 1rem; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--dim); font-size: .9375rem; line-height: 1.35; }
.toc a::before { content: counter(t, decimal-leading-zero) "  "; font: 500 .8125rem/1 var(--mono); white-space: pre; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }
.toc-m { display: none; border: 1px solid var(--line); margin-bottom: 2rem; }
.toc-m summary { padding: .9rem 1rem; cursor: pointer; min-height: 44px; }
.toc-m ol { margin: 0; padding: 0 1rem 1rem 2.2rem; }
.toc-m li a { display: block; padding: .35rem 0; }

.prose { max-width: 42rem; font-size: 1.125rem; line-height: 1.7; }
.prose > * { margin: 0 0 1.4rem; }
.prose h2 { font-size: clamp(2rem, 3.4vw, 2.7rem); margin: 3.8rem 0 1.2rem; display: flex; gap: 1rem; align-items: baseline; }
.prose h2 .no { flex: none; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose code:not(pre code) { font: 400 .92em var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 3px; }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { font-family: var(--mono); color: var(--dim); }
.call { border-left: 2px solid var(--line); padding: .2rem 0 .2rem 1.3rem; }
.call .label { display: block; margin-bottom: .4rem; }
.call p { margin: 0; }
.call--why { border-left-color: var(--accent); }
.call--why .label { color: var(--accent); }
.call--q { border: 1px solid var(--line); border-left: 2px solid var(--signal); padding: 1rem 1.2rem; background: var(--surface); font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; }
.call--q .label { color: var(--signal); font-size: .8125rem; }
.call--skill { background: var(--surface); border: 1px solid var(--line); padding: 1.1rem 1.3rem; font-size: 1rem; }
.call--note { font-style: italic; }

.code { margin: 2rem 0; background: var(--code-bg); color: var(--code-ink); border: 1px solid #262522; border-radius: 3px; min-width: 0; }
@media (min-width: 1200px) { .prose .code { margin-right: -8rem; } }
.code__bar { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .35rem 1rem; border-bottom: 1px solid #262522; font: 500 .8125rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #aeaba3; }
.code__bar button { min-height: 40px; min-width: 44px; padding: 0 .8rem; background: none; border: 1px solid #3a3935; border-radius: 2px; color: #e6e4dd; cursor: pointer; font: inherit; }
.code__bar button:hover { border-color: #e6e4dd; }
.code pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; font: 400 .9375rem/1.6 var(--mono); tab-size: 2; }
.code pre code { font: inherit; background: none; }
.code :focus-visible { outline-color: #9db6d0; }
.token.comment { color: #8f8c84; font-style: italic; }
.token.keyword, .token.boolean { color: #d7a7e6; }
.token.string, .token.template-string { color: #b8d68f; }
.token.function { color: #8fc4e8; }
.token.class-name, .token.builtin { color: #eec77f; }
.token.tag, .token.punctuation.tag { color: #e79a8a; }
.token.attr-name { color: #eec77f; }
.token.number { color: #f0a870; }
.token.operator, .token.punctuation { color: #c9c6be; }

.art-end { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; }
.art-end > div { grid-column: 2; max-width: 52rem; }
.filed { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; align-items: center; padding: 1.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 3rem; }
.share { display: flex; flex-wrap: wrap; gap: .5rem; }
.share a, .share button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer; text-decoration: none; font: 500 .9375rem/1 var(--sans); }
.share a:hover, .share button:hover { border-color: var(--ink); color: var(--ink); }
.news { margin-top: 3rem; padding: 2rem; background: var(--surface); border: 1px solid var(--line); }
.news h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.news p { color: var(--dim); margin: .6rem 0 0; }

@media (max-width: 1100px) {
  .art-head, .art-body, .art-end { grid-template-columns: minmax(0, 1fr); }
  .art-end > div { grid-column: 1; }
  .toc { display: none; }
  .toc-m { display: block; }
  .art-head__side { order: 2; }
}

/* ---------- about ---------- */
.split { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem clamp(1rem, 3vw, 3rem); }
.split > .a { grid-column: 1 / span 5; }
.split > .b { grid-column: 7 / span 6; }
@media (max-width: 860px) { .split > .a, .split > .b { grid-column: 1 / -1; } }
.bigtext { font: 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.3 var(--serif); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem 2rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.timeline h3 { font-size: 2rem; }
.timeline p { color: var(--dim); margin: .6rem 0 1rem; max-width: 60ch; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.roles li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .5rem 0; border-bottom: 1px dotted var(--line); }
.roles li span:last-child { font: 400 .875rem/1.5 var(--mono); color: var(--dim); text-align: right; }
@media (max-width: 700px) { .timeline > li { grid-template-columns: 1fr; } .roles li { grid-template-columns: 1fr; } .roles li span:last-child { text-align: left; } }
.careerbar { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 1rem; }
.careerbar span { flex: 1 1 8rem; background: var(--ground); padding: .8rem 1rem; font-size: .9375rem; }
.careerbar small { display: block; font: 500 .8125rem/1.3 var(--mono); color: var(--dim); margin-top: .2rem; }
.quotes { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.quotes li { counter-increment: q; display: grid; grid-template-columns: 4rem 1fr; padding: 1.4rem 0; border-top: 1px solid var(--line); font: italic 400 clamp(1.5rem, 2.8vw, 2.3rem)/1.2 var(--serif); }
.quotes li::before { content: counter(q, decimal-leading-zero); font: 500 .8125rem/2.4 var(--mono); font-style: normal; color: var(--dim); }
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.caps > div { background: var(--ground); padding: 1.6rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.caps h3 { font-size: 1.7rem; }
.caps p { color: var(--dim); margin: .5rem 0 1rem; font-size: 1rem; }

/* ---------- projects ---------- */
.feature { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem clamp(1rem, 3vw, 3rem); align-items: end; }
.feature .plate { grid-column: 1 / span 8; }
.feature .feature__text { grid-column: 9 / span 4; }
.feature__text h3 { font-size: clamp(2rem, 3.4vw, 3rem); margin: .8rem 0 1rem; }
.feature__text p { color: var(--dim); }
@media (max-width: 860px) { .feature .plate, .feature .feature__text { grid-column: 1 / -1; } }
.jump { position: sticky; top: var(--bar-h); z-index: 20; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.jump .wrap { display: flex; gap: .25rem; overflow-x: auto; align-items: center; scrollbar-width: none; }
.jump a { white-space: nowrap; padding: 1rem .8rem; text-decoration: none; font-size: .9375rem; }
.jump a .n { font: 500 .8125rem/1 var(--mono); color: var(--dim); margin-left: .3rem; }
.jump .label { padding-right: .5rem; white-space: nowrap; }
.caption-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.caption-grid > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ground); padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; text-decoration: none; }
.caption-grid > a:hover { background: var(--surface); color: var(--ink); }
.caption-grid h3 { font-size: 1.7rem; }
.caption-grid p { color: var(--dim); margin: 0; font-size: 1rem; }
.caption-grid .chips { margin-top: auto; padding-top: .5rem; }
.meta-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }

/* ---------- patterns ---------- */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.three > div { background: var(--ground); padding: 1.6rem; }
.three h3 { font-size: 1.8rem; margin: .6rem 0; }
.three p { color: var(--dim); margin: 0; font-size: 1rem; }
@media (max-width: 800px) { .three { grid-template-columns: 1fr; } }
.search { display: flex; flex-direction: column; gap: 1rem; margin: 2.5rem 0 2rem; }
.search input[type="search"] {
  width: 100%; min-height: 56px; padding: 0 1.2rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 1.0625rem/1 var(--sans); border-radius: 2px;
}
.search input::placeholder { color: var(--dim); }
.search__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.search select { min-height: 44px; padding: 0 .8rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); font: 400 1rem var(--sans); border-radius: 2px; }
.clear { background: none; border: 0; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .4rem; }
.empty { padding: 4rem 1rem; text-align: center; border: 1px dashed var(--line); }
.empty h3 { font-size: 2rem; }
.empty p { color: var(--dim); }

.spec { display: flex; flex-direction: column; gap: .9rem; }
.spec__plate { aspect-ratio: 4 / 3; background: var(--mat); border: 1px solid var(--line); display: grid; place-items: center; padding: 12%; position: relative; text-decoration: none; overflow: hidden; }
.spec__plate:hover .mini { transform: scale(1.05); }
.spec__plate .no { position: absolute; left: .7rem; top: .7rem; }
.spec__plate .badge { position: absolute; right: .7rem; top: .6rem; background: var(--ground); }
.mini { width: 100%; height: 100%; transition: transform .5s var(--ease); --h: 212; --c: hsl(var(--h) 38% 58%); }
:root[data-theme="light"] .mini { --c: hsl(var(--h) 36% 38%); }
.mini--data { display: flex; align-items: flex-end; gap: 6%; }
.mini--data i { flex: 1; background: var(--c); border-radius: 2px 2px 0 0; }
.mini--data i:nth-child(1) { height: 42%; } .mini--data i:nth-child(2) { height: 78%; opacity: .8; } .mini--data i:nth-child(3) { height: 58%; opacity: .6; } .mini--data i:nth-child(4) { height: 92%; } .mini--data i:nth-child(5) { height: 30%; opacity: .7; }
.mini--layout { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6%; }
.mini--layout i { background: var(--surface-2); border: 1px solid var(--c); border-radius: 3px; }
.mini--layout i:first-child { grid-row: span 2; background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.mini--interaction { display: grid; grid-template-columns: 1fr 3fr; gap: 8%; }
.mini--interaction i { background: var(--surface-2); border-radius: 3px; }
.mini--interaction i:first-child { background: linear-gradient(var(--c) 0 22%, transparent 22% 34%, var(--line) 34% 50%, transparent 50% 62%, var(--line) 62% 78%, transparent 78%); }
.mini--interaction i:last-child { box-shadow: inset 0 0 0 2px var(--c); }
.mini--forms { display: flex; flex-direction: column; justify-content: center; gap: 10%; }
.mini--forms i { height: 22%; border: 1px solid var(--dim); border-radius: 3px; background: var(--surface); }
.mini--forms i:nth-child(2) { width: 60%; background: var(--c); border-color: var(--c); border-radius: 999px; }
.mini--forms i:nth-child(3) { width: 40%; height: 16%; border-style: dashed; }
.mini--color { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5%; align-content: center; }
.mini--color i { aspect-ratio: 1; border-radius: 50%; background: hsl(var(--h) 40% 50%); }
.mini--color i:nth-child(2) { background: hsl(calc(var(--h) + 40) 45% 55%); } .mini--color i:nth-child(3) { background: hsl(calc(var(--h) + 120) 35% 50%); } .mini--color i:nth-child(4) { background: hsl(calc(var(--h) + 200) 40% 60%); }
.spec h2 { font: 400 1.6rem/1.15 var(--serif); }
.spec h2 a { text-decoration: none; }
.spec h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.spec p { color: var(--dim); margin: 0; font-size: 1rem; }
.spec .good { color: var(--ink); font-size: .9375rem; }
.spec .good b { font-weight: 600; }

/* pattern detail */
.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.back:hover { text-decoration: underline; }
.uses { columns: 2 16rem; padding-left: 1.2rem; margin: .8rem 0 0; }
.uses li { margin: .3rem 0; }
.panes { border: 1px solid var(--line); margin-top: 2.5rem; background: var(--surface); }
.panes__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line); padding: 0 .5rem; }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { min-height: 52px; padding: 0 1rem; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: 500 .9375rem/1 var(--sans); color: var(--dim); white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pane-actions { display: flex; gap: .5rem; padding: .4rem 0; }
.pane-actions button { min-height: 44px; padding: 0 1rem; border: 1px solid var(--line); background: var(--ground); cursor: pointer; border-radius: 2px; font: 500 .9375rem/1 var(--sans); }
.pane-actions button:hover { border-color: var(--ink); }
.pane-actions [hidden] { display: none; }
[role="tabpanel"] { padding: clamp(1rem, 3vw, 2.5rem); }
[role="tabpanel"] pre { margin: 0; overflow-x: auto; font: 400 .9375rem/1.6 var(--mono); background: var(--code-bg); color: var(--code-ink); padding: 1.2rem; border-radius: 2px; }
.pane-note { color: var(--dim); font-size: 1rem; margin: 0 0 1rem; }
.prompt-text { max-width: 44rem; font-size: 1.0625rem; }
.lighttable { background: var(--mat); padding: clamp(1rem, 4vw, 3rem); border: 1px solid var(--line); }

/* hairline stat strip (live pattern) */
.hss-cap { color: var(--dim); font-size: 1rem; margin: 0 0 .8rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; margin-bottom: 2rem; }
@container hss (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@container hss (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, 1fr); } .hss-strip--5 { grid-template-columns: repeat(5, 1fr); } }
.hss-host { container: hss / inline-size; }
.hss-tile { background: var(--surface); padding: 1rem 1.1rem; min-width: 0; text-align: left; border: 0; font: inherit; color: var(--ink); }
.hss-tile .l { display: block; font: 500 .8125rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); overflow-wrap: anywhere; }
.hss-tile .f { display: block; font: 700 1.6rem/1.2 var(--sans); font-variant-numeric: tabular-nums; margin: .35rem 0 .2rem; }
.hss-tile .f.none { color: var(--dim); font-weight: 400; }
.hss-tile .u { display: block; font-size: .9375rem; color: var(--dim); }
button.hss-tile { cursor: pointer; }
button.hss-tile:hover { background: color-mix(in srgb, var(--ink) 6%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
.hss-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.hss-list li:first-child { border-top: 0; }
.hss-list li[hidden] { display: none; }
.hss-list .s { font: 500 .8125rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--dim); white-space: nowrap; }
.hss-status { margin: .8rem 0 0; color: var(--dim); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  .plate__frame:hover img { transform: none; }
}
@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .sec-head { grid-template-columns: 1fr; }
}

.prose-fig { margin: 2rem 0; }
.prose-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.prose-fig figcaption { margin-top: .6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.call p + p { margin-top: .7em; }
.prose code { overflow-wrap: anywhere; }
.prose a.btn { color: var(--ground); text-decoration: none; }
.prose a.btn:hover { color: var(--ink); }
