/*!
Theme Name: Shading Specialists
Theme URI: https://shadingspecialists.co.uk
Author: Shading Specialists
Description: Bespoke ACF Flexible Content theme for Shading Specialists. Every page is composed from section blocks in /blocks; this file is the single source of truth for the design system.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shading
*/

/* ==========================================================================
   SHADING SPECIALISTS - DESIGN SYSTEM
   ==========================================================================
   Read DESIGN-SYSTEM.md before adding styles.

   Three layers, and they only ever flow downwards:

     1. PALETTE      Raw values. Never referenced by a component.
     2. CONTEXT      Semantic tokens (--surface, --text, --rule, --accent)
                     re-declared by .surface--ink etc, so everything inside
                     inverts for free.
     3. COMPONENTS   Consume layer 2 only. A component that hardcodes a hex
                     or reads a palette token is a bug: it will not invert.

   CONTENTS
     01  Palette
     02  Scale - space, type, layout, motion
     03  Context tokens and surface themes
     04  Reset
     05  Typography
     06  Links and rules
     07  Buttons
     08  Sections and the collapse rule
     09  Layout - wrap, grid, media
     10  Cards
     11  Forms
     12  Utilities
     13  Motion and accessibility
   ========================================================================== */


/* 01  PALETTE ============================================================= */
/* Raw values. Add here, then expose through a context token in 03.          */

:root {
  /* Neutrals, very slightly warm so black reads as ink rather than screen. */
  --ss-black:      #0a0a0a;
  --ss-ink:        #131313;
  --ss-ink-75:     #414141;
  --ss-ink-70:     #5f5f5f;   /* body copy on light   6.4:1 on paper */
  --ss-ink-55:     #6e6e6e;   /* eyebrows and labels  5.1:1 on paper */
  --ss-ink-40:     #8f8f8f;   /* control borders      3.2:1 on paper */
  --ss-ink-25:     #bcbcbc;   /* decorative only, never carries meaning */
  --ss-ink-15:     #dedbd6;   /* hairline rules */
  --ss-ink-08:     #eceae5;   /* sunk surfaces, media placeholder */

  --ss-white:      #ffffff;
  --ss-bone:       #f4f2ed;
  --ss-bone-deep:  #e9e6df;

  /* One accent, used sparingly: link underlines, active states, marks. */
  --ss-bronze:     #a98a64;
  --ss-bronze-lo:  #c4ab8e;

  --ss-danger:     #a4342b;

  /* Translucency for surfaces that sit on photography. Alpha cannot resolve
     to a flat token, so the values are declared here and nowhere else. */
  --veil-scrim:        rgba(10, 10, 10, 0.5);
  --veil-panel-top:    rgba(10, 10, 10, 0.3);
  --veil-panel-bottom: rgba(10, 10, 10, 0.44);
  --veil-frost-top:    rgba(10, 10, 10, 0.2);
  --veil-frost-bottom: rgba(10, 10, 10, 0.34);

  --line-over-soft:   rgba(255, 255, 255, 0.1);
  --line-over:        rgba(255, 255, 255, 0.3);
  --line-over-strong: rgba(255, 255, 255, 0.5);

  --text-over:        rgba(255, 255, 255, 0.74);
  --text-over-faint:  rgba(255, 255, 255, 0.55);

  /* The masthead shade that keeps a white logo legible against a bright sky. */
  --gradient-bar: linear-gradient(to bottom, rgba(10, 10, 10, 0.42), rgba(10, 10, 10, 0));
}


/* 02  SCALE =============================================================== */

