/* ============================================================
   alperen.cengiz — personal site
   Palette is semantic: periwinkle = projects, amber = roots/skills.
   ============================================================ */

:root {
  --ink: #0A0C14;
  --ink-2: #0D101C;
  --surface: rgba(148, 163, 200, 0.05);
  --surface-2: rgba(148, 163, 200, 0.08);
  --line: rgba(148, 163, 200, 0.17);
  --line-soft: rgba(148, 163, 200, 0.09);
  --text: #EDEFF7;
  --muted: #9AA3B8;
  --dim: #7B86A0;
  --project: #8FA0FF;
  --project-soft: rgba(143, 160, 255, 0.13);
  --skill: #F2B963;
  --skill-soft: rgba(242, 185, 99, 0.12);
  --live: #6EE7A0;
  --root: rgba(148, 163, 200, 0.34);
  /* consulting diagrams: step kinds */
  --k-fast: #6FD3E6;
  --k-reason: #B9A2FF;
  --k-person: #EDEFF7;
  --font-display: "Syne", "Avenir Next", "Futura", sans-serif;
  --font-body: "Geist", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "Menlo", monospace;
  --maxw: 1140px;
  --pad: clamp(16px, 5vw, 48px);
  --col: 30px; /* width of the node-dot column on the map */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.panel-open { overflow: hidden; }

/* Plotting-surface texture: faint dot grid + soft depth vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(rgba(148, 163, 200, 0.055) 1px, transparent 1px),
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(143, 160, 255, 0.05), transparent 60%);
  background-size: 34px 34px, 100% 100%;
  pointer-events: none;
}

::selection { background: rgba(143, 160, 255, 0.32); }

a { color: inherit; }

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  background: rgba(10, 12, 20, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transform: translateY(-110%);
  visibility: hidden;
  transition: transform 0.45s var(--ease-out), visibility 0s 0.45s;
}
.nav.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.nav-mark {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}
.nav-mark-dot { color: var(--project); }

.nav-links {
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links .nav-ext { color: var(--project); }
.nav-links .nav-ext:hover { color: var(--text); }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: clamp(72px, 13vh, 130px) var(--pad) 0;
}

.hero-inner {
  max-width: calc(var(--maxw) - 2 * var(--pad));
  margin: 0 auto;
  text-align: center;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--skill);
  margin-bottom: clamp(16px, 2.6vh, 26px);
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 8.6vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: clamp(18px, 3vh, 30px);
}
.hero-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-line-in {
  display: inline-block;
  white-space: nowrap;
  transform: translateY(112%);
  animation: line-up 0.9s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes line-up { to { transform: translateY(0); } }

.hero-thesis {
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34em;
  margin: 0 auto clamp(20px, 3vh, 28px);
  text-wrap: balance;
}

.hero-now {
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.4vw, 13.5px);
  color: var(--muted);
  margin-bottom: 16px;
  text-wrap: balance;
}
.hero-now a { color: var(--project); text-decoration: none; border-bottom: 1px solid rgba(143,160,255,0.35); }
.hero-now a:hover { border-bottom-color: var(--project); }
.hero-now-sep { color: var(--dim); margin: 0 6px; }
.status-strong { color: var(--text); }

.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 9px;
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 160, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(110, 231, 160, 0); }
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px clamp(16px, 3vw, 28px);
  font-family: var(--font-mono);
  font-size: 13px;
}
.hero-links a {
  color: var(--text);
  text-decoration: none;
  padding-bottom: 3px;
  background: linear-gradient(var(--project), var(--project)) no-repeat 0 100% / 0 1px;
  transition: background-size 0.3s var(--ease-out), color 0.2s;
}
.hero-links a:hover { background-size: 100% 1px; color: var(--project); }
.hero-links a::after { content: " ↗" / ""; color: var(--dim); font-size: 0.9em; }

/* Load-in for hero secondary elements */
.reveal-load {
  opacity: 0;
  transform: translateY(14px);
  animation: fade-up 0.85s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ============ ROOT MAP ============ */
.map {
  position: relative;
  max-width: calc(var(--maxw) - 2 * var(--pad));
  margin: 0 auto;
  padding: clamp(26px, 4vh, 40px) 0 clamp(60px, 10vh, 110px);
}

.roots {
  position: absolute;
  top: 0; left: 0;
  overflow: visible;
  pointer-events: none;
}

.root { fill: none; stroke: var(--root); stroke-linecap: round; transition: stroke 0.35s; }
.root-main  { stroke-width: 1.7; }
.root-trunk { stroke-width: 1.3; }
.root-fine  { stroke-width: 0.9; stroke: rgba(148, 163, 200, 0.26); }
.root-hair  { stroke-width: 0.7; stroke: rgba(148, 163, 200, 0.17); }
.root-tip   { stroke-width: 0.8; stroke: rgba(148, 163, 200, 0.16); }
.root.is-lit { stroke: var(--project); }

.seed {
  display: block;
  width: 11px; height: 11px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--skill);
  box-shadow: 0 0 0 5px rgba(242, 185, 99, 0.12), 0 0 22px rgba(242, 185, 99, 0.35);
}

.map-hint {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 14px;
  text-wrap: balance;
}
.js .map-hint { opacity: 0; animation: fade-up 0.8s var(--ease-out) 1.2s forwards; }

.sap {
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--skill);
  box-shadow: 0 0 10px 2px rgba(242, 185, 99, 0.55);
  offset-rotate: 0deg;
  opacity: 0;
  pointer-events: none;
}
.sap.is-running { animation: sap 2.6s cubic-bezier(.45,.05,.35,1) forwards; }
@keyframes sap {
  0%   { offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px clamp(18px, 2.5vw, 32px);
  margin-top: clamp(70px, 11vh, 120px);
}

.branch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--skill);
  margin-bottom: 26px;
}
.branch-dot {
  flex: none;
  width: var(--col);
  height: 14px;
  display: grid;
  place-items: center;
}
.branch-dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--skill);
  opacity: 0.85;
}

