/* ALLCUT — site design system.
   White paper, ink type, one red. Hairlines, zero radius, mono data labels.
   Page-specific styles live in /static/css/pages/<page>.css. */

/* ───────────── tokens ───────────── */
:root {
  --paper: #fafaf8;
  --white: #ffffff;
  --tint: #f3f2ee;
  --ink: #15130f;
  --ink-2: #46423c;
  --ink-3: #736e66;
  --ink-4: #a6a198;
  --rule: #e5e3de;
  --rule-2: #d3d0c9;
  --red: #e1251b;
  --red-ink: #c41d13;      /* red for small text on white: 5.7:1 */
  --red-deep: #9e160e;
  --red-tint: #fcebe9;

  --f-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1440px;
  --gutter: clamp(20px, 3.2vw, 44px);
  --header-h: 68px;
  --section: clamp(72px, 9vw, 136px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--f-sans); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: color-mix(in srgb, var(--red) 22%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
hr { border: 0; height: 1px; background: var(--rule); margin: 0; }

.sr-only {
  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; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--white);
  padding: 10px 14px; font-weight: 600; font-size: 14px; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ───────────── layout ───────────── */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.section--rule { border-top: 1px solid var(--rule); }
.section--white { background: var(--white); }
.section--tint { background: var(--tint); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 28px); }
.stack > * + * { margin-top: var(--stack, 16px); }

/* ───────────── type ───────────── */
.label {
  font: 500 11px/1.35 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.label--red { color: var(--red-ink); }
.label--ink { color: var(--ink); }
.label-rule { display: flex; align-items: center; gap: 12px; }
.label-rule::before { content: ""; width: 24px; height: 2px; background: var(--rc, var(--red)); flex: none; }

/* ───────────── range colour codes ─────────────
   Each range has --rc (swatch/bar), --rc-ink (text on white), --rc-lite (text on dark), --rc-tint
   (quiet background), set by .rc-<range-slug> (generated in base.html from scripts/palette.py). */
.swatch { display: inline-block; flex: none; width: 9px; height: 9px; margin-right: 9px; background: var(--rc, var(--ink-4)); vertical-align: 0.05em; }
.rc-text { color: var(--rc-ink, var(--red-ink)); }
.rc-top { position: relative; }
.rc-top::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--rc); pointer-events: none; }

