/* ==========================================================================
   Ploce Design Studio — main.css
   --------------------------------------------------------------------------
   Tokens, base styles, and the components shared by every page:
   header, footer, buttons, cards, filters, forms, weave textures, preloader.

   Page-specific styles live in pages.css.

   CONTENTS
   01. Design tokens (colours, type scale, spacing)
   02. Reset and base
   03. Typography
   04. Layout helpers (container, sections)
   05. Weave textures (the studio's signature pattern)
   06. Preloader
   07. Site header and navigation
   08. Site footer
   09. Buttons
   10. Project cards and grids
   11. Filter chips
   12. Forms
   13. Scroll-reveal animation (respects prefers-reduced-motion)
   ========================================================================== */

/* 01. DESIGN TOKENS ======================================================= */

:root {
  /* Palette — see the brand brief. Text pairings were checked for WCAG AA. */
  --straw:       #E8B923;  /* accent, used sparingly; also text on bark (8.1:1) */
  --dry-grass:   #C9A24B;  /* decorative strands; text on bark only (6.0:1) */
  --nest-brown:  #8A7B3A;  /* large text / rules on cream (3.7:1) */
  --reed-olive:  #5E6B3A;  /* secondary text on cream (5.1:1), focus outlines */
  --bark:        #2B2A26;  /* main text and dark sections */
  --cream:       #F6F1E4;  /* main background */
  --cream-deep:  #EFE7D3;  /* panels, wells, input backgrounds */
  --cream-soft:  #CFC9B8;  /* secondary text on bark (8.1:1) */
  --bark-soft:   #6A675C;  /* hairlines on cream (derived from bark) */

  /* Semantic extras (not in the palette brief — listed in the README). */
  --error:       #9A3324;  /* form errors: needs to differ from brand colours */
  --line:        rgba(43, 42, 38, 0.16);   /* hairlines on cream */
  --line-strong: rgba(43, 42, 38, 0.34);
  --scrim:       rgba(24, 23, 20, 0.72);   /* text legibility over photos */

  /* Typefaces. Fraunces (a sturdy serif) carries headlines and titles; Afacad
     is the body and default text; Barlow Semi Condensed sets the tracked
     uppercase labels; Cal Sans is reserved for primary actions (buttons);
     Questrial handles secondary controls (chips, toggles, the language
     switcher). Questrial and Cal Sans ship one weight, so they are always
     used at 400 — never faux-bolded. */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Afacad", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-condensed: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-display: "Cal Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-geometric: "Questrial", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Fluid type scale — one clamp() per role, mobile-first. */
  --fs-display: clamp(2.75rem, 1.4rem + 6.6vw, 6rem);
  --fs-h1:      clamp(2.3rem, 1.4rem + 4.2vw, 4.25rem);
  --fs-h2:      clamp(1.85rem, 1.3rem + 2.6vw, 3rem);
  --fs-h3:      clamp(1.3rem, 1.1rem + 1vw, 1.7rem);
  --fs-lede:    clamp(1.2rem, 1.05rem + 0.8vw, 1.55rem);
  --fs-body:    clamp(1.0625rem, 1rem + 0.3vw, 1.2rem);
  --fs-small:   0.9rem;
  --fs-eyebrow: 0.8rem;

  /* Spacing */
  --gutter:        clamp(1.25rem, 4vw, 4rem);
  --gap:           clamp(1rem, 2.5vw, 1.75rem);
  --space-section: clamp(4rem, 9vw, 7.5rem);
  --header-h:      4.25rem;

  --radius: 4px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1); /* calm, slightly "woven-in" ease */
}

/* 02. RESET AND BASE ====================================================== */

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

