:root {
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1c222a;
  --line: #2a323d;
  --line-strong: #3a4553;
  --text: #e6eaef;
  --text-soft: #a7b0bd;
  --text-mute: #6f7a89;
  --accent: #38bdf8;
  --accent-dim: #0e3a4d;
  --deep: #38bdf8;
  --deep-bg: #0e2a38;
  --pov: #c4b5fd;
  --pov-bg: #241f3a;
  --radius: 8px;
  --max: 860px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fb;
    --surface: #ffffff;
    --surface-2: #f0f3f7;
    --line: #dde3ea;
    --line-strong: #c4cdd8;
    --text: #14181d;
    --text-soft: #47525f;
    --text-mute: #7a8592;
    --accent: #0284c7;
    --accent-dim: #d8eefc;
    --deep: #0284c7;
    --deep-bg: #e0f2fe;
    --pov: #7c3aed;
    --pov-bg: #ede9fe;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
:target,
section[id],
#top {
  scroll-margin-top: 76px;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-name { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.nav-name:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--text-soft); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---- shared ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px;
  max-width: none;
}
h1 {
  font-size: clamp(20px, 5vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 24px;
  max-width: 18ch;
}
h2 {
  font-size: clamp(14px, 3.5vw, 24px);
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 20px;
}
h3 { font-size: 18px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; }
h4 { font-size: 15px; font-weight: 600; margin: 20px 0 4px; color: var(--text); }
.body { color: var(--text-soft); margin: 0 0 16px; }

section { padding: 32px 0; border-bottom: 2px solid var(--line-strong); }
.about { padding-top: 32px; }

/* ---- buttons ---- */
.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 500;
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #04121a; border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }

@media (prefers-color-scheme: light) {
  .btn-primary { color: #fff; }
}

/* ---- ecosystem ---- */
.block { margin-top: 36px; }
.block:first-of-type { margin-top: 28px; }
.diagram { margin: 0; }
.diagram img {
  max-height: 400px;
  width: auto;
  max-width: 100%;
  cursor: zoom-in;
}

/* lightbox overlay — reusable */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  background: color-mix(in srgb, #000 78%, transparent);
  padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 28px; line-height: 1;
  padding: 8px;
}
.lightbox-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/*
.diagram img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
*/
figcaption { font-size: 13px; color: var(--text-mute); margin-top: 10px; }

/* ---- accordion ---- */
.accordion { border-top: 1px solid var(--line);/* margin-top: 20px;*/ }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-heading { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; }

.acc-trigger {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 18px 40px 18px 0;
  cursor: pointer; position: relative;
  font-family: inherit; color: inherit;
}
.acc-trigger:hover .acc-title { color: var(--accent); }
.acc-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.acc-title {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); margin: 0 0 4px;
  transition: color .15s;
}
.acc-teaser { font-size: 15px; color: var(--text-mute); margin: 0; line-height: 1.5; }

/* plus/minus indicator */
.acc-trigger::after {
  content: ""; position: absolute; top: 24px; right: 6px;
  width: 12px; height: 12px;
  background:
    linear-gradient(var(--text-soft), var(--text-soft)) center/12px 1.5px no-repeat,
    linear-gradient(var(--text-soft), var(--text-soft)) center/1.5px 12px no-repeat;
  transition: transform .2s;
}
.acc-item.open .acc-trigger::after { transform: rotate(45deg); }
.acc-item.open .acc-teaser { color: var(--text-soft); }

.acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
}
.acc-item.open .acc-panel { max-height: 4000px; }
.acc-inner { padding: 4px 0 24px; }

/* content inside accordion panels */
.acc-inner .group { font-weight: 600; color: var(--text); margin: 18px 0 6px; font-size: 14px; }
.acc-inner ul { margin: 0 0 4px; padding-left: 20px; }
.acc-inner li { color: var(--text-soft); margin-bottom: 4px; }
.acc-inner .body:first-child { margin-top: 0; }

/* ---- writeups ---- */
.section-lede { max-width: 60ch; margin-bottom: 32px; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.tile {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tile-img {
  display: block;
  width: 100%;                    /* full content width — as wide as the text, no wider */
  aspect-ratio: 400 / 250;        /* preserves the 8:5 shape at any column width */
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);   /* placeholder tone while loading */
  margin: 14px 0;                 /* space above (from tag) and below (to heading) */
}
.tile h3 { margin: 0 0 8px; }
.tile p { color: var(--text-soft); font-size: 15px; margin: 0 0 16px; flex: 1; }
.tag-deep { color: var(--deep); background: var(--deep-bg); }
.tag-pov { color: var(--pov); background: var(--pov-bg); }
.tile-more { font-size: 14px; color: var(--accent); font-weight: 500; }

/* ---- two col ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.two-col section { border-bottom: none; }
.contact-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 20px; }

/* ---- footer ---- */
.foot { padding: 32px 0; }
.foot p { color: var(--text-mute); font-size: 13px; font-family: var(--mono); margin: 0; }

/* ---- responsive ---- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  section { padding: 48px 0; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .two-col section { border-bottom: 1px solid var(--line); padding: 40px 0; }
  .acc-trigger { padding-right: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .acc-panel, .acc-title, .acc-trigger::after, .tile, .btn { transition: none; }
}