.display { font-size: clamp(44px, 6.6vw, 104px); line-height: .92; letter-spacing: -0.04em; font-weight: 800; font-stretch: 104%; }
.h1 { font-size: clamp(36px, 4.6vw, 68px); line-height: .96; letter-spacing: -0.035em; font-stretch: 104%; }
.h2 { font-size: clamp(28px, 3vw, 46px); line-height: 1; letter-spacing: -0.03em; }
.h3 { font-size: clamp(19px, 1.5vw, 23px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }
.lede { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 58ch; text-wrap: pretty; }
.body { color: var(--ink-2); max-width: 66ch; text-wrap: pretty; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--f-mono); }
.num { font-variant-numeric: tabular-nums; }
.red { color: var(--red-ink); }

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 40px; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head .label { margin-bottom: 18px; }
.section-head__aside { max-width: 44ch; color: var(--ink-2); }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* ───────────── buttons & links ───────────── */
.btn {
  --b: var(--ink); --f: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 1px solid var(--b); background: var(--b); color: var(--f);
  font: 600 15px/1 var(--f-sans); letter-spacing: -0.005em; white-space: nowrap; border-radius: 0;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { --b: #000; }
.btn--red { --b: var(--red); }
.btn--red:hover { --b: var(--red-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn--ghost:hover { border-color: var(--ink); background: var(--white); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--rule-2); padding-bottom: 3px; transition: border-color .15s, color .15s;
}
.link-arrow::after { content: "→"; font-family: var(--f-mono); transition: transform .15s var(--ease); }
.link-arrow:hover { border-color: var(--red); color: var(--red-ink); }
.link-arrow:hover::after { transform: translateX(3px); }
.link { color: var(--red-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link:hover { color: var(--red-deep); }

/* ───────────── chips ───────────── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--rule-2);
  font: 500 11px/1.2 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); background: var(--white);
}
.chip::before { content: ""; width: 5px; height: 5px; background: var(--red); flex: none; }
.chip--plain::before { display: none; }

/* ───────────── key figures ───────────── */
.kf { display: grid; grid-template-columns: repeat(var(--kf-cols, 2), minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.kf__item { padding: 14px 16px 16px 0; border-bottom: 1px solid var(--rule); }
.kf__item:nth-child(n) { border-right: 0; }
.kf__value { display: block; font-size: clamp(22px, 2vw, 30px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kf__label { display: block; margin-top: 6px; }

/* ───────────── spec table ───────────── */
.specs { border-top: 1px solid var(--ink); }
.specs__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.specs__k { font: 500 11.5px/1.35 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.specs__v { font-weight: 600; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.005em; }
.specs__group { padding: 22px 0 8px; border-bottom: 1px solid var(--rule); }
.specs__group:first-child { padding-top: 12px; }

/* ───────────── data table ───────────── */
/* position:relative keeps absolutely positioned children (e.g. .sr-only labels) inside the scroll box;
   without it they escape and widen the whole page on phones. */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--ink); }
.table th, .table td { padding: 12px 16px 12px 0; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.table th { font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.table td { font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--white); }
.table .is-current td { background: var(--red-tint); }

/* ───────────── figures & drawing motifs ───────────── */
.plate { mix-blend-mode: multiply; }               /* legacy white-plate photos melt into the paper */
.fig { position: relative; margin: 0; }
.crop { position: relative; }
.crop::before, .crop::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--ink-4); border-style: solid;
}
.crop::before { left: 0; top: 0; border-width: 1px 0 0 1px; }
.crop::after { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.fig-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; }

/* vertical dimension line: place inside a position:relative box that hugs the object */
.dim {
  position: absolute; top: 0; bottom: 0; right: -30px; width: 1px; background: var(--ink-4);
  pointer-events: none;
}
.dim::before, .dim::after { content: ""; position: absolute; left: -5px; width: 11px; height: 1px; background: var(--ink-4); }
.dim::before { top: 0; }
.dim::after { bottom: 0; }
.dim__label {
  position: absolute; top: 50%; left: 8px; transform: translateY(-50%) rotate(-90deg) translateX(50%);
  transform-origin: left center; white-space: nowrap; background: var(--paper); padding: 2px 6px;
  font: 500 11px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-3);
}
.ground { height: 1px; background: var(--rule-2); position: relative; }

/* ───────────── product card ───────────── */
.cards { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--white);
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 18px 18px 20px;
  transition: background-color .15s;
}
.card:hover { background: #fff; }
.card__media { aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 8% 10%; }
.card__media img { max-height: 100%; width: auto; object-fit: contain; transition: transform .3s var(--ease); }
.card:hover .card__media img { transform: translateY(-4px); }
.card__range { margin-top: 14px; }
.card__name { margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.card__meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 12px/1.4 var(--f-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card__link::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 1100px) { .cards { --cols: 3; } }
@media (max-width: 760px) { .cards { --cols: 2; } .card { padding: 12px 12px 16px; } .card__name { font-size: 17px; } }

/* ───────────── breadcrumb ───────────── */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--ink-3); transition: color .15s; }
.crumbs a:hover { color: var(--red-ink); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--ink-4); }

/* ───────────── page header block (inner pages) ───────────── */
.page-head { padding: clamp(40px, 6vw, 88px) 0 clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--rule); }
.page-head .crumbs { margin-bottom: clamp(28px, 4vw, 48px); }
.page-head .h1 { max-width: 16ch; }
.page-head .lede { margin-top: 20px; }

/* ───────────── forms ───────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .field__label { font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.field .req { color: var(--red-ink); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; background: var(--white); border: 1px solid var(--rule-2); border-radius: 0;
  font-size: 16px; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); outline: none; }
.field__hint { font-size: 13px; color: var(--ink-3); }

/* ───────────── header ───────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 30px; width: auto; }
.nav { display: flex; align-items: stretch; height: 100%; gap: clamp(4px, 1.4vw, 22px); }
.nav > a {
  position: relative; display: flex; align-items: center; padding: 0 4px; font-size: 15px; font-weight: 500; color: var(--ink-2);
  transition: color .15s;
}
.nav > a::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease); }
.nav > a:hover { color: var(--ink); }
.nav > a[aria-current="page"] { color: var(--ink); }
.nav > a[aria-current="page"]::after, .nav > a:hover::after { transform: scaleX(1); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.header-phone { font: 500 13px/1 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; transition: color .15s; }
.header-phone:hover { color: var(--red-ink); }
.menu-btn { display: none; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--rule-2); background: var(--white); font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.menu-btn__bars { width: 16px; height: 9px; position: relative; }
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink); transition: transform .2s var(--ease), top .2s var(--ease); }
.menu-btn__bars::before { top: 0; }
.menu-btn__bars::after { top: 7.5px; }
.nav-open .menu-btn__bars::before { top: 3.75px; transform: rotate(45deg); }
.nav-open .menu-btn__bars::after { top: 3.75px; transform: rotate(-45deg); }

@media (max-width: 1080px) { .header-phone { display: none; } }
@media (max-width: 900px) {
  /* no blur here: a blurred header traps the fixed menu inside its 64 px box, so the menu had no height and no background */
  .site-header { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu-btn { display: inline-flex; }
  .header-tools .btn { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; height: auto; flex-direction: column; gap: 0;
    padding: 12px var(--gutter) 32px; background: var(--paper); border-top: 1px solid var(--rule);
    overflow-y: auto; overscroll-behavior: contain;   /* small phones: the menu scrolls instead of cutting off the bottom buttons */
    visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
  }
  .nav-open .nav { visibility: visible; opacity: 1; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .nav > a { padding: 18px 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .nav > a::after { display: none; }
  .nav > a[aria-current="page"] { color: var(--red-ink); }
  .nav__extra { display: flex !important; flex-direction: column; gap: 10px; margin-top: 28px; }
  .nav-open { overflow: hidden; }
}
.nav__extra { display: none; }

/* ───────────── footer ───────────── */
.site-footer { background: var(--ink); color: #cfcbc4; padding: clamp(56px, 7vw, 96px) 0 28px; }
.site-footer a { color: #cfcbc4; transition: color .15s; }
.site-footer a:hover { color: var(--white); }
.site-footer .label { color: #8d887f; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: .95; }
.footer-brand p { margin-top: 20px; max-width: 34ch; color: #a9a49b; font-size: 15px; }
.footer-col .label { margin-bottom: 16px; }
.footer-col li + li { margin-top: 9px; }
.footer-col li { font-size: 15px; }
.footer-contact .big { display: block; font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -0.01em; }
.footer-bottom { margin-top: clamp(48px, 6vw, 80px); padding-top: 22px; border-top: 1px solid #2d2a25; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font: 500 12px/1.4 var(--f-mono); letter-spacing: .04em; color: #8d887f; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ───────────── enquiry band (shared CTA) ───────────── */
.cta-band { background: var(--white); border-top: 1px solid var(--rule); }
.cta-band__inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.cta-band__contacts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.cta-band__contacts a { display: block; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); transition: color .15s; }
.cta-band__contacts a:hover { color: var(--red-ink); }
.cta-band__contacts strong { display: block; font-size: clamp(17px, 1.4vw, 21px); letter-spacing: -0.01em; margin-top: 6px; }
@media (max-width: 860px) { .cta-band__inner { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .cta-band__contacts { grid-template-columns: 1fr; } }

/* ───────────── motion helpers (JS adds .js to <html>) ───────────── */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
