/* ==========================================================================
   Range & Rack — Editorial Premium
   Values transcribed from the design artboards (Main / Products / Mobile).
   The artboards are fixed-width exports (1440px desktop, 390px mobile), so
   their type sizes are the ENDS of a range, not constants — display sizes
   become clamp(), body copy stays fixed.
   ========================================================================== */

:root {
  /* Palette */
  --ink: #1b1d21;
  --red: #d62828;
  --red-hover: #a81f1f;
  --hairline: #e4dfd8;
  --ground: #faf8f5;
  --tan: #efe8de;
  --body: #4a453f;
  --muted: #6b655c;

  /* Dark section */
  --panel: #24272c;
  --panel-border: #3a3f45;
  --on-dark: #f2f3f4;
  --on-dark-muted: #b9bdc1;
  --on-panel-label: #9aa1a8;

  /* Contrast-corrected. The artboard values below failed WCAG AA;
     each is replaced by the nearest accessible equivalent.
       nav inactive     #7a756c (4.32) -> #736e65 (4.78)
       form placeholder #565d63 (2.52) -> #8a9299 (5.35)
       red on dark      #d62828 (3.37) -> #e85a5a (4.86) */
  --nav-inactive: #736e65;
  --placeholder: #8a9299;
  --red-on-dark: #e85a5a;

  /* Type */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid display scale: 390px artboard -> 1440px artboard */
  --fs-h1-home: clamp(2.75rem, 1.6rem + 6.2vw, 5.5rem);      /* 44 -> 88 */
  --fs-h1-page: clamp(2rem, 1.4rem + 3.2vw, 3.375rem);       /* 32 -> 54 */
  --fs-section: clamp(1.75rem, 1.3rem + 2.2vw, 2.625rem);    /* 28 -> 42 */
  --fs-pull: clamp(1.1875rem, 1rem + 1.3vw, 1.6875rem);      /* 19 -> 27 */
  --fs-dark-h: clamp(2.125rem, 1.5rem + 2.6vw, 3.125rem);    /* 34 -> 50 */

  /* Category index scale — overridden per variant */
  --cat-num: 1.25rem;
  --cat-name: 1.1875rem;
  --cat-desc: 0.84375rem;
  --cat-pad: 1.5rem;
  --cat-name-col: auto;

  /* Rhythm */
  --gutter: clamp(1.25rem, 4.4vw, 4rem);                     /* 20 -> 64 */
  --eyebrow-size: 0.6875rem;                                 /* 11px mobile */
  --eyebrow-track: 0.08em;
  --maxw: 90rem;
}

@media (min-width: 48rem) {
  :root {
    --eyebrow-size: 0.75rem;                                 /* 12px desktop */
    --eyebrow-track: 0.1em;
    --cat-num: 1.5rem;
    --cat-name: 1.5rem;
    --cat-desc: 0.875rem;
    --cat-pad: 1.625rem;
    --cat-name-col: 300px;
  }
}

/* --------------------------------------------------------------- base --- */

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

/* The hidden attribute must beat any class that sets an explicit display.
   Without this, `el.hidden = true` silently does nothing on .form-panel
   (display:flex), leaving the form visible after a successful submit. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: 0.2px; margin: 0; }
p { margin: 0; }
img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-hover); }

/* The artboards define no focus styling. Required for keyboard use. */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.on-dark :focus-visible,
.section--dark :focus-visible { outline-color: var(--red-on-dark); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ground);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  text-transform: uppercase;
}
.skip-link:focus { left: 0; color: var(--ground); }

.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;
}

