/* ============================================================
   PackHouse Design System — tokens + base
   Ported from the Claude Design handoff bundle (design-system
   2331576f). Signal red on architectural neutrals, sharp corners,
   mono spec labels, blueprint grid. Consumers: the kadence-child
   theme front-end only.
   ============================================================ */

/* ----------------------------------------------------------------
   Webfonts (self-hosted woff2, latin subset)
   Display: TT Interphases Pro (brand, pending) — Inter Tight 800
   is the live bolder fallback. Body: Inter Tight. Mono: Space Mono.
   ---------------------------------------------------------------- */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/intertight-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/intertight-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/intertight-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/intertight-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/intertight-800.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/spacemono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/spacemono-700.woff2") format("woff2");
}

:root {
  /* ---- Brand red (signal) ---- */
  --ph-red: #FF1010;
  --ph-red-hover: #D60606;
  --ph-red-bright: #FF3636;
  --ph-burgundy: #3A0505;

  /* ---- Architectural neutrals ---- */
  --ph-black: #050505;
  --ph-charcoal: #111111;
  --ph-charcoal-2: #1A1A1A;
  --ph-charcoal-3: #242424;
  --ph-steel: #7D7D7D;
  --ph-steel-light: #A8A8A4;
  --ph-concrete: #E7E4DE;
  --ph-concrete-2: #D8D4CC;
  --ph-offwhite: #F7F7F4;
  --ph-white: #FFFFFF;

  /* ---- Semantic: surfaces ---- */
  --surface-page: var(--ph-offwhite);
  --surface-card: var(--ph-white);
  --surface-raised: var(--ph-white);
  --surface-sunken: var(--ph-concrete);
  --surface-inverse: var(--ph-charcoal);
  --surface-inverse-deep: var(--ph-black);
  --surface-inverse-raised: var(--ph-charcoal-2);

  /* ---- Semantic: text ---- */
  --text-strong: var(--ph-black);
  --text-body: #262626;
  --text-muted: var(--ph-steel);
  --text-on-dark: var(--ph-offwhite);
  --text-muted-on-dark: var(--ph-steel-light);
  --text-accent: var(--ph-red);
  --text-on-red: var(--ph-white);

  /* ---- Semantic: lines / borders ---- */
  --line-soft: var(--ph-concrete);
  --line-strong: var(--ph-concrete-2);
  --line-ink: #0A0A0A;
  --line-on-dark: var(--ph-charcoal-3);
  --line-accent: var(--ph-red);

  /* ---- Semantic: actions ---- */
  --action-primary: var(--ph-red);
  --action-primary-hover: var(--ph-red-hover);
  --action-primary-text: var(--ph-white);
  --focus-ring: var(--ph-red);

  /* ---- Status (muted, architectural) ---- */
  --status-success: #1F7A4D;
  --status-warning: #C77400;
  --status-danger: var(--ph-red);
  --status-info: #2A5BD7;

  /* ---- Families ---- */
  --font-display: "TT Interphases Pro", "Inter Tight", system-ui, sans-serif;
  --font-body: "Inter Tight", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", ui-monospace, monospace;

  /* ---- Weights ---- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 800;

  /* ---- Display / heading scale ---- */
  --text-display-2xl: clamp(3.5rem, 7vw, 6.5rem);
  --text-display-xl: clamp(2.75rem, 5vw, 4.5rem);
  --text-display-lg: clamp(2.25rem, 4vw, 3.25rem);
  --text-h1: clamp(2rem, 3.2vw, 2.75rem);
  --text-h2: clamp(1.625rem, 2.4vw, 2.125rem);
  --text-h3: 1.5rem;
  --text-h4: 1.25rem;

  /* ---- Body scale ---- */
  --text-lead: 1.25rem;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.8125rem;

  /* ---- Label / mono ---- */
  --text-label: 0.75rem;

  /* ---- Line heights ---- */
  --leading-tight: 1.02;
  --leading-snug: 1.12;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ---- Tracking ---- */
  --tracking-display: -0.03em;
  --tracking-heading: -0.015em;
  --tracking-body: 0em;
  --tracking-label: 0.18em;
  --tracking-label-tight: 0.12em;

  /* ---- Spacing scale (4px base) ---- */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --space-11: 10rem;

  /* ---- Section rhythm ---- */
  --section-pad-y: clamp(4rem, 9vw, 9rem);
  --container-max: 1280px;
  --container-wide: 1480px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* ---- Radii — sharp, architectural ---- */
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-pill: 999px;

  /* ---- Border widths ---- */
  --border-hair: 1px;
  --border-thin: 1.5px;
  --border-rule: 2px;
  --border-frame: 3px;

  /* ---- Shadows (soft, layered, low-spread) ---- */
  --shadow-xs: 0 1px 2px rgba(5, 5, 5, 0.06);
  --shadow-sm: 0 2px 6px rgba(5, 5, 5, 0.06), 0 1px 2px rgba(5, 5, 5, 0.05);
  --shadow-md: 0 8px 24px rgba(5, 5, 5, 0.08), 0 2px 6px rgba(5, 5, 5, 0.05);
  --shadow-lg: 0 20px 50px rgba(5, 5, 5, 0.12), 0 6px 14px rgba(5, 5, 5, 0.06);
  --shadow-red: 0 10px 30px rgba(255, 16, 16, 0.22);
  --shadow-inset-line: inset 0 0 0 1px rgba(5, 5, 5, 0.06);

  /* ---- Blur / glass ---- */
  --blur-panel: blur(14px) saturate(120%);

  /* ---- Motion: sharp, confident, no bounce ---- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 360ms;

  /* ---- Architectural grid / blueprint textures ---- */
  --grid-line: rgba(5, 5, 5, 0.05);
  --grid-line-dark: rgba(255, 255, 255, 0.05);
  --grid-size: 48px;
  --bg-grid-light:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  --bg-grid-dark:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
}

