/* tamgahq.com site theme, loaded after tamga.css (design system v1.0).
   Direction: "engineering report". Quiet neutrals, turquoise as a small accent, Geist + Geist Mono,
   hairline rules, small radii, no gradients or glows. Unbounded stays only in the wordmark.
   Shared by the home page and the topic pages (pages.css). */

:root {
  --t-font-display: "Geist", "Segoe UI", system-ui, sans-serif;
  --t-font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --t-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, Consolas, monospace;
  --t-font-brand: "Unbounded", "Arial Black", system-ui, sans-serif;

  --t-radius-sm: 4px;
  --t-radius-md: 6px;
  --t-radius-lg: 8px;
  --t-radius-xl: 10px;
  --t-radius-2xl: 12px;

  /* dark (default) */
  --t-bg: #0B0E13;
  --t-surface: #10141B;
  --t-surface-2: #171C25;
  --t-line: #222833;
  --t-line-strong: #2F3744;
  --t-ink: #E8EBEF;
  --t-muted: #8D96A4;
  --t-faint: #5D6673;
  --t-accent: #1FA5A0;
  --t-accent-ink: #3CC4BB;
  --t-on-accent: #061614;
  --t-accent-soft: rgba(31, 165, 160, .12);
  --t-ok: #3FC48C;
  --t-warn: #E3AC45;
  --t-bad: #EE6A6E;
  --t-focus: #3CC4BB;
  --t-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);
  --t-grid: rgba(232, 235, 239, .045);
  /* tinted wash: the page starts deep teal-navy and settles into the base colour */
  --t-wash-top: #121B2C;                       /* top of the page */
  --t-wash-glow: rgba(31, 165, 160, .14);      /* turquoise light in the wash */
  --t-wash-depth: 1100px;                      /* how far down the wash reaches */
  --t-band: rgba(14, 18, 24, .55);             /* alternating section shade */
  --t-grain: .07;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --t-bg: #F7F8F9; --t-surface: #FFFFFF; --t-surface-2: #F0F2F4;
    --t-line: #E2E5E9; --t-line-strong: #CDD2D8;
    --t-ink: #0E131A; --t-muted: #59636F; --t-faint: #8A939E;
    --t-accent: #17857F; --t-accent-ink: #136A66; --t-on-accent: #FFFFFF; --t-accent-soft: rgba(23, 133, 127, .09);
    --t-ok: #12805A; --t-warn: #9A6400; --t-bad: #C2363B; --t-focus: #17857F;
    --t-shadow: 0 1px 2px rgba(14, 19, 26, .04), 0 20px 40px -28px rgba(14, 19, 26, .18);
    --t-grid: rgba(14, 19, 26, .05);
    --t-wash-top: #C9D8E6; --t-wash-glow: rgba(23, 133, 127, .22); --t-band: rgba(255, 255, 255, .6); --t-grain: .045;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --t-bg: #F7F8F9; --t-surface: #FFFFFF; --t-surface-2: #F0F2F4;
  --t-line: #E2E5E9; --t-line-strong: #CDD2D8;
  --t-ink: #0E131A; --t-muted: #59636F; --t-faint: #8A939E;
  --t-accent: #17857F; --t-accent-ink: #136A66; --t-on-accent: #FFFFFF; --t-accent-soft: rgba(23, 133, 127, .09);
  --t-ok: #12805A; --t-warn: #9A6400; --t-bad: #C2363B; --t-focus: #17857F;
  --t-shadow: 0 1px 2px rgba(14, 19, 26, .04), 0 20px 40px -28px rgba(14, 19, 26, .18);
  --t-grid: rgba(14, 19, 26, .05);
  --t-wash-top: #C9D8E6; --t-wash-glow: rgba(23, 133, 127, .22); --t-band: rgba(255, 255, 255, .6); --t-grain: .045;
  color-scheme: light;
}

/* base */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.t-base { font-size: 16px; line-height: 1.6; font-feature-settings: "ss01", "cv11";
  /* tinted wash: deep teal-navy at the top with a soft turquoise light, settling into the base colour */
  background:
    radial-gradient(70% 700px at 50% 0%, var(--t-wash-glow), transparent 80%),
    linear-gradient(180deg, var(--t-wash-top) 0px, var(--t-bg) var(--t-wash-depth)),
    var(--t-bg);
  background-repeat: no-repeat; }
/* film grain over everything: gives the wash texture and removes gradient banding */
body.t-base::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: var(--t-grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* alternating section shade, and a closing wash that rises from the bottom of a section (pages opt in) */
.band { background: var(--t-band); }
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 520px at 50% 100%, var(--t-wash-glow), transparent 80%),
              linear-gradient(0deg, var(--t-wash-top), transparent 75%); }