/* ---------------------------------------------------------- primitives --- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  font-weight: 500;
}

.h-display { font-family: var(--font-display); letter-spacing: 0.2px; }

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

.rule-top { border-top: 1px solid var(--hairline); }

/* Buttons — flat, no radius, no shadow (Editorial Premium). */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 1.75rem;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--solid { background: var(--ink); color: var(--ground); }
.btn--solid:hover { background: #000; color: var(--ground); }
.btn--outline { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: var(--ground); }
.btn--red { background: var(--red); color: #fff; border-color: var(--red); }
.btn--red:hover { background: var(--red-hover); color: #fff; }

/* ------------------------------------------------------------- header --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  max-width: var(--maxw);
  margin-inline: auto;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark .amp { color: var(--red); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}
.site-nav a {
  color: var(--nav-inactive);
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.header-location { color: var(--muted); white-space: nowrap; }

/* Mobile: nav collapses behind MENU; location moves to its own strip. */
@media (max-width: 47.999rem) {
  .site-nav {
    display: none;
    width: 100%;
    border-top: 1px solid var(--hairline);
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--hairline); }
  .site-nav a { display: block; padding: 1rem var(--gutter); }
  .site-header { flex-wrap: wrap; }
  .header-location { display: none; }
}

.location-strip {
  display: block;
  padding: 0.625rem var(--gutter);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--nav-inactive);
}
@media (min-width: 48rem) {
  .location-strip { display: none; }
  .site-header { border-bottom: 1px solid var(--hairline); }
  .nav-toggle { display: none; }
  .site-nav { display: block !important; }
}

/* ------------------------------------------------------------- footer --- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 1.5rem var(--gutter);
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

@media (min-width: 48rem) {
  .site-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.875rem;
  }
}

/* ----------------------------------------------- category index list --- */
/* BASE_SPEC.md §4: numbered editorial index, NOT a card grid.
   No boxes, no per-item borders, no icon background fill. Hairlines only. */

.cat-index {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.cat-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas:
    "num  media name"
    "desc desc  desc"
    "link link  link";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.625rem;
  padding-block: var(--cat-pad);
  border-top: 1px solid var(--hairline);
}
.cat-index .cat-row:last-child { border-bottom: 1px solid var(--hairline); }

.cat-num {
  grid-area: num;
  font-size: var(--cat-num);
  color: var(--red);
  line-height: 1;
}

.cat-media {
  grid-area: media;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  /* A fixed square box, not just a width. Photos are square (533x533) while
     the line-art viewBoxes are wider than tall, so sizing by width alone
     gave rows different heights — which shifted each description off a
     shared baseline once photos landed. The box is constant; its contents
     scale to fit. */
  width: 2.375rem;
  height: 2.375rem;
  flex-shrink: 0;
}
.cat-media svg { max-width: 100%; max-height: 100%; height: auto; display: block; }

.cat-name {
  grid-area: name;
  font-size: var(--cat-name);
  font-weight: 700;
  line-height: 1.1;
}

.cat-desc {
  grid-area: desc;
  font-size: var(--cat-desc);
  line-height: 1.6;
  color: var(--body);
  margin: 0;
}

/* Mobile board shortens several descriptions; desktop uses the full text. */
.cat-desc-full { display: none; }
.cat-desc-short { display: inline; }

.cat-link {
  grid-area: link;
  color: var(--red);
  white-space: nowrap;
  justify-self: start;
  /* 11px text alone is under the 44px touch target. */
  padding-block: 0.625rem;
}

@media (min-width: 48rem) {
  .cat-row {
    grid-template-columns: 2.875rem 2.875rem var(--cat-name-col) 1fr auto;
    grid-template-areas: "num media name desc link";
    column-gap: 2.25rem;
    row-gap: 0;
  }
  .cat-media { width: 2.875rem; height: 2.875rem; }
  .cat-link { padding-block: 0; justify-self: end; }
  .cat-desc-full { display: inline; }
  .cat-desc-short { display: none; }
}

/* Products variant — same component, larger scale. */
@media (min-width: 48rem) {
  .cat-index--lg {
    --cat-num: 1.625rem;
    --cat-name: 1.625rem;
    --cat-desc: 0.90625rem;
    --cat-pad: 1.875rem;
    --cat-name-col: 320px;
  }
}

/* --------------------------------------------------------------- hero --- */
/* Asymmetric split: copy left, bordered tan figure panel right (1.35fr/1fr).
   Mobile stacks: headline block, then the panel as a shorter full-width band. */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--hairline);
  max-width: var(--maxw);
  margin-inline: auto;
}

.hero-copy { padding: 2.5rem var(--gutter) 0; }

.hero-title {
  font-size: var(--fs-h1-home);
  font-weight: 800;
  line-height: 0.96;
  margin-block: 0 1.375rem;
}
.hero-title--page { font-size: var(--fs-h1-page); line-height: 1.02; }

/* Hand-drawn underline under the final phrase. */
.underline-wrap { position: relative; display: inline-block; }
.underline-wrap svg {
  position: absolute;
  left: 0;
  bottom: -0.3125rem;
  width: 100%;
  height: 0.625rem;
  overflow: visible;
}

.hero-lede {
  font-size: 0.96875rem;
  line-height: 1.65;
  color: var(--body);
  margin-bottom: 1.625rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 2.25rem;
}

.figure-panel {
  background: var(--tan);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.875rem;
  min-height: 10.625rem;
  color: var(--ink);
}
.figure-panel svg { width: auto; height: 8.125rem; }
.figure-tag {
  position: absolute;
  color: #5c554a;
}
.figure-tag--tl { top: 1rem; left: 1rem; }
.figure-tag--br { bottom: 1rem; right: 1rem; }