/* ----------------------------------------------------------------
   Base element styles, scoped to the PackHouse body class so the
   wp-admin and block editor are untouched. The class is added in
   functions.php via body_class.
   ---------------------------------------------------------------- */
body.packhouse {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-inverse-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.packhouse h1,
body.packhouse h2,
body.packhouse h3,
body.packhouse h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-snug);
  margin: 0;
  text-wrap: balance;
}

body.packhouse p { margin: 0; text-wrap: pretty; }
body.packhouse a { color: inherit; text-decoration: none; }

body.packhouse ::selection { background: var(--ph-red); color: #fff; }

/* ---- Reusable type helpers ---- */
.ph-display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--text-display-xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--text-strong);
}
.ph-eyebrow,
.ph-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
}
.ph-lead {
  font-size: var(--text-lead);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}
.ph-accent { color: var(--text-accent); }

/* ---- Layout helpers ---- */
.ph-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.ph-section { padding-block: var(--section-pad-y); }
.ph-on-dark {
  background: var(--surface-inverse);
  color: var(--text-on-dark);
}
.ph-on-dark h1, .ph-on-dark h2, .ph-on-dark h3, .ph-on-dark h4 {
  color: var(--text-on-dark);
}

/* ---- A thin red rule used as a section divider ---- */
.ph-rule {
  height: var(--border-rule);
  width: 64px;
  background: var(--ph-red);
  border: 0;
}

/* ---- Blueprint grid backgrounds ---- */
.ph-grid-bg {
  background-image: var(--bg-grid-light);
  background-size: var(--grid-size) var(--grid-size);
}
.ph-grid-bg-dark {
  background-image: var(--bg-grid-dark);
  background-size: var(--grid-size) var(--grid-size);
}

/* ---- Thin red corner-frame accent ---- */
.ph-corner-frame { position: relative; }
.ph-corner-frame::before,
.ph-corner-frame::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: var(--border-rule) solid var(--ph-red);
}
.ph-corner-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.ph-corner-frame::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
