@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === DESIGN TOKENS === */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #252838;
  --border: rgba(255,255,255,0.08);
  --text: #e8eaf0;
  --text-muted: #8b90a0;
  --accent: #00c9a7;
  --accent-hover: #00e5be;
  --accent-dim: rgba(0,201,167,0.12);
  --nav-h: 64px;
  --max-w: 1120px;
  --radius: 8px;
  --radius-lg: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* === LAYOUT === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* === NAV === */
.site-header {
  position: sticky;
  top: 0;
  /* Must stay above .a11y-widget's z-index (see accessibility block below):
     .nav-links is a descendant of .site-header, and position:fixed on a
     descendant doesn't escape an ancestor's stacking context — so the mobile
     nav dropdown's actual paint order is capped by .site-header's z-index
     here, not its own. Without this, the accessibility widget (mounted
     directly on <body>, outside the header) would render on top of the open
     mobile nav whenever positioned at a top corner. */
  z-index: 300;
  height: var(--nav-h);
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--text); }
.nav-logo img { height: 32px; width: auto; }
.nav-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #0f1117;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links li > a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links li > a:hover,
.nav-links li > a.active { color: var(--text); }
.nav-links li:last-child > a {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.nav-links li:last-child > a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Logo hover easter egg (about.html only — GitHub issue #10). Hidden
   entirely outside hover-capable devices rather than just relying on the
   JS trigger never firing, so there's no dormant absolutely-positioned
   element left in touch layouts. min-width matches the mobile nav
   breakpoint below (768px) — js/about-easter-egg.js's own gate mirrors
   this exactly, since .nav-links is display:none/fixed under it and the
   JS's gap-centering math would misfire against that layout. Positioned
   via JS at the true midpoint between the logo and the nav links, so this
   rule only owns sizing/animation, not placement. */
.logo-easter-egg {
  display: none;
}
@media (hover: hover) and (min-width: 769px) {
  .logo-easter-egg {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    height: calc(var(--nav-h) - 22px);
    width: auto;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 600ms ease;
  }
  .logo-easter-egg.is-visible {
    opacity: 1;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #0f1117;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #0f1117;
}
.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  padding-left: 0;
}
.btn-ghost:hover { color: var(--text); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === HERO === */
.hero {
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.4rem, calc(5vw * var(--text-scale, 1)), 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
  max-width: 20ch;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 54ch;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}
.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* === TWO-PATH CARDS === */
.paths {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}
.paths-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.path-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.2s;
  color: inherit;
}
.path-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}
.path-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.path-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.path-card p {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.65;
  flex: 1;
}
.path-link {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
}

/* === TRUST STRIP === */
.trust {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--border);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.trust-item { text-align: center; }
.trust-number {
  font-size: clamp(2rem, calc(4vw * var(--text-scale, 1)), 2.8rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}
.trust-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === PAGE HERO (inner pages) === */
.page-hero {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-size: clamp(1.9rem, calc(4vw * var(--text-scale, 1)), 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}
.page-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 55ch;
  line-height: 1.7;
}

/* === CONTENT SECTIONS === */
.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section h2 {
  font-size: clamp(1.4rem, calc(3vw * var(--text-scale, 1)), 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.section-intro {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* === SERVICE CARDS === */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .service-grid .service-card:nth-child(4) {
    grid-column: 2;
  }
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
}
.service-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1rem;
}
.service-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}
.service-card ul {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.service-card ul li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 0.9rem;
  position: relative;
}
.service-card ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* === PRODUCT CARDS === */
.product-grid {
  display: grid;
  gap: 1.25rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: start;
}
.product-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.product-card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.product-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.product-card.product-concept {
  background: transparent;
  border-style: dashed;
  border-color: rgba(255,255,255,0.06);
}

/* === STATUS TAGS === */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--prod {
  background: rgba(0,201,167,0.15);
  color: var(--accent);
}
.tag--dev {
  background: rgba(255,186,0,0.12);
  color: #ffba00;
}
.tag--concept {
  background: rgba(139,144,160,0.1);
  color: var(--text-muted);
}

/* === BIO / ABOUT === */
.bio-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}
.bio-body p {
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1.25rem;
  font-size: 1rem;
}
.bio-body p:last-child { margin-bottom: 0; }
.bio-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.bio-meta-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.bio-meta-item:last-child { border-bottom: none; padding-bottom: 0; }
.bio-meta-item:first-child { padding-top: 0; }
.bio-meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.bio-meta-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* === CONTACT === */
.contact-form-wrap {
  max-width: 560px;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.925rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 140px; }
.form-note {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--accent);
  background: rgba(0,201,167,0.08);
  border: 1px solid rgba(0,201,167,0.2);
  margin-bottom: 1.25rem;
}
.form-status {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: none;
}
.form-status.success {
  background: rgba(0,201,167,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,201,167,0.2);
  display: block;
}
.form-status.error {
  background: rgba(255,100,100,0.08);
  color: #ff7070;
  border: 1px solid rgba(255,100,100,0.15);
  display: block;
}
/* === CTA BAND === */
.cta-band {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.cta-band h2 {
  font-size: clamp(1.4rem, calc(3vw * var(--text-scale, 1)), 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.cta-band p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: 1.75rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.footer-left,
.footer-right {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-right a { color: var(--text-muted); }
.footer-right a:hover { color: var(--accent); }

/* === PROBLEM SECTION === */
.problem-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}
.problem-body {
  max-width: 60ch;
}
.problem-body p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}
.problem-body p:last-child { margin-bottom: 0; }
.problem-body strong { color: var(--text); font-weight: 500; }

/* === HERO / PROBLEM VISUALS (GitHub issue #11) === */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.hero-visual {
  width: 100%;
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-visual svg { display: block; width: 100%; height: 100%; }

.problem-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.problem-row + .problem-row { margin-top: 2.5rem; }
.problem-row .problem-body p { margin-bottom: 0; }

.problem-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-sizing: border-box;
}
.visual-label {
  font-size: 0.7rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Visual 1: noise resolving into grid */
.noise-dot { animation: noiseToGrid 5s ease-in-out infinite; }
.noise-dot--soft { fill: var(--text-muted); opacity: 0.45; }
.noise-dot--mid { fill: var(--text-muted); opacity: 0.75; }
.grid-dot { fill: var(--accent); }
.grid-line { stroke: var(--accent); stroke-width: 1.5; animation: gridLineIn 5s ease-in-out infinite; }

@keyframes noiseToGrid {
  0%, 15% { transform: translate(0, 0); }
  60%, 100% { transform: translate(var(--dx), var(--dy)); }
}
@keyframes gridLineIn {
  0%, 55% { opacity: 0; }
  75%, 100% { opacity: 0.35; }
}

/* Visual 2: document with highlight building */
.doc-card { padding: 2rem; min-height: 256px; }
.doc-line {
  height: 10px;
  width: 70%;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  margin-bottom: 12px;
  transform-origin: left;
  animation: docLineGrow 4s ease-in-out infinite;
}
.doc-line-2 { width: 90%; animation-delay: 0.15s; }
.doc-line-3 { width: 50%; margin-bottom: 20px; animation-delay: 0.3s; }
.doc-line-tail { width: 65%; margin-top: 20px; margin-bottom: 0; animation-delay: 0.45s; }
.doc-highlight {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 6px;
  animation: highlightFade 4s ease-in-out infinite;
}
.doc-highlight-line {
  height: 8px;
  width: 85%;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 3px;
  margin-bottom: 8px;
}
.doc-highlight-line:last-child { width: 60%; margin-bottom: 0; }

@keyframes docLineGrow {
  0%, 10% { transform: scaleX(0); }
  45%, 100% { transform: scaleX(1); }
}
@keyframes highlightFade {
  0%, 55% { opacity: 0; transform: translateY(4px); }
  80%, 100% { opacity: 1; transform: translateY(0); }
}

/* Visual 3: risk timeline progressing */
.timeline-card {
  padding: 2.25rem 2rem;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.timeline-track {
  position: relative;
  height: 2px;
  margin: 0 8px;
  background: var(--border);
}
.timeline-track svg { position: absolute; top: 0; left: 0; width: 100%; height: 2px; overflow: visible; }
.timeline-line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 300; animation: lineDraw 4s ease-in-out infinite; }
.timeline-marker {
  position: absolute;
  top: -9px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  transform: translateX(-50%);
}
.marker-ok { left: 22%; background: var(--accent); animation: markerPulse 4s ease-in-out infinite 0.6s; }
.marker-incident { left: 78%; background: #e5534b; animation: flagPop 4s ease-in-out infinite; }
.timeline-tag {
  position: absolute;
  top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  transform: translateX(-50%);
}
.tag-ok { left: 22%; }
.tag-incident { left: 78%; }

@keyframes lineDraw {
  0% { stroke-dashoffset: 300; }
  70%, 100% { stroke-dashoffset: 0; }
}
@keyframes markerPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.15); }
}
@keyframes flagPop {
  0%, 60% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  85%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@media (max-width: 768px) {
  .hero-grid, .problem-row { grid-template-columns: 1fr; }
  .hero-visual, .problem-visual { display: none; }
  .problem-row + .problem-row { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .noise-dot { animation: none; transform: translate(var(--dx), var(--dy)); }
  .grid-line { animation: none; opacity: 0.35; }
  .doc-line { animation: none; transform: scaleX(1); }
  .doc-highlight { animation: none; opacity: 1; transform: translateY(0); }
  .timeline-line { animation: none; stroke-dashoffset: 0; }
  .timeline-marker { animation: none; }
  .marker-incident { opacity: 1; }
}

/* === PRODUCT SHOWCASE === */
.product-showcase {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  border-top: 1px solid var(--border);
}
.showcase-header {
  margin-bottom: 2.5rem;
  max-width: 58ch;
}
.showcase-header h2 {
  font-size: clamp(1.6rem, calc(3.5vw * var(--text-scale, 1)), 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}
.showcase-header p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* === LAYERS === */
.layers-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.layer-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.layer-item:last-child { border-bottom: none; }
.layer-item:hover { background: var(--surface-2); }
.layer-num {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.75rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  border-right: 1px solid var(--border);
  margin-top: 0.05rem;
}
.layer-body {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.layer-body-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.layer-body h3 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
}
.layer-body p {
  font-size: 0.865rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.layer-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(0,201,167,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,201,167,0.2);
}

/* === FOUNDING BLOCK === */
.founding-block {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid rgba(0,201,167,0.3);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.founding-block-copy h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.founding-block-copy p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 54ch;
}

/* === ALSO BUILDING === */
.also-building {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}
.also-building-header {
  margin-bottom: 1.5rem;
}
.also-building-header h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mini-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mini-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.mini-card p {
  font-size: 0.825rem;
  color: var(--text-muted);
  opacity: 0.65;
  line-height: 1.55;
  flex: 1;
}

/* === HOMEPAGE ABOUT === */
.home-about {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}
.home-about p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 54ch;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}
.home-about p:last-child { margin-bottom: 0; }

/* === BLOG === */
.post-grid {
  display: grid;
  gap: 1.25rem;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.post-card-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.post-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.post-card h3 a { color: inherit; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.post-card .tag { align-self: flex-start; }

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.post-content {
  max-width: 65ch;
}
.post-content p {
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1.25rem;
  font-size: 1.02rem;
}
.post-content h2 {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.post-content h3 {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}
.post-content ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}
.post-content ul li {
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 1rem;
  position: relative;
}
.post-content ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.post-content a { color: var(--accent); }

/* Floating back-to-blog button — same widget-chrome recipe as .a11y-toggle
   (fixed circle, --surface/--border/--accent, box-shadow), positioned
   top-left so it never collides with .a11y-widget's default bottom-right
   spot. If a reader has moved the a11y widget to top-left via its own
   data-pos setting, the two will overlap — an acceptable rare edge case
   rather than adding position-negotiation logic between two independent
   floating widgets. */
.back-fab {
  position: fixed;
  top: calc(var(--nav-h) + 1rem);
  left: 1.25rem;
  z-index: 150;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.back-fab:hover,
.back-fab:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.back-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem clamp(1rem, 4vw, 2rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li > a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child > a {
    border: none;
    border-bottom: none;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    color: var(--accent);
  }

  .paths-grid { grid-template-columns: 1fr; }
  .bio-grid { grid-template-columns: 1fr; gap: 2rem; }
  .product-card { grid-template-columns: 1fr; }
  .product-card-meta { align-items: flex-start; }
  .founding-block { flex-direction: column; align-items: flex-start; }
  .layer-item { grid-template-columns: 44px 1fr; }
  .layer-body { padding: 1.25rem 1.25rem; }
}

@media (max-width: 480px) {
  .trust-grid { gap: 1.25rem; }
  .trust-number { font-size: 1.8rem; }

  .a11y-widget { bottom: 1rem; right: 1rem; }
  .a11y-widget[data-pos="bottom-left"] { left: 1rem; }
  .back-fab { left: 1rem; }
  .a11y-widget[data-pos="top-right"],
  .a11y-widget[data-pos="top-left"] { top: calc(var(--nav-h) + 0.75rem); }
  .a11y-widget[data-pos="top-left"] { left: 1rem; }
}

/* === ACCESSIBILITY: TEXT PRESENTATION (GitHub issue #7) === */
/* Self-hosted so the switcher works even if Google Fonts is slow/blocked. */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/opendyslexic-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/opendyslexic-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Font choice reuses the existing --font custom property, so every
   component that already reads var(--font) picks it up with no
   per-component changes. */
html[data-font="atkinson"] { --font: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif; }
html[data-font="opendyslexic"] { --font: 'OpenDyslexic', system-ui, -apple-system, sans-serif; }
html[data-font="monospace"] { --font: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; }

/* Text size: scaling the root font-size cascades cleanly for plain-rem
   sizing with no per-component rules needed. Several headings use
   clamp(Xrem, Yvw, Zrem) (e.g. .hero h1, .page-hero h1) — the rem min/max
   bounds already scale correctly via the root font-size change above, but
   the vw middle term doesn't, since vw is viewport-relative rather than
   root-font-relative (issue #15). Fixed via --text-scale: each affected
   heading wraps only its vw term in calc(Yvw * var(--text-scale, 1)),
   leaving the rem bounds untouched (multiplying those too would
   double-scale them). Any new fluid heading added later should follow the
   same pattern rather than a plain Yvw. */
html[data-text-size="112"] { font-size: 112%; --text-scale: 1.12; }
html[data-text-size="125"] { font-size: 125%; --text-scale: 1.25; }

/* Line spacing: !important is deliberate here, not a specificity shortcut —
   this is a user-triggered, opt-in accessibility override (WCAG 1.4.12
   expects author styles to yield to it) and it needs to reliably beat the
   many hardcoded line-height/letter-spacing values already set per
   component throughout this file, without a specificity arms race that
   would silently break every time a new component is added. Headings and
   nav are deliberately untouched — only body copy gets relaxed.
   The :not() list excludes the site's uppercase "eyebrow label" paragraphs
   (.hero-label, .section-label, .bio-meta-label, .post-card-date), whose
   tight tracked letter-spacing is a deliberate design element that
   `letter-spacing: 0.01em` would otherwise flatten, and excludes <li> inside
   .nav-links/.service-card, which aren't body copy (nav items and bulleted
   feature lists respectively). */
html[data-line-spacing="relaxed"] p:not(.hero-label):not(.section-label):not(.bio-meta-label):not(.post-card-date),
html[data-line-spacing="relaxed"] li:not(.nav-links *):not(.service-card *) {
  line-height: 1.9 !important;
  letter-spacing: 0.01em !important;
  word-spacing: 0.03em !important;
}

/* --- Widget chrome --- */
.a11y-widget {
  position: fixed;
  z-index: 200; /* below .site-header's 300 so the mobile nav wins if both overlap */
  bottom: 1.25rem;
  right: 1.25rem;
}
.a11y-widget[data-pos="bottom-left"] { right: auto; left: 1.25rem; }
.a11y-widget[data-pos="top-right"] { bottom: auto; top: calc(var(--nav-h) + 1rem); }
.a11y-widget[data-pos="top-left"] { bottom: auto; top: calc(var(--nav-h) + 1rem); right: auto; left: 1.25rem; }

.a11y-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transition: border-color 0.2s, color 0.2s;
}
.a11y-toggle:hover,
.a11y-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.a11y-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.a11y-panel {
  position: absolute;
  width: min(300px, calc(100vw - 2.5rem));
  max-height: min(420px, calc(100vh - 6rem));
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.a11y-panel[hidden] { display: none; }
.a11y-widget[data-pos="bottom-right"] .a11y-panel { bottom: calc(100% + 0.75rem); right: 0; }
.a11y-widget[data-pos="bottom-left"] .a11y-panel { bottom: calc(100% + 0.75rem); left: 0; }
.a11y-widget[data-pos="top-right"] .a11y-panel { top: calc(100% + 0.75rem); right: 0; }
.a11y-widget[data-pos="top-left"] .a11y-panel { top: calc(100% + 0.75rem); left: 0; }

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.a11y-panel-header h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.a11y-panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.a11y-panel-close:hover { color: var(--text); }
.a11y-panel-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.a11y-group { margin-bottom: 1rem; }
.a11y-group:last-of-type { margin-bottom: 1.25rem; }
.a11y-group legend {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0;
}
.a11y-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Native radio inputs, visually hidden but still in the tab order and
   keyboard-operable (arrow keys move within the group, Space selects) —
   avoids re-implementing roving-tabindex/ARIA radiogroup logic in JS.
   Each input is absolutely positioned inside its OWN small wrapper (inset:0,
   sized to match its label) rather than the whole panel — with no wrapper,
   an all-auto-offset `position: absolute` collapses every option in every
   group to the same static-position point, so clicks silently land on
   whichever option happens to paint on top instead of the one under the
   visible label. */
.a11y-option {
  position: relative;
  display: inline-flex;
}
.a11y-option-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.a11y-option-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.a11y-option-input:checked + .a11y-option-label {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.a11y-option-input:focus-visible + .a11y-option-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.a11y-panel-reset {
  width: 100%;
  justify-content: center;
}