html {
  scroll-behavior: smooth;
  /* In-page anchors clear the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 1.5rem);

  /* Never allow sideways scrolling. The closed mobile menu sits just past
     the right edge (moved there with a transform), and while the sticky
     header is animating in or out, its transform briefly makes that menu
     count as page content — which would let a visitor swipe the page
     sideways for a moment. "clip" hides anything past the edge instead of
     making it scrollable, and unlike "hidden" it does not disturb the
     sticky header or smooth scrolling. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--bark);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Remove default list styling where we supply our own. */
ul.clean,
ol.clean {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* The HTML "hidden" attribute must always win. Without this guard, any
   class rule that sets display (like .error-page { display: grid }) would
   override the browser's built-in [hidden] { display: none } — both have
   the same importance, and the stylesheet is applied later. The detail
   templates hide their "not found" sections with the hidden attribute,
   so this line keeps them truly invisible. */
[hidden] {
  display: none !important;
}

/* Visible keyboard focus everywhere. Reed olive reads 5.1:1 on cream. */
:focus-visible {
  outline: 3px solid var(--reed-olive);
  outline-offset: 3px;
}

/* On dark sections, use the straw outline instead (8.1:1 on bark). */
.on-dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--straw);
}

::selection {
  background: var(--straw);
  color: var(--bark);
}

/* Skip link: hidden until focused. */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.6rem 1rem;
  background: var(--bark);
  color: var(--cream);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

/* Screen-reader-only text (used for extra button context). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 03. TYPOGRAPHY ========================================================== */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  margin: 0 0 1em;
  max-width: 66ch; /* long lines are hard to read; cap the measure */
}

a {
  color: inherit;
}

/* Emphasis. The heaviest weight in the system is 600, so <strong>/<b> resolve
   to it rather than a 700 the body family never loads. */
strong,
b {
  font-weight: 600;
}

/* In-body links: quiet underline that fills on hover. */
.main a:not(.btn):not(.chip) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Big opening paragraph for section intros. */
.lede {
  font-family: var(--font-serif);
  font-size: var(--fs-lede);
  line-height: 1.4;
  max-width: 34ch;
}

/* Small caps-style label that leads each section, e.g. "(01) Our work". */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--reed-olive);
}

/* The rule line that runs after an eyebrow, tying it to the margin. */
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

/* 04. LAYOUT HELPERS ===================================================== */

.container {
  width: min(100% - (var(--gutter) * 2), 1240px);
  margin-inline: auto;
}

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

/* Slightly tighter variant for stacked inner sections. */
.section--tight {
  padding-block: calc(var(--space-section) * 0.66);
}

/* Header block that opens a section: the eyebrow + heading pair, with
   breathing room underneath. */
.section-head {
  margin-bottom: clamp(1.6rem, 4vw, 2.75rem);
}

/* Dark sections flip the palette to cream-on-bark. */
.section--bark {
  background: var(--bark);
  color: var(--cream);
}

.section--bark .eyebrow {
  color: var(--straw);
}

.section--bark .eyebrow::after {
  background: rgba(246, 241, 228, 0.35);
}

/* 05. WEAVE TEXTURES ====================================================== */
/* Two sets of dashed diagonal strands crossing each other, echoing the straw
   strands of the PDS mark. Used as dividers, footer band and hover overlays. */

.weave-divider {
  height: 14px;
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(45deg, var(--straw) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, var(--dry-grass) 0 2px, transparent 2px 10px);
  opacity: 0.75;
  border-block: 1px solid var(--line);
}

/* 06. PRELOADER =========================================================== */
/* The PDS sign from the favicon assembles itself: the tile fades in, the
   olive and straw strands draw, the seed pops, then the whole overlay fades
   away. Pure CSS, so it finishes even if JavaScript never runs. The main.js
   script removes the element afterwards to keep the page clean.
   Total time: about 1.6 seconds. */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: var(--cream);
  animation: preloader-out 0.45s ease-out 1.15s forwards;
}

.preloader svg {
  width: clamp(130px, 26vw, 210px);
  height: auto;
  overflow: visible;
}

/* The tile fades in first. */
.preloader .pl-tile {
  opacity: 0;
  animation: pl-fade 0.35s ease-out 0.05s forwards;
}

/* Strands draw with stroke-dashoffset; each path is normalised with
   pathLength="1" so the whole group draws evenly. */
.preloader .pl-olive path,
.preloader .pl-straw path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.preloader .pl-olive path {
  animation: pl-draw 0.5s ease-out 0.3s forwards;
}

