/* SEC Carpentry — base reset + typography + layout primitives (Workshop world) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  letter-spacing: -0.003em;
  color: var(--ink);
  /* Sanded-ply paper tooth: a faint, seamless procedural grain over the warm
     ground — makes the "Grain" in the world real on every flat light surface
     (dark bands set their own background and cover it). */
  background-color: var(--ground);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27140%27%20height%3D%27140%27%3E%3Cfilter%20id%3D%27g%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.82%27%20numOctaves%3D%272%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20type%3D%27saturate%27%20values%3D%270%27%2F%3E%3CfeComponentTransfer%3E%3CfeFuncA%20type%3D%27linear%27%20slope%3D%270.075%27%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: repeat;
  caret-color: var(--orange);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Sticky footer + iOS: dvh (not vh) tracks the Safari toolbar; main grows so
     short pages still pin the footer to the bottom (no gap below the footer). */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
main { flex: 1 0 auto; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange-ink); }
input, textarea, select { font: inherit; color: inherit; }

/* ---- Display type: Archivo, the workshop signage voice ---- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-6xl); font-weight: 800; letter-spacing: -0.035em; text-transform: uppercase; }
h2 { font-size: var(--fs-5xl); font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; }
h3 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; }
h4 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); }
strong, b { font-weight: 600; }

/* ---- Drawing-set label (eyebrow repurposed): uppercase tracked, hairline + index.
   Earned, not decorative: it carries the section's place in the "set" like a
   titled drawing. ---- */
.eyebrow, .label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-primary);
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--graphite);
  margin: 0 0 var(--space-4);
}
.eyebrow::before, .label::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--orange);
}
.on-walnut .eyebrow, .on-walnut .label { color: var(--bone-soft); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.container--wide { max-width: 1680px; }
.container--narrow { max-width: 1080px; }
.section { padding: var(--space-10) 0; }
.section--tight { padding: var(--space-9) 0; }

/* ---- Surface helpers ---- */
.on-light   { background: var(--ground); color: var(--ink); }
.on-deep    { background: var(--ground-deep); color: var(--ink); }
.on-walnut  { background: var(--walnut); color: var(--bone); }
.on-walnut h1, .on-walnut h2, .on-walnut h3, .on-walnut h4 { color: var(--bone); }
.on-walnut a:hover { color: var(--orange-bright); }

/* Focus — orange ring, offset */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-walnut :focus-visible { outline-color: var(--orange-bright); }

/* ---- Browser surfaces carry the design (craft-floor) ---- */
::selection { background: var(--orange); color: #1A120B; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground-deep); }
::-webkit-scrollbar-thumb {
  background: var(--graphite);
  border: 3px solid var(--ground-deep);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--orange); }
* { scrollbar-color: var(--graphite) var(--ground-deep); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.divider { height: 1px; background: var(--line); border: 0; margin: var(--space-7) 0; }
.on-walnut .divider { background: var(--line-dark); }

/* ---- The wedge "A" — THE signature mark (the logo's orange chevron-A).
   One per headline, standing in for the letter A: C<a>R</a>PENTRY, cr<a>a</a>ft.
   Rendered as an inline SVG image sized to the cap height. ---- */
.a-mark {
  display: inline-block;
  height: 0.82em;
  width: auto;
  vertical-align: baseline;
  transform: translateY(0.02em);
  margin-inline: 0.01em;
  user-select: none;
  -webkit-user-drag: none;
}
/* Keep a word carrying the inline wedge on one line (the <img> is a wrap point). */
.nw { white-space: nowrap; }

/* Measurement figure — mono is earned here (dimensions, counts), not a costume. */
.dim { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---- Reveal-on-scroll (IntersectionObserver adds .is-in) ---- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity var(--motion-normal) var(--ease-decelerate),
              transform var(--motion-normal) var(--ease-decelerate);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* Sibling stagger within a group */
.featured-grid .reveal:nth-child(1), .bento .reveal:nth-child(1),
.stats-grid .reveal:nth-child(1), .values-grid .reveal:nth-child(1),
.services-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.featured-grid .reveal:nth-child(2), .bento .reveal:nth-child(2),
.stats-grid .reveal:nth-child(2), .values-grid .reveal:nth-child(2),
.services-grid .reveal:nth-child(2) { transition-delay: 80ms; }
.featured-grid .reveal:nth-child(3), .bento .reveal:nth-child(3),
.stats-grid .reveal:nth-child(3), .values-grid .reveal:nth-child(3),
.services-grid .reveal:nth-child(3) { transition-delay: 160ms; }
.bento .reveal:nth-child(4) { transition-delay: 240ms; }
.bento .reveal:nth-child(5) { transition-delay: 280ms; }
.bento .reveal:nth-child(6) { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Vanilla marquee (seamless -50% loop; track content duplicated once) ---- */
.marquee { overflow: hidden; width: 100%; }
.marquee__track {
  display: flex; align-items: center; width: max-content;
  will-change: transform;
  animation: marquee-scroll var(--marquee-dur, 46s) linear infinite;
}
.marquee[data-dir="rtl"] .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee-scroll {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-50%,0,0); }
}
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }
