/* ============================================================
   OmniTechnicus — editorial-technical design system
   Shared across every page. Direction: Pragmatic Engineer /
   Stripe Press register. One accent (brand blue), used sparingly.
   Dark is the default theme; light is a first-class peer, toggle persisted.
   ------------------------------------------------------------
   Brand blue = neural navy #1F3B73 (light), brightened to #3d8bfd
   on dark. To re-tune the accent change only --accent / --accent-ink
   / --accent-wash in both themes below.
   ============================================================ */

:root {
  /* light — primary design, cool paper + deep ink */
  --bg:        oklch(98.6% 0.003 250);
  --bg-2:      oklch(96.5% 0.004 250);
  --surface:   oklch(100% 0 0);
  --fg:        oklch(23% 0.02 264);
  --fg-soft:   oklch(34% 0.018 264);
  --muted:     oklch(52% 0.015 264);
  --faint:     oklch(64% 0.012 264);
  --border:    oklch(90% 0.006 264);
  --border-2:  oklch(85% 0.008 264);
  --accent:    #1F3B73;
  --accent-ink: #162a52;
  --accent-wash: color-mix(in oklab, #1F3B73 10%, transparent);
  --ok:        oklch(58% 0.13 155);
  --shadow:    0 1px 2px oklch(23% 0.02 264 / 0.04), 0 8px 28px oklch(23% 0.02 264 / 0.06);

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1160px;
  --wrap-narrow: 720px;
  --gut: clamp(20px, 5vw, 64px);
}

[data-theme="dark"] {
  --bg:        oklch(17.5% 0.014 264);
  --bg-2:      oklch(20.5% 0.016 264);
  --surface:   oklch(22% 0.018 264);
  --fg:        oklch(95% 0.005 250);
  --fg-soft:   oklch(86% 0.008 250);
  --muted:     oklch(70% 0.012 264);
  --faint:     oklch(58% 0.013 264);
  --border:    oklch(30% 0.018 264);
  --border-2:  oklch(36% 0.02 264);
  --accent:    #3d8bfd;
  --accent-ink: #6ea8fe;
  --accent-wash: color-mix(in oklab, #3d8bfd 16%, transparent);
  --ok:        oklch(74% 0.15 155);
  --shadow:    0 1px 2px oklch(0% 0 0 / 0.3), 0 12px 36px oklch(0% 0 0 / 0.36);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .35s ease, color .35s ease;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding-inline: var(--gut); }

a { 
  text-decoration: none;
}

.page-link { 
  color: var(--accent); 
  text-decoration: none;
  transition: color .16s ease;
}

.page-link:hover { 
  color: var(--fg);
}

::selection { background: var(--accent-wash); }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3rem);    letter-spacing: -0.022em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em;  }
h3 { font-size: 1.375rem;    letter-spacing: -0.015em; }
h4 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
h5 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 32px; height: 80px; }
.brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 20px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
}
.header__logo-text {
  font-family: 'Orbitron', var(--font-body);
  font-size: 24px;
  letter-spacing: 0.05em;
  color: var(--accent);
  transition: color .18s ease;
}
.brand:hover .header__logo-text { color: var(--accent); }
.brand[aria-current="page"] .header__logo-text { color: var(--accent); }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash);
}
.nav nav { display: flex; gap: 26px; margin-left: auto; font-size: 14.5px; font-weight: 500; }
.nav nav a {
  font-family: 'Orbitron', var(--font-body);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-soft);
  position: relative;
  padding: 4px 0;
  transition: color .18s ease;
}
.nav nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--accent); transition: width .22s ease;
}
.nav nav a:hover { color: var(--fg); }
.nav nav a:hover::after,
.nav nav a[aria-current="page"]::after { width: 100%; }
.nav nav a[aria-current="page"] { color: var(--fg); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border-2); background: var(--surface);
  color: var(--fg-soft); cursor: pointer; display: grid; place-items: center;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }

.menu-toggle { display: none; width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--fg-soft);
  cursor: pointer; place-items: center; }
.menu-toggle svg { width: 18px; height: 18px; }

@media (max-width: 680px) {
  .nav { gap: 8px; padding-inline: 0px; }
  .nav nav {
    position: absolute; top: 80px; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px var(--gut) 16px; display: none;
  }
  .nav nav.open { display: flex; }
  .nav nav a { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .menu-toggle { display: grid; margin-left: auto; }
  .theme-toggle { order: 3; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 48px; padding: 0 24px; border-radius: 10px;
  font-weight: 500; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  transition: transform .16s ease, background .2s ease, border-color .2s ease, color .2s ease;
  text-decoration: none;
}
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: oklch(100% 0 0); }
[data-theme="dark"] .btn-primary { color: oklch(17.5% 0.014 264); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--surface); border-color: var(--border-2); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- section scaffolding ---------- */
section.band { padding: clamp(32px, 5vh, 56px) 0; border-top: 1px solid var(--border); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.sec-head a { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: color .18s ease; }
.sec-head a:hover { color: var(--accent); }
.sec-head a .arr { transition: transform .2s ease; }
.sec-head a:hover .arr { transform: translateX(3px); }

/* ---------- page hero (subpage header) ---------- */
.page-hero { padding: clamp(28px, 4vh, 48px) 0 clamp(36px, 6vh, 64px); }
.page-hero .kicker {
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-family: 'Orbitron', var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-hero .kicker .line { width: 34px; height: 1px; background: var(--border-2); display: inline-block; }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.022em;
  max-width: 18ch; margin-bottom: 22px; text-wrap: balance;
}
.page-hero p.dek { font-size: clamp(1.02rem, 1.0vw, 1.22rem); line-height: 1.55; color: var(--fg-soft); max-width: 60ch; text-wrap: pretty; }

/* ---------- pills / chips ---------- */
.pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-wash); padding: 3px 9px; border-radius: 999px; font-weight: 500;
}
.chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--fg-soft); border: 1px solid var(--border-2); padding: 3px 9px; border-radius: 6px;
}
.dotsep { color: var(--faint); }
.part-badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.meta { color: var(--muted); }

