/* ---------- tokens ---------- */
:root {
  --paper: #FBFAF7;
  --ink: #1A1A1A;
  --grey: #777166;
  --hairline: #E8E4DC;
  --accent: #C94F27;
  /* --accent itself is frozen (brand value, fine for decorative/outline use at
     3:1 non-text contrast). Small text needs 4.5:1, which the raw accent misses
     in both directions, so two application-level derivatives carry the eyebrow:
     darkened for paper (4.68:1), lightened for the ink contact band (4.62:1). */
  --accent-text: #C04C25;
  --accent-text-on-ink: #D85E37;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  /* Section padding-block. Adjacent sections each contribute one, so the gap
     a reader actually sees at a section boundary is 2x this value. */
  --space: clamp(3.75rem, 6.5vw, 5.5rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --content: 72rem;
  --radius: 3px;                        /* one corner radius, everywhere */
  --tile-gap: 18px;                     /* masonry column + row gap */
  --ease-out: cubic-bezier(.22, 1, .36, 1);   /* enter / press — fast, then settles */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);    /* hover colour + fill changes */
}
@font-face { font-family: "Archivo"; font-weight: 300; font-display: swap;
  src: url("../assets/fonts/archivo-300.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/archivo-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/inter-600.woff2") format("woff2"); }

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em;
  text-wrap: balance; }
p { text-wrap: pretty; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* sticky nav is ~71px — keep anchored sections clear of it */
#top, #work, #services, #about, #contact { scroll-margin-top: 5.5rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink);
  color: #fff; padding: .5rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 99; }
.skip-link:focus { left: 0; }

/* ---------- shared bits ---------- */
.eyebrow { font: 600 .72rem/1 var(--font-body); letter-spacing: .28em;
  text-transform: uppercase; color: var(--accent-text); margin: 0 0 1.1rem; }
/* Every variant carries a 1px border — transparent on the filled ones — so the
   solid and outlined buttons share identical box maths and their labels sit on
   the same baseline when they sit side by side. */
.btn { display: inline-block; font: 600 .8rem/1 var(--font-body);
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  padding: .95rem 1.6rem; border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color .18s var(--ease-soft), border-color .18s var(--ease-soft),
              color .18s var(--ease-soft), transform .12s var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--ink); color: #fff; }
.btn--solid:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn--ghost { color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .btn:active, .chip:active, .nav-toggle:active, .lightbox-close:active { transform: none; }
  .lightbox-prev:active, .lightbox-next:active { transform: translateY(-50%); }
}

/* ---------- nav ---------- */
.site-nav { position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline); z-index: 10; }
.nav-inner { max-width: var(--content); margin: 0 auto; padding: .8rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand img { height: 44px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) { font: 600 .78rem/1 var(--font-body); letter-spacing: .14em;
  text-transform: uppercase; color: var(--grey); text-decoration: none;
  transition: color .18s var(--ease-soft); }
.nav-links a:not(.btn):hover { color: var(--ink); }
/* 44px tap target — the primary phone-call CTA, present in both the desktop
   and mobile nav, so it gets the same minimum as the chips and nav-toggle */
.nav-links .btn { padding: .92rem 1.2rem; }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
/* Asymmetric padding: the hero wants air above it (it sits under the nav) but
   not a 240px void below it before the work section starts. */
.hero { max-width: var(--content); margin: 0 auto; text-align: center;
  padding: clamp(4.5rem, 8.5vw, 7.5rem) var(--gutter) clamp(3.5rem, 6vw, 5rem); }
.hero-title { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 300;
  line-height: 1.04; letter-spacing: -.03em; }
.hero-title strong { font-weight: 700; }
/* deliberately NOT text-wrap: balance — balancing this sentence makes Chromium
   break before the em dash and start line 2 with "—". It keeps the inherited
   `pretty`, which fixes the short last line without moving the dash. */
.hero-pitch { color: var(--grey); font-size: 1.05rem; max-width: 34rem;
  margin: 1.35rem auto 2.25rem; }
.hero-ctas { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- reveal (guarded, JS adds .is-visible) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html:not(.no-js) .reveal { opacity: 0; transform: translateY(16px);
    transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
  html:not(.no-js) .reveal.is-visible { opacity: 1; transform: none; }
  /* tiles that cross the threshold together cascade left-to-right */
  html:not(.no-js) .work-grid .reveal:nth-child(3n+2) { transition-delay: .06s; }
  html:not(.no-js) .work-grid .reveal:nth-child(3n+3) { transition-delay: .12s; }
}

/* ---------- mobile nav ---------- */
@media (max-width: 720px) {
  /* 44x44 — the only way into the menu on a phone, so it gets a real tap target */
  html:not(.no-js) .nav-toggle { display: grid; place-items: center; width: 44px; height: 44px;
    padding: 0; background: none; border: 1px solid var(--hairline);
    border-radius: var(--radius); cursor: pointer;
    transition: border-color .18s var(--ease-soft), transform .12s var(--ease-out); }
  html:not(.no-js) .site-nav.is-open .nav-toggle { border-color: var(--ink); }
  .nav-toggle:active { transform: scale(.94); }
  .nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--ink);
    box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
  html:not(.no-js) .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; text-align: center;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: 1rem var(--gutter) 1.4rem; gap: 1.1rem; }
  html:not(.no-js) .site-nav.is-open .nav-links { display: flex; }
  html.no-js .nav-links { flex-wrap: wrap; justify-content: flex-end; gap: .9rem; }
  /* entrance only — the panel still hides instantly, so nothing can strand it open */
  @media (prefers-reduced-motion: no-preference) {
    html:not(.no-js) .site-nav.is-open .nav-links { animation: menu-in .18s var(--ease-out) both; }
  }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- sections shared ---------- */
.section-inner { max-width: var(--content); margin: 0 auto;
  padding: var(--space) var(--gutter); }
/* descendant, not child: the About heading is nested inside .about-copy and was
   falling through to the UA default (24px/bold) while every other section
   heading rendered 44.8px/300. */
.section-inner h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 300;
  line-height: 1.08; letter-spacing: -.015em; }