.nodes { list-style: none; display: grid; gap: 22px; }

.node {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr);
  column-gap: 12px;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.node:focus-visible { outline: 2px solid var(--project); outline-offset: 6px; border-radius: 3px; }

.node-dot {
  width: var(--col);
  height: 30px;
  display: grid;
  place-items: center;
}
.node-dot::before {
  content: "";
  border-radius: 50%;
  background: var(--project);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.node-l .node-dot::before {
  width: 26px; height: 26px;
  background: radial-gradient(circle at 50% 50%, var(--project) 0 34%, rgba(143,160,255,0.22) 36% 100%);
  box-shadow: 0 0 0 1px rgba(143, 160, 255, 0.55), 0 0 26px rgba(143, 160, 255, 0.28);
}
.node-m .node-dot::before {
  width: 14px; height: 14px;
  box-shadow: 0 0 0 4px rgba(143, 160, 255, 0.14);
}
.node-s .node-dot { height: 20px; }
.node-s .node-dot::before { width: 7px; height: 7px; background: var(--muted); }

.node:hover .node-dot::before,
.node:focus-visible .node-dot::before { transform: scale(1.18); }
.node-l:hover .node-dot::before { box-shadow: 0 0 0 1px var(--project), 0 0 34px rgba(143, 160, 255, 0.5); }

.node-text { display: block; min-width: 0; }
.node-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  transition: color 0.25s;
}
.node-l .node-name { font-size: clamp(19px, 1.9vw, 23px); line-height: 30px; }
.node-m .node-dot { height: 24px; }
.node-m .node-name { font-size: 16.5px; line-height: 24px; }
.node-s .node-name {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12.5px;
  line-height: 20px;
  color: var(--muted);
}
.node:hover .node-name, .node:focus-visible .node-name { color: var(--project); }