/* ---------- read-list (article rows) ---------- */
.read-list { display: flex; flex-direction: column; }
.read-item { display: block; padding: 22px 4px; border-bottom: 1px solid var(--border); }
.read-item:first-child { padding-top: 0; }
.read-item:last-child { border-bottom: 0; }
.read-item .tag-row { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.read-item h4 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.28rem; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 6px;
  transition: color .18s ease;
}
.read-item:hover h4 { color: var(--accent-ink); }
.read-item p { color: var(--muted); font-size: 0.94rem; max-width: 64ch; }

/* ---------- project cards ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px) { .proj-grid { grid-template-columns: 1fr; } }
.proj {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .22s ease, border-color .22s ease;
}
.proj:hover { transform: translateY(-3px); border-color: var(--border-2); }
.proj .shot {
  height: 72px; position: relative;
  background:
    repeating-linear-gradient(45deg, transparent 0 11px, color-mix(in oklab, var(--fg) 4%, transparent) 11px 12px),
    var(--bg-2);
  border-bottom: 1px solid var(--border); display: grid; place-items: center;
}
.proj .shot .label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint);
  border: 1px dashed var(--border-2); padding: 6px 12px; border-radius: 7px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.proj .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proj h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; letter-spacing: -0.01em; }
.proj h3 a { color: inherit; text-decoration: none; }
.proj h3 a:hover { color: var(--accent-ink); }
.proj p { color: var(--muted); font-size: 0.93rem; flex: 1; }
.proj .stack { display: flex; flex-wrap: wrap; gap: 7px; }

/* status dot */
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.status .d { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.production .d { background: var(--ok); }
.status.educational .d { background: var(--accent); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--border); padding: 20px 0 14px; background: var(--bg-2); }
.foot-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.foot-brand { max-width: 30ch; }
.foot-brand .brand { margin-bottom: 4px; gap: 7px; }
.foot-brand .footer__logo-text {
  font-family: 'Orbitron', var(--font-body);
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.foot-brand .brand:hover .footer__logo-text,
.foot-brand .brand[aria-current="page"] .footer__logo-text {
  color: var(--accent);
}
.foot-brand p { color: var(--muted); font-size: 13px; }
.foot-cols { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-col h5 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.foot-col a { display: block; color: var(--fg-soft); font-size: 13px; padding: 2px 0; transition: color .16s ease; }
.foot-col a:hover { color: var(--accent); }
.foot-col.inline-links { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.foot-col.inline-links h5 { margin-bottom: 0; margin-right: 4px; }
.foot-col.inline-links a { display: inline-block; padding: 0; }
.foot-bottom { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.foot-bottom p { color: var(--muted); font-size: 12px; }

/* ---------- focus-visible ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- feature card & article grid (articles, reviews, index) ---------- */
.feature {
  position: relative; cursor: pointer;
  display: grid; grid-template-columns: 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); margin-bottom: 14px;
}
.feature .copy { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.feature .copy .tag-row { display: flex; gap: 10px; align-items: center; }
.feature .copy h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.feature .copy h2 a::after { content: ''; position: absolute; inset: 0; }
.feature .copy h2 a:hover { color: var(--accent-ink); }
.feature .copy p { color: var(--fg-soft); text-wrap: pretty; }
.article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .article-grid { grid-template-columns: 1fr; } }
.article-card {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px; padding: 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  transition: background .18s ease, border-color .18s ease;
}
.article-card:hover { background: var(--bg-2); border-color: var(--border-2); }
.article-card .tag-row { display: flex; gap: 10px; align-items: center; }
.article-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.42rem; line-height: 1.16; letter-spacing: -0.015em; text-wrap: balance; }
.article-card h3 a { transition: color .16s ease; }
.article-card h3 a::after { content: ''; position: absolute; inset: 0; }
.article-card:hover h3 a { color: var(--accent-ink); }
.article-card p { color: var(--muted); font-size: 0.96rem; flex: 1; text-wrap: pretty; }
.article-card .meta { font-size: 12px; }
.article-card.hide { display: none; }
.empty { padding: 40px; text-align: center; color: var(--muted); display: none; }

/* ---------- shared filter UI (articles, media, projects, ai-trends) ---------- */
.filter {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--fg-soft); cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .filter[aria-checked="true"] { color: oklch(17.5% 0.014 264); }
.section { padding-bottom: clamp(56px, 8vh, 96px); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  [data-anim] { animation: none !important; }
}
