/* kem.bio 2.0 — color blocks */

:root {
  /* Palette: Snow, Black, Blazing Flame, Dark Slate Grey, Muted Teal. */
  --snow: #fffafb;
  --black: #000100;
  --flame: #f34213;
  --slate: #1c5253;
  --teal: #81b29a;

  --bg: var(--snow);
  --bg-tint: #f3eeee;
  --band: var(--black);
  --surface: #ffffff;
  --line: rgba(0, 1, 0, .14);
  --ink: var(--black);
  --text: #1d2424;
  --muted: #4f6767;
  --faint: #c7d3cd;
  --accent: var(--flame);

  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --header-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, blockquote, ol, ul, figure, dl, dd { margin: 0; }

::selection { background: var(--flame); color: var(--black); }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--black); color: var(--snow); padding: 8px 14px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Small mono labels. */
.kicker, .tile__meta, .tile__figure, .facts dt, .note-row time, .note-row__no, .note-nav__label,
.site-footer, .contact__label, .gallery__count, .modal__kicker, .nav a, .menu-toggle {
  font-family: var(--mono); font-size: 12px; font-weight: 400; line-height: 1.4;
  letter-spacing: .04em; text-transform: uppercase;
}
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Color blocks ---------- */
/* Each block sets its own text colors so the same markup works on any palette color. */

.block--slate { --b-bg: var(--slate); --b-fg: var(--snow); --b-soft: #d6e4dd; --b-kicker: var(--teal); --b-em: var(--flame); }
.block--flame { --b-bg: var(--flame); --b-fg: var(--black); --b-soft: var(--black); --b-kicker: var(--black); --b-em: var(--snow); }
.block--teal  { --b-bg: var(--teal);  --b-fg: var(--black); --b-soft: var(--black); --b-kicker: var(--slate); --b-em: var(--snow); }
.block--black { --b-bg: var(--black); --b-fg: var(--snow); --b-soft: #d9dcdb; --b-kicker: var(--teal); --b-em: var(--flame); }
.block--snow  { --b-bg: var(--snow);  --b-fg: var(--black); --b-soft: var(--text); --b-kicker: var(--slate); --b-em: var(--flame); border-bottom: 2px solid var(--black); }
[class*="block--"] { background: var(--b-bg); color: var(--b-fg); }
[class*="block--"] .kicker { color: var(--b-kicker); }
[class*="block--"] em { font-style: normal; color: var(--b-em); }

/* ---------- Header ---------- */

.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); background: var(--black); color: var(--snow); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--sans); font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1; color: var(--snow); text-decoration: none; }
.brand span { color: var(--flame); }