.section-inner > h2 + * { margin-top: 2rem; }

/* ---------- gallery ---------- */
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }
/* 40px tall (was 33). Horizontal padding stays at 1rem — 1.15rem tipped the
   three chips past the content width at 375 and wrapped them to a second row. */
.chip { position: relative; font: 600 .72rem/1 var(--font-body); letter-spacing: .12em;
  text-transform: uppercase; background: none; border: 1px solid var(--hairline);
  color: var(--grey); padding: .83rem 1rem; border-radius: 999px; cursor: pointer;
  transition: color .18s var(--ease-soft), border-color .18s var(--ease-soft),
              background-color .18s var(--ease-soft), transform .12s var(--ease-out); }
/* invisible 2px collar takes the pill from a 40px box to a 44px tap target */
.chip::after { content: ""; position: absolute; inset: -2px 0; }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip:active { transform: scale(.97); }
/* a filter that is on should be unmistakable — outline → ink fill, not a
   recolour of the same outline (also lifts it from 4.3:1 to 16:1) */
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.work-grid { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 10px; grid-auto-flow: row; column-gap: var(--tile-gap); }
.work-tile { margin: 0 0 var(--tile-gap); overflow: hidden; border-radius: var(--radius); }
.work-tile--l { grid-row: span 46; }   /* ≈ 460px tall */
.work-tile--m { grid-row: span 38; }
.work-tile--s { grid-row: span 30; }
.tile-link { display: block; height: 100%; }
.tile-link picture, .tile-link img { height: 100%; width: 100%; object-fit: cover; }
/* hover:hover guard — without it a tap on a phone leaves the photo stuck zoomed
   behind the lightbox it just opened */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .tile-link img { transition: transform .45s var(--ease-out); }
  .tile-link:hover img { transform: scale(1.04); }
}
@media (max-width: 900px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .work-grid { display: block; }
  .work-tile { grid-row: auto; }
  .work-tile--l { aspect-ratio: 4 / 5; } .work-tile--m { aspect-ratio: 1; }
  .work-tile--s { aspect-ratio: 4 / 3; }
}

/* ---------- services ---------- */
/* white on the paper token is a 1.5% step — the card fill was doing no work, so the
   boxes read as generic containers. Hairline rules + negative space instead:
   an index, which is what this list actually is. */
