/* ============================================================
   WALLS SAND & GRAVEL / DESIGN SYSTEM
   css/system.css | tokens + shared components | no build step
   Palette derived from the client's own product photography:
   limestone paper, basalt ink, red-jasper sienna accent.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */

:root {
  /* color */
  --paper:      #EFEDE8;   /* limestone */
  --paper-2:    #E7E4DB;   /* stone tint */
  --paper-3:    #DEDBD1;   /* pressed stone */
  --ink:        #191713;   /* basalt */
  --ink-2:      #211E18;   /* raised dark surface */
  --ink-3:      #2A261F;   /* dark hover */
  --ink-deep:   #121009;   /* footer */
  --text:       #23201B;
  --text-2:     #5C574B;
  --text-3:     #8A8375;
  --text-d:     #ECE9E1;   /* on dark */
  --text-d2:    #ABA495;   /* on dark, secondary */
  --accent:      #9C4A28;  /* red-jasper sienna */
  --accent-deep: #843D1E;
  --accent-hi:  #D97C49;   /* accent on dark */
  --line:       #D7D3C8;
  --line-2:     #C6C1B3;
  --line-d:     #3A352B;   /* hairline on dark */
  --white-tile: #FBFAF7;   /* logo tiles */

  /* type */
  --font-body: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  /* rhythm */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --section: clamp(72px, 9vw, 122px);
  --gutter: clamp(20px, 4.5vw, 56px);
  --measure: 62ch;

  /* shape: one radius scale = sharp (0). plates and cards take
     a 1px ink border instead of rounding. */
  --r: 0px;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t-med: 420ms;
}

/* ---------- 2. BASE ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--accent); color: #F5F1E8; }

h1, h2, h3, h4 {
  font-family: var(--font-body);
  color: var(--text);
  margin: 0;
  font-weight: 740;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

p { margin: 0; }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* section scaffolding */

.section { padding-block: var(--section); position: relative; }
.section-tight { padding-block: calc(var(--section) * 0.62); }

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

.section-head { max-width: var(--measure); margin-bottom: var(--s7); }
.section-head .sub { margin-top: var(--s4); color: var(--text-2); max-width: 46ch; }

.h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.sub { font-size: 1.0625rem; }

section[id] { scroll-margin-top: 92px; }

/* ---------- 3. SIGNATURE MOTIF: strata rule ---------- */
/* three stepped hairlines, like bench levels in a quarry pit */

.strata {
  height: 11px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 34% 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 5px / 62% 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 10px / 100% 1px no-repeat;
}
.strata-dark {
  background:
    linear-gradient(var(--accent-hi), var(--accent-hi)) 0 0 / 34% 1px no-repeat,
    linear-gradient(var(--line-d), var(--line-d)) 0 5px / 62% 1px no-repeat,
    linear-gradient(var(--line-d), var(--line-d)) 0 10px / 100% 1px no-repeat;
}

/* ---------- 4. BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 640;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 15px 26px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              background var(--t-fast) linear,
              border-color var(--t-fast) linear,
              color var(--t-fast) linear;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary { background: var(--accent); color: #F7F2E9; }
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--text-d); }

.btn-light { background: transparent; color: var(--text-d); border-color: var(--text-d2); }
.btn-light:hover { background: var(--text-d); color: var(--ink); }

.btn .lucide { width: 17px; height: 17px; }

/* ---------- 5. PLATES (photography treatment) ---------- */
/* every photo renders as a mounted specimen plate:
   1px ink border, stone tone grade, mono caption */

.plate { border: 1px solid var(--ink); background: var(--ink); }
.plate img {
  width: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
  aspect-ratio: var(--plate-ratio, 3 / 2);
}
.plate-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-2);
}
.plate-caption .no { color: var(--accent); }

.on-dark .plate { border-color: var(--text-d2); }
.on-dark .plate-caption { color: var(--text-d2); }

/* ---------- 6. CHIPS / TAGS / STATS ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--text-2);
}
.chip .dot { width: 9px; height: 9px; flex: none; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s5);
}
.stat { border-left: 1px solid var(--line-2); padding-left: var(--s4); }
.stat .num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat .num .lucide { width: 26px; height: 26px; color: var(--accent); }
.stat .lbl { margin-top: 6px; color: var(--text-2); font-size: 0.82rem; line-height: 1.45; }

/* ---------- 7. CARDS ---------- */

.card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: var(--s5);
  transition: border-color var(--t-fast) linear, transform var(--t-fast) var(--ease);
}
.card:hover { border-color: var(--ink); }

/* ---------- 8. FORMS ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-d2);
}
.field input, .field select, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-d);
  background: var(--ink);
  border: 1px solid var(--line-d);
  padding: 13px 14px;
  border-radius: 0;
  appearance: none;
  width: 100%;
  min-width: 0;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ABA495' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8B8474; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 1px;
  border-color: var(--accent-hi);
}

/* ---------- 9. MOTION ---------- */

.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  transition-delay: var(--rv-delay, 0ms);
}
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- 10. UTILITIES ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--text-d);
  padding: 10px 18px;
  z-index: 200;
}
.skip:focus { left: 12px; top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
