:root {
  --paper: #fbfbf8;
  --ink: #0a0a0a;
  --muted: #66645f;
  --line: #d8d7d1;
  --soft: #efeee9;
  --red: #d9261c;
  --condensed: "Arial Narrow", "Liberation Sans Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- archive ---------- */
.archive-page { height: 100svh; overflow: hidden; }
.archive-shell {
  width: min(1360px, calc(100% - 72px));
  height: 100svh;
  margin: 0 auto;
  padding: 50px 0 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.archive-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}
.archive-heading h1 {
  margin: 0;
  font-family: var(--condensed);
  font-size: clamp(3.8rem, 6vw, 6rem);
  line-height: .9;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.archive-heading p {
  max-width: 390px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
  letter-spacing: .06em;
  text-align: right;
  text-transform: uppercase;
}
.filters {
  flex: 0 0 auto;
  display: flex;
  gap: clamp(18px, 3.2vw, 52px);
  margin-top: 38px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-button {
  flex: 0 0 auto;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #353535;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.filter-button:hover { color: var(--ink); }
.filter-button.is-active { color: var(--red); border-color: var(--red); }
.filter-button:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
.project-window {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 2px 70px;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.project-window::-webkit-scrollbar { display: none; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 58px 34px;
}
.grid-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(112px, .68fr) minmax(0, 1fr);
  gap: 21px;
  align-items: end;
}
.grid-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #111;
}
.grid-card__media img,
.grid-card__media video,
.media-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid-card__media img { transition: transform .5s ease, filter .35s ease, opacity .25s ease; }
.grid-card__media video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s ease;
}
.grid-card__cue {
  position: absolute;
  right: 11px;
  bottom: 10px;
  padding-left: 13px;
  color: #fff;
  font-size: .57rem;
  font-weight: 750;
  letter-spacing: .11em;
  opacity: 0;
  text-transform: uppercase;
  transition: opacity .22s ease;
}
.grid-card__cue::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 2px;
  background: var(--red);
  transform: translateY(-50%);
}
.grid-card:hover .grid-card__media img,
.grid-card:focus-visible .grid-card__media img { transform: scale(1.025); filter: brightness(.72); }
.grid-card:hover .grid-card__media video,
.grid-card:focus-visible .grid-card__media video { opacity: 1; }
.grid-card:hover .grid-card__cue,
.grid-card:focus-visible .grid-card__cue { opacity: 1; }
.grid-card:focus-visible { outline: 2px solid var(--red); outline-offset: 7px; }
.grid-card__copy { min-width: 0; padding-bottom: 2px; }
.grid-card__copy h2 {
  margin: 0 0 9px;
  font-family: var(--condensed);
  font-size: clamp(1.25rem, 1.55vw, 1.55rem);
  line-height: 1.02;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.grid-card__copy p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.48;
}
.grid-card__copy small {
  font-size: .59rem;
  line-height: 1.4;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.empty-state { margin: 40px 0; color: var(--muted); font-size: .82rem; }

/* ---------- project page ---------- */
.project-shell {
  width: min(1440px, calc(100% - 96px));
  margin: 0 auto;
  padding: 52px 0 90px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 46px;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.back-link span { font-size: 1.05rem; transition: translate .2s ease; }
.back-link:hover span { translate: -5px 0; }
.project-intro {
  display: grid;
  grid-template-columns: minmax(320px, 370px) minmax(560px, 1fr);
  gap: clamp(50px, 7vw, 110px);
  align-items: center;
  padding-bottom: 34px;
}
.project-intro h1 {
  max-width: 430px;
  margin: 0;
  font-family: var(--condensed);
  font-size: clamp(3.25rem, 4.6vw, 5.25rem);
  line-height: 1.01;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.project-rule { display: block; width: 34px; height: 2px; margin: 31px 0 27px; background: var(--ink); }
.project-facts { margin: 0; }
.project-facts div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  margin: 0 0 14px;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.project-facts dt, .project-facts dd { margin: 0; }
.project-facts dd::before { content: "·"; margin-right: 23px; color: #777; }
.accent { color: var(--red); font-weight: 750; }
.project-player { overflow: hidden; background: #0a0a0a; }
.project-player video,
.project-player img,
.media-placeholder--wide { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.detail-section {
  display: grid;
  grid-template-columns: minmax(230px, 285px) minmax(560px, 1fr);
  gap: clamp(45px, 5vw, 78px);
  padding: 31px 0;
  border-top: 1px solid var(--line);
}
.detail-section:last-of-type { border-bottom: 1px solid var(--line); }
.detail-section header { padding-top: 2px; }
.detail-section h2 {
  margin: 0;
  font-family: var(--condensed);
  font-size: 1.2rem;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.prose { max-width: 740px; }
.prose p { margin: 0 0 18px; color: #292929; font-size: .93rem; line-height: 1.68; }
.prose p:last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 26px 0 10px; font-family: var(--condensed); letter-spacing: .04em; text-transform: uppercase; }
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.08rem; }
.prose ul, .prose ol { margin: 16px 0; padding-left: 1.25rem; color: #292929; }
.prose li { margin: 7px 0; font-size: .93rem; line-height: 1.55; }
.gallery-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gallery-image { padding: 0; overflow: hidden; border: 0; background: #111; cursor: zoom-in; aspect-ratio: 16 / 9; }
.gallery-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease, filter .3s ease; }
.gallery-image:hover img { transform: scale(1.035); filter: brightness(.8); }
.tool-list { display: flex; flex-wrap: wrap; gap: 8px 21px; margin: 22px 0 0; padding: 0; list-style: none; }
.tool-list li { font-size: .65rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tool-list li:not(:last-child)::after { content: "·"; margin-left: 21px; color: #888; }
.more-projects { padding-top: 38px; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.related-card { display: grid; grid-template-columns: 86px 1fr; gap: 17px; align-items: center; }
.related-card img { width: 86px; aspect-ratio: 4 / 5; object-fit: cover; transition: filter .25s ease; }
.related-card h3 { margin: 0 0 8px; font-family: var(--condensed); font-size: 1rem; line-height: 1.05; letter-spacing: .05em; text-transform: uppercase; }
.related-card small { display: block; font-size: .54rem; line-height: 1.45; letter-spacing: .055em; text-transform: uppercase; }
.related-card b { display: inline-block; margin-top: 12px; color: var(--red); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
.related-card:hover img { filter: brightness(.7); }
.lightbox { max-width: min(1100px, 92vw); padding: 0; border: 0; background: transparent; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox img { max-height: 86vh; width: auto; margin: auto; }
.lightbox button { position: fixed; right: 25px; top: 16px; border: 0; background: transparent; color: white; font-size: 2.3rem; cursor: pointer; }

/* ---------- login and admin ---------- */
.auth-page, .admin-page { min-height: 100svh; }
.auth-shell {
  width: min(440px, calc(100% - 34px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 45px 0;
}
.auth-kicker { margin: 0 0 12px; color: var(--red); font-size: .62rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.auth-shell h1, .admin-header h1 {
  margin: 0;
  font-family: var(--condensed);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.auth-shell h1 { font-size: clamp(3rem, 10vw, 5rem); }
.auth-shell > p { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.auth-form { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.form-row { display: grid; gap: 8px; margin-bottom: 18px; }
.form-row label, .field-label { font-size: .62rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.form-row input, .form-row textarea, .form-row select,
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form input[type="number"], .admin-form textarea, .admin-form select {
  width: 100%;
  border: 1px solid #bdbcb6;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
.form-row textarea, .admin-form textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus,
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 10px 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: .63rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.button:hover { background: var(--red); border-color: var(--red); }
.button--secondary { background: transparent; color: var(--ink); }
.button--secondary:hover { color: white; }
.button--danger { background: transparent; border-color: #b8b6b0; color: var(--red); }
.button--danger:hover { background: var(--red); color: white; }
.form-error, .flash { padding: 12px 14px; border-left: 3px solid var(--red); background: #f5e6e4; font-size: .78rem; line-height: 1.45; }
.flash--success { border-color: #111; background: var(--soft); }
.admin-shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 90px; }
.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-header h1 { font-size: clamp(2.8rem, 6vw, 5rem); line-height: .9; }
.admin-header__actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 9px; }
.admin-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.admin-section__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.admin-section h2 { margin: 0; font-family: var(--condensed); font-size: 1.4rem; letter-spacing: .055em; text-transform: uppercase; }
.admin-section__heading p, .help { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.project-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.admin-project { display: grid; grid-template-columns: 58px minmax(190px, 1.4fr) 1fr auto; gap: 18px; align-items: center; padding: 11px; background: var(--paper); }
.admin-project img { width: 58px; aspect-ratio: 4 / 5; object-fit: cover; background: #111; }
.admin-project h3 { margin: 0 0 4px; font-family: var(--condensed); font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; }
.admin-project p, .admin-project small { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.admin-project__actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.icon-button { min-width: 34px; min-height: 34px; padding: 6px; border: 1px solid #bbb9b3; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--red); color: var(--red); }
.admin-form { margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .form-row { margin: 0; }
.checkbox-row { display: flex; align-items: center; gap: 9px; min-height: 42px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--red); }
.markdown-help { padding: 11px 13px; background: var(--soft); color: var(--muted); font-size: .68rem; line-height: 1.55; }
.media-preview { display: flex; align-items: start; gap: 15px; margin-top: 10px; }
.media-preview img, .media-preview video { width: 120px; max-height: 100px; object-fit: cover; background: #111; }
.gallery-admin { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.gallery-admin label { position: relative; display: block; cursor: pointer; }
.gallery-admin img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery-admin input { position: absolute; left: 7px; top: 7px; width: 18px; height: 18px; accent-color: var(--red); }
.form-actions { position: sticky; bottom: 0; display: flex; justify-content: end; gap: 9px; margin-top: 30px; padding: 15px 0; background: linear-gradient(to bottom, transparent, var(--paper) 25%); }
.settings-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-shell { width: min(100% - 48px, 1000px); }
  .project-intro { grid-template-columns: 285px 1fr; gap: 42px; align-items: start; }
  .detail-section { grid-template-columns: 215px 1fr; gap: 42px; }
  .gallery-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-project { grid-template-columns: 55px 1fr auto; }
  .admin-project__meta { display: none; }
}

@media (max-width: 760px) {
  .archive-shell { width: calc(100% - 28px); padding: 32px 0 14px; }
  .archive-heading { display: block; }
  .archive-heading h1 { font-size: 3.5rem; }
  .archive-heading p { margin-top: 14px; text-align: left; }
  .filters { margin-top: 24px; }
  .project-window { padding-top: 24px; }
  .project-grid { grid-template-columns: 1fr; gap: 35px; }
  .grid-card { grid-template-columns: 128px minmax(0, 1fr); }

  .project-shell { width: calc(100% - 28px); padding-top: 27px; }
  .back-link { margin-bottom: 31px; }
  .project-intro { display: flex; flex-direction: column; gap: 34px; }
  .project-intro__copy { width: 100%; }
  .project-intro h1 { max-width: 100%; font-size: clamp(3rem, 15vw, 5rem); }
  .project-player { order: -1; width: calc(100% + 28px); margin-left: -14px; }
  .detail-section { display: block; padding: 27px 0 32px; }
  .detail-section header { margin-bottom: 22px; }
  .gallery-strip { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .gallery-image { min-width: 77%; scroll-snap-align: start; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { grid-template-columns: 76px 1fr; }

  .admin-shell { width: calc(100% - 28px); padding-top: 28px; }
  .admin-header { display: block; }
  .admin-header__actions { justify-content: start; margin-top: 23px; }
  .admin-section__heading { display: block; }
  .admin-section__heading p { margin-top: 8px; }
  .admin-project { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .admin-project img { width: 48px; }
  .admin-project__actions { grid-column: 1 / -1; justify-content: start; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .gallery-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.project-player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #0a0a0a;
}