:root {
  /* Space - a 4px-rooted scale. Use tokens, never raw px. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  /* Section rhythm - fluid, chosen per section in the editor. */
  --pad-none:     0rem;
  --pad-tight:    clamp(2.5rem, 5vw, 4rem);
  --pad-default:  clamp(4.5rem, 8vw, 8rem);
  --pad-spacious: clamp(6.5rem, 12vw, 11.5rem);

  /* Type - Manrope throughout. Weight and tracking carry the hierarchy. */
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);

  --weight-display: 200;
  --weight-light:   300;
  --weight-normal:  400;
  --weight-medium:  500;
  --weight-semi:    600;
  --weight-bold:    700;

  --text-2xs:  0.6875rem;
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-md:   0.9375rem;
  --text-body: clamp(1rem, 0.975rem + 0.12vw, 1.0625rem);
  --text-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);

  --text-h4: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --text-h3: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-h2: clamp(1.75rem, 1.35rem + 2vw, 3rem);
  --text-h1: clamp(2.125rem, 1.55rem + 2.9vw, 4rem);
  --text-display: clamp(2.5rem, 1.5rem + 4.6vw, 5.5rem);

  --leading-tight:   1.06;
  --leading-snug:    1.18;
  --leading-heading: 1.28;
  --leading-body:    1.62;
  --leading-loose:   1.75;

  /* Tracking - the workhorse of a single-family system. */
  --track-display:   -0.032em;
  --track-heading:   -0.02em;
  --track-body:       0em;
  --track-ui:         0.02em;
  --track-caps:       0.14em;
  --track-caps-wide:  0.2em;

  /* Layout */
  --wrap-max:    1600px;
  --wrap-wide:   1780px;
  --wrap-text:   58ch;
  --gutter:      clamp(1.25rem, 4vw, 4rem);
  --grid-gap:    clamp(1rem, 2.2vw, 2rem);
  --grid-gap-lg: clamp(1.5rem, 3.5vw, 3.5rem);

  /* Flat by intent. The tokens exist so the decision lives in one place. */
  --radius:    0px;
  --radius-sm: 0px;
  --rule-width: 1px;

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:  0.2s;
  --dur:       0.4s;
  --dur-slow:  0.7s;

  /* Depth is used almost nowhere. Photography carries the weight. */
  --shadow-panel: 0 24px 80px -24px rgba(10, 10, 10, 0.28);

  --z-base:     1;
  --z-sticky:   100;
  --z-masthead: 200;
  --z-menu:     300;

  --masthead-h: 84px;
}

@media (max-width: 900px) {
  :root { --masthead-h: 68px; }
}


/* 03  CONTEXT TOKENS AND SURFACE THEMES =================================== */
/* Every component reads these. Re-declare them to re-theme a whole subtree. */

:root,
.surface--paper {
  --surface:       var(--ss-white);
  --surface-alt:   var(--ss-bone);
  --surface-sunk:  var(--ss-ink-08);

  --text:          var(--ss-ink);
  --text-strong:   var(--ss-black);
  --text-muted:    var(--ss-ink-70);
  --text-faint:    var(--ss-ink-55);

  --rule:          var(--ss-ink-15);
  --rule-strong:   var(--ss-ink-40);

  --accent:        var(--ss-bronze);
  --accent-text:   #8e6f4a;

  --btn-solid-bg:       var(--ss-ink);
  --btn-solid-text:     var(--ss-white);
  --btn-solid-bg-hover: var(--ss-black);
  --btn-line:           var(--ss-ink-40);
  --btn-line-hover:     var(--ss-ink);

  --media-placeholder: var(--ss-ink-08);
  color-scheme: light;
}

.surface--bone {
  --surface:      var(--ss-bone);
  --surface-alt:  var(--ss-white);
  --surface-sunk: var(--ss-bone-deep);
  --rule:         var(--ss-bone-deep);
  --media-placeholder: var(--ss-bone-deep);

  /* Bone sits lighter than paper, so borders step down one notch to hold 3:1. */
  --rule-strong:  #8a8a8a;
  --btn-line:     #8a8a8a;
}

.surface--ink,
.surface--black {
  --surface:      var(--ss-ink);
  --surface-alt:  var(--ss-black);
  --surface-sunk: #1d1d1d;

  --text:         #f2f0ec;
  --text-strong:  var(--ss-white);
  --text-muted:   rgba(242, 240, 236, 0.72);
  --text-faint:   rgba(242, 240, 236, 0.56);

  --rule:         rgba(255, 255, 255, 0.14);
  --rule-strong:  rgba(255, 255, 255, 0.3);

  --accent:       var(--ss-bronze-lo);
  --accent-text:  var(--ss-bronze-lo);

  --btn-solid-bg:       var(--ss-white);
  --btn-solid-text:     var(--ss-ink);
  --btn-solid-bg-hover: #ece9e3;
  --btn-line:           rgba(255, 255, 255, 0.45);
  --btn-line-hover:     var(--ss-white);

  --media-placeholder: #202020;
  color-scheme: dark;
}

/* Same token set as ink, one step deeper. Used by the footer. */
.surface--black {
  --surface:     var(--ss-black);
  --surface-alt: var(--ss-ink);
}

