/* ─────────────────────────────────────────────────────────────────────────
   Testpack — Base styles
   What Tailwind doesn't give us: serial-stamp helpers, honeycomb backdrops,
   crop marks, custom hex clips, scroll-reveal primitives.
   ─────────────────────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'ss02';
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}

/* ─── Display type ───────────────────────────────────────────────────── */

.font-display { font-family: var(--font-display); font-feature-settings: 'ss01'; }
.font-mono    { font-family: var(--font-mono); }
.font-body    { font-family: var(--font-body); }

.display-xl {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.25rem, 7.5vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.display-md {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Serial stamp — small uppercase mono used for codes, dimensions, IDs.
   Lives next to display headings the way an ISO number sits on a lab spec sheet. */
.spec {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.spec-sm {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* ─── Honeycomb backdrop ─────────────────────────────────────────────────
   A single SVG tile, repeated. Subtle — sits behind content as structure,
   not a decorative pattern. Two opacity ramps for paper vs rust grounds. */

.honeycomb-bg {
  background-size: 56px 100px;
  background-repeat: repeat;
}
.honeycomb-bg--paper {
  background-color: var(--paper);
  background-image: url('../assets/honeycomb-ink.svg');
}
.honeycomb-bg--rust {
  background-color: var(--rust-deep);
  background-image: url('../assets/honeycomb-paper.svg');
}
.honeycomb-bg--paper-light {
  background-color: var(--paper-light);
  background-image: url('../assets/honeycomb-rust.svg');
}

/* ─── Crop marks — print-design echo from the business card ────────── */

.crop-frame { position: relative; }
.crop-frame::before,
.crop-frame::after,
.crop-frame > .crop-tl,
.crop-frame > .crop-br { display: block; }

.crop-tl, .crop-tr, .crop-bl, .crop-br {
  position: absolute; width: 14px; height: 14px;
  pointer-events: none;
}
.crop-tl { top: 12px; left: 12px;  border-top: 1px solid currentColor; border-left:  1px solid currentColor; }
.crop-tr { top: 12px; right: 12px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }
.crop-bl { bottom: 12px; left: 12px;  border-bottom: 1px solid currentColor; border-left:  1px solid currentColor; }
.crop-br { bottom: 12px; right: 12px; border-bottom: 1px solid currentColor; border-right: 1px solid currentColor; }

/* ─── Hexagonal clip — used on the hero video viewport + image moments ── */

.hex-clip {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.hex-clip--portrait {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* ─── Hairline tags / chips — small monospace labels with a leading tick ─ */

.tick-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.tick-label::before {
  content: ''; display: inline-block;
  width: 18px; height: 1px;
  background: currentColor;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: background 240ms var(--ease-out-quart),
              color 240ms var(--ease-out-quart),
              transform 240ms var(--ease-out-quart);
}
.btn:hover { transform: translateY(-1px); }

.btn--solid-rust {
  background: var(--rust);
  color: var(--paper-light);
  border-color: var(--rust);
}
.btn--solid-rust:hover { background: var(--rust-bright); border-color: var(--rust-bright); }

.btn--ghost-rust {
  color: var(--rust);
  border-color: var(--rust);
}
.btn--ghost-rust:hover { background: var(--rust); color: var(--paper-light); }

.btn--ghost-paper {
  color: var(--paper-light);
  border-color: var(--paper-light);
}
.btn--ghost-paper:hover { background: var(--paper-light); color: var(--rust-deep); }

.btn .arrow {
  width: 14px; height: 1px; background: currentColor; position: relative;
  transition: width 240ms var(--ease-out-quart);
}
.btn .arrow::after {
  content: ''; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
}
.btn:hover .arrow { width: 22px; }

/* ─── Section structure ──────────────────────────────────────────────── */

.section-rule {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

/* Editorial running figure number ('FIG. 01') — sits at the top of sections */
.fig-no {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ─── Reveal on scroll (CSS-only via IntersectionObserver utility) ────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms var(--ease-out-quart),
              transform 800ms var(--ease-out-quart);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Body-text rich content */
.prose-rust p { margin-bottom: 1.1em; max-width: 60ch; }
.prose-rust p:last-child { margin-bottom: 0; }

/* Test-row hover wash — kept in CSS rather than as a Tailwind arbitrary-opacity
   class because Play CDN's JIT is flaky with /[0.04]-style tokens on custom colours. */
.test-row:hover { background: rgba(250, 246, 238, 0.04); }
.test-row:hover .test-row__title { transform: translateX(8px); }
.test-row:hover .test-row__arrow { color: var(--rust-bright); transform: translateX(4px); }
.test-row__title,
.test-row__arrow { transition: transform 500ms var(--ease-out-quart), color 500ms var(--ease-out-quart); }

/* ─── Selection ──────────────────────────────────────────────────────── */
::selection { background: var(--rust); color: var(--paper-light); }

/* ─── Focus ──────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--rust-bright);
  outline-offset: 3px;
}