.node-line {
  display: block;
  color: var(--muted);
  text-wrap: pretty;
}
.node-l .node-line { font-size: 14px; line-height: 1.5; margin-top: 2px; }
.node-m .node-line { font-size: 13px; line-height: 1.5; color: var(--dim); }
/* small nodes: the one-liner is a tooltip */
.node-s .node-line {
  position: absolute;
  left: calc(var(--col) + 12px);
  top: calc(100% + 4px);
  z-index: 5;
  width: max-content;
  max-width: 240px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(13, 16, 28, 0.96);
  border: 1px solid var(--line);
  border-radius: 3px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.node-s:hover .node-line, .node-s:focus-visible .node-line { opacity: 1; transform: none; }
/* the rightmost branch opens its tooltips leftward so they stay on screen */
.branch:last-child .node-s .node-line { left: auto; right: 0; }
.nodes .node-s { margin-top: -10px; }
.nodes li:first-child .node-s { margin-top: 0; }

/* growth: nodes appear as their root reaches them */
.map.is-pre .branch-label,
.map.is-pre .node { opacity: 0; }
.map.is-pre .node-dot::before { transform: scale(0); }
.map.is-grow .branch-label,
.map.is-grow .node {
  transition: opacity 0.7s var(--ease-out) var(--appear, 0s);
}
.map.is-grow .node-dot::before {
  transition: transform 0.55s cubic-bezier(.34, 1.56, .64, 1) var(--appear, 0s), box-shadow 0.35s;
}

/* ============ PANEL ============ */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(5, 6, 12, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s;
}
.panel-backdrop.is-open { opacity: 1; }
.panel[hidden], .panel-backdrop[hidden] { display: none; }

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 80;
  width: min(820px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.42s var(--ease-out), width 0.3s var(--ease-out);
}
.panel.is-wide { width: min(1060px, 100vw); }
.panel.is-open { transform: none; }

.panel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(12px, 3vw, 24px);
  border-bottom: 1px solid var(--line-soft);
}
.panel-nav, .panel-close {
  all: unset;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  padding: 6px 8px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34%;
  transition: color 0.2s, background 0.2s;
}
.panel-nav:hover, .panel-close:hover { color: var(--text); background: var(--surface-2); }
.panel-nav:focus-visible, .panel-close:focus-visible { outline: 2px solid var(--project); }
.panel-close { margin-left: auto; font-size: 22px; line-height: 1; padding: 4px 10px; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 40px) clamp(18px, 4vw, 44px) 56px;
  container-type: inline-size;
}

/* ============ PROJECT DETAILS ============ */
/* Without JS the details render inline as a long page; with JS they only feed the panel. */
.details {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  container-type: inline-size;
}
.details .detail { padding: 56px 0; border-top: 1px solid var(--line-soft); }
.js .details { display: none; }

.detail-head {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 24px);
  margin-bottom: 22px;
}
.detail-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--skill);
  margin-bottom: 6px;
}
.detail-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 4cqi, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.detail-sub {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: 0.03em;
  margin-top: 6px;
}
.detail-lead {
  font-size: 17px;
  color: var(--text);
  max-width: 64ch;
  margin-bottom: 14px;
  text-wrap: pretty;
}
.detail-text {
  font-size: 15px;
  color: var(--muted);
  max-width: 66ch;
  margin-bottom: 18px;
  text-wrap: pretty;
}
.row-tags {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.03em;
  margin-top: 6px;
}
.detail-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--project);
  padding: 10px 18px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}
.btn:hover { background: #A7B4FF; transform: translateY(-1px); }
.btn-ghost {
  color: var(--project);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(143, 160, 255, 0.45);
}
.btn-ghost:hover { background: var(--project-soft); color: var(--text); }

.detail-skills { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--skill);
  padding: 4px 10px;
  border: 1px solid rgba(242, 185, 99, 0.32);
  border-radius: 999px;
  background: var(--skill-soft);
}

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}
.dot-live { background: var(--live); animation: pulse 2.4s ease-in-out infinite; }

.eyebrow-sm {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}