.nav { display: flex; gap: clamp(20px, 3vw, 36px); list-style: none; padding: 0; }
.nav a { color: var(--snow); text-decoration: none; position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle { display: none; align-items: center; gap: 10px; margin-right: -10px; padding: 10px; border: 0; background: none; cursor: pointer; color: var(--snow); }
.menu-toggle__icon { position: relative; width: 18px; height: 10px; }
.menu-toggle__icon span { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .3s var(--ease), top .3s var(--ease); }
.menu-toggle__icon span:first-child { top: 0; }
.menu-toggle__icon span:last-child { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:first-child { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:last-child { top: 4px; transform: rotate(-45deg); }

.mobile-menu { position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; background: var(--black); color: var(--snow); overflow-y: auto; opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.mobile-menu.is-open { opacity: 1; transform: none; }
.mobile-menu__inner { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding-top: 24px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
.mobile-menu__links { list-style: none; padding: 0; }
.mobile-menu__links li { border-bottom: 1px solid rgba(255, 250, 251, .15); }
.mobile-menu__links a { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -.03em; color: var(--snow); text-decoration: none; }
.mobile-menu__no { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .04em; color: var(--teal); }
.mobile-menu__links a[aria-current="page"] { color: var(--flame); }
.mobile-menu__foot { margin-top: 40px; }
.mobile-menu__foot p { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--teal); }
.mobile-menu__foot .social { margin-top: 16px; }
.mobile-menu__foot .social a { color: var(--snow); border-color: rgba(255, 250, 251, .25); }

/* ---------- Home hero ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); min-height: min(100svh, 760px); padding-top: var(--header-h); }
.hero__text { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(40px, 6vw, 88px) var(--gutter); }
.hero__title { max-width: 11em; font-weight: 800; font-size: min(7.6vw, 116px); line-height: .92; letter-spacing: -.035em; }
.hero__intro { max-width: 30em; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: var(--b-soft); }
.hero__side { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.hero__photo { background: var(--teal); overflow: hidden; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.05); mix-blend-mode: multiply; }
.hero__strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px clamp(16px, 2vw, 28px); background: var(--flame); color: var(--black); font-weight: 700; font-size: 20px; text-decoration: none; transition: background .2s; }
.hero__strip:hover { background: var(--snow); }

/* ---------- Work cards ---------- */

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; }
.tile { --t-bg: var(--snow); --t-fg: var(--black); --t-soft: var(--text); --t-name: var(--black); --t-meta: var(--slate);
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  min-height: clamp(300px, 26vw, 400px); height: 100%; padding: clamp(20px, 2vw, 28px);
  background: var(--t-bg); color: var(--t-fg); text-decoration: none; overflow: hidden;
}
.tile--flame { --t-bg: var(--flame); --t-soft: var(--black); --t-meta: var(--black); }
.tile--teal  { --t-bg: var(--teal); --t-soft: var(--black); --t-meta: var(--slate); }
.tile--black { --t-bg: var(--black); --t-fg: var(--snow); --t-soft: #d9dcdb; --t-name: var(--flame); --t-meta: var(--teal); }
.tile--slate { --t-bg: var(--slate); --t-fg: var(--snow); --t-soft: #d6e4dd; --t-name: var(--snow); --t-meta: var(--teal); }
.tile--snow  { box-shadow: inset 2px 0 0 var(--black); }
.tiles li:first-child .tile--snow { box-shadow: none; }
.tile__meta { display: flex; justify-content: space-between; gap: 12px; color: var(--t-meta); }
.tile__meta span:last-child { font-size: 18px; line-height: 1; transition: transform .3s var(--ease); }
.tile__body { display: grid; gap: 10px; }
.tile__name { font-weight: 800; font-size: clamp(32px, 3.2vw, 52px); line-height: .95; letter-spacing: -.03em; color: var(--t-name); }
.tile__role { font-size: 15px; line-height: 1.4; color: var(--t-soft); max-width: 18em; }
.tile__figure { color: var(--t-meta); }
.tile::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; background: var(--t-fg); transform: scaleY(0); transform-origin: bottom; transition: transform .3s var(--ease); }
.tile:hover::after { transform: scaleY(1); }
.tile:hover .tile__meta span:last-child { transform: translateX(6px); }

/* ---------- Latest notes (home) ---------- */

.latest { padding: clamp(56px, 8vw, 112px) 0; }
.latest__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: clamp(24px, 3vw, 40px); }
.latest__title { font-weight: 800; font-size: clamp(40px, 5.6vw, 80px); line-height: .95; letter-spacing: -.035em; color: var(--ink); }
.latest__more { color: var(--ink); text-decoration: none; white-space: nowrap; }
.latest__more:hover { color: var(--flame); }
.latest__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); list-style: none; padding: 0; }
.latest__card {
  display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 20px 20px 22px;
  border-top: 4px solid var(--black); background: var(--bg-tint); color: var(--ink); text-decoration: none;
  transition: background .2s;
}
.latest__card .kicker { color: var(--muted); }
.latest__name { font-weight: 800; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.02; letter-spacing: -.025em; }
.latest__desc { font-size: 15px; line-height: 1.45; color: var(--text); }
.latest__card .latest__read { margin-top: auto; padding-top: 12px; color: var(--ink); }
.latest__card:hover { background: var(--teal); }
.latest__card:hover .kicker { color: var(--black); }

/* ---------- Page hero (Work, Notes, Contact, 404, Thanks) ---------- */

.page-hero { padding: calc(var(--header-h) + clamp(48px, 7vw, 104px)) 0 clamp(48px, 7vw, 96px); }
.page-hero--center { min-height: 80svh; display: flex; align-items: center; }
.page-hero__title { margin-top: clamp(20px, 3vw, 36px); font-weight: 800; font-size: min(12vw, 168px); line-height: .9; letter-spacing: -.04em; }
.page-hero__lead { margin-top: clamp(24px, 3vw, 40px); max-width: 32em; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; color: var(--b-soft); }
.page-hero .text-link { display: inline-block; margin-top: 32px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--b-fg); }
.page-body { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(72px, 10vw, 140px); }

/* ---------- Project page ---------- */

