/* ==========================================================================
   PERIKEE LABS — "DATUM" v1.0
   Enamel-grey ground, graphite ink, one red index mark, spec-sheet structure.

   Single-theme by deliberate commitment: the ground IS the identity.
   No JavaScript anywhere on this site. Nothing here is 1px.
   ========================================================================== */

/* -------------------------------------------------- 1. PALETTE + UNITS --- */
:root {
  --pk-field:      #C9CED0;   /* page ground — Enamel Grey                   */
  --pk-plate:      #DADEDF;   /* document sheet — Privacy / Terms only       */
  --pk-well:       #B5BBBD;   /* spec-sheet fill                             */
  --pk-well-alt:   #BEC3C5;   /* spec-sheet alternating row (a value step,
                                 which is what replaces hairline rules)      */
  --pk-graphite:   #191D20;   /* footer + dark band ONLY, never a page bg    */
  --pk-ink:        #14171A;   /* all body text and headings                  */
  --pk-pencil:     #454B50;   /* metadata labels only — never prose          */
  --pk-red:        #B8301A;   /* position marks + primary button ONLY        */
  --pk-red-lift:   #E8563A;   /* the same red, on dark grounds only          */
  --pk-blue:       #1F4B8F;   /* annotation ink — link underlines            */
  --pk-blue-lift:  #8FB2E8;   /* annotation ink, on dark grounds only        */

  --pk-face: "Chivo", "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pk-mono: "Chivo Mono", "DM Mono", ui-monospace, "SF Mono", "Cascadia Mono",
             Consolas, Menlo, monospace;

  --pk-gutter: 22px;   /* page side gutter, mobile  */
  --pk-pad:    96px;   /* section padding,  mobile  */
  --pk-major:  40px;   /* datum major tick interval */
  color-scheme: light;
}
@media (min-width: 768px) {
  :root { --pk-gutter: 48px; --pk-pad: 152px; --pk-major: 64px; }
}

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

html, body { background-color: var(--pk-field); margin: 0; padding: 0; }

body {
  font-family: var(--pk-face);
  color: var(--pk-ink);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* -------------------------------------------------- 2. TYPE -------------- */
h1, h2, h3, p, li { font-family: var(--pk-face); color: var(--pk-ink); margin: 0; }

h1 {
  font-size: clamp(2.75rem, 10vw, 5.5rem);   /* 44px floor — 88px cap */
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.625rem, 4.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 20ch;
  text-wrap: balance;
}
h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
p, li { font-size: 17px; line-height: 1.65; max-width: 64ch; }
strong { font-weight: 700; }   /* product names inside prose */

@media (min-width: 768px) {
  h3    { font-size: 19px; }
  p, li { font-size: 18px; line-height: 1.70; }
}

a { color: inherit; }

/* -------------------------------------------------- 3. HEADER ------------ */
.pk-header {
  position: relative;
  z-index: 5;
  background: var(--pk-field);
  padding: 22px var(--pk-gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: 1140px;
}
.pk-nameplate {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 16px;
}
.pk-nav { display: flex; gap: 28px; }

/* Nav rides the same scale as the datum band: a 2px tick under each item,
   and the current page's tick turns red and full height. */
.pk-nav a {
  position: relative;
  font-family: var(--pk-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pk-ink);
  padding: 0 0 16px;
}
.pk-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 2px; height: 8px;
  background-color: var(--pk-ink);
  opacity: 0.35;
}
.pk-nav a[aria-current="page"]::after {
  width: 4px; height: 16px;
  background-color: var(--pk-red);
  opacity: 1;
}

/* -------------------------------------------------- 4. DATUM BAND -------- */
/* The signature device. Minor ticks 2px wide / 6px tall at 8px pitch.
   Major ticks 2px / 14px at 40px (mobile) or 64px (desktop).

   PHASE RULE: drawn on the full-bleed section, so its left edge is always
   viewport x=0 and every band on every page shares one phase — the major
   ticks line up vertically down the entire site. Never move this onto a
   padded container; the alignment dies silently and still looks fine alone. */
.pk-section { position: relative; }

.pk-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20px;
  z-index: 1;
  pointer-events: none;
  background-repeat: repeat-x, repeat-x;
  background-position: 0 100%, 0 100%;
  background-size: 100% 14px, 100% 6px;
  background-image:
    repeating-linear-gradient(90deg, #14171A 0 2px, transparent 2px 40px),
    repeating-linear-gradient(90deg, rgba(20,23,26,0.30) 0 2px, transparent 2px 8px);
}
@media (min-width: 768px) {
  .pk-section::before {
    background-image:
      repeating-linear-gradient(90deg, #14171A 0 2px, transparent 2px 64px),
      repeating-linear-gradient(90deg, rgba(20,23,26,0.30) 0 2px, transparent 2px 8px);
  }
}

/* The index mark. Its position IS the section number — section N stands on
   major tick N, so scrolling walks the mark right along the scale.

   The number comes from a class, not an inline style attribute, so the site
   can ship a strict Content-Security-Policy with no 'unsafe-inline'.
   Add a section? Give it the next class and renumber the gutter numerals. */
.pk-s1 { --n: 1; }
.pk-s2 { --n: 2; }
.pk-s3 { --n: 3; }
.pk-s4 { --n: 4; }
.pk-s5 { --n: 5; }
.pk-s6 { --n: 6; }
.pk-s7 { --n: 7; }
.pk-s8 { --n: 8; }

.pk-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--n) * var(--pk-major) - 1px);
  width: 4px;
  height: 20px;
  background-color: var(--pk-red);
  z-index: 1;
  pointer-events: none;
}