.service-grid { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 0 clamp(1.5rem, 3.5vw, 3rem); }
.service-card { background: none; border: 0; border-top: 1px solid var(--hairline);
  border-radius: 0; padding: 1.25rem 0 1.9rem; }
.service-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .45rem; }
.service-card p { margin: 0; color: var(--grey); font-size: .92rem; max-width: 26rem; }
@media (max-width: 900px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
/* 5fr/7fr gave the copy a ~78-character measure (too wide to track) and shrank
   the craft photo to the smallest image on the page. Even columns fix both. */
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center; }
.about-media img { border-radius: var(--radius); }
.about-copy p:not(.eyebrow) { max-width: 34rem; }
@media (max-width: 760px) { .about-layout { grid-template-columns: 1fr; } }

/* ---------- contact (dark band) ---------- */
.contact { background: var(--ink); color: #fff; }
/* the dark band's padding is fill, not gap — it keeps the fuller measure */
.contact .section-inner { padding-block: clamp(4.5rem, 8vw, 7rem); }
.contact .eyebrow { color: var(--accent-text-on-ink); }
.contact h2 { font-weight: 300; font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -.02em; }
.contact h2 strong { font-weight: 700; }
.contact-sub { color: #B9B2A8; max-width: 36rem; }
.contact-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2.25rem; }
.btn--paper { background: var(--paper); color: var(--ink); }
.btn--paper:hover { background: #fff; }
.btn--outline-light { color: #fff; border-color: #4a463f; }
.btn--outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .07); }

/* ---------- footer ---------- */
.footer { background: var(--ink); border-top: 1px solid #33302a; }
.footer-inner { max-width: var(--content); margin: 0 auto; padding: 1.9rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; }
.footer p { margin: 0; color: #8D887E; font-size: .8rem; }
.footer a { color: #B9B2A8; text-underline-offset: .18em;
  transition: color .18s var(--ease-soft); }
.footer a:hover { color: #fff; }

/* ---------- lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
/* .88 let the nav and headings read through the scrim; a viewer should black out */
.lightbox::backdrop { background: rgba(10, 9, 7, .95); }
.lightbox figure { margin: 0; }
.lightbox-img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-caption { color: #B9B2A8; font-size: .85rem; text-align: center; padding-top: .8rem; }
/* pill sits under the glyph so the controls stay legible when a pale photo
   runs under them, and gives each control a 44px+ target */
.lightbox button { position: fixed; display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 2.2rem;
  line-height: 1; cursor: pointer;
  transition: background-color .18s var(--ease-soft), color .18s var(--ease-soft),
              transform .12s var(--ease-out); }
.lightbox-close { top: .75rem; right: .9rem; }
.lightbox-prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .6rem; top: 50%; transform: translateY(-50%); }
.lightbox button:hover { background: rgba(255, 255, 255, .16); color: var(--accent); }
.lightbox-close:active { transform: scale(.92); }
.lightbox-prev:active, .lightbox-next:active { transform: translateY(-50%) scale(.92); }

/* Modal entrance. Centred origin — a lightbox is not anchored to a trigger.
   The scale lives on <figure>, never on the <dialog>: a transform on the dialog
   would make it the containing block for the position:fixed controls and drag
   them off the viewport edges. Exit is quicker than the enter. */
@media (prefers-reduced-motion: no-preference) {
  .lightbox { opacity: 0;
    transition: opacity .16s var(--ease-soft),
                overlay .16s allow-discrete, display .16s allow-discrete; }
  .lightbox[open] { opacity: 1;
    transition: opacity .22s var(--ease-soft),
                overlay .22s allow-discrete, display .22s allow-discrete; }
  @starting-style { .lightbox[open] { opacity: 0; } }
  .lightbox figure { transition: transform .16s var(--ease-out); }
  .lightbox[open] figure { transform: scale(1); transition: transform .22s var(--ease-out); }
  @starting-style { .lightbox[open] figure { transform: scale(.97); } }
  .lightbox::backdrop { opacity: 0;
    transition: opacity .16s var(--ease-soft),
                overlay .16s allow-discrete, display .16s allow-discrete; }
  .lightbox[open]::backdrop { opacity: 1;
    transition: opacity .22s var(--ease-soft),
                overlay .22s allow-discrete, display .22s allow-discrete; }
  @starting-style { .lightbox[open]::backdrop { opacity: 0; } }
}