/* learning science → product */
.science { margin: 26px 0 22px; }
.science-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  counter-reset: sci;
}
.science-list li {
  padding: 18px 18px 20px;
  border-left: 1px solid var(--line-soft);
  counter-increment: sci;
}
.science-list li:first-child { border-left: none; padding-left: 4px; }
.science-finding {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.3;
  margin-bottom: 6px;
  text-wrap: balance;
}
.science-finding::before {
  content: counter(sci, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--skill);
  margin-bottom: 8px;
}
.science-cite {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 10px;
}
.science-choice { font-size: 13.5px; color: var(--muted); text-wrap: pretty; }
.science-choice::before { content: "→ "; color: var(--project); }

/* ============ CONSULTING CASE ============ */
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: clamp(20px, 3.5cqi, 40px);
  margin: 30px 0 40px;
}
.case-col { border-top: 1px solid var(--line); padding-top: 18px; }
.case-list { list-style: none; display: grid; gap: 10px; }
.case-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.68em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--project);
  opacity: 0.7;
}
.case-text { font-size: 14px; color: var(--muted); margin-bottom: 12px; text-wrap: pretty; }
.case-text:first-of-type { color: var(--text); font-size: 15px; }

.diagram {
  margin: 0 0 32px;
  padding: clamp(16px, 3cqi, 28px);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--ink);
}
.diagram-cap {
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 64ch;
  text-wrap: balance;
}
.diagram-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--skill);
  letter-spacing: 0.14em;
  margin-right: 10px;
}

/* step kinds — shared by the pattern, lanes, and legend */
.k-data   { --k: var(--dim); }
.k-fast   { --k: var(--k-fast); }
.k-reason { --k: var(--k-reason); }
.k-person { --k: var(--k-person); }

/* 01 pattern */
.pattern {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.pattern-step {
  position: relative;
  padding: 16px 16px 18px;
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--k);
  border-radius: 3px;
  background: var(--surface);
}
.pattern-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-family: var(--font-mono);
}
.pattern-kind {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--k);
  margin-bottom: 8px;
}
.pattern-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.pattern-text { font-size: 13px; color: var(--muted); text-wrap: pretty; }

/* 02 architecture map */
.arch { display: grid; }
.arch-layer, .arch-flow {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 16px;
  background: var(--surface);
}
.arch-orch { border-color: rgba(185, 162, 255, 0.45); background: rgba(185, 162, 255, 0.06); }
.arch-label { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.arch-letter {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-right: 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--k-reason);
  vertical-align: 2px;
}
.arch-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--dim);
  letter-spacing: 0.03em;
}
.arch-label .arch-sub { margin-left: 8px; }
.arch-router { font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.arch-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.arch-chips li {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid rgba(185, 162, 255, 0.4);
  border-radius: 999px;
}
.arch-shared { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.arch-shared strong { color: var(--k-person); font-weight: 500; }
.arch-conn {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  padding: 8px 0;
}
.arch-flows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.arch-flow { border-top-width: 2px; }
.f-a { border-top-color: var(--k-fast); }
.f-b { border-top-color: var(--skill); }
.f-c { border-top-color: var(--project); }
.f-a .arch-letter { background: var(--k-fast); }
.f-b .arch-letter { background: var(--skill); }
.f-c .arch-letter { background: var(--project); }
.arch-flow ul { list-style: none; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.arch-flow li {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.arch-flow li:last-child { border-bottom: none; }
.arch-data { background: transparent; border-style: dashed; }
.arch-sources { font-family: var(--font-mono); font-size: 12px; color: var(--dim); line-height: 1.8; }

/* 03 lanes */
.lanes { display: grid; gap: 10px; }
.lane {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.3fr 1fr;
  gap: 24px;
}
.lane-head span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.cell {
  position: relative;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--k);
  border-radius: 3px;
  background: var(--surface);
}
.cell b {
  display: block;
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}
.k-person.cell { background: rgba(237, 239, 247, 0.04); }
.cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--dim);
  opacity: 0.6;
}
.cell-skip {
  border: 1px dashed var(--line-soft);
  background: none;
  color: var(--dim);
  display: grid;
  place-items: center;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
}
.lg::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--k);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: -1px;
}

