/* ==========================================================================
   site.css — shared dark theme (derived from opinions.html / blog pages)
   ========================================================================== */

:root {
  --bg:        #14161c;
  --surface:   #1b1e26;
  --surface-2: #21252f;
  --ink:       #e6e9ef;
  --muted:     #8b93a7;
  --faint:     #5b6275;
  --line:      #2a2e3a;
  --accent:    #ffb454;
  --blue:      #6cb6ff;
  --purple:    #c490f5;
  --green:     #82d99a;
  --red:       #ff7b72;
  --teal:      #5ec9b0;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 820px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(120% 90% at 50% -10%, transparent 30%, var(--bg) 78%);
  pointer-events: none; z-index: 0;
}

/* ---- top nav ---- */
header.site {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 10px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .mark { font-family: var(--mono); font-weight: 600; color: var(--accent); font-size: 18px; letter-spacing: -.5px; }
.brand .name { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: 18px; letter-spacing: -.3px; }
.brand .name b { color: var(--blue); font-weight: 600; }

nav.site {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-family: var(--mono); font-size: 13px;
}
nav.site a {
  color: var(--muted); text-decoration: none;
  padding: 4px 2px; transition: color .18s;
}
nav.site a:hover, nav.site a:focus-visible { color: var(--accent); }
nav.site a.current { color: var(--accent); font-weight: 500; }

/* ---- wrapper ---- */
.wrap {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px);
}
.wrap.wrap-wide { max-width: 1120px; }

/* ---- masthead ---- */
.masthead { padding: 64px 0 14px; }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; margin-bottom: 22px; flex-wrap: wrap;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.eyebrow .path { color: var(--blue); }
.masthead h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -1.5px;
  font-size: clamp(36px, 7vw, 56px); line-height: 1; margin: 0 0 16px; color: var(--ink);
}
.masthead .standfirst {
  font-size: 21px; color: var(--muted); margin: 0; max-width: 56ch; font-style: italic;
}
.masthead h1 .cursor {
  display: inline-block;
  width: .5ch;
  height: .82em;
  transform: translateY(.06em);
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .masthead h1 .cursor { animation: none; }
}

/* ---- content typography ---- */
.content { padding: 8px 0 40px; }
.content h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: -.5px;
  font-size: clamp(26px, 5vw, 34px); line-height: 1.2; color: var(--ink);
  margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--line);
}
.content h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.content h3 {
  font-family: var(--display); font-weight: 600; letter-spacing: -.3px;
  font-size: 22px; color: var(--ink); margin: 32px 0 12px;
}
.content .pub-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 12px;
}
.content .pub-heading-row h3 {
  margin: 0;
}
.content .pub-heading-row a {
  margin-left: auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
}
.content h4 {
  font-family: var(--mono); font-weight: 500; font-size: 14px;
  color: var(--accent); margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .5px;
}
.content p { margin: 0 0 18px; }
.content a { color: var(--blue); text-decoration: none; }
.content a:hover, .content a:focus-visible { color: var(--accent); text-decoration: underline; }

/* ---- lists ---- */
.content ul, .content ol { margin: 0 0 18px; padding-left: 1.4em; }
.content li { margin-bottom: 6px; }
.content ul.leaders {
  max-width: 60em; padding: 0; overflow-x: hidden; list-style: none;
}
.content ul.leaders li {
  display: flex; align-items: baseline; margin-bottom: 8px;
}
.content ul.leaders li:before {
  content: ""; flex: 1; order: 1;
  border-bottom: 1px dotted var(--faint);
  margin: 0 0.33em; transform: translateY(-0.35em);
}
.content ul.leaders span:first-child { padding-right: 0.33em; white-space: nowrap; }
.content ul.leaders span + span { padding-left: 0.33em; white-space: nowrap; color: var(--muted); }