/* Anything sitting on top of photography borrows the dark theme. */
.surface--over-media {
  --text:        var(--ss-white);
  --text-strong: var(--ss-white);
  --text-muted:  var(--text-over);
  --text-faint:  var(--text-over-faint);
  --rule:        var(--line-over-soft);
  --rule-strong: var(--line-over);
  --accent:      var(--ss-bronze-lo);
  --accent-text: var(--ss-bronze-lo);
  --btn-solid-bg:       var(--ss-white);
  --btn-solid-text:     var(--ss-ink);
  --btn-solid-bg-hover: #ece9e3;
  --btn-line:           var(--line-over-strong);
  --btn-line-hover:     var(--ss-white);
}

/* Only these rules paint a background. */
.surface--paper,
.surface--bone,
.surface--ink,
.surface--black {
  background-color: var(--surface);
  color: var(--text);
}


/* 04  RESET =============================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-h) + var(--space-lg));
}

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-body);
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Scroll lock. --scrollbar-w is measured in JS so nothing shifts sideways. */
body.is-locked {
  overflow: hidden;
  padding-right: var(--scrollbar-w, 0px);
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

svg { fill: currentColor; }

[hidden] { display: none !important; }

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

.surface--ink ::selection {
  background-color: var(--ss-white);
  color: var(--ss-ink);
}


/* 05  TYPOGRAPHY ========================================================== */
/* Semantic classes, not element selectors. A block chooses its level by
   meaning (h2 for a section heading) and its size by class (.t-display).   */

.t-display,
.t-h1,
.t-h2,
.t-h3,
.t-h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  text-wrap: balance;
}

.t-display {
  font-size: var(--text-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--track-display);
}

.t-h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-display);
}

.t-h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-heading);
}

.t-h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-light);
  line-height: var(--leading-heading);
  letter-spacing: var(--track-heading);
}

.t-h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  line-height: var(--leading-heading);
  letter-spacing: var(--track-ui);
}

/* Eyebrow - the small letterspaced cap line above a heading. */
.t-eyebrow {
  display: block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  line-height: 1.4;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-faint);
}

.t-eyebrow--accent { color: var(--accent-text); }

/* Meta - captions, credits, the small print under a card. */
.t-meta {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.t-lead {
  font-size: var(--text-lead);
  font-weight: var(--weight-light);
  line-height: var(--leading-body);
  color: var(--text-muted);
}

.t-body { font-size: var(--text-body); }

.t-small {
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

.t-ui {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-ui);
  line-height: 1.4;
}

/* Rich text from the editor. The only place bare elements are styled. */
.rich-text > * + * { margin-top: 1em; }
.rich-text h2,
.rich-text h3,
.rich-text h4 {
  color: var(--text-strong);
  letter-spacing: var(--track-heading);
  margin-top: 1.6em;
}
.rich-text h2 { font-size: var(--text-h3); font-weight: var(--weight-light); }
.rich-text h3 { font-size: var(--text-h4); font-weight: var(--weight-medium); }
.rich-text h4 { font-size: var(--text-body); font-weight: var(--weight-semi); }
.rich-text p { color: var(--text-muted); }
.rich-text a { color: var(--text); }
.rich-text strong { font-weight: var(--weight-semi); color: var(--text); }
.rich-text ul,
.rich-text ol {
  padding-left: 1.25em;
  color: var(--text-muted);
}
.rich-text li + li { margin-top: 0.4em; }
.rich-text ul { list-style: none; padding-left: 0; }
.rich-text ul > li {
  position: relative;
  padding-left: 1.5em;
}
.rich-text ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.5em;
  height: var(--rule-width);
  background-color: var(--rule-strong);
}
.rich-text blockquote {
  border-left: var(--rule-width) solid var(--accent);
  padding-left: var(--space-md);
  font-size: var(--text-lead);
  font-weight: var(--weight-light);
  color: var(--text);
}
.rich-text img { margin-block: var(--space-lg); }
.rich-text > *:first-child { margin-top: 0; }


/* 06  LINKS AND RULES ===================================================== */

a { color: inherit; }

/* Default prose link - hairline underline that thickens to the accent. */
.rich-text a,
.link-underline {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% var(--rule-width);
  padding-bottom: 0.12em;
  transition: background-size var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.rich-text a:hover,
.link-underline:hover { background-size: 100% 2px; }

/* Nav-style link - underline draws in from the left on hover. */
.link-reveal {
  position: relative;
  text-decoration: none;
  display: inline-block;
}

.link-reveal::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.18em;
  width: 100%;
  height: var(--rule-width);
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}