/* phases */
.phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 26px;
}
.phase { padding: 18px 20px; border-left: 1px solid var(--line-soft); }
.phase:first-child { border-left: none; padding-left: 4px; }
.phase-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--skill);
  margin-bottom: 8px;
}
.phase-text { font-size: 13.5px; color: var(--muted); text-wrap: pretty; }

/* detail content adapts to the panel's width, not the viewport's */
@container (max-width: 860px) {
  .case-grid { grid-template-columns: 1fr; }
  .pattern { grid-template-columns: 1fr 1fr; }
  .pattern-step:nth-child(2)::after { content: none; }
  .arch-flows { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .phase { border-left: none; padding-left: 4px; border-top: 1px solid var(--line-soft); }
  .phase:first-child { border-top: none; }
  .lane-head { display: none; }
  .lane {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--line-soft);
  }
  .cell:not(:last-child)::after { content: none; }
  .cell-skip { display: none; }
}
@container (max-width: 680px) {
  .science-list { grid-template-columns: 1fr 1fr; }
  .science-list li:nth-child(3) { border-left: none; padding-left: 4px; }
  .science-list li:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@container (max-width: 460px) {
  .science-list, .pattern { grid-template-columns: 1fr; }
  .science-list li { border-left: none; padding-left: 4px; }
  .science-list li + li { border-top: 1px solid var(--line-soft); }
  .pattern-step::after { content: none !important; }
}

/* ============ SECTIONS ============ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 10vh, 110px) var(--pad) 0;
}
.section-head { margin-bottom: clamp(24px, 4vh, 40px); }

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--skill);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--skill);
  opacity: 0.55;
  vertical-align: 4px;
  margin-right: 12px;
}

/* ============ EXPERIENCE ============ */
.exp-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}
.exp-item {
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  flex-wrap: wrap;
}
.exp-org {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.exp-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}
.exp-role {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--skill);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.exp-note {
  font-size: 14px;
  color: var(--muted);
  max-width: 62ch;
  margin-top: 6px;
  text-wrap: pretty;
}
.exp-edu {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dim);
}
.honor-item {
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.honor-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
}

/* ============ ABOUT ============ */
.section-about { padding-bottom: clamp(64px, 11vh, 120px); }

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.about-photo {
  position: relative;
  width: min(260px, 60vw);
  aspect-ratio: 1;
  justify-self: center;
}
.about-photo img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  z-index: 1;
  filter: saturate(0.92);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 99%);
}
.about-ring {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 1px solid rgba(143, 160, 255, 0.35);
  background: radial-gradient(circle at 50% 42%, rgba(143, 160, 255, 0.12), rgba(143, 160, 255, 0.02) 65%);
}
.about-ring::after {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 200, 0.18);
}
.about-node { position: absolute; border-radius: 50%; z-index: 2; }
.about-node-a { width: 10px; height: 10px; background: var(--skill); top: 13%; right: 12%; }
.about-node-b { width: 7px; height: 7px; background: var(--project); bottom: 18%; left: 7%; }

.about-text { color: var(--muted); max-width: 56ch; margin-bottom: 16px; text-wrap: pretty; }
.about-text a { color: var(--text); text-decoration-color: rgba(143, 160, 255, 0.5); text-underline-offset: 3px; }
.about-text a:hover { color: var(--project); }

.about-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}
.about-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dim);
  text-decoration: none;
  width: fit-content;
  transition: color 0.2s;
}
.about-links a:hover { color: var(--project); }
.about-links a::before { content: "→ "; color: var(--project); opacity: 0.6; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px var(--pad) 36px;
}
.footer-note {
  max-width: calc(var(--maxw) - 2 * var(--pad));
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

/* ============ PROJECT VISUALS ("how it works") ============ */
.viz {
  margin: 26px 0 28px;
  padding: 18px 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}
.viz-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}
.viz-cap em { font-style: normal; letter-spacing: 0.04em; text-transform: none; color: var(--dim); }