/* -------------------------------------------------- 5. SHEET GEOMETRY ---- */
/* Nothing is centered. Every page is a drawing sheet read from top-left. */
.pk-wrap {
  position: relative;
  z-index: 2;
  max-width: 1140px;
  margin-left: 0;
  padding: var(--pk-pad) var(--pk-gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .pk-wrap {
    /* 24-col sheet: 1–6 index gutter · 8–20 content · 21–24 margin.
       Columns 21–24 stay EMPTY, permanently. It is the margin of a
       drawing sheet — the moment it holds anything, the direction is gone. */
    grid-template-columns: 6fr 1fr 13fr 4fr;
    gap: 0;
  }
  .pk-gutter  { grid-column: 1; }
  .pk-content { grid-column: 3; }
}

.pk-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.pk-content > * { margin: 0; }

/* -------------------------------------------------- 6. INDEX BLOCK ------- */
.pk-index-n {
  display: block;
  font-family: var(--pk-mono);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pk-index-l {
  display: block;
  margin-top: 8px;
  font-family: var(--pk-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pk-pencil);
}
@media (min-width: 768px) { .pk-index-n { font-size: 44px; } }

/* -------------------------------------------------- 7. TITLEBLOCK -------- */
.pk-meta {
  font-family: var(--pk-mono);
  font-size: 13px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.pk-meta-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px;
  padding: 4px 0;
}
.pk-meta-row > span:first-child {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pk-pencil);
  align-self: center;
}

/* -------------------------------------------------- 8. SPEC SHEET -------- */
/* A recessed well framed in 2px ink, indexed in red on the fourth side.
   Surfaces are cut into the field, never lifted off it: no shadow, no
   radius, no translucency, anywhere a visitor can see one. */
.pk-sheet {
  width: 100%;
  background-color: var(--pk-well);
  border: 2px solid var(--pk-ink);
  border-left: 6px solid var(--pk-red);
}
/* Stacking gap comes from .pk-content's flex gap — adding margin here
   doubles it to 48px. */

.pk-sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 16px;
  background-color: var(--pk-ink);
}
.pk-sheet-name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--pk-field);        /* 11.33:1 on ink */
}
.pk-sheet-status {
  font-family: var(--pk-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pk-red-lift);     /* 4.99:1 on ink — base red would be 2.98 */
}

.pk-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px 16px;
}
.pk-row:nth-child(even) { background-color: var(--pk-well-alt); }

/* Inside a spec sheet every piece of text is ink. Labels and values are
   told apart by face, size and case — never by greying the label out. */