.project__hero { padding-top: var(--header-h); }
.project__hero-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(40px, 6vw, 72px); }
.project__title { margin-top: clamp(20px, 3vw, 36px); font-weight: 800; font-size: min(9vw, 132px); line-height: .9; letter-spacing: -.04em; }
.project__sub { margin-top: 16px; font-weight: 600; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -.015em; color: var(--b-em); }
.block--flame .project__sub, .block--teal .project__sub { color: var(--b-fg); opacity: .8; }
.project__cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: 12px 12px 0 var(--black); }
.block--black .project__cover, .block--slate .project__cover { box-shadow: 12px 12px 0 var(--flame); }

.project__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); row-gap: 40px; padding-top: clamp(48px, 6vw, 80px); }
.project__aside { grid-column: 1 / span 4; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.facts { border-top: 4px solid var(--black); }
.facts > div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { font-size: 15px; line-height: 1.45; color: var(--ink); }
.facts a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--flame); }
.facts a:hover { color: var(--flame); }
.project__body { grid-column: 6 / span 7; max-width: 720px; }
.project__body p { font-size: 18px; line-height: 1.65; color: var(--text); }
.project__body p + p { margin-top: 1.1em; }
.project__body .is-strong { font-weight: 700; color: var(--ink); }
.project__body .is-muted { color: var(--muted); }
.project__body .project__quote { margin-bottom: 1em; padding: 18px 22px; background: var(--teal); font-weight: 700; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; letter-spacing: -.015em; color: var(--black); }
.project__body .project__quote--end { margin: 1.4em 0 0; background: var(--flame); }