@media (min-width: 48rem) {
  .hero { grid-template-columns: 1.35fr 1fr; align-items: stretch; }
  .hero-copy { padding: 5.5rem 4.5rem 5.5rem var(--gutter); }
  .hero-lede { font-size: 1.125rem; line-height: 1.7; max-width: 30rem; margin-bottom: 2.25rem; }
  .hero-actions { flex-direction: row; align-items: center; gap: 1.75rem; padding-bottom: 0; }
  .hero-actions .btn--outline {
    border: 0;
    border-bottom: 1px solid var(--ink);
    padding: 0 0 0.1875rem;
  }
  .hero-actions .btn--outline:hover { background: transparent; color: var(--red); border-color: var(--red); }
  .figure-panel { padding: 3rem 2.5rem; min-height: 0; }
  .figure-panel svg { height: 16.25rem; }
  .figure-tag--tl { top: 1.75rem; left: 1.75rem; }
  .figure-tag--br { bottom: 1.75rem; right: 1.75rem; }
  .underline-wrap svg { height: 0.875rem; bottom: -0.375rem; }
}

/* ------------------------------------------------- pull statement -------- */
/* Rule-framed, never a left-border accent box. */

.pull {
  padding: 2.75rem var(--gutter);
  border-bottom: 1px solid var(--hairline);
  max-width: var(--maxw);
  margin-inline: auto;
}
/* Reading measure lives here so the block itself stays full-width and
   keeps its left edge aligned with every other section. */
.pull-eyebrow, .pull-body { max-width: 60rem; }
.pull-eyebrow { color: var(--muted); display: block; margin-bottom: 1.125rem; }
.pull-body {
  border-top: 1px solid var(--ink);
  padding-top: 1.25rem;
  font-size: var(--fs-pull);
  line-height: 1.55;
  color: var(--ink);
}
@media (min-width: 48rem) {
  /* Shares the page wrapper's box so its left edge lines up with the
     hero copy. The prose is narrowed by .pull-inner, not by shrinking
     this block — narrowing the block itself moved its left edge. */
  .pull { padding: 5rem var(--gutter); }
  .pull-eyebrow { margin-bottom: 1.5rem; }
  .pull-body { padding-top: 1.75rem; }
}

/* ------------------------------------------------------------ pillars --- */
/* Stacked with horizontal rules on mobile; 4 columns with vertical
   hairlines on desktop. The divider axis flips, so the vertical rules are
   scoped to the wide breakpoint only. */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  padding-inline: var(--gutter);
  max-width: var(--maxw);
  margin-inline: auto;
  border-bottom: 1px solid var(--hairline);
}
.pillar { padding-block: 1.625rem; border-bottom: 1px solid var(--hairline); }
.pillars .pillar:last-child { border-bottom: 0; }
.pillar-num { font-size: 1.5rem; color: var(--red); display: block; margin-bottom: 0.5rem; line-height: 1; }
.pillar-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.pillar-desc { font-size: 0.84375rem; line-height: 1.6; color: var(--muted); }

@media (min-width: 62rem) {
  .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 4.375rem; }
  .pillar {
    padding-block: 0;
    padding-inline: 1.625rem;
    border-bottom: 0;
    border-left: 1px solid var(--hairline);
  }
  .pillar:first-child { padding-left: 0; border-left: 0; }
  .pillar:last-child { padding-right: 0; }
  .pillar-num { font-size: 1.875rem; margin-bottom: 0.875rem; }
  .pillar-name { font-size: 1.1875rem; margin-bottom: 0.625rem; }
}

/* ---------------------------------------------------- section heading --- */

.section { padding: 2.75rem var(--gutter) 1.25rem; max-width: var(--maxw); margin-inline: auto; }
.section-eyebrow { color: var(--muted); display: block; margin-bottom: 0.5rem; }
.section-title { font-size: var(--fs-section); font-weight: 800; }
.section-head { margin-bottom: 1.875rem; }
@media (min-width: 48rem) {
  .section { padding: 5.5rem var(--gutter) 2.5rem; }
  .section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3.125rem;
  }
  .section-note { font-size: 0.875rem; color: var(--muted); }
}
.section-note { font-size: 0.84375rem; color: var(--muted); display: block; margin-top: 0.375rem; }

/* -------------------------------------------------------- dark block --- */

.section--dark {
  background: var(--ink);
  color: var(--on-dark);
  padding: 3.125rem var(--gutter);
}
.section--dark .eyebrow-red { color: var(--red-on-dark); display: block; margin-bottom: 0.875rem; }
.dark-title { font-size: var(--fs-dark-h); font-weight: 800; line-height: 1.05; margin-bottom: 1.125rem; }
.dark-lede { font-size: 0.90625rem; line-height: 1.6; color: var(--on-dark-muted); margin-bottom: 1.625rem; }
.dark-contact { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.875rem; }
.dark-contact a { color: var(--on-dark); }
.dark-contact a:hover { color: var(--red-on-dark); }
.dark-contact .muted { color: var(--on-panel-label); }