.pk-row > span:first-child {
  font-family: var(--pk-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pk-row > span:last-child { font-size: 16px; line-height: 1.45; }

@media (min-width: 768px) {
  .pk-sheet-head { padding: 16px 24px; }
  .pk-sheet-name { font-size: 26px; }
  .pk-row {
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: baseline;
    padding: 16px 24px;
  }
}

/* -------------------------------------------------- 8b. PLATES ----------- */
/* Product imagery. Framed in 2px ink with a mono label bar, exactly like a
   spec sheet — so a screenshot reads as a plate laid on the bench rather
   than a hero image. The art stays vivid inside its frame; the page around
   it stays grey. Never let one of these go full-bleed. */
.pk-plates {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .pk-plates { grid-template-columns: 1fr 1fr; }
  /* One image on its own must not stretch to half a page. */
  .pk-plates--solo { grid-template-columns: 1fr; max-width: 320px; }
}

.pk-plate {
  margin: 0;
  border: 2px solid var(--pk-ink);
  background-color: var(--pk-well);
}
.pk-plate img {
  display: block;
  width: 100%;
  height: auto;
}
.pk-plate figcaption {
  font-family: var(--pk-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pk-ink);
  background-color: var(--pk-well-alt);
  padding: 10px 12px;
  border-top: 2px solid var(--pk-ink);
}

/* -------------------------------------------------- 9. BUTTONS ----------- */
/* Stencils, not pills. A red-bordered button with red text is banned:
   red is 3.80:1 on the ground and fails AA at button size. The only red
   button is a solid fill with WHITE text (6.04:1). */
.pk-btn {
  display: inline-block;
  font-family: var(--pk-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 2px solid var(--pk-ink);
  background-color: transparent;
  color: var(--pk-ink);
  text-decoration: none;
  transition: background-color 120ms linear, color 120ms linear;
}
.pk-btn:hover { background-color: var(--pk-ink); color: var(--pk-field); }

/* -------------------------------------------------- 10. LINKS ------------ */
/* Link TEXT never takes an accent colour. Only the underline does. */
.pk-content p a, .pk-doc a {
  text-decoration: underline;
  text-decoration-color: var(--pk-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.pk-content p a:hover, .pk-doc a:hover { text-decoration-color: var(--pk-red); }

/* -------------------------------------------------- 11. FOCUS ------------ */
/* WCAG 2.4.7. Red is 3.80:1 on the ground, clearing the 3:1 threshold for
   focus indicators. On dark grounds it lifts. */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--pk-red);
  outline-offset: 3px;
}
.pk-band a:focus-visible,
.pk-footer a:focus-visible { outline-color: var(--pk-red-lift); }

/* -------------------------------------------------- 12. DARK BAND -------- */
/* Base red and Pencil are banned here — both fail on graphite, both lift. */
.pk-band { background-color: var(--pk-graphite); }
.pk-band h2,
.pk-band p,
.pk-band .pk-meta,
.pk-band .pk-index-n { color: var(--pk-field); }        /* 10.68:1 */
.pk-band .pk-index-l,
.pk-band .pk-meta-row > span:first-child { color: var(--pk-plate); }  /* 12.52:1 */
.pk-band p a {
  color: var(--pk-field);
  text-decoration-color: var(--pk-blue-lift);
}
.pk-band::before {
  background-image:
    repeating-linear-gradient(90deg, #C9CED0 0 2px, transparent 2px 40px),
    repeating-linear-gradient(90deg, rgba(201,206,208,0.34) 0 2px, transparent 2px 8px);
}
.pk-band::after { background-color: var(--pk-red-lift); }
@media (min-width: 768px) {
  .pk-band::before {
    background-image:
      repeating-linear-gradient(90deg, #C9CED0 0 2px, transparent 2px 64px),
      repeating-linear-gradient(90deg, rgba(201,206,208,0.34) 0 2px, transparent 2px 8px);
  }
}

/* -------------------------------------------------- 13. DOC SHEET -------- */
/* A printed page laid on the bench. Privacy and Terms only. */
.pk-doc {
  background-color: var(--pk-plate);
  border: 2px solid var(--pk-ink);
  width: 100%;
  max-width: 820px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 768px) { .pk-doc { padding: 48px; } }
.pk-doc h3 { margin-top: 16px; }
.pk-doc h3:first-of-type { margin-top: 0; }
.pk-doc p { max-width: 64ch; }
.pk-clause {
  font-family: var(--pk-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--pk-pencil);
  margin-right: 10px;
}

/* -------------------------------------------------- 14. FOOTER ----------- */
.pk-footer { background-color: var(--pk-graphite); }
.pk-footer-inner {
  max-width: 1140px;
  padding: 64px var(--pk-gutter);
  font-family: var(--pk-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--pk-field);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
}
.pk-footer a {
  color: var(--pk-field);
  text-decoration: underline;
  text-decoration-color: var(--pk-blue-lift);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.pk-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }

/* -------------------------------------------------- 15. NEVER EXIST ------ */
/* Belt and braces: no dividers, no rules, no 1px anything, ever. */
hr { display: none; }

/* -------------------------------------------------- 16. REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