.preloader .pl-straw path {
  animation: pl-draw 0.5s ease-out 0.55s forwards;
}

/* The seed at the centre of the weave. */
.preloader .pl-seed {
  opacity: 0;
  animation: pl-fade 0.3s ease-out 0.85s forwards;
}

@keyframes pl-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes pl-fade {
  to { opacity: 1; }
}

@keyframes preloader-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* 07. SITE HEADER AND NAVIGATION ========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  transition: transform 0.35s var(--ease);
}

/* JS adds .is-hidden when the visitor scrolls down (see main.js). */
.site-header.is-hidden {
  transform: translateY(-100%);
}

/* Never hide the header while its menu or search is in use. */
.site-header:focus-within {
  transform: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand__logo {
  height: clamp(34px, 9vw, 46px);
  width: auto;
}

/* The hamburger button: three bars that cross into an X. */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--bark);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

body.nav-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile navigation (overlay) --- */

.site-nav {
  position: fixed;
  inset: 0;
  z-index: 400; /* below the header, so the close button stays reachable */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  background: var(--cream);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  overflow-y: auto;
}

body.nav-open .site-nav {
  transform: none;
}

body.nav-open {
  overflow: hidden; /* stop the page scrolling behind the menu */
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mobile links are large and quiet, like the rest of the type. */
.site-nav .nav-link {
  display: block;
  padding: 0.55rem 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.site-nav .nav-link[aria-current="page"] {
  color: var(--nest-brown);
}

/* On mobile the dropdown contents simply sit open beneath their parent. */
.nav-menu {
  list-style: none;
  margin: 0.2rem 0 1rem;
  padding: 0 0 0 1.1rem;
}

.nav-menu a {
  display: block;
  padding: 0.3rem 0;
  font-size: var(--fs-body);
  color: var(--reed-olive);
  text-decoration: none;
}

.nav-menu a:hover {
  color: var(--bark);
}

/* The little chevron button next to "Studio" is only needed on desktop. */
.nav-menu-button {
  display: none;
}

/* --- Desktop navigation (inline) --- */

@media (min-width: 64em) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2.2rem;
    padding: 0;
    background: none;
    transform: none;
    overflow: visible;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 1.6rem;
  }

  .site-nav .nav-link {
    display: inline-block;
    padding: 0.2rem 0;
    font-family: var(--font-condensed);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
  }

  .site-nav .nav-link:hover {
    border-bottom-color: var(--dry-grass);
  }

  .site-nav .nav-link[aria-current="page"] {
    color: var(--bark);
    border-bottom-color: var(--straw);
  }

  /* "Studio" is both a link and a dropdown parent. */
  .nav-item--has-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }

  .nav-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--bark);
  }

  .nav-menu-button svg {
    width: 12px;
    height: 12px;
    transition: transform 0.25s var(--ease);
  }

  .nav-item--has-menu.is-open .nav-menu-button svg {
    transform: rotate(180deg);
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: -1rem;
    min-width: 13rem;
    margin: 0;
    padding: 0.5rem;
    background: var(--cream);
    border: 1px solid var(--line-strong);
    box-shadow: 0 1.5rem 2.5rem rgba(43, 42, 38, 0.12);
    display: none;
  }

  /* Opened by hover, by keyboard focus, or by tapping the chevron. */
  .nav-item--has-menu:hover .nav-menu,
  .nav-item--has-menu:focus-within .nav-menu,
  .nav-item--has-menu.is-open .nav-menu {
    display: block;
  }

  .nav-menu a {
    padding: 0.45rem 0.7rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bark);
  }

  .nav-menu a:hover {
    background: var(--cream-deep);
    color: var(--bark);
  }
}

/* --- Language toggle (placeholder) --- */

.lang {
  position: relative;
}

.lang-button {
  font: inherit;
  font-family: var(--font-geometric);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--bark);
  cursor: pointer;
}

.lang-button:hover {
  border-color: var(--nest-brown);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 15rem;
  margin: 0;
  padding: 0.6rem 0.9rem;
  list-style: none;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1.5rem 2.5rem rgba(43, 42, 38, 0.12);
  font-size: 0.9rem;
  display: none;
}

