/* ipattern.co — hub chrome.
   Tokens, self-hosted faces, header, footer and the tile/grid system shared by
   the home page and the showcase index. Extracted from the home page on
   2026-08-26 so the two cannot drift apart.

   NOTE: these tokens are the newer palette and are NOT the same as
   /assets/css/tokens.css, which /about and the case pages still use.
   Reconciling the two is a separate job. */

/* ---- home-page tokens. These diverge from /assets/css/tokens.css, which the
     rest of the site still uses; reconciling the two is the next job. ---- */
:root {
  --bg: #F7F7F5;
  --bg-grid: #E7E7E2;
  --ink: #161A18;
  --mut: #6E736F;
  --faint: #9A9E9A;
  --line: #D6D6D0;
  --hair: #E4E4DF;
  --accent: #0E7C68;
  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5.5vw, 80px);
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);

  /* ---- type scale. rem, not px, so the browser's own font-size setting is
       honoured. Six steps replace the twelve ad-hoc px values that were here,
       four of which were half-pixels. ---- */
  --t-micro: 0.625rem;   /* 10px - badges, nav, footer, tags */
  --t-small: 0.6875rem;  /* 11px - rule headings, CTAs */
  --t-cap:   0.75rem;    /* 12px - dense supporting copy */
  --t-body:  0.8125rem;  /* 13px - deks, tile copy */
  --t-lead:  0.9375rem;  /* 15px - tile titles */
  --t-h3:    1.125rem;   /* 18px - logo, section titles */

  /* matches /assets/css/tokens.css's --nav exactly, so the header reads the
     same size here as it does on every chrome.js/site-header page (e.g.
     realtime-study) — the two token systems otherwise stay unreconciled,
     see the note above. */
  --nav: clamp(0.65rem, 0.35vw + 0.5rem, 0.875rem);
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 80px 80px;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- header ---- */
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}
nav { display: flex; align-items: center; gap: 26px; font-family: var(--font-mono); font-size: var(--nav); letter-spacing: .14em; color: var(--mut); }
nav a { transition: color 150ms ease; white-space: nowrap; }
nav a:hover { color: var(--ink); }
/* Press states land on pointer-down with no transition, then fade back out.
   Instant where the system responds; the release can afford 150ms. */
nav a:active { color: var(--ink); opacity: .55; transition: none; }
nav a[aria-current] { color: var(--ink); }
nav .sep { color: var(--line); }
nav .mail svg { width: 15px; height: 15px; display: block; }

.rule { display: flex; align-items: center; gap: 14px; margin: clamp(24px, 3vw, 40px) var(--gutter) clamp(14px, 1.6vw, 22px); }
.rule :is(span, h2, h3) { margin: 0; font-family: var(--font-mono); font-size: var(--t-small); font-weight: 400; letter-spacing: .06em; color: var(--mut); white-space: nowrap; }
.rule i { flex: 1; height: 1px; background: var(--line); }
.subhead { margin: -6px var(--gutter) 0; font-size: var(--t-body); line-height: 1.5; color: var(--mut); max-width: 62ch; text-wrap: pretty; }
.arch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 0 var(--gutter) clamp(24px, 3vw, 40px); }
.arch-grid .still { aspect-ratio: 3 / 2; }
/* lone card in a category reads as a deliberate wide feature, not an orphan */
.arch-grid .tile.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 860px) { .arch-grid .tile.wide { grid-template-columns: 1fr; gap: 10px; } }
.arch-grid .tile.wide .still { grid-row: span 5; aspect-ratio: 16 / 10; }
.arch-grid .ttl { white-space: normal; }
.cta { font-family: var(--font-mono); font-size: var(--t-small); letter-spacing: .04em; color: var(--accent); margin-top: 2px; }
.cta:active, .hero-cta:active, .fs-cta:active { opacity: .55; transition: none; }

.tile { display: flex; flex-direction: column; gap: 9px; }
.still { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: #EFEFEB; transition: transform 160ms var(--ease-out-strong); }
.badge { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); border: 1px solid var(--line); border-radius: 2px; font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: .06em; color: var(--ink); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.overlay { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ink) 34%, transparent); opacity: 0; transition: opacity 200ms ease; pointer-events: none; }
.overlay span { font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: .06em; color: #FFFFFF; background: color-mix(in srgb, var(--ink) 80%, transparent); padding: 6px 10px; border-radius: 2px; }
.tile:focus-visible .overlay { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .overlay { opacity: 1; }
}
.tile:active .still { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) { .overlay { transition: none; } .still { transition: none; } .tile:active .still { transform: none; } }
.still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:active .still { border-color: var(--ink); }
.tag { font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: .06em; color: var(--mut); }
.tag b { font-weight: 400; color: var(--accent); }
.ttl { margin: 0; font-size: var(--t-h3); font-weight: 500; letter-spacing: -.015em; }
.arch-grid .ttl { font-size: var(--t-lead); }
.line2 { font-size: var(--t-cap); line-height: 1.45; color: var(--mut); margin-top: -3px; text-wrap: pretty; }
.arch-grid .line2 { font-size: var(--t-small); line-height: 1.4; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .still img { transition: transform 200ms var(--ease-out-strong); }
  .tile:hover .still img { transform: scale(1.03); }
}

/* ---- footer ---- */
footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: .1em; color: var(--mut);
}
footer a { transition: color 150ms ease; }
footer a:hover { color: var(--ink); }

/* ---- mobile ---- */
@media (max-width: 860px) {
  body { background-size: 65px 65px; }
  header { padding: 14px var(--gutter); }
    nav { gap: 12px; letter-spacing: .12em; }
  .rule :is(span, h2, h3) { white-space: normal; }
  .arch-grid { grid-template-columns: 1fr; gap: 18px; }
  .badge { font-size: 0; gap: 0; padding: 5px; }
  .ttl { font-size: var(--t-lead); }
  .arch-grid .ttl { font-size: var(--t-body); }
}

/* ---- reduced transparency ------------------------------------------------
   The header is a translucent layer with content scrolling under it. When the
   reader has asked for less transparency it becomes a solid surface instead —
   frostier, not blurrier. */
@media (prefers-reduced-transparency: reduce) {
  header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .badge { background: var(--bg); }
  .overlay { background: color-mix(in srgb, var(--ink) 74%, transparent); }
}

/* ---- more contrast -------------------------------------------------------
   Solid surfaces, defined borders, and the muted greys promoted to ink. */
@media (prefers-contrast: more) {
  header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
           border-bottom: 1px solid var(--ink); }
  .still, .badge { border-color: var(--ink); }
  .tag, .line2, .fs-note, .fs-sector, nav, footer { color: var(--ink); }
  .rule i { background: var(--ink); }
}

.skip-link{
  position:absolute;left:-9999px;top:0;z-index:100;
  padding:.7rem 1rem;background:var(--ink);color:var(--bg);
  font-family:var(--font-mono);font-size:.75rem;letter-spacing:.08em;
  text-transform:uppercase;text-decoration:none;
}
.skip-link:focus{left:0;}
[tabindex="-1"]:focus{outline:none;}