a { color: inherit; }
::selection { background: var(--t-accent-soft); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* type */
.t-display, .t-h1, .t-h2, .t-h3 { font-family: var(--t-font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.t-h1 { font-size: clamp(34px, 4.4vw, 54px); letter-spacing: -.035em; line-height: 1.04; }
.t-h2 { font-size: clamp(26px, 2.8vw, 36px); letter-spacing: -.03em; }
.t-h3 { font-size: 18px; letter-spacing: -.015em; line-height: 1.3; }
.t-lede { font-size: 17px; line-height: 1.6; color: var(--t-muted); }
.t-eyebrow { font: 500 12px/1 var(--t-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--t-muted); }
.t-eyebrow b { color: var(--t-accent-ink); font-weight: 500; margin-right: 10px; }
.t-wordmark { font-family: var(--t-font-brand); font-size: 14px; }

/* components */
.t-btn { font: 500 14.5px/1 var(--t-font-body); border-radius: var(--t-radius-md); min-height: 40px; padding: 0 16px; letter-spacing: -.005em; }
.t-btn--lg { min-height: 46px; padding: 0 20px; font-size: 15px; }
.t-btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--t-radius-md); }
.t-btn--primary:hover { filter: none; background: color-mix(in srgb, var(--t-accent) 88%, var(--t-ink)); }
.t-btn--ghost { border-color: var(--t-line-strong); }
.t-btn--ghost:hover { border-color: var(--t-muted); background: var(--t-surface); }
.t-btn .arr { font-family: var(--t-font-mono); transition: transform var(--t-fast) var(--t-ease); }
.t-btn:hover .arr { transform: translateX(2px); }
.t-card { border-radius: var(--t-radius-lg); padding: 22px; }
.t-card--raised { box-shadow: var(--t-shadow); }
.t-status { border-radius: var(--t-radius-sm); padding: 5px 8px; font: 500 11px/1 var(--t-font-mono); letter-spacing: .04em; }
.t-status::before { width: 6px; height: 6px; }
.t-chip { border-radius: var(--t-radius-md); padding: 8px 12px; font-size: 14px; }
.t-chip[aria-pressed="true"] { background: var(--t-accent-soft); border-color: var(--t-accent); color: var(--t-ink); }
.t-seg { border-radius: var(--t-radius-md); padding: 2px; }
.t-seg > button { border-radius: var(--t-radius-sm); padding: 7px 10px; font: 500 12px/1 var(--t-font-mono); }
.t-seg > button[aria-pressed="true"] { background: var(--t-surface-2); color: var(--t-ink); }
.t-seg > a { padding: 7px 10px; border-radius: var(--t-radius-sm); font: 500 12px/1 var(--t-font-mono); color: var(--t-muted); text-decoration: none; }
.t-seg > a:hover { color: var(--t-ink); }
.t-seg > a[aria-current="page"] { background: var(--t-surface-2); color: var(--t-ink); }
.t-seg > a:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.t-input { border-radius: var(--t-radius-md); min-height: 42px; font-size: 15px; background: var(--t-bg); }
.t-input:focus { box-shadow: 0 0 0 3px var(--t-accent-soft); }
.t-label { font-size: 13.5px; font-weight: 500; }
.t-base :focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }

/* header */
header.bar { position: sticky; top: 0; z-index: 70; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--t-bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--t-line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand svg { width: 22px; height: 22px; }
.bar nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); font-size: 14px; }
.bar nav a.l { text-decoration: none; color: var(--t-muted); white-space: nowrap; transition: color var(--t-fast); }
.bar nav a.l:hover, .bar nav a.l[aria-current] { color: var(--t-ink); }

/* footer */
footer { border-top: 1px solid var(--t-line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 13.5px; color: var(--t-muted); }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: end; }
footer .links a { text-decoration: none; }
footer .links a:hover { color: var(--t-ink); }
footer .note { grid-column: 1 / -1; font-size: 12.5px; color: var(--t-faint); }
@media (max-width: 620px) {
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  footer .links { justify-content: start; }
}

/* theme toggle (sun shows in dark mode, moon in light mode); logic in theme.js */
.theme-btn { all: unset; box-sizing: border-box; width: 32px; height: 32px; flex: none; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--t-line); border-radius: var(--t-radius-md); background: var(--t-surface); color: var(--t-muted);
  transition: color var(--t-fast), border-color var(--t-fast); }
.theme-btn:hover { color: var(--t-ink); border-color: var(--t-line-strong); }
.theme-btn:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: block; }
}
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }

