/* Alzam Interactive – main site styles. Design notes: .dev/design.md */

:root {
  --paper: #F6F6FA;
  --surface: #FFFFFF;
  --ink: #15163A;
  --body: #474964;
  --muted: #626580;
  --violet: #5446C9;
  --violet-dark: #4135A8;
  --lavender: #9184D9;
  --lavender-soft: #E7E4F8;
  --teal: #148A83;
  --amber: #B7791F;
  --line: #DCDCE8;
  --night: #121331;
  --night-text: #C9CAE0;
  --sports: #F41E5A;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 10px;
  --section: clamp(72px, 9vw, 112px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "ss01" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 1.7rem + 3vw, 4rem); letter-spacing: -0.035em; line-height: 1.03; }
h2 { font-size: clamp(2rem, 1.5rem + 1.9vw, 2.75rem); }
h3 { font-size: 1.375rem; letter-spacing: -0.015em; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; }

a { color: var(--violet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--violet-dark); }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 16px; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.lead { font-size: 1.25rem; line-height: 1.55; color: var(--body); max-width: 36em; }
.measure { max-width: 38em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border-radius: 8px; border: 1.5px solid transparent;
  font: 600 1rem/1.2 var(--font); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-dark); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: #B9BAD0; }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--night); }
.btn-light:hover { background: var(--lavender-soft); color: var(--night); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 246, 250, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.brand-name span { font-weight: 400; color: var(--muted); }

.nav-list { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-list a {
  display: inline-block; padding: 10px 14px; border-radius: 8px;
  color: var(--ink); font-weight: 500; font-size: 1rem; text-decoration: none;
}
.nav-list a:hover { background: var(--lavender-soft); color: var(--ink); }
.nav-list a[aria-current="page"] { color: var(--violet); }
.nav-cta { margin-left: 10px; }
.nav-cta .btn { min-height: 44px; padding: 10px 18px; color: #fff; white-space: nowrap; }
.nav-list .nav-cta a.btn:hover { background: var(--violet-dark); color: #fff; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 8px;
  background: transparent; border: 1.5px solid var(--line); color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 1100px) {
  .header-inner { flex-wrap: wrap; }
  .js .nav-toggle { display: inline-flex; }
  html:not(.js) .site-nav { width: 100%; padding-bottom: 12px; }
  html:not(.js) .nav-list { flex-wrap: wrap; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .js .nav-list a { display: block; padding: 14px 8px; font-size: 1.125rem; }
  .js .nav-cta { margin: 12px 0 0; }
  .js .nav-cta .btn { width: 100%; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section-tight { padding: calc(var(--section) * .6) 0; }
.section-head { display: grid; gap: 18px; max-width: 46rem; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head p { font-size: 1.125rem; color: var(--body); }
.rule-top { border-top: 1px solid var(--line); }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-copy { display: grid; gap: 28px; align-content: start; }
.hero-kicker { font-weight: 600; color: var(--violet); font-size: 1rem; letter-spacing: -0.005em; }
.hero h1 { max-width: 12.5em; }
.hero .lead { max-width: 30em; }

.figures {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  margin-top: clamp(48px, 7vw, 80px); padding-top: 28px; border-top: 1px solid var(--line);
}
.figure { display: grid; gap: 4px; }
.figure strong { color: var(--ink); font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.figure span { color: var(--muted); font-size: .9375rem; line-height: 1.4; }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 680px; }
  .hero h1 { max-width: 13em; }
}
@media (max-width: 640px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
}

/* Hero schematic: many systems, one record */
.schematic { width: 100%; height: auto; overflow: visible; }
.schematic .chip-box { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.schematic .chip-name { fill: var(--ink); font: 600 13px var(--font); }
.schematic .chip-frag { fill: var(--muted); font: 400 12px var(--font); }
.schematic .flow { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.schematic .flow-trunk { fill: none; stroke: var(--violet); stroke-width: 2.4; stroke-linecap: round; }
.schematic .record-box { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.schematic .record-head { fill: var(--ink); }
.schematic .record-title { fill: #fff; font: 600 13px var(--font); }
.schematic .record-sub { fill: var(--lavender); font: 400 11.5px var(--font); }
.schematic .record-account { fill: var(--ink); font: 700 17px var(--font); letter-spacing: -0.02em; }
.schematic .row-label { fill: var(--muted); font: 400 12.5px var(--font); }
.schematic .row-value { fill: var(--ink); font: 600 13.5px var(--font); }
.schematic .row-line { stroke: var(--line); stroke-width: 1; }
.schematic .merge-node { fill: var(--violet); }
.schematic .merge-ring { fill: none; stroke: var(--violet); stroke-width: 1.5; opacity: .35; }

@media (prefers-reduced-motion: no-preference) {
  .js .schematic .flow, .js .schematic .flow-trunk {
    stroke-dasharray: 100; stroke-dashoffset: 100;
    animation: draw 1.1s cubic-bezier(.6, 0, .2, 1) forwards;
    animation-delay: var(--d, 0s);
  }
  .js .schematic .chip { opacity: 0; animation: fade .5s ease forwards; animation-delay: var(--d, 0s); }
  .js .schematic .record-row { opacity: 0; animation: fade .45s ease forwards; animation-delay: var(--d, 1.4s); }
  .js .schematic .merge-ring { animation: pulse 2.6s ease-out 2.4s 2 both; transform-box: fill-box; transform-origin: center; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.4); opacity: 0; } }

/* ---------- Services list (home + services) ---------- */
.disciplines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.discipline {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 20px;
  padding: 32px 0; border-top: 1px solid var(--line);
  color: inherit; text-decoration: none; align-content: start;
}
.discipline .icon { grid-row: span 3; width: 48px; height: 48px; color: var(--violet); }
.discipline h3 { transition: color .15s ease; }
.discipline p { color: var(--body); }
.discipline .more { margin-top: 10px; font-weight: 600; font-size: 1rem; color: var(--violet); }
a.discipline:hover h3 { color: var(--violet); }
@media (max-width: 760px) { .disciplines { grid-template-columns: 1fr; } }

/* ---------- Split (text + diagram) ---------- */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.split-copy { display: grid; gap: 22px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }


/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px); }
.principle { display: grid; gap: 12px; align-content: start; }
.principle svg { width: 32px; height: 32px; color: var(--teal); }
.principle h3 { font-size: 1.1875rem; }
.principle p { font-size: 1rem; line-height: 1.6; }
@media (max-width: 960px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Process (a real sequence, so it is numbered) ---------- */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.process li { position: relative; padding: 0 28px 0 0; display: grid; gap: 10px; align-content: start; }
.process li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--violet); color: var(--violet);
  font-weight: 700; font-size: 1rem; position: relative; z-index: 1; margin-bottom: 10px;
}
.process li::after {
  content: ""; position: absolute; top: 20px; left: 40px; right: 0; height: 1.5px; background: var(--line);
}
.process li:last-child::after { display: none; }
.process h3 { font-size: 1.25rem; }
.process p { font-size: 1rem; }
@media (max-width: 860px) {
  .process { grid-template-columns: 1fr; gap: 28px; }
  .process li { padding: 0 0 0 64px; }
  .process li::before { position: absolute; left: 0; top: 0; margin: 0; }
  .process li::after { top: 40px; bottom: -28px; left: 20px; right: auto; width: 1.5px; height: auto; }
}

/* ---------- Closing call to action ---------- */
.cta-band { background: var(--night); color: var(--night-text); }
.cta-band .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 64px; align-items: end; padding-top: clamp(64px, 8vw, 104px); padding-bottom: clamp(64px, 8vw, 104px); }
.cta-band h2 { color: #fff; max-width: 14em; }
.cta-band p { margin-top: 18px; max-width: 34em; font-size: 1.125rem; }
@media (max-width: 760px) { .cta-band .container { grid-template-columns: 1fr; align-items: start; } }

/* ---------- Page heads (inner pages) ---------- */
.page-head { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.page-head .container { display: grid; gap: 24px; }
.page-head h1 { max-width: 15em; font-size: clamp(2.375rem, 1.6rem + 3vw, 3.75rem); }
.page-head .lead { max-width: 38em; }

/* ---------- Services page ---------- */
.services-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.toc { position: sticky; top: 100px; display: grid; gap: 4px; }
.toc p { font-size: .9375rem; color: var(--muted); margin-bottom: 8px; }
.toc a { display: block; padding: 8px 0 8px 14px; border-left: 2px solid var(--line); color: var(--body); text-decoration: none; font-weight: 500; font-size: 1rem; }
.toc a:hover, .toc a.is-active { border-left-color: var(--violet); color: var(--ink); }
.service { display: grid; gap: 20px; padding: 0 0 clamp(56px, 7vw, 88px); margin-bottom: clamp(56px, 7vw, 88px); border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.service:last-child { border-bottom: 0; margin-bottom: 0; }
.service-title { display: flex; align-items: center; gap: 16px; }
.service-title svg { width: 44px; height: 44px; color: var(--violet); flex: none; }
.service h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); }
.service .lead { font-size: 1.1875rem; }
.service h3 { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-top: 8px; }
.ticks { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink); font-weight: 500; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--lavender-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.2 2.2 4.8-5' fill='none' stroke='%235446C9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
@media (max-width: 900px) {
  .services-layout { grid-template-columns: 1fr; }
  .toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .toc p { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .ticks { grid-template-columns: 1fr; } .toc { display: none; } }

/* ---------- About ---------- */
.mission { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.mission h2 { max-width: 10em; }
.mission p { font-size: 1.1875rem; }
@media (max-width: 860px) { .mission { grid-template-columns: 1fr; } }

.leader { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.leader-photo { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--lavender-soft); }
.leader-photo img { width: 100%; height: 100%; object-fit: cover; }
.leader-copy { display: grid; gap: 16px; max-width: 40em; }
.leader-role { color: var(--violet); font-weight: 600; }
.leader-links { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 600; }
@media (max-width: 720px) { .leader { grid-template-columns: 1fr; } .leader-photo { max-width: 240px; } }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 16px; }
.facts dt { color: var(--muted); font-size: .9375rem; }
.facts dd { margin: 4px 0 0; color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field label { color: var(--ink); font-weight: 600; font-size: 1rem; }
.field label .req { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 1rem/1.4 var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid #8A8CA6; border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2315163A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center/16px no-repeat;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #6E7090; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(84, 70, 201, .18); }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-note { font-size: .9375rem; color: var(--muted); }
.form-status { grid-column: 1 / -1; padding: 14px 16px; border-radius: 8px; font-weight: 500; }
.form-status--ok { background: #E3F4F1; color: #0B5B56; }
.form-status--error { background: #FBE7EA; color: #8E1630; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

.details { display: grid; gap: 28px; }
.details h2 { font-size: 1.375rem; }
.detail { display: grid; gap: 4px; }
.detail dt { color: var(--muted); font-size: .9375rem; }
.detail dd { margin: 0; color: var(--ink); font-weight: 600; }
.detail dd a { color: var(--ink); }
.detail dd a:hover { color: var(--violet); }
.aside-note { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 1rem; }

/* ---------- Legal ---------- */
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.5rem; margin: 48px 0 14px; }
.prose p, .prose li { margin: 0 0 14px; }
.prose ul { padding-left: 1.25em; margin-bottom: 14px; }
.prose .updated { color: var(--muted); font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--night-text); font-size: 1rem; }
.cta-band + .site-footer .footer-top { border-top: 1px solid rgba(255,255,255,.08); }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding: 64px 0 48px; }
.footer-brand { display: grid; gap: 16px; align-content: start; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-name span { color: var(--night-text); }
.footer-brand p { max-width: 22em; }
.site-footer h2 { color: #fff; font-size: 1rem; letter-spacing: 0; margin-bottom: 14px; }
.footer-links { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: var(--night-text); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer address { font-style: normal; display: grid; gap: 8px; }

.sports-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: center;
  margin-top: 8px; padding: 14px 18px; border-radius: 10px; max-width: 340px;
  background: #D30F48; color: #fff !important; text-decoration: none !important;
  transition: background-color .15s ease, transform .15s ease;
}
.sports-link:hover { background: #B00C3C; }
.sports-link svg { grid-row: span 2; width: 30px; height: 30px; }
.sports-link strong { font-size: 1.0625rem; font-weight: 700; line-height: 1.2; }
.sports-link small { font-size: .875rem; line-height: 1.3; color: #fff; }

.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; padding: 22px 0 32px; border-top: 1px solid rgba(255,255,255,.1); font-size: .9375rem; }
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; }
@media (max-width: 960px) { .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: grid; align-content: center; gap: 22px; padding-block: 96px; }

.flush-top { padding-top: 0; }
.detail-list { display: grid; gap: 22px; margin: 0; }

/* ---------- Insights ---------- */
.posts { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.post { display: grid; gap: 10px; padding: 32px 0; border-top: 1px solid var(--line); align-content: start; }
.post h2, .post h3 { font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.2; }
.posts-compact .post h3 { font-size: 1.1875rem; }
.post h2 a, .post h3 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover, .post h3 a:hover { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1.5px; }
.post p { color: var(--body); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: .9375rem; color: var(--muted); }
.post-cat { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--lavender-soft); color: var(--violet-dark); font-weight: 600; }
.post-back { font-weight: 600; }
.posts-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.more-title { font-size: 1.5rem; margin-bottom: 8px; }
.article-head h1 { max-width: 18em; }
.article-body { font-size: 1.125rem; line-height: 1.7; }
.article-body h2 { font-size: 1.625rem; margin: 52px 0 16px; }
.article-body h3 { font-size: 1.25rem; margin: 36px 0 12px; }
.article-body p, .article-body li { color: var(--body); }
.article-body strong { color: var(--ink); }
.article-body ol { padding-left: 1.4em; margin: 0 0 18px; }
.article-body li { margin-bottom: 10px; }
@media (max-width: 900px) { .posts, .posts-compact { grid-template-columns: 1fr; } }

/* Phones get the compact hero diagram */
.schematic-m { display: none; }
.schematic .m-name { font-size: 14px; }
.schematic .m-label { font-size: 12px; }
.schematic .m-value { font-size: 13px; }
.schematic .m-account { font-size: 15px; }
@media (max-width: 600px) {
  .schematic:not(.schematic-m) { display: none; }
  .schematic-m { display: block; max-width: 420px; }
}

/* Review fixes */
[id] { scroll-margin-top: 96px; }
.site-footer :focus-visible, .cta-band :focus-visible { outline-color: #fff; }
.discipline { position: relative; }
.discipline h3 a { color: inherit; text-decoration: none; }
.discipline h3 a::after { content: ""; position: absolute; inset: 0; }
.discipline:hover h3 a { color: var(--violet); }
.discipline:focus-within { outline: 3px solid var(--violet); outline-offset: 6px; border-radius: 6px; }
.discipline h3 a:focus-visible { outline: none; }

/* Architecture layers (HTML, so it reflows on phones) */
.layers { margin: 0; display: grid; gap: 30px; }
.layer { position: relative; display: grid; gap: 6px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.layer + .layer::before, .layer-outputs::before {
  content: ""; position: absolute; left: 50%; top: -31px; width: 1.6px; height: 22px; background: var(--lavender);
}
.layer + .layer::after, .layer-outputs::after {
  content: ""; position: absolute; left: calc(50% - 5px); top: -11px; border: 5px solid transparent; border-top: 7px solid var(--lavender);
}
.layer-model { background: var(--lavender-soft); border-color: var(--lavender); }
.layer-title { color: var(--ink); font-weight: 600; font-size: 1rem; }
.layer-note { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.layer-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.layer-tags li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--body); font-size: .875rem; font-weight: 500; }
.layer-outputs { position: relative; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.layer-outputs li { display: grid; place-items: center; text-align: center; min-height: 76px; padding: 12px; border-radius: var(--radius); background: var(--ink); color: #fff; font-weight: 600; font-size: .9375rem; line-height: 1.3; }
@media (max-width: 480px) { .layer-outputs { grid-template-columns: 1fr; } .layer-outputs li { min-height: 52px; } }

/* Articles: list markers without the stylistic set, text column with a side note */
.article-body ol li::marker { font-feature-settings: normal; }
.byline { color: var(--muted); font-size: 1rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 44rem) minmax(0, 300px); justify-content: space-between; gap: 64px; align-items: start; }
.article-aside { position: sticky; top: 108px; display: grid; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 1rem; }
.aside-title { color: var(--ink); font-weight: 700; font-size: 1.125rem; line-height: 1.3; }
@media (max-width: 1000px) { .article-layout { grid-template-columns: 1fr; } .article-aside { position: static; max-width: 44rem; } }

/* ---------- Company Brain ---------- */
.flagship { background: var(--night); color: var(--night-text); padding: clamp(64px, 8vw, 104px) 0; }
.flagship-head { display: grid; gap: 18px; max-width: 46rem; margin-bottom: clamp(32px, 4vw, 48px); }
.flagship-kicker { color: var(--lavender); font-weight: 600; }
.flagship h2 { color: #fff; font-size: clamp(2rem, 1.5rem + 1.9vw, 2.75rem); }
.flagship-lead { font-size: 1.125rem; max-width: 40em; }
.flagship :focus-visible { outline-color: #fff; }
.trust { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(28px, 4vw, 48px); }
.trust li { padding: 24px 0; border-top: 1px solid var(--line); font-size: 1rem; }
.trust strong { display: block; color: var(--ink); font-size: 1.125rem; margin-bottom: 6px; }
@media (max-width: 900px) { .trust { grid-template-columns: 1fr; } }
.brain-fallback { padding: 40px; border-radius: 16px; background: #0B0C24; color: var(--night-text); }

/* ---------- Privacy: cookie table (stacks into cards on phones) ---------- */
.cookie-table-wrap { margin: 8px 0 22px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.cookie-table caption { text-align: left; color: var(--ink); font-weight: 600; padding-bottom: 10px; }
.cookie-table th, .cookie-table td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-top: 1px solid var(--line); }
.cookie-table thead th { padding-top: 0; border-top: 0; color: var(--muted); font-size: .875rem; font-weight: 600; }
.cookie-table tbody th { color: var(--ink); font-weight: 600; }
.cookie-table th:last-child, .cookie-table td:last-child { padding-right: 0; }
.cookie-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; color: var(--ink); background: var(--lavender-soft); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.cookie-kind { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; font-weight: 400; }
@media (max-width: 720px) {
  .cookie-table, .cookie-table tbody, .cookie-table tr, .cookie-table th, .cookie-table td { display: block; }
  .cookie-table caption { display: block; }
  .cookie-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .cookie-table tbody tr { padding: 14px 0; border-top: 1px solid var(--line); }
  .cookie-table tbody th, .cookie-table td { padding: 3px 0; border-top: 0; }
  .cookie-table tbody th { margin-bottom: 4px; }
  .cookie-table .cookie-kind { display: inline; margin: 0 0 0 8px; }
  .cookie-table td::before { content: attr(data-label) ": "; content: attr(data-label) ": " / ""; color: var(--ink); font-weight: 600; }
}
