/* ═══════════════════════════════════════════════════════════════════════
   Studio Unit Zero — main stylesheet
   Sections: 01 base · 02 layout · 03 header · 04 cover · 05 type blocks
             06 work grid · 07 case study · 08 about/contact · 09 footer
             10 lightbox · 11 utilities
   ═════════════════════════════════════════════════════════════════════ */

/* ── 01 base ──────────────────────────────────────────────────────────── */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-weight: 400;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

p a:not([class]) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease);
}

p a:not([class]):hover {
  color: var(--accent-deep);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-2);
  z-index: 999;
  padding: var(--sp-2) var(--sp-3);
  background: var(--accent);
  color: var(--white);
  font-size: var(--step--1);
}

.skip-link:focus {
  top: var(--sp-2);
}

/* ── 02 layout ────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: var(--narrow);
}

/* Wider wrap with a generous, always-visible side gutter — used on Work so
   the grid reads with clear margins on both sides at every viewport. */
.wrap--work {
  max-width: 1560px;
  padding-inline: clamp(1.5rem, 5vw, 5rem);
}

.section {
  padding-block: var(--sp-section);
}

.section--sunk {
  background: var(--paper-sunk);
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5rem);
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ── 03 header ────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.site-header__inner {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: block;
  flex-shrink: 0;
}

.brand img {
  height: clamp(26px, 3.2vw, 34px);
  width: auto;
  transition: filter var(--dur) var(--ease);
}

/* Solid state — applied on scroll and on every non-hero page */
.site-header.is-solid,
body:not(.has-hero) .site-header {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--rule);
}

/* Over-hero state — knock the logo and links to white */
body.has-hero .site-header:not(.is-solid) .brand img {
  filter: brightness(0) invert(1);
}

body.has-hero .site-header:not(.is-solid) .nav__link,
body.has-hero .site-header:not(.is-solid) .nav-toggle {
  color: var(--white);
}

body.has-hero .site-header:not(.is-solid) .nav__link::after {
  background: var(--white);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav__link {
  position: relative;
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding-block: var(--sp-1);
  transition: color var(--dur-fast) var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 5px auto;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) linear;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--sp-3) var(--gutter) var(--sp-5);
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  /* menu panel is always light, so force dark links even over a hero */
  body.has-hero .site-header:not(.is-solid) .nav__link {
    color: var(--ink);
  }

  .nav__link {
    width: 100%;
    padding-block: var(--sp-2);
    font-size: var(--step-1);
    border-bottom: 1px solid var(--rule);
  }

  .nav__link::after {
    display: none;
  }
}

/* ── 04 cover ─────────────────────────────────────────────────────────── */
/* Full-bleed, text-free image slideshow. js/main.js swaps which
   .home-cover__img carries .is-active on a timer (every 5-7s). Falls back
   to a single static frame with no JS or with reduced motion. */

.home-cover {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: var(--overlay-ink);
}

.home-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.0s var(--ease);
}

.home-cover__img.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .home-cover__img {
    transition: none;
  }
}

/* Page header for interior pages */
.page-head {
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.page-head__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.page-head__title {
  font-size: var(--step-4);
  font-weight: 400;
  max-width: 16ch;
}

.page-head__lede {
  margin-top: var(--sp-3);
  max-width: 52ch;
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: var(--leading-snug);
}

/* ── 05 type blocks ───────────────────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-muted);
  margin-bottom: var(--sp-4);
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.statement {
  font-size: var(--step-3);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.025em;
  max-width: 24ch;
  text-wrap: balance;
}

.statement--wide {
  max-width: 30ch;
}

.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: var(--sp-3);
}

.prose--lead p {
  font-size: var(--step-1);
  color: var(--ink-soft);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Mono definition list — project metadata */
.specs {
  display: grid;
  gap: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.5;
}

.specs > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--sp-2);
  padding-block: var(--sp-2);
  border-top: 1px solid var(--rule);
}

.specs > div:last-child {
  border-bottom: 1px solid var(--rule);
}

