/* =====================================================================
 SITE.CSS  -  shared by EVERY page (homepage + inner pages)
 ---------------------------------------------------------------------
 Colours, fonts, the small label chips, and the screen overlays (vignette, glass edge,
 frame marks, scanlines) live here, so a change is made once and hits every page.
 Homepage-only styles are in home.css, inner-page styles in page.css.
 ===================================================================== */

:root {
  --paper: #EFEDE8;     /* background */
  --ink:   #1D1C1A;     /* text, wordmark, active card - a warm off-black, softer on the eyes */
  --hot:   #FF4A1C;     /* the one colour: cards, status dot, loader number */

  --card-w: clamp(240px, 38vw, 500px);

  /* CARD OUTLINE: thickness scales with the card (never under 4px) */
  --edge: max(4px, calc(var(--card-w) * .012));

  /* VIGNETTE: very light darkening toward the corners (0 = off). */
  --vignette: .12;

  /* DROP SHADOW: solid (no blur), offset down-right, faint. Raise/lower the .16 for stronger/weaker. */
  --shadow: calc(var(--card-w) * .028) calc(var(--card-w) * .034) 0 rgba(29,28,26,.16);

  /* SCANLINES: one pass over the whole page, one on each card (tilts with the card), one on the loader.
     --scan-a = strength of the page lines (0 = off), --scan-gap = spacing between them. */
  --scan-a:   .16;   /* strength at the screen's edge; the middle is lighter (CRT.centre in site.js) */

  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); }
/* nothing may push the page wider than the screen (a long title or an overlay used to make phones
   zoom out / slide sideways). clip, unlike hidden, doesn't break sticky elements. */
html, body { overflow-x: clip; }
body { font-family: var(--mono); -webkit-font-smoothing: antialiased; font-synthesis: none; }

#vignette {
  position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(ellipse 82% 78% at 50% 48%, transparent 52%, rgba(28, 27, 25, var(--vignette)) 100%);
}

/* ---------- CRT GLASS EDGE ----------
   Rounded corners with a soft dark rim, like the curved edge of a tube. */
/* Oversized past every screen edge, so the rounded corners sit OFF-screen: you see the soft dark
   rim but never the shape's outline. */
#tube {
  position: fixed; inset: -6vmin; z-index: 36; pointer-events: none;
  border-radius: 10vmin;
  box-shadow: inset 0 0 13vmin rgba(28, 27, 25, .24);
}

/* ---------- FRAME MARKS ----------
   Print/instrument furniture: an L-bracket in each corner and a small tick at the middle of each
   edge. White + difference blend, so they read dark on the paper and light over dark shapes. */
#frame { position: fixed; inset: 10px; z-index: 37; pointer-events: none; color: #fff; mix-blend-mode: difference; }
#frame i { position: absolute; width: 16px; height: 16px; border: 0 solid currentColor; }
#frame i:nth-child(1) { top: 0;    left: 0;  border-width: 2px 0 0 2px; }
#frame i:nth-child(2) { top: 0;    right: 0; border-width: 2px 2px 0 0; }
#frame i:nth-child(3) { bottom: 0; left: 0;  border-width: 0 0 2px 2px; }
#frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
#frame b { position: absolute; background: currentColor; }
#frame b:nth-child(5) { top: 0;    left: 50%; width: 1px; height: 6px; }
#frame b:nth-child(6) { bottom: 0; left: 50%; width: 1px; height: 6px; }
#frame b:nth-child(7) { left: 0;   top: 50%;  height: 1px; width: 6px; }
#frame b:nth-child(8) { right: 0;  top: 50%;  height: 1px; width: 6px; }

/* ---------- PAGE SCANLINES ----------
   ONE layer over the whole screen (cards, wordmark, everything), not per-card. The script draws
   the lines on a canvas and bows them outward like a CRT: straight at the top/bottom edges,
   curving and spreading apart toward the middle. Tune CRT { gap, bloat } in the script.
   A soft lighter band also rolls down the screen every few seconds. */
