/*
  ZAHNPUTZHOBEL — DESIGN SYSTEM
  Single source of truth for all visual design constraints.

  Structure:
    1. Font faces (self-hosted, see assets/fonts/)
    2. Design tokens (custom properties on :root)
    3. Reset & base element styles
    4. Typography
    5. Layout primitives
    6. Components
    7. Utilities
    8. Media & accessibility

  Namespace: every class is prefixed `zh-` to stay collision-free when
  dropped into any page. Do not fork this file — every page that needs
  a new pattern should extend the tokens/components here instead of
  redefining color, type or spacing locally.
*/

/* ============================================================
   1. FONT FACES
   Self-hosted, no external requests. Big Shoulders and IBM Plex
   Sans are shipped as variable fonts (one file covers their whole
   weight range); IBM Plex Mono is a single static weight used only
   for tabular spec data. SIL OFL 1.1 licensed — see assets/fonts/.
   ============================================================ */

@font-face {
  font-family: "Big Shoulders";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/big-shoulders-variable.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-variable.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

/* ============================================================
   2. DESIGN TOKENS
   ============================================================ */

:root {
  /* ---- Color — steel + bone. The whole palette, nothing else. ---- */
  --zh-gunmetal-950: #17181a; /* page ground */
  --zh-gunmetal-900: #212327; /* section surface, one step up */
  --zh-gunmetal-800: #2b2e33; /* elevated surface / hover */
  --zh-gunmetal-700: #383c42; /* borders on dark, stronger */

  --zh-steel-300: #9aa0a6; /* muted secondary text */
  --zh-steel-200: #c7cbce; /* lines, icon strokes, labels */
  --zh-steel-100: #edeff0; /* bright headline color */

  --zh-bone-600: #a9895e; /* accent, pressed */
  --zh-bone-500: #c9a876; /* accent — the miswak tone */
  --zh-bone-300: #e3cfa1; /* accent, hover / light */

  --zh-ink-200: #e7e5e0; /* body copy on dark ground */
  --zh-line: rgba(199, 203, 206, 0.16); /* hairline dividers */
  --zh-line-strong: rgba(199, 203, 206, 0.32);

  --zh-focus: var(--zh-bone-300);

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

  /* ---- Type scale ---- */
  --zh-text-xs: 0.8125rem; /* 13px — fine print */
  --zh-text-sm: 0.9375rem; /* 15px — captions, nav */
  --zh-text-base: 1.0625rem; /* 17px — body copy */
  --zh-text-lg: 1.25rem; /* 20px — lede paragraph */
  --zh-text-xl: 1.5rem; /* 24px — sub-heading */
  --zh-text-2xl: clamp(1.875rem, 1.6rem + 1.3vw, 2.75rem); /* section headline */
  --zh-text-3xl: clamp(2.75rem, 2rem + 4vw, 5.25rem); /* hero display */

  --zh-leading-tight: 1.04;
  --zh-leading-snug: 1.3;
  --zh-leading-body: 1.65;

  --zh-tracking-tight: -0.01em;
  --zh-tracking-wide: 0.04em;

  /* ---- Spacing scale (rem) ---- */
  --zh-space-1: 0.25rem;
  --zh-space-2: 0.5rem;
  --zh-space-3: 0.75rem;
  --zh-space-4: 1rem;
  --zh-space-5: 1.5rem;
  --zh-space-6: 2rem;
  --zh-space-7: 3rem;
  --zh-space-8: 4.5rem;
  --zh-space-9: 6.5rem;
  --zh-space-10: 9rem;

  /* ---- Layout ---- */
  --zh-container-width: 72rem; /* 1152px */
  --zh-gutter: clamp(1.25rem, 4vw + 0.25rem, 3rem);

  /* ---- Shape — machined edges, not soft UI chrome ---- */
  --zh-chamfer-sm: 2px;
  --zh-chamfer-md: 3px;

  /* ---- Motion ---- */
  --zh-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --zh-duration-fast: 150ms;
  --zh-duration-slow: 900ms;
}

/* ============================================================
   3. RESET & BASE
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--zh-gunmetal-950);
  color: var(--zh-ink-200);
  font-family: var(--zh-font-body);
  font-size: var(--zh-text-base);
  line-height: var(--zh-leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */

.zh-display {
  font-family: var(--zh-font-display);
  font-weight: 700;
  font-size: var(--zh-text-3xl);
  line-height: var(--zh-leading-tight);
  letter-spacing: var(--zh-tracking-tight);
  color: var(--zh-steel-100);
}

.zh-h2 {
  font-family: var(--zh-font-display);
  font-weight: 700;
  font-size: var(--zh-text-2xl);
  line-height: var(--zh-leading-tight);
  letter-spacing: var(--zh-tracking-tight);
  color: var(--zh-steel-100);
}

.zh-h3 {
  font-family: var(--zh-font-body);
  font-weight: 600;
  font-size: var(--zh-text-xl);
  line-height: var(--zh-leading-snug);
  color: var(--zh-steel-100);
}

.zh-lede {
  font-size: var(--zh-text-lg);
  line-height: var(--zh-leading-snug);
  color: var(--zh-ink-200);
  max-width: 38ch;
}

.zh-body {
  font-size: var(--zh-text-base);
  max-width: 62ch;
  color: var(--zh-ink-200);
}

.zh-caption {
  font-size: var(--zh-text-sm);
  color: var(--zh-steel-300);
  max-width: 52ch;
}

.zh-mono {
  font-family: var(--zh-font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.zh-label {
  font-size: var(--zh-text-xs);
  color: var(--zh-steel-300);
  letter-spacing: var(--zh-tracking-wide);
}

/* ============================================================
   5. LAYOUT PRIMITIVES
   ============================================================ */

.zh-container {
  width: 100%;
  max-width: var(--zh-container-width);
  margin-inline: auto;
  padding-inline: var(--zh-gutter);
}

.zh-section {
  padding-block: var(--zh-space-9);
  border-top: 1px solid var(--zh-line);
}

.zh-section--tight {
  padding-block: var(--zh-space-7);
}

.zh-section--surface {
  background: var(--zh-gunmetal-900);
}

.zh-stack > * + * {
  margin-top: var(--gap, var(--zh-space-5));
}

.zh-grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--zh-space-8);
  align-items: center;
}

@media (min-width: 56rem) {
  .zh-grid-two {
    grid-template-columns: 1fr 1fr;
    gap: var(--zh-space-9);
  }
  .zh-grid-two--wide-start {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.zh-divider {
  border: 0;
  border-top: 1px solid var(--zh-line);
  margin: 0;
}

/* ============================================================
   6. COMPONENTS
   ============================================================ */

/* -- Header ------------------------------------------------- */

.zh-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--zh-space-3) var(--zh-space-6);
  padding-block: var(--zh-space-5);
}

.zh-wordmark {
  font-family: var(--zh-font-display);
  font-weight: 700;
  font-size: var(--zh-text-lg);
  letter-spacing: var(--zh-tracking-tight);
  color: var(--zh-steel-100);
  text-decoration: none;
  display: inline-block;
}

.zh-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zh-space-2) var(--zh-space-5);
}