.link-reveal:hover::after,
.link-reveal:focus-visible::after,
.link-reveal[aria-current="page"]::after { transform: scaleX(1); }

/* Standalone call-to-action link, letterspaced caps with a fixed rule. */
.link-cta {
  display: inline-block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-strong);
  padding-bottom: 0.5em;
  border-bottom: var(--rule-width) solid var(--rule-strong);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.link-cta:hover { border-color: var(--text-strong); }

.rule {
  border: 0;
  height: var(--rule-width);
  background-color: var(--rule);
  margin: 0;
}


/* 07  BUTTONS ============================================================= */
/* Buttons never set a colour directly. They read --btn-* from context, so
   the same markup works on paper, on ink, and over a photograph.           */

.btn {
  --btn-pad-y: 1.05rem;
  --btn-pad-x: 2rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);

  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: var(--rule-width) solid transparent;
  border-radius: var(--radius);

  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--track-caps);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

.btn--solid {
  background-color: var(--btn-solid-bg);
  color: var(--btn-solid-text);
  border-color: var(--btn-solid-bg);
}

.btn--solid:hover {
  background-color: var(--btn-solid-bg-hover);
  border-color: var(--btn-solid-bg-hover);
}

.btn--line {
  background-color: transparent;
  color: var(--text-strong);
  border-color: var(--btn-line);
}

.btn--line:hover {
  border-color: var(--btn-line-hover);
  background-color: transparent;
}

/* Text-only button, same metrics so it aligns in a button row. */
.btn--text {
  background-color: transparent;
  color: var(--text-strong);
  border-color: transparent;
  padding-inline: 0;
  border-bottom-color: var(--rule-strong);
}

.btn--text:hover { border-bottom-color: var(--text-strong); }

.btn--sm { --btn-pad-y: 0.8rem; --btn-pad-x: 1.4rem; }
.btn--lg { --btn-pad-y: 1.25rem; --btn-pad-x: 2.75rem; }
.btn--block { display: flex; width: 100%; }

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Row of buttons. Blocks output this whenever there is more than one CTA. */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

/* Circular icon button - close, carousel arrows. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: var(--rule-width) solid var(--btn-line);
  border-radius: 50%;
  color: var(--text-strong);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}

.btn-icon:hover { border-color: var(--btn-line-hover); }
.btn-icon svg { width: 1rem; height: 1rem; }


/* 08  SECTIONS AND THE COLLAPSE RULE ====================================== */
/* Padding is set from two custom properties so PHP can halve one side when
   two sections share a background. See inc/sections.php - the flow map is
   built before render, then written onto the element as a class pair.      */

.section {
  position: relative;
  padding-top: var(--section-pad-top, var(--pad-default));
  padding-bottom: var(--section-pad-bottom, var(--pad-default));
}

.section--pad-none     { --section-pad-top: var(--pad-none);     --section-pad-bottom: var(--pad-none); }
.section--pad-tight    { --section-pad-top: var(--pad-tight);    --section-pad-bottom: var(--pad-tight); }
.section--pad-default  { --section-pad-top: var(--pad-default);  --section-pad-bottom: var(--pad-default); }
.section--pad-spacious { --section-pad-top: var(--pad-spacious); --section-pad-bottom: var(--pad-spacious); }

/* Collapse: when the neighbouring section shares this background, each side
   contributes half, so the seam reads as one gap rather than two.          */
.section--collapse-top    { padding-top: calc(var(--section-pad-top) / 2); }
.section--collapse-bottom { padding-bottom: calc(var(--section-pad-bottom) / 2); }

/* Section header - eyebrow, heading, and an optional link on the right. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.section-head__text { max-width: var(--wrap-text); }
.section-head__text > * + * { margin-top: var(--space-sm); }
.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-head--center .section-head__text { margin-inline: auto; }


/* 09  LAYOUT ============================================================== */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide { max-width: calc(var(--wrap-wide) + var(--gutter) * 2); }
.wrap--text { max-width: calc(var(--wrap-text) + var(--gutter) * 2); }
.wrap--flush { max-width: none; padding-inline: 0; }

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--gap-lg { gap: var(--grid-gap-lg); }