.specs dt {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.specs dd {
  margin: 0;
  color: var(--ink);
}

@media (max-width: 480px) {
  .specs > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  border-top: 1px solid var(--rule);
}

.stats > div {
  padding-top: var(--sp-4);
}

.stats dt {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.stats dd {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── 06 work grid ─────────────────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  padding-block: var(--sp-3);
  border-block: 1px solid var(--rule);
  margin-bottom: var(--sp-6);
}

.filters__btn {
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  border-radius: 2px;
  transition: color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.filters__btn:hover {
  color: var(--ink);
  background: var(--paper-sunk);
}

.filters__btn[aria-pressed="true"] {
  color: var(--white);
  background: var(--accent);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.work-card {
  display: block;
}

.work-card[hidden] {
  display: none;
}

/* Fixed ratio so every card in the grid reads as the same size. object-fit:
   cover scales the photo uniformly and crops any overflow — it never
   stretches or distorts the image the way forcing width/height would. */
.work-card__media {
  position: relative;
  overflow: hidden;
  background: var(--paper-sunk);
  aspect-ratio: 3 / 2;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease),
    filter var(--dur-slow) var(--ease);
}

.work-card__media--placeholder {
  background: var(--paper-sunk);
}

.work-card:hover .work-card__media img {
  transform: scale(1.035);
}

.work-card__body {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
}

.work-card__title {
  font-size: var(--step-2);
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: color var(--dur-fast) var(--ease);
}

.work-card:hover .work-card__title {
  color: var(--accent);
}

.work-card__place {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: 0.35rem;
}

.empty-state {
  padding-block: var(--sp-6);
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* ── 07 case study ────────────────────────────────────────────────────── */

.cover {
  position: relative;
  height: 78svh;
  min-height: 420px;
  background: var(--overlay-ink);
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13, 15, 18, 0.4),
    rgba(13, 15, 18, 0) 40%
  );
  pointer-events: none;
}

.case-intro {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.case-intro__title {
  font-size: var(--step-4);
  font-weight: 400;
  margin-bottom: var(--sp-5);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  height: auto;
  background: var(--paper-sunk);
}

.shot--full {
  width: 100%;
}

.shot--duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.shot--inset {
  max-width: var(--narrow);
  margin-inline: auto;
}

/* Drawings are tall and line-based — cap them so a plan does not swamp the page */
.shot--plan img {
  width: auto;
  max-height: 78svh;
  margin-inline: auto;
}

.shot--plan figcaption {
  text-align: center;
}

.shot--bleed {
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
}

@media (max-width: 640px) {
  .shot--duo {
    grid-template-columns: 1fr;
  }
}

.shot figcaption {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.zoomable {
  cursor: zoom-in;
}

/* Pull-quote between gallery runs */
.pullquote {
  max-width: 34ch;
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
  text-align: center;
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  text-wrap: balance;
}

.pairnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
}

.pairnav a {
  padding-block: var(--sp-5);
  transition: background var(--dur-fast) var(--ease);
}

.pairnav a:hover {
  background: var(--paper-sunk);
}

.pairnav a + a {
  text-align: right;
  border-left: 1px solid var(--rule);
  padding-left: var(--sp-3);
}

.pairnav a:first-child {
  padding-right: var(--sp-3);
}

.pairnav span {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-muted);
  margin-bottom: var(--sp-1);
}

.pairnav strong {
  font-size: var(--step-2);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* ── 08 about / contact ───────────────────────────────────────────────── */

.creed {
  font-size: var(--step-2);
  line-height: 1.5;
  letter-spacing: -0.015em;
  max-width: 26ch;
}

.creed-list {
  display: grid;
  gap: 0;
  max-width: var(--measure);
}

.creed-list li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--sp-2);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

.creed-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.creed-list b {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--accent);
  padding-top: 0.25rem;
}

/* Contact channels */
.channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.channel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--paper);
  transition: background var(--dur) var(--ease);
}

.channel:hover {
  background: var(--accent-wash);
}

.channel__label {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-muted);
}

/* Sized to keep studiounitzero@gmail.com on one line in a three-up column. */
.channel__value {
  font-size: clamp(1.0625rem, 1.35vw, 1.375rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.channel:hover .channel__value {
  color: var(--accent);
}

.channel__note {
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: var(--sp-2);
}

.channel svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Big CTA band */
.cta-band {
  padding-block: clamp(4rem, 10vw, 8rem);
  background: var(--accent);
  color: var(--white);
}

.cta-band .eyebrow {
  color: rgb(var(--white-rgb) / 0.7);
}

.cta-band .eyebrow::after {
  background: rgb(var(--white-rgb) / 0.3);
}

.cta-band__title {
  font-size: var(--step-4);
  font-weight: 400;
  max-width: 16ch;
  margin-bottom: var(--sp-5);
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.9rem 1.6rem;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:hover {
  background: var(--white);
  color: var(--accent);
}

.btn--ink {
  color: var(--ink);
}

.btn--ink:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ── 09 footer ────────────────────────────────────────────────────────── */

.site-footer {
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-4);
  border-top: 1px solid var(--rule);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
  padding-bottom: var(--sp-6);
}

@media (max-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
}

.site-footer img.brand-mark {
  height: 30px;
  width: auto;
  margin-bottom: var(--sp-3);
}

.site-footer h3 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}

.site-footer ul li + li {
  margin-top: var(--sp-1);
}

.site-footer ul a {
  font-size: var(--step--1);
  color: var(--ink-soft);
  transition: color var(--dur-fast) var(--ease);
}

.site-footer ul a:hover {
  color: var(--accent);
}

.site-footer__tagline {
  font-size: var(--step--1);
  color: var(--ink-muted);
  max-width: 34ch;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-muted);
}

/* ── 10 lightbox ──────────────────────────────────────────────────────── */

dialog.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100svh;
  max-height: 100svh;
  padding: 0;
  border: 0;
  background: rgba(10, 11, 13, 0.96);
}

dialog.lightbox::backdrop {
  background: rgba(10, 11, 13, 0.9);
}

.lightbox__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: clamp(1rem, 4vw, 3.5rem);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  background: rgb(var(--white-rgb) / 0.08);
  transition: background var(--dur-fast) var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgb(var(--white-rgb) / 0.2);
}

.lightbox__close {
  top: var(--sp-2);
  right: var(--sp-2);
}

.lightbox__nav--prev {
  left: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--next {
  right: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__count {
  position: absolute;
  bottom: var(--sp-3);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: rgb(var(--white-rgb) / 0.7);
}

/* ── 11 utilities ─────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Only hide reveal targets when JS is present to un-hide them — otherwise the
   page content would be permanently invisible if the script fails to run. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

.stack-4 > * + * {
  margin-top: var(--sp-4);
}

.stack-5 > * + * {
  margin-top: var(--sp-5);
}