/* ---- navcontainer project lists ---- */
.content .navcontainer { margin: 12px 0 24px; }
.content .navcontainer ul { list-style: none; padding: 0; margin: 0; }
.content .navcontainer li {
  list-style: none; padding: 8px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.content .navcontainer li a { color: var(--blue); }
.content .navcontainer li a:hover { color: var(--accent); }
.content .navcontainer li div { color: var(--muted); font-size: 15px; text-align: right; }

/* ---- tables ---- */
.content table {
  border-collapse: collapse; width: 100%; margin: 16px 0 28px;
  font-family: var(--mono); font-size: 14px; table-layout: auto;
}
.content table td, .content table th {
  border: 1px solid var(--line); padding: 8px 12px;
}
.content table th, .content table td:first-child {
  color: var(--accent); font-weight: 500; white-space: nowrap;
}
.content table td { color: var(--ink); }
.content table a { color: var(--blue); }
/* ---- publications ---- */
.content .pub-table { width: 100%; }
.content .pub-table td:first-child { white-space: nowrap; }
.content .pub-table td:nth-child(2) { width: 100%; }
.content .pub-table td:last-child {
  white-space: nowrap;
  text-align: right;
  width: 1%;
  padding-right: 0;
}
.content .pub-title { color: var(--teal); font-weight: 500; }
.content .pub-num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
}
.content .pub-links { white-space: nowrap; color: var(--faint); margin-left: 0.6em; font-size: 13px; }
.content .pub-links a { color: var(--blue); }
.content .pub-year {
  font-family: var(--display); font-weight: 700; font-size: 28px;
  color: var(--accent); letter-spacing: -.5px;
  margin: 32px 0 16px; padding: 8px 0 8px 16px;
  border-left: 3px solid var(--accent);
  position: relative;
}
.content .pub-year:first-child { margin-top: 12px; }
.content .pub-list { list-style: none; padding: 0; margin: 0; }
.content .pub-list li {
  display: flow-root;
  position: relative;
  margin-bottom: 12px;
  padding-left: 16px;
  padding-right: clamp(220px, 26vw, 320px);
  border-left: 1px solid var(--line);
}
.content .pub-list li > b { display: block; }
.content .pub-links-right,
.content .pub-list .pub-links {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  text-align: right;
}
.content .pub-links-right + br { clear: both; }
.content .pub-timeline {
  position: relative;
  display: grid;
  --timeline-stroke: color-mix(in srgb, var(--accent) 45%, var(--line));
  grid-template-columns: 180px minmax(0, 1fr);
  column-gap: 28px;
  row-gap: 0;
  padding-left: 0;
  align-items: start;
}
.content .pub-timeline::before {
  content: "";
  position: absolute;
  left: 84px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-stroke);
  z-index: 0;
}
.content .pub-timeline .pub-year,
.content .pub-timeline .pub-list li {
  position: relative;
  z-index: 1;
}
.content .pub-timeline .pub-year {
  grid-column: 1;
  justify-self: center;
  margin-left: 0;
  font-size: 18px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  margin-top: 30px;
  margin-bottom: 14px;
  padding: 10px 14px 9px;
  border-radius: 14px;
  border: 1px solid var(--timeline-stroke);
  background: var(--surface);
  box-shadow: none;
  transform: none;
  overflow: visible;
}
.content .pub-timeline .pub-list { grid-column: 2; }

/* ---- images ---- */
.content img { max-width: 100%; height: auto; border-radius: 4px; }
.content img[align="right"], .content img[align="left"] { margin: 0 0 12px 12px; }

/* ---- hr ---- */
.content hr {
  border: none; border-top: 1px solid var(--line); margin: 28px 0;
}

/* ---- footer ---- */
footer.site {
  position: relative; z-index: 1; border-top: 1px solid var(--line);
  margin-top: 70px; padding: 40px clamp(20px, 5vw, 56px);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
footer.site a { color: var(--blue); text-decoration: none; }
footer.site .signoff { color: var(--faint); }

/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(12px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.masthead .reveal:nth-child(2){ animation-delay:.05s } .masthead .reveal:nth-child(3){ animation-delay:.1s }
@keyframes rise { to { opacity: 1; transform: none; } }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