@media (min-width: 62rem) {
  .section--dark {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 5rem;
    padding: 6rem var(--gutter);
    max-width: var(--maxw);
    margin-inline: auto;
  }
  .dark-lede { font-size: 0.96875rem; line-height: 1.65; max-width: 23.75rem; margin-bottom: 2rem; }
  .dark-contact { gap: 0.625rem; margin-bottom: 0; }
}

/* ---------------------------------------------------------- closing ----- */

.closing { padding: 4rem var(--gutter) 5rem; text-align: center; max-width: var(--maxw); margin-inline: auto; }
.closing-title { font-size: var(--fs-section); font-weight: 800; margin-bottom: 1rem; }
.closing-body { font-size: 1rem; color: var(--body); max-width: 32.5rem; margin: 0 auto 2rem; }

/* ----------------------------------------------------------- the form --- */
/* The artboards draw every field as a styled <div>. This is real markup:
   labels, inputs, selects, textarea. Flat treatment, no radius, no shadow. */

.form-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.field { display: flex; flex-direction: column; gap: 0.375rem; }

.field label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--on-panel-label);
}
.field .req { color: var(--red-on-dark); }

.field input,
.field select,
.field textarea {
  background: var(--ink);
  border: 1px solid var(--panel-border);
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px — prevents iOS zoom-on-focus */
  color: var(--on-dark);
  width: 100%;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); }

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--placeholder) 50%),
                    linear-gradient(135deg, var(--placeholder) 50%, transparent 50%);
  background-position: calc(100% - 1.125rem) 1.1875rem, calc(100% - 0.8125rem) 1.1875rem;
  background-size: 0.3125rem 0.3125rem, 0.3125rem 0.3125rem;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--red-on-dark);
  outline-offset: 1px;
  border-color: var(--red-on-dark);
}

.form-row { display: grid; grid-template-columns: 1fr; gap: 0.875rem; }
@media (min-width: 30rem) {
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
}
@media (min-width: 62rem) {
  .form-panel { padding: 2.25rem; gap: 1.125rem; }
  .field label { font-size: 0.6875rem; }
}

.form-submit { width: 100%; margin-top: 0.25rem; }
@media (min-width: 48rem) { .form-submit { width: auto; } }

.form-status { font-size: 0.9375rem; line-height: 1.6; }
.form-status:empty { display: none; }
.form-status[data-state="error"] {
  color: #ffb4b4;
  border-left: 2px solid var(--red-on-dark);
  padding-left: 0.75rem;
}
.form-status[data-state="loading"] { color: var(--on-dark-muted); }

.form-success {
  border-top: 1px solid var(--panel-border);
  padding-top: 1.5rem;
}
.form-success h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.625rem; }
.form-success p { color: var(--on-dark-muted); font-size: 0.9375rem; line-height: 1.6; }

button[disabled] { opacity: 0.6; cursor: wait; }

/* Contact page intro above the dark block. */
.contact-intro { padding: 2.5rem var(--gutter) 0; max-width: var(--maxw); margin-inline: auto; }
@media (min-width: 48rem) { .contact-intro { padding-top: 4.5rem; } }

/* Category photos share the icon's slot. Editorial Premium forbids drop
   shadows, rounded corners, and gray photo-frame boxes — product shots sit
   flat on the warm ground exactly as the line art does. */
.cat-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  box-shadow: none;
  /* Supplier shots carry a white studio background; multiply drops it onto
     the warm ground so photos and line art share one surface. */
  mix-blend-mode: multiply;
}

/* Hero figure panel photo. Same flat treatment as the row photos: multiply
   drops the supplier's white studio background onto the tan panel so the
   product sits on the surface rather than in a white box. Height is capped
   so the panel keeps the artboard's proportions instead of the image
   dictating them. */
.figure-panel img {
  width: 100%;
  max-width: 100%;
  height: 11.25rem;
  object-fit: contain;
  display: block;
  border-radius: 0;
  box-shadow: none;
  mix-blend-mode: multiply;
}
@media (min-width: 48rem) {
  .figure-panel img { height: 24rem; }
}

/* <address> is italic by default in every browser, which fights the mono
   eyebrow styling the rest of the contact block uses. */
.contact-address {
  font-style: normal;
  color: var(--on-panel-label);
  line-height: 1.7;
}