.lang.is-open .lang-menu {
  display: block;
}

.lang-menu strong {
  color: var(--bark);
}

.lang-menu .lang-note {
  color: var(--reed-olive);
  font-size: 0.82rem;
}

/* 08. SITE FOOTER ======================================================== */

.site-footer {
  background: var(--bark);
  color: var(--cream);
}

/* The weave band that "ties off" the bottom of every page. */
.footer-weave {
  height: 22px;
  background-color: var(--bark);
  background-image:
    repeating-linear-gradient(45deg, var(--straw) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(-45deg, var(--dry-grass) 0 2px, transparent 2px 12px);
  opacity: 0.55;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(3rem, 6vw, 5rem) 2.5rem;
}

@media (min-width: 64em) {
  .footer-grid {
    grid-template-columns: 1.4fr 0.8fr 1.2fr 0.8fr;
    gap: clamp(2rem, 4vw, 4rem);
  }
}

.footer-brand__logo {
  height: 46px;
  width: auto;
  margin-bottom: 1.2rem;
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  margin-bottom: 1.4rem;
}

.footer-address {
  font-size: var(--fs-small);
  line-height: 1.7;
  color: var(--cream-soft);
  font-style: normal;
}

.footer-list-para {
  font-size: var(--fs-small);
  color: var(--cream-soft);
  margin: 0 0 1rem;
}

.footer-heading {
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--straw);
  margin: 0 0 1rem;
}

.footer-list {
  list-style: none;
  margin: 0 0 1.8rem;
  padding: 0;
}

.footer-list li + li {
  margin-top: 0.45rem;
}

.footer-list a {
  color: var(--cream);
  text-decoration: none;
}

.footer-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(--straw);
  text-underline-offset: 0.25em;
}

/* The Follow and Contact column wears the same condensed label face as its
   headings, so the whole column reads as one set of labels. */
.footer-contact .footer-list a {
  font-family: var(--font-condensed);
  font-weight: 500;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.4rem;
  border-top: 1px solid rgba(246, 241, 228, 0.18);
  font-size: var(--fs-small);
}

.footer-bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-bottom a {
  color: var(--cream);
}

.to-top {
  color: var(--straw);
  text-decoration: none;
  font-family: var(--font-geometric);
  font-weight: 400;
}

.to-top:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer-credit {
  width: 100%;
  color: rgba(246, 241, 228, 0.55);
  margin: 0;
}

/* 09. BUTTONS ============================================================= */

.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  background: var(--bark);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-align: center;
  border: 2px solid var(--bark);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

/* Hover tips from straw to bark — the accent, used sparingly. */
.btn:hover {
  background: var(--straw);
  border-color: var(--straw);
  color: var(--bark);
}

/* Ghost variant for use on dark sections. */
.btn--ghost {
  background: transparent;
  border-color: var(--cream);
  color: var(--cream);
}

.btn--ghost:hover {
  background: var(--straw);
  border-color: var(--straw);
  color: var(--bark);
}

/* 10. PROJECT CARDS AND GRIDS ============================================ */
/* Cards carry their ratio class (card--portrait / -landscape / -square),
   which drives both the image shape and the column span on desktop. */

.work-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 48em) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop masonry feel: 12 columns, mixed spans, dense backfill. */
@media (min-width: 64em) {
  .work-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
  }

  .work-grid .card--portrait,
  .work-grid .card--square {
    grid-column: span 4;
  }

  .work-grid .card--landscape {
    grid-column: span 8;
  }
}

.card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--cream-deep);
}

.card--portrait .card__media { aspect-ratio: 4 / 5; }
.card--landscape .card__media { aspect-ratio: 3 / 2; }
.card--square .card__media { aspect-ratio: 1 / 1; }

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.7s var(--ease); /* the slow zoom */
}

.card__link:hover .card__media img,
.card__link:focus-visible .card__media img {
  transform: scale(1.045);
}