.zh-nav a {
  font-size: var(--zh-text-sm);
  color: var(--zh-steel-300);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color var(--zh-duration-fast) var(--zh-ease),
    border-color var(--zh-duration-fast) var(--zh-ease);
}

.zh-nav a:hover {
  color: var(--zh-steel-100);
  border-color: var(--zh-line-strong);
}

/* -- Buttons -------------------------------------------------- */

.zh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  font-family: var(--zh-font-body);
  font-weight: 600;
  font-size: var(--zh-text-sm);
  padding: 0.85em 1.4em;
  border-radius: var(--zh-chamfer-sm);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--zh-duration-fast) var(--zh-ease),
    border-color var(--zh-duration-fast) var(--zh-ease),
    color var(--zh-duration-fast) var(--zh-ease);
}

.zh-btn--primary {
  background: var(--zh-bone-500);
  color: var(--zh-gunmetal-950);
}

.zh-btn--primary:hover {
  background: var(--zh-bone-300);
}

.zh-btn--ghost {
  background: transparent;
  border-color: var(--zh-line-strong);
  color: var(--zh-steel-100);
}

.zh-btn--ghost:hover {
  border-color: var(--zh-steel-200);
  background: var(--zh-gunmetal-800);
}

/* -- Panels / surfaces ----------------------------------------- */

.zh-panel {
  border: 1px solid var(--zh-line);
  border-radius: var(--zh-chamfer-md);
  padding: var(--zh-space-6);
  background: var(--zh-gunmetal-900);
}

/* -- Spec table -------------------------------------------------
   Used for genuine tabular measurement data (dimensions, mass,
   material). Monospace here is functional — it keeps the figures
   aligned — not a decorative label treatment. */

.zh-spec-table {
  width: 100%;
}

.zh-spec-table tr {
  border-top: 1px solid var(--zh-line);
}

.zh-spec-table tr:first-child {
  border-top: 0;
}

.zh-spec-table th,
.zh-spec-table td {
  text-align: left;
  padding-block: var(--zh-space-3);
  font-weight: 400;
  vertical-align: baseline;
}

.zh-spec-table th {
  color: var(--zh-steel-300);
  font-size: var(--zh-text-sm);
  font-weight: 400;
  width: 40%;
}

.zh-spec-table td {
  font-family: var(--zh-font-mono);
  font-size: var(--zh-text-base);
  color: var(--zh-steel-100);
  text-align: right;
}

@media (min-width: 30rem) {
  .zh-spec-table td {
    text-align: left;
  }
}

/* -- Image frame --------------------------------------------------
   A consistent treatment for product photography: flat, no shadow,
   a single hairline edge — like a plate in a parts catalog. */

.zh-frame {
  border: 1px solid var(--zh-line);
  border-radius: var(--zh-chamfer-md);
  overflow: hidden;
  background: var(--zh-gunmetal-900);
}

.zh-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -- Technical silhouette overlay -------------------------------- */

.zh-silhouette {
  fill: none;
  stroke: var(--zh-steel-200);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zh-silhouette--draw {
  stroke-dasharray: var(--zh-path-length, 1200);
  stroke-dashoffset: var(--zh-path-length, 1200);
  animation: zh-draw var(--zh-duration-slow) var(--zh-ease) 400ms forwards;
}

@keyframes zh-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* -- Footer ------------------------------------------------------ */

.zh-footer {
  padding-block: var(--zh-space-7);
  border-top: 1px solid var(--zh-line);
}

.zh-footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zh-space-6);
  justify-content: space-between;
  align-items: flex-start;
}

/* ============================================================
   7. UTILITIES
   ============================================================ */

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

.zh-accent {
  color: var(--zh-bone-500);
}

.zh-muted {
  color: var(--zh-steel-300);
}

/* ============================================================
   8. ACCESSIBILITY & MEDIA
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--zh-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .zh-silhouette--draw {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 30rem) {
  :root {
    --zh-space-9: 4rem;
    --zh-space-8: 3rem;
  }
}