/* product screenshots */
.shot { margin: 22px 0 26px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.shot figcaption { margin-top: 10px; font-size: 13px; color: var(--dim); text-wrap: pretty; }

/* step colours */
.c-project { --c: var(--project); }
.c-amber   { --c: var(--skill); }
.c-cyan    { --c: var(--k-fast); }
.c-violet  { --c: var(--k-reason); }
.c-green   { --c: var(--live); }
.c-white   { --c: var(--k-person); }
.c-dim     { --c: var(--dim); }

/* a chain of steps, left → right; groups box a run of steps */
.flow { list-style: none; display: flex; align-items: stretch; gap: 22px; }
.flow > li { flex: var(--n, 1) 1 0; min-width: 0; position: relative; display: flex; flex-direction: column; }
.flow > li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -17px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dim);
}
.st {
  flex: 1;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--c, var(--project));
  border-radius: 4px;
  background: var(--ink-2);
}
.st b {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 4px;
}
.st span { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.st .st-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c, var(--project));
  margin-bottom: 5px;
}
.grp {
  padding: 26px 10px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.grp-label {
  position: absolute;
  top: 7px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c, var(--dim));
}
.grp > .flow { flex: 1; gap: 18px; }
.grp > .flow > li:not(:last-child)::after { right: -15px; }

/* a return path under the chain */
.loop-back {
  margin: 0 8% 0;
  height: 30px;
  border: 1px dashed var(--c, var(--skill));
  border-top: none;
  border-radius: 0 0 14px 14px;
  position: relative;
}
.loop-back span {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  padding: 0 10px;
  background: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--c, var(--skill));
  white-space: nowrap;
}
.viz .loop-back span { background: #11141f; }
.viz-foot { margin-top: 22px; font-size: 13px; color: var(--dim); text-wrap: pretty; }
.viz-foot + .viz-foot { margin-top: 6px; }

/* two parallel tracks that meet */
.tracks { display: grid; gap: 12px; }
.track { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.track-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c, var(--dim));
}

/* feature grid */
.feats {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  margin: 8px 0 22px;
}
.feats li { font-size: 14px; color: var(--muted); padding-left: 14px; position: relative; text-wrap: pretty; }
.feats li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--project);
}
.feats b { display: block; color: var(--text); font-weight: 500; font-size: 14.5px; margin-bottom: 1px; }
.detail h4.eyebrow-sm, .panel-body h4.eyebrow-sm { margin-top: 30px; }

@container (max-width: 620px) {
  .flow { flex-direction: column; gap: 20px; }
  .flow > li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -18px; transform: translateX(-50%); }
  .grp > .flow > li:not(:last-child)::after { right: auto; }
  .loop-back { height: auto; border: none; margin-top: 14px; text-align: center; }
  .loop-back span { position: static; transform: none; white-space: normal; background: none; }
  .loop-back span::before { content: "↺ "; }
  .track { grid-template-columns: 1fr; gap: 8px; }
  .feats { grid-template-columns: 1fr; }
}