/* The weave corner that appears on hover. */
.card__weave {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  height: 52px;
  background-color: var(--bark);
  background-image:
    repeating-linear-gradient(45deg, var(--straw) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--dry-grass) 0 2px, transparent 2px 9px);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.card__link:hover .card__weave,
.card__link:focus-visible .card__weave {
  opacity: 1;
}

.card__body {
  padding-top: 0.8rem;
}

.card__title {
  font-size: 1.25rem;
  margin: 0 0 0.15rem;
}

.card__meta {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--reed-olive);
}

/* --- List view (Projects page toggle) --- */

.work-grid.is-list {
  display: block;
}

.work-grid.is-list .card {
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr;
  gap: 1.25rem;
  align-items: start;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.work-grid.is-list .card:first-child {
  border-top: 1px solid var(--line);
}

.work-grid.is-list .card__media {
  aspect-ratio: 4 / 3;
}

.work-grid.is-list .card__body {
  padding-top: 0;
  align-self: center;
}

@media (max-width: 47.99em) {
  .work-grid.is-list .card {
    grid-template-columns: 1fr;
  }
}

/* 11. FILTER CHIPS ======================================================= */

.chip {
  font-family: var(--font-geometric);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0.42rem 0.9rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--bark);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--nest-brown);
}

.chip[aria-pressed="true"] {
  background: var(--bark);
  border-color: var(--bark);
  color: var(--cream);
}

/* 12. FORMS ============================================================== */

.field {
  margin-bottom: 1.35rem;
}

.field__label {
  display: block;
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

/* The asterisk marks required fields; the text is read to screen readers. */
.field__label .required {
  color: var(--nest-brown);
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  font: inherit;
  color: var(--bark);
  background: #fffdf6;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.field__textarea {
  min-height: 9rem;
  resize: vertical;
}

.field__input:hover,
.field__select:hover,
.field__textarea:hover {
  border-color: var(--nest-brown);
}

.field__input[aria-invalid="true"],
.field__select[aria-invalid="true"],
.field__textarea[aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}

/* Each field keeps a slot for its message, so the layout never jumps. */
.field__error {
  min-height: 1.3em;
  margin: 0.35rem 0 0;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--error);
}

.field__hint {
  margin: 0.35rem 0 0;
  font-size: var(--fs-small);
  color: var(--reed-olive);
}

/* Status message shown after submitting (or failing to submit). */
.form-status {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--bark);
  background: var(--cream-deep);
  font-size: var(--fs-small);
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-ok {
  border-left-color: var(--reed-olive);
}

.form-status.is-error {
  border-left-color: var(--error);
}

/* 13. SCROLL-REVEAL ANIMATION =========================================== */
/* Elements marked data-reveal fade and rise once, as they enter the view.
   A tiny inline script in each page's <head> adds class "js" to <html>,
   so visitors without JavaScript simply see everything immediately. */

html.js [data-reveal]:not([data-reveal="stagger"]) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease);
}

html.js [data-reveal].is-revealed:not([data-reveal="stagger"]) {
  opacity: 1;
  transform: none;
}

/* Stagger containers: the children reveal one after another. */
html.js [data-reveal="stagger"] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease);
}

html.js [data-reveal="stagger"].is-revealed > * {
  opacity: 1;
  transform: none;
}

/* nth-child delays create the ripple; items beyond nine share the last. */
html.js [data-reveal="stagger"].is-revealed > *:nth-child(2) { transition-delay: 0.08s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(3) { transition-delay: 0.16s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(4) { transition-delay: 0.24s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(5) { transition-delay: 0.32s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(6) { transition-delay: 0.4s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(7) { transition-delay: 0.48s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(8) { transition-delay: 0.56s; }
html.js [data-reveal="stagger"].is-revealed > *:nth-child(n + 9) { transition-delay: 0.64s; }

/* --- Reduced motion: everything static, nothing animates --------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* The preloader never appears at all. */
  .preloader {
    display: none;
  }

  html.js [data-reveal]:not([data-reveal="stagger"]),
  html.js [data-reveal="stagger"] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Neutralise every animation and transition site-wide. */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
