/* Digi.Tech base: tokens, type, page frame */
:root {
  --bg: #f1f2fb;
  --surface: #ffffff;
  --ink: #17163f;
  --muted: #55567c;
  --line: #cdd0ea;
  --brand: #3a2df0;
  --brand-ink: #ffffff;
  --mark: #ffd43a;
  --mark-ink: #17163f;
  --ok: #0a7f61;
  --bad: #b81f55;
  --c-security: #b81f55;
  --c-text: #3a2df0;
  --c-developer: #0a7f61;
  --c-web-and-seo: #c2560a;
  --c-media: #7b2ff7;
  --c-network: #0a6fb8;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --r: 6px;
  --wrap: 1180px;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0e0e2a;
  --surface: #181840;
  --ink: #ecedfb;
  --muted: #a9abd2;
  --line: #303170;
  --brand: #a39dff;
  --brand-ink: #0e0e2a;
  --ok: #45dfb5;
  --bad: #ff85ae;
  --c-security: #ff85ae;
  --c-text: #a39dff;
  --c-developer: #45dfb5;
  --c-web-and-seo: #ffa25e;
  --c-media: #c9a3ff;
  --c-network: #6cc4ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e0e2a;
    --surface: #181840;
    --ink: #ecedfb;
    --muted: #a9abd2;
    --line: #303170;
    --brand: #a39dff;
    --brand-ink: #0e0e2a;
    --ok: #45dfb5;
    --bad: #ff85ae;
    --c-security: #ff85ae;
    --c-text: #a39dff;
    --c-developer: #45dfb5;
    --c-web-and-seo: #ffa25e;
    --c-media: #c9a3ff;
    --c-network: #6cc4ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-wrap: break-word;
}
img, svg, iframe, canvas { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.15rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* Contact bar on every page */
.topbar {
  display: block;
  background: var(--mark);
  color: var(--mark-ink);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
  padding: 0.5rem 1rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.topbar:hover { background: #ffe066; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; }
.logo { font: 800 1.55rem/1 var(--display); letter-spacing: -0.04em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; }
.logo i { display: inline-block; width: 0.3em; height: 0.3em; margin: 0 0.07em; background: var(--mark); box-shadow: 0 0 0 1.5px var(--ink); }
.nav { display: flex; gap: 0.2rem; margin-right: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem; padding: 0.45rem 0.65rem; border-radius: var(--r); }
.nav a:hover { background: var(--surface); }
.nav a[aria-current='page'] { box-shadow: inset 0 -3px 0 var(--mark); }
.nav-toggle { display: none; }
.head-tools { display: flex; align-items: center; gap: 0.6rem; }
.search { position: relative; }
.search input { width: 15rem; max-width: 100%; }
.search-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(26rem, 92vw); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 0.35rem; z-index: 50;
}
.search-results a { display: block; padding: 0.5rem 0.65rem; border-radius: 4px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--bg); }
.search-results small { display: block; color: var(--muted); }
.search-results p { margin: 0.5rem 0.65rem; color: var(--muted); }
.icon-btn { width: 2.5rem; height: 2.5rem; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r); cursor: pointer; display: grid; place-items: center; }
.icon-btn span { width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }

@media (max-width: 1080px) {
  .search input { width: 10.5rem; }
  .head-tools .btn { display: none; }
}
@media (max-width: 820px) {
  .head-row { flex-wrap: wrap; padding-block: 0.5rem; gap: 0.6rem; }
  .nav-toggle { display: inline-block; margin-left: auto; font: 600 0.95rem var(--body); background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--r); padding: 0.5rem 0.8rem; }
  .nav { display: none; order: 5; width: 100%; flex-wrap: wrap; margin: 0; }
  .nav.open { display: flex; }
  .head-tools { order: 4; width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
}

/* Page frame */
.page { padding-block: clamp(1.75rem, 4vw, 3.25rem) clamp(2.5rem, 6vw, 4.5rem); }
.page:not(.page-wide) > * { max-width: 50rem; }
.page-head { margin-bottom: 1.75rem; }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--muted); max-width: 44rem; }
.meta, .crumbs { font-size: 0.92rem; color: var(--muted); }
.crumbs { margin-bottom: 1rem; }
.crumbs a { color: inherit; }
.bits { display: flex; gap: 4px; margin-top: 1.1rem; }
.bits b { width: 11px; height: 11px; border: 1.5px solid var(--ink); }
.bits b.on { background: var(--ink); }
.sec { padding-block: clamp(2.25rem, 5.5vw, 4.25rem); }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 0; color: var(--muted); max-width: 40rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2.5rem; margin-top: 2rem; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* Bands */
.band { padding-block: clamp(2rem, 5vw, 3.5rem); }
.band-brand { background: var(--brand); color: var(--brand-ink); }
.band-brand a { color: inherit; }
.band-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 3rem; align-items: center; }
.band-row h2 { margin-bottom: 0.3em; }
.band-row p { margin: 0; }
@media (max-width: 820px) { .band-row { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { background: #121136; color: #d9dbf3; padding-block: 3rem 2rem; font-size: 0.96rem; }
.site-foot a { color: #ffffff; }
.site-foot .logo { color: #ffffff; margin-bottom: 0.8rem; }
.site-foot .logo i { box-shadow: none; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; }
.foot-grid h2 { font: 700 1rem var(--body); letter-spacing: 0; color: #ffffff; margin-bottom: 0.7rem; }
.foot-grid nav a { display: block; padding: 0.22rem 0; text-decoration: none; color: #d9dbf3; }
.foot-grid nav a:hover { color: #ffffff; text-decoration: underline; }
.foot-legal { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid #34357a; font-size: 0.86rem; line-height: 1.55; color: #b9bbe0; }
.site-foot .btn-line { border-color: #ffffff; color: #ffffff; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* Cookie notice */
.cookie { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: 26rem; background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 1rem; display: flex; gap: 1rem; align-items: center; font-size: 0.92rem; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }

/* Adjustments layered over ui.css */
section.gloss-letter h2 { margin: 2rem 0 0.4rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--ink); scroll-margin-top: 6rem; }
div.t-canvas { justify-self: start; }
ul.cards { grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .site-head, .band, .site-foot, .cookie, .ad, .side { display: none !important; } body { background: #fff; color: #000; } }