@media (max-width: 1000px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.stack > * + * { margin-top: var(--stack-gap, var(--space-md)); }
.stack--sm { --stack-gap: var(--space-sm); }
.stack--lg { --stack-gap: var(--space-lg); }
.stack--xl { --stack-gap: var(--space-xl); }

/* Media frame - the standard image wrapper. Ratio is a token so a block
   can override it without touching the image styles.                       */
.media {
  position: relative;
  overflow: hidden;
  background-color: var(--media-placeholder);
  aspect-ratio: var(--media-ratio, 4 / 3);
}

.media > img,
.media > video,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--media-position, center);
}

.media--1-1     { --media-ratio: 1 / 1; }
.media--4-3     { --media-ratio: 4 / 3; }
.media--3-4     { --media-ratio: 3 / 4; }
.media--16-9    { --media-ratio: 16 / 9; }
.media--21-9    { --media-ratio: 21 / 9; }
.media--3-2     { --media-ratio: 3 / 2; }
.media--natural { --media-ratio: auto; }

/* Slow zoom on hover. Applied by the parent, not the image. */
.media-zoom .media > img,
.media-zoom .media > video {
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}

.media-zoom:hover .media > img,
.media-zoom:hover .media > video { transform: scale(1.04); }

/* Scrim - the only gradient in the system, used to keep text legible
   over photography. Strength is a token so blocks stay consistent.         */
.scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, var(--scrim-strength, 0.62)) 0%,
    rgba(10, 10, 10, calc(var(--scrim-strength, 0.62) * 0.55)) 34%,
    rgba(10, 10, 10, 0) 72%
  );
}

.scrim--full::after {
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, var(--scrim-strength, 0.62)) 0%,
    rgba(10, 10, 10, calc(var(--scrim-strength, 0.62) * 0.7)) 50%,
    rgba(10, 10, 10, calc(var(--scrim-strength, 0.62) * 0.45)) 100%
  );
}

.scrim--soft { --scrim-strength: 0.4; }
.scrim--hard { --scrim-strength: 0.78; }


/* 10  CARDS =============================================================== */
/* One card skeleton. Blocks vary it with modifiers, never with new classes. */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.card__body {
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-normal);
  letter-spacing: var(--track-heading);
  line-height: var(--leading-heading);
  color: var(--text-strong);
}

.card__meta { color: var(--text-muted); }

.card__excerpt {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: var(--leading-body);
}

/* Whole card is clickable - the title carries the visible link affordance. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

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

/* Overlay card - caption sits inside the image, on a scrim. */
.card--overlay .card__body {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: var(--space-md);
}


/* 11  FORMS =============================================================== */

.field { display: block; }
.field + .field { margin-top: var(--space-md); }

.field__label {
  display: block;
  margin-bottom: var(--space-2xs);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.field__input,
.field__textarea,
.field__select {
  width: 100%;
  padding: 0.9rem 1rem;
  background-color: transparent;
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-md);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--text-strong);
}

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


/* 12  UTILITIES =========================================================== */

.u-hidden        { display: none !important; }
.u-center        { text-align: center; }
.u-measure       { max-width: var(--wrap-text); }
.u-mt-0          { margin-top: 0 !important; }
.u-relative      { position: relative; }
.u-full          { width: 100%; }

.u-flow > * + *  { margin-top: var(--space-md); }

.screen-reader-text {
  position: absolute !important;
  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;
  top: -100%;
  left: var(--space-sm);
  z-index: 999;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--ss-ink);
  color: var(--ss-white);
  font-size: var(--text-md);
  text-decoration: none;
}

.skip-link:focus { top: var(--space-sm); }


/* 13  MOTION AND ACCESSIBILITY ============================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.surface--ink :focus-visible,
.surface--over-media :focus-visible { outline-color: var(--ss-bronze-lo); }

/* Entrance animation. Content is hidden only once app.js has armed it, and
   only until the observer reports it in view — so a JavaScript failure, a
   missing IntersectionObserver, or an observer that never fires all leave the
   page fully visible rather than blank.                                     */
.js .reveal.is-armed:not(.is-in) {
  opacity: 0;
  transform: translateY(14px);
}

.js .reveal {
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.js .reveal--delay-1 { transition-delay: 80ms; }
.js .reveal--delay-2 { transition-delay: 160ms; }
.js .reveal--delay-3 { transition-delay: 240ms; }

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Matches the armed selector so it wins even if JS armed before the user
     switched the preference on. */
  .js .reveal.is-armed:not(.is-in),
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