/* consulting: the use-case board */
.f-d { border-top-color: var(--k-reason); }
.f-d .arch-letter { background: var(--k-reason); }
.uc-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.uc-col {
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-top-width: 2px;
  border-radius: 4px;
  background: var(--surface);
}
.uc-col ul { list-style: none; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.uc-col li {
  position: relative;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  padding: 8px 26px 8px 0;
  border-bottom: 1px solid var(--line-soft);
  text-wrap: pretty;
}
.uc-col li:last-child { border-bottom: none; }
.uc-col li em {
  position: absolute;
  right: 0; top: 9px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.06em;
}
.uc-col li.is-top { color: var(--text); }
.uc-col li.is-top::after {
  content: "★";
  position: absolute;
  right: 0; bottom: 8px;
  font-size: 10px;
  color: var(--skill);
}
.uc-n {
  display: inline-grid;
  place-items: center;
  width: 17px; height: 17px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--skill-soft);
  border: 1px solid rgba(242, 185, 99, 0.45);
  color: var(--skill);
  font-family: var(--font-mono);
  font-size: 10px;
  vertical-align: 1px;
}
.uc-out { font-style: italic; color: var(--dim) !important; }
.uc-key { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin-left: 10px; }
.uc-key i { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.uc-key .uc-top, .uc-key .uc-start { color: var(--skill); }

/* consulting: priority guidance */
.prio { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4cqi, 44px); }
.prio-note { margin-left: 8px; letter-spacing: 0.04em; text-transform: none; }
.weights { display: grid; gap: 8px; margin-bottom: 20px; }
.w { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; align-items: center; gap: 12px; }
.w b { font-family: var(--font-mono); font-weight: 400; font-size: 12px; color: var(--text); }
.w::after {
  content: "";
  height: 8px;
  width: calc(var(--w) * 2.5%);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--skill), rgba(242, 185, 99, 0.55));
}
.prio-rules li b { color: var(--text); font-weight: 500; }
.start-list { list-style: none; counter-reset: start; display: grid; gap: 0; }
.start-list li {
  counter-increment: start;
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.start-list li::before {
  content: counter(start);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--skill-soft);
  border: 1px solid rgba(242, 185, 99, 0.45);
  color: var(--skill);
  font-family: var(--font-mono);
  font-size: 11px;
}
.start-list b { font-weight: 500; font-size: 14px; }
.start-list span { font-size: 12.5px; color: var(--dim); }
.arch-router b { color: var(--text); font-weight: 500; }

/* granger: the paper */
.paper {
  margin: 8px 0 22px;
  padding: 20px 22px;
  border: 1px solid rgba(143, 160, 255, 0.35);
  border-radius: 6px;
  background: var(--project-soft);
}
.paper .eyebrow-sm { margin-bottom: 10px; }
.paper-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.3; text-wrap: balance; }
.paper-authors { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.paper .detail-links { margin-top: 16px; }

@container (max-width: 860px) {
  .uc-board { grid-template-columns: 1fr 1fr; }
  .prio { grid-template-columns: 1fr; }
}
@container (max-width: 520px) {
  .uc-board { grid-template-columns: 1fr; }
}

/* ============ SCROLL REVEALS ============ */
/* hidden state only applies once JS has marked <html class="js"> —
   no-JS visitors and print get fully visible content */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media print {
  .js .reveal { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .branches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 32px; }
  .exp-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .br-wide { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-body { order: -1; }
  .nav-links a:not(.nav-ext) { display: none; }
}

@media (max-width: 600px) {
  .branches { grid-template-columns: 1fr; gap: 40px; margin-top: 64px; }
  body { font-size: 15.5px; }
  /* bottom sheet instead of a side drawer */
  .panel, .panel.is-wide {
    top: auto;
    width: 100%;
    height: 90svh;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
  .panel.is-open { transform: none; }
  .panel-nav { max-width: 38%; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-line-in { animation: none; transform: none; }
  .reveal-load { animation: none; opacity: 1; transform: none; }
  .js .map-hint { animation: none; opacity: 1; }
  .js .reveal { transition: none; opacity: 1; transform: none; }
  .live-dot, .dot-live { animation: none; }
  .panel, .panel-backdrop { transition: none; }
  .sap { display: none; }
}

/* ============ CONSULTING PANEL (overview diagram + explanation drawer) ============
   Diagram, mini-project chips, drawer and explainer styles are shared with /consulting/ and live in
   consulting/diagram.css; interactivity in consulting/consulting.js. Only panel layout tweaks here. */
.consult-overview .mmd svg { min-width: calc(var(--w) * 0.78); }
.consult-overview .blocks { margin: 14px 0 10px; }
.consult-overview .legend-row { margin-top: 14px; }
.consult-cta { align-items: center; gap: 16px; margin: 6px 0 26px; }
.consult-cta-note { font-size: 13.5px; color: var(--dim); max-width: 52ch; text-wrap: pretty; }
.xtemplates { display: none; }
@container (max-width: 620px) {
  .consult-overview .stx-simple { grid-template-columns: 1fr; }
  .consult-overview .stx-arrow { transform: none; justify-self: center; }
}
