/* ============================================================
   Shared styles for the section pages.
   PALETTES — keep in sync with the block at the top of index.html.
   --p1..--p4: complexity & architecture, (unused), memory & learning, control
   ============================================================ */
:root {
  --bg: #0c0908; --bg2: #18110e; --text: #efe3d6; --muted: #8f7f72;
  --edge: #33271f; --node: #5a473b; --accent: #fff1e2;
  --p1: #ff5f3d; --p2: #ff8a5e; --p3: #ff9d74; --p4: #ffd1b6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 60% at 50% 62%, var(--bg2) 0%, var(--bg) 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 17px; line-height: 1.65; min-height: 100vh;
}
a { color: var(--text); text-decoration-color: var(--node); text-underline-offset: 3px; transition: text-decoration-color .2s, color .2s; }
a:hover { text-decoration-color: var(--accent); }

/* ---------- header: identical in size and position to the home page ---------- */
.site-head { padding: 30px 34px 0; line-height: 1.15; }
.site-head .name { font-weight: 500; font-size: 26px; letter-spacing: .005em; line-height: 1.15; text-decoration: none; display: block; width: fit-content; }
.site-head .sub { margin-top: 4px; font-size: 15px; color: var(--muted); letter-spacing: .01em; line-height: 1.15; }
.pillars {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; line-height: 1.15;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.pillars li { display: flex; align-items: center; gap: 8px; color: var(--c); }
.pillars li.lead { color: var(--muted); text-transform: none; letter-spacing: .06em; pointer-events: none; }
.pillars li.lead::before { display: none; }
.pillars li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }

.portrait {
  position: absolute; top: 28px; right: 34px; display: block;
  width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--edge); box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--edge);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.9); }
.portrait { background: color-mix(in srgb, var(--bg) 78%, var(--muted)); }  /* photo background: page color, a touch lighter and greyer */

/* ---------- content panel: the blurb box, grown ---------- */
.panel {
  margin: 32px 34px 34px; max-width: 920px; min-height: calc(100vh - 220px);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  border: 1px solid var(--edge); border-radius: 14px;
  padding: 30px 40px 40px;
}
.panel > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.panel > *:nth-child(2) { animation-delay: .05s; } .panel > *:nth-child(3) { animation-delay: .1s; }
.panel > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel > * { animation: none; } }

.panel-nav {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 34px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .04em;
}
.panel-nav a { text-decoration: none; color: var(--muted); }
.panel-nav a:hover, .panel-nav a[aria-current="page"] { color: var(--text); }
.panel-nav .back { margin-right: auto; }

.kicker {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; margin-bottom: 22px; }
h2 { font-size: 21px; font-weight: 500; margin: 44px 0 14px; }
h3 { font-size: 19px; font-weight: 500; margin-bottom: 6px; }
p { margin-bottom: 16px; max-width: 68ch; }
.lede { font-size: 19px; opacity: .92; max-width: 62ch; }
.muted { color: var(--muted); }
.draft { border-left: 2px solid var(--p1); padding-left: 12px; color: var(--muted); font-size: 14px; font-family: "IBM Plex Mono", monospace; }

/* pillar tags (projects page) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.tag {
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px; border: 1px solid currentColor;
}
.t-complexity { color: var(--p1); }
.t-memory { color: var(--p3); }   .t-control { color: var(--p4); }

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.pillar-card { border: 1px solid var(--edge); border-radius: 12px; padding: 18px; }
.pillar-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pillar-card h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pillar-card p { font-size: 14.5px; opacity: .8; margin: 6px 0 0; }

.card { border-top: 1px solid var(--edge); padding: 26px 0; }
.card:last-child { border-bottom: 1px solid var(--edge); }
.card p { margin: 8px 0 0; opacity: .85; }
.pub { border-top: 1px solid var(--edge); padding: 18px 0; }
.pub .title { font-weight: 500; }
.pub .meta { color: var(--muted); font-size: 15px; }
.pub .links { font-family: "IBM Plex Mono", monospace; font-size: 12px; margin-top: 4px; display: flex; gap: 14px; }

.timeline { list-style: none; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--edge); }
.timeline .when { font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--muted); padding-top: 3px; }

.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px;
  border: 1px solid var(--accent); text-decoration: none; font-family: "IBM Plex Mono", monospace; font-size: 13px;
  transition: background .2s, color .2s;
}
.button:hover { background: var(--accent); color: var(--bg); }

.links-list { list-style: none; font-family: "IBM Plex Mono", monospace; font-size: 15px; }
.links-list li { padding: 12px 0; border-top: 1px solid var(--edge); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.links-list .label { color: var(--muted); }

.panel-foot { margin-top: 48px; display: flex; justify-content: space-between; align-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--muted); }

@media (max-width: 700px) {
  /* portrait centered on top, name centered under it, then the panel */
  .site-head { padding: 108px 18px 0; }
  .site-head .name { font-size: 22px; margin: 0 auto; }
  .pillars { gap: 6px 16px; font-size: 10px; }
  .portrait { top: 16px; right: auto; left: calc(50% - 39px); width: 78px; height: 78px; }
  .panel { margin: 16px 10px 10px; padding: 20px 16px 26px; border-radius: 12px; }
  .panel-nav .back { flex-basis: 100%; margin-bottom: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
.pub .meta b { color: var(--text); font-weight: 500; }
.pub .title a { text-decoration: none; } .pub .title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.paper-links { margin-top: 12px; display: grid; gap: 6px; }
.paper-links a { font-size: 14.5px; text-decoration: none; padding-left: 18px; position: relative; }
.paper-links a::before { content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--p3); }
.paper-links a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* click outside the panel: it shrinks back and the page fades before returning home */
html { cursor: default; }
body { transition: opacity .28s; }
.panel { transition: transform .28s cubic-bezier(.7,0,.2,1), opacity .28s; transform-origin: top left; }
body.closing .panel { transform: scale(.96); opacity: 0; }
body.closing { opacity: .6; }

/* page title with an icon link beside it (publications: Google Scholar) */
.title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.title-row h1 { margin-bottom: 0; }
.title-icon {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--edge); color: var(--muted);
  display: grid; place-items: center; transition: color .25s, border-color .25s, transform .25s;
}
.title-icon:hover, .title-icon:focus-visible { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); outline: none; }
.title-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