.project__more { padding-top: clamp(24px, 4vw, 48px); }
.project__more > .kicker { padding-bottom: 14px; color: var(--muted); }
.project__more .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Slide gallery: native horizontal scroll with snap, aligned to the content edge. */
.gallery {
  --slide-h: clamp(240px, 30vw, 400px);
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  margin-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px);
}
.gallery__track {
  display: flex; gap: clamp(8px, 1vw, 12px); list-style: none; margin: 0; padding: 0 var(--edge);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery__track.is-dragging .gallery__open { pointer-events: none; }
.gallery__track:focus-visible { outline-offset: -2px; }
.gallery__slide { flex: none; scroll-snap-align: start; }
.gallery__open { display: block; padding: 0; border: 0; background: var(--bg-tint); overflow: hidden; cursor: zoom-in; }
.gallery__open img { height: var(--slide-h); width: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
.gallery__bar { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.gallery__progress { flex: 1; height: 4px; background: var(--bg-tint); overflow: hidden; }
.gallery__progress span { display: block; height: 100%; background: var(--flame); transform-origin: left; transform: scaleX(0); transition: transform .2s linear; }
.gallery__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery__count span { color: var(--ink); }
.gallery__nav { display: flex; gap: 8px; }
.gallery__btn, .lightbox__btn { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: var(--black); color: var(--snow); cursor: pointer; transition: background .2s, opacity .2s; }
.gallery__btn:hover:not(:disabled) { background: var(--flame); color: var(--black); }
.gallery__btn:disabled { opacity: .25; cursor: default; }

/* Lightbox */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; }
.lightbox::backdrop { background: rgba(0, 1, 0, .94); }
.lightbox[open] { animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lightbox__stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 72px 72px 64px; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.lightbox__count { position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.lightbox__btn { position: absolute; background: rgba(255, 255, 255, .1); }
.lightbox__btn:hover { background: var(--flame); color: var(--black); }
.lightbox__close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
body.lightbox-open, body.menu-open { overflow: hidden; }

/* ---------- Contact ---------- */

.contact-page { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 32px); row-gap: 40px; }
.contact-page__copy { grid-column: 1 / span 5; }
.contact-page__copy p { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; color: var(--ink); }
.contact-page__copy p + p { margin-top: 1em; }
.contact-page .contact { grid-column: 7 / span 6; }

.contact__list { list-style: none; padding: 0; border-top: 4px solid var(--black); }
.contact__item { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact__label { color: var(--muted); }
.contact__value { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.contact__value > a { font-weight: 700; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.1; letter-spacing: -.015em; color: var(--ink); text-decoration: underline; text-decoration-color: var(--flame); text-decoration-thickness: 3px; text-underline-offset: 6px; overflow-wrap: anywhere; }
.contact__value > a:hover { color: var(--flame); }
.contact__copy { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; background: var(--teal); color: var(--black); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.contact__copy:hover { background: var(--slate); color: var(--snow); }
.contact__copy.is-done { background: var(--slate); color: var(--snow); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.contact__book, .form__submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border: 0; background: var(--flame); color: var(--black); text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: -.01em;
  transition: background .2s, color .2s;
}
.contact__book:hover, .form__submit:hover { background: var(--black); color: var(--snow); }

.social { display: flex; gap: 10px; list-style: none; padding: 0; margin-top: 32px; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); transition: background .2s, color .2s; }
.social a:hover { background: var(--flame); border-color: var(--flame); color: var(--black); }

/* ---------- Book a call popup ---------- */

.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; background: var(--snow); color: var(--text); box-shadow: 14px 14px 0 var(--flame); overflow: auto; overscroll-behavior: contain; }
.modal::backdrop { background: rgba(28, 82, 83, .7); }
.modal[open] { animation: modal-in .3s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px); } }
.modal__inner { padding: clamp(22px, 4vw, 36px); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.modal__kicker { color: var(--slate); }
.modal__title { margin-top: 8px; font-weight: 800; font-size: clamp(32px, 4vw, 44px); letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.modal__intro { margin-top: 10px; font-size: 15px; }
.modal__close { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--black); color: var(--snow); cursor: pointer; transition: background .2s; }
.modal__close:hover { background: var(--flame); color: var(--black); }
body.modal-open { overflow: hidden; }

.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { padding: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.field small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.field input:not([type="radio"]), .field textarea, .form__slots input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 0; border: 2px solid var(--black); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .form__slots input:focus { outline: none; border-color: var(--flame); }
.field legend + .chips, .field legend + .form__slots { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid var(--black); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.chips input:hover + span { background: var(--bg-tint); }
.chips input:checked + span { background: var(--slate); border-color: var(--slate); color: var(--snow); }
.chips input:focus-visible + span { outline: 2px solid var(--flame); outline-offset: 2px; }
.form__slots { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.slot > span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.slot > small { font-size: 12px; color: var(--muted); }
.form__slots input { max-width: 280px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form__submit:disabled { opacity: .5; cursor: progress; }
.form__status { font-size: 14px; color: var(--text); }
.form__status.is-error { color: #b4413b; }
.form__status a { color: inherit; }
.form.is-sent > :not(.form__done) { display: none; }
.form__done { display: grid; gap: 8px; padding: 12px 0; }
.form__done strong { font-weight: 800; font-size: 32px; line-height: 1; color: var(--ink); }
.form__done p { font-size: 15px; }

/* ---------- Notes list ---------- */

.note-list { list-style: none; padding: 0; border-top: 4px solid var(--black); }
.note-row a { display: grid; grid-template-columns: 72px 140px minmax(0, 1fr) 32px; gap: 8px 24px; align-items: baseline; padding: clamp(20px, 2.4vw, 30px) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.note-row__no { color: var(--flame); }
.note-row time { color: var(--muted); }
.note-row__title { display: block; font-weight: 800; font-size: clamp(26px, 3vw, 42px); line-height: 1; letter-spacing: -.025em; color: var(--ink); transition: color .2s; }
.note-row__desc { display: block; margin-top: 10px; max-width: 40em; font-size: 15px; color: var(--text); }
.note-row__arrow { font-size: 22px; color: var(--ink); justify-self: end; transition: transform .3s var(--ease), color .2s; }
.note-row a:hover .note-row__title, .note-row a:hover .note-row__arrow { color: var(--flame); }
.note-row a:hover .note-row__arrow { transform: translateX(6px); }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--flame); vertical-align: middle; }
.empty { color: var(--muted); }

/* ---------- Single note ---------- */

.note__head { padding: calc(var(--header-h) + clamp(40px, 6vw, 88px)) 0 clamp(40px, 6vw, 72px); }
.note__title { margin-top: clamp(20px, 3vw, 36px); max-width: 16em; font-weight: 800; font-size: clamp(44px, 6.4vw, 96px); line-height: .92; letter-spacing: -.035em; }
.note__lead { margin-top: clamp(20px, 2.4vw, 32px); max-width: 32em; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.4; color: var(--b-soft); }

.prose { max-width: 680px; margin: clamp(40px, 6vw, 72px) 0 0; font-size: 18px; line-height: 1.7; color: var(--text); }
.prose > * + * { margin-top: 1.2em; }
.prose h2, .prose h3 { font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; margin-top: 1.8em; }
.prose h2 { font-size: 32px; }
.prose h3 { font-size: 24px; }
.prose em { color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--flame); text-decoration-thickness: 2px; }
.prose a:hover { color: var(--flame); }
.prose blockquote { margin-left: 0; padding: 18px 22px; background: var(--teal); font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--black); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--flame); }
.prose hr { border: 0; border-top: 4px solid var(--black); margin: 2.4em 0; }
.prose p:has(> img) { margin-top: 2em; margin-bottom: 2.4em; }
.prose img { width: 100%; height: auto; border: 2px solid var(--black); box-shadow: 10px 10px 0 var(--teal); }
.prose code { font-family: var(--mono); font-size: .82em; background: var(--bg-tint); padding: .1em .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--black); }
.note__sign { max-width: 680px; margin: 40px 0 0; font-weight: 700; font-size: 22px; color: var(--slate); }

.note-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: clamp(64px, 9vw, 104px); margin-bottom: clamp(64px, 9vw, 104px); }
.note-nav__item { display: block; padding: 20px; background: var(--bg-tint); text-decoration: none; transition: background .2s; }
.note-nav__item--next { text-align: right; }
.note-nav__label { display: block; color: var(--muted); }
.note-nav__title { display: block; margin-top: 10px; font-weight: 800; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
.note-nav__item:hover { background: var(--teal); }

/* ---------- Footer ---------- */

.site-footer { background: var(--band); color: var(--snow); padding: 28px 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; }
.site-footer a { color: var(--snow); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (hover: none) {
  .gallery__track { cursor: auto; }
}

/* ---------- Responsive ---------- */

@media (min-width: 1081px) {
  .prose, .note__sign { margin-left: 25%; }
}

@media (max-width: 1080px) {
  .tiles, .project__more .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tiles li:last-child:nth-child(odd) .tile { min-height: 240px; }
  .tile--snow, .tiles li:first-child .tile--snow { box-shadow: inset 0 0 0 2px var(--black); }
}

@media (max-width: 900px) {
  .latest__list { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__side { grid-template-rows: auto auto; }
  .hero__photo img { aspect-ratio: 4 / 3; height: auto; }
  .project__hero-inner { grid-template-columns: 1fr; }
  .project__cover { max-width: 520px; }
  .project__aside, .project__body { grid-column: 1 / -1; }
  .project__aside { position: static; }
  .contact-page__copy, .contact-page .contact { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }

  .kicker, .tile__meta, .tile__figure, .facts dt, .note-row time, .note-row__no, .note-nav__label,
  .site-footer, .contact__label, .gallery__count, .modal__kicker { font-size: 11px; }

  .hero__title { font-size: 12.6vw; }
  .hero__strip { font-size: 18px; }

  .tiles, .project__more .tiles { grid-template-columns: 1fr; }
  .tiles li:last-child:nth-child(odd) { grid-column: auto; }
  .tile, .tiles li:last-child:nth-child(odd) .tile { min-height: 220px; }
  .tile__name { font-size: 40px; }

  .page-hero__title { font-size: 16vw; }
  .project__title { font-size: 15vw; }
  .project__cover { box-shadow: 8px 8px 0 var(--black); }
  .project__body p { font-size: 17px; }
  .gallery { --slide-h: 62vw; }
  .gallery__bar { gap: 14px; }

  .lightbox__stage { padding: 64px 0 56px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; }

  .note-row a { grid-template-columns: auto minmax(0, 1fr) 24px; gap: 6px 14px; }
  .note-row__text { grid-column: 1 / span 2; grid-row: 2; }
  .note-row__arrow { grid-column: 3; grid-row: 1; }
  .note-row__title { font-size: 28px; }

  .note__title { font-size: 11vw; }
  .prose { font-size: 17px; }
  .prose blockquote { font-size: 21px; }
  .note-nav { grid-template-columns: 1fr; gap: 12px; margin: 56px auto; }
  .note-nav__item--next { text-align: left; }

  .form__row { grid-template-columns: 1fr; }
  .slot { grid-template-columns: 34px minmax(0, 1fr); }
  .slot > small { display: none; }
  .form__slots input { max-width: none; }
  .contact__item { grid-template-columns: 1fr; gap: 6px; }
  .modal { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; box-shadow: none; }
  .modal__inner { padding: 20px var(--gutter) max(28px, env(safe-area-inset-bottom)); }
  .form__submit { width: 100%; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}