.scan {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  --scan-rgb: 28, 27, 25;
  overflow: hidden;
}
.scan::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22vh;
  background: linear-gradient(to bottom, transparent, rgba(var(--scan-rgb), .045) 50%, transparent);
  animation: scanRoll 7s linear infinite;
}
/* phosphor mask: fine red / green / blue stripes, only toward the edges of the glass, plus a faint flicker */
.scan::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,40,40,.06) 0 1px, rgba(40,255,80,.05) 1px 2px, rgba(60,80,255,.06) 2px 3px);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, transparent 25%, #000 100%);
          mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, transparent 25%, #000 100%);
}
#scan { animation: crtFlicker 5s steps(1) infinite; }
@keyframes crtFlicker { 0%,100% { opacity: 1; } 41% { opacity: .93; } 42% { opacity: 1; } 77% { opacity: .95; } 78% { opacity: 1; } }
@keyframes scanRoll { from { transform: translateY(-30vh); } to { transform: translateY(110vh); } }
@media (prefers-reduced-motion: reduce) { .scan::after { animation: none; display: none; } #scan { animation: none; } }

/* ---------- LABELS: small paper chips, always legible ---------- */
.ui { position: fixed; z-index: 50; pointer-events: none; display: flex; gap: 8px; }
.ui--top { top: 16px; left: 16px; right: 16px; justify-content: space-between; align-items: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--ink);
  padding: 5px 9px; font-size: 11px; font-weight: 500; line-height: 1.2;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.chip--live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hot);
  animation: blink 1.6s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: .15; } }
@media (max-width: 640px) { .ui--top .chip--live { display: none; } }
.chip--link { color: inherit; text-decoration: none; font-family: inherit; cursor: pointer; pointer-events: auto; transition: background .2s, color .2s; }
.chip--link:hover, .chip--link:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
button.chip { appearance: none; }

/* ---------- PAGE TRANSITION ----------
   .wipe is the ink curtain that floods the screen when you leave a page (grows out of the card you
   clicked) and lifts off again when the next page arrives. site.js builds it. */
.wipe { position: fixed; inset: 0; z-index: 5000; overflow: hidden; background: var(--ink); color: var(--paper); }
/* the card: 1.41 : 1 like the homepage cards, sized to COVER the screen, everything inside in cqw */
.wipe__card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100vw, calc(100vh * 1.41)); aspect-ratio: 1.41;
  container-type: inline-size; background: var(--ink);
}
.wipe__in {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(5cqw + 1.2cqw);
}
.wipe__meta {
  display: flex; justify-content: space-between; gap: 1em;
  font-size: max(9px, 3.1cqw); line-height: 1; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.wipe__title { font-family: var(--display); text-transform: uppercase; font-size: 28cqw; line-height: .84; letter-spacing: -.005em; }
.wipe__title .ln { display: block; width: max-content; white-space: nowrap; transform-origin: 0 50%; }
/* boot.js adds .is-arriving before the page paints, so there is no flash of the new page
   before the curtain takes over */
html.is-arriving::before { content: ""; position: fixed; inset: 0; background: #1D1C1A; z-index: 4999; }

/* ---------- BUTTONS (hero, services, contact form) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  box-shadow: 4px 5px 0 rgba(29,28,26,.16);
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn--solid { background: var(--ink); color: var(--paper); }
.btn:hover, .btn:focus-visible { background: var(--hot); color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 7px 0 rgba(29,28,26,.2); outline: none; }

/* ---------- LOCKUP: your logo + name in a chip (top left of every page) ---------- */
.lockup { gap: 8px; padding: 5px 10px 5px 6px; }
.lockup__back { margin-right: -2px; }
.lockup__logo { width: 22px; height: 22px; flex: none; }
.lockup__name { height: 17px; width: auto; flex: none; transform: translateY(10%); }   /* optically centred: the "y" tail hangs below */
.lockup.chip--link:hover, .lockup.chip--link:focus-visible { background: var(--hot); color: var(--ink); }
