/* Self-hosted fonts: point these at your own font files.
   Local-name fallbacks kept so the page still works before you wire up src. */
@font-face {
  font-family: 'LibertinusSans';
  src: local('Libertinus Sans');
  /* src: url('/fonts/LibertinusSans-Regular.woff2') format('woff2'); */
}
@font-face {
  font-family: 'LibertinusSans';
  font-weight: 600;
  src: local('Libertinus Sans SemiBold'), local('Libertinus Sans Bold');
  /* src: url('/fonts/LibertinusSans-Bold.woff2') format('woff2'); */
}
@font-face {
  font-family: 'LibertinusSans';
  font-style: italic;
  src: local('Libertinus Sans Italic');
  /* src: url('/fonts/LibertinusSans-Italic.woff2') format('woff2'); */
}
@font-face {
  font-family: 'UbuntuMono';
  src: local('Ubuntu Mono');
  /* src: url('/fonts/UbuntuMono-Regular.woff2') format('woff2'); */
}
@font-face {
  font-family: 'UbuntuMono';
  font-weight: bold;
  src: local('Ubuntu Mono Bold');
  /* src: url('/fonts/UbuntuMono-Bold.woff2') format('woff2'); */
}

:root {
  --bg: #1d2021;
  --bg1: #282828;
  --bg2: #3c3836;
  --bg3: #504945;
  --fg: #ebdbb2;
  --fg-dim: #a89984;
  --gray: #928374;
  --yellow: #d79921;
  --yellow-b: #fabd2f;
  --orange: #d65d0e;
  --orange-b: #fe8019;
  --aqua: #689d6a;
  --aqua-b: #8ec07c;
  --red: #cc241d;
  --red-b: #fb4934;
  --blue: #458588;
  --blue-b: #83a598;
  --green: #98971a;
  --green-b: #b8bb26;
}

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

html { background: var(--bg); height: 100%;}
html, body { overflow-x: hidden; max-width: 100%; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'LibertinusSans', Georgia, serif;
  line-height: 1.5;
  /* faint grain + a soft off-center glow, built from gradients only */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(235,219,178,0.05) 1px, transparent 0),
    radial-gradient(ellipse 900px 500px at 78% -10%, rgba(214,89,14,0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 5% 30%, rgba(104,157,106,0.05), transparent 65%);
  background-size: 3px 3px, auto, auto;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: repeat, no-repeat, no-repeat;
  min-height: 100%;
  display: flex; 
  flex-direction: column;
}

.mono { font-family: 'UbuntuMono', 'Courier New', monospace; }

/* subtle CRT scanline + vignette overlay */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.10) 0px,
      rgba(0,0,0,0.10) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.35) 100%);
  z-index: 999;
  mix-blend-mode: multiply;
}

/* ============ NAV ============ */
header {
  border-bottom: 1px solid var(--bg3);
  padding: 18px 48px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: rgba(29,32,33,0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(2px);
}
.logo {
  font-family: 'UbuntuMono', monospace;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--yellow-b);
  text-decoration: none;
}
.logo span { color: var(--fg-dim); }
nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  font-family: 'UbuntuMono', monospace;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0.5px;
}
nav a {
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 0.15s, border-color 0.15s;
}
nav a:hover, nav a:focus-visible {
  color: var(--aqua-b);
  border-color: var(--aqua-b);
  outline: none;
}

/* ============ HERO ============ */
.hero {
  padding: 90px 48px 70px;
  max-width: 1180px;
  margin: 0 auto;
/*  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px; */ 
  display: flex; 
  flex-direction: column;
  align-items: center;
}
.hero-cb {
    line-height: normal;
    font-size: 1rem;
    transform: translateZ(0);
    color: transparent;
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 860px ) {
    .hero-cb {
        font-size: 12px;
        line-height: 1.1;
    }
}
@media (max-width: 490px ) {
    .hero-cb {
        font-size: 7px;
        line-height: 1.1;
    }
}

.cb-y { color:#fabd2f; }
.cb-o { color:#fe8019; }
.cb-g { color:#b8bb26; }
.hero-tag {
  font-family: 'UbuntuMono', monospace;
  font-size: 12px;
  color: var(--orange-b);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--orange-b);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--orange-b);
  animation: blink 1.6s infinite steps(2);
}
@keyframes blink { 50% { opacity: 0.25; } }

h1 {
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: var(--fg);
}

h2 { color: var(--green-b);}
h3 { color: var(--aqua-b);}
h4 { color: var(--blue-b);}

h1 em {
  font-style: italic;
  color: var(--aqua-b);
}
.hero p.lede {
  margin-top: 22px;
  font-size: 18px;
  color: var(--fg-dim);
  max-width: 46ch;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
}
.btn {
  font-family: 'UbuntuMono', monospace;
  font-size: 13px;
  padding: 12px 22px;
  border: 1px solid var(--yellow-b);
  color: var(--yellow-b);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--yellow-b); color: var(--bg); }
.btn.ghost {
  border-color: var(--bg3);
  color: var(--fg-dim);
}
.btn.ghost:hover { background: var(--bg2); color: var(--fg); }

/* --- signature: loss curve scope panel --- */
.scope {
  border: 1px solid var(--bg3);
  background: var(--bg1);
  padding: 18px 20px 14px;
  position: relative;
}
.scope-head {
  display: flex;
  justify-content: space-between;
  font-family: 'UbuntuMono', monospace;
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.scope-head .live { color: var(--aqua-b); }
svg.loss { display: block; width: 100%; height: auto; }
.scope-foot {
  display: flex;
  justify-content: space-between;
  font-family: 'UbuntuMono', monospace;
  font-size: 11px;
  color: var(--gray);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--bg3);
}
.scope-foot b { color: var(--fg); font-weight: normal; }

/* ============ SECTION LABEL ============ */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 48px;
  border-top: 1px solid var(--bg2);
}
.eyebrow {
  font-family: 'UbuntuMono', monospace;
  font-size: 12px;
  color: var(--blue-b);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section h2 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 40px;
  max-width: 30ch;
}

/* ============ LOGBOOK ============ */
.logbook { display: flex; flex-direction: column; }
.entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-top: 1px solid var(--bg2);
}
.entry:last-child { border-bottom: 1px solid var(--bg2); }
.entry-id {
  font-family: 'UbuntuMono', monospace;
  color: var(--orange-b);
  font-size: 13px;
}
.entry-id .date {
  display: block;
  color: var(--gray);
  margin-top: 4px;
  font-size: 12px;
}
.entry h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.entry p { color: var(--fg-dim); max-width: 62ch; }
.tags {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tags span {
  font-family: 'UbuntuMono', monospace;
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
/* ============ TAG FILTER BAR ============ */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.tag-filter-btn {
  font-family: 'UbuntuMono', monospace;
  font-size: 11px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--bg3);
  color: var(--fg-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tag-filter-btn[data-tag="all"] {
  border-color: var(--fg-dim);
  color: var(--fg-dim);
}
.tag-filter-btn[data-tag="all"].active {
  background: var(--fg-dim);
  color: var(--bg);
}
.tag-filter-btn:not([data-tag="all"]) {
  border-color: currentColor;
}
.tag-filter-btn:not([data-tag="all"]).active {
  background: color-mix(in srgb, currentColor 22%, transparent);
}
.entry.is-hidden { display: none; }
/* ============ METRICS STRIP ============ */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--bg2);
}
.metric {
  padding: 26px 24px;
  border-left: 1px solid var(--bg2);
}
.metric:first-child { border-left: none; }
.metric .pre {
  display: flex;
  align-items: flex-end;
  min-height: 32px;
  line-height: 1.4;
}
.metric .post {margin-top: 6px; }
.metric .ref {
  margin-top: 12px;
  font-family: 'UbuntuMono', monospace;
  font-size: 10px;
}
.metric .ref a {
  color: var(--gray);
  text-decoration: none;
  border-bottom: 1px dotted var(--bg3);
}
.metric .ref a:hover { color: var(--aqua-b); border-color: var(--aqua-b); }
.metric .num {
  font-family: 'UbuntuMono', monospace;
  font-size: 30px;
  color: var(--yellow-b);
  margin: 6px 0;
  line-height 1.1;
}
.metric .label {
  margin-top: 6px;
  font-family: 'UbuntuMono', monospace;
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============ SINGLE ENTRY BODY ============ */
.entry-body p { margin-bottom: 18px; }
.entry-body a { color: var(--aqua-b); }

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--bg2);
  padding: 36px 48px;
  display: flex;
  justify-content: space-between;
  font-family: 'UbuntuMono', monospace;
  font-size: 12px;
  color: var(--gray);
}
footer a { color: var(--gray); text-decoration: none; }
footer a:hover { color: var(--aqua-b); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 50px; }
  h1 { font-size: 38px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-left: none; border-top: 1px solid var(--bg2); }
  .metric:first-child { border-top: none; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  header { padding: 16px 24px; }
  .section, .hero { padding-left: 24px; padding-right: 24px; }
  nav ul { gap: 18px; }
}
/* ============ PUBLICATIONS ============ */ 
.publications-list { 
  min-width: 100%;
}
.publications-list li {
  margin-bottom: 14px;
}
.publications-list a {
  text-decoration: none;
  color: inherit;
}
.publications-list em:nth-of-type(1) {
  font-style: italic;
  font-weight: bold;
  color: var(--blue-b);
}
.publications-list em:nth-of-type(2) {
  font-style: italic;
  font-weight: normal;
  color: var(--aqua-b);
}

main { flex: 1 0 auto; }

/* ============ BURGER MENU ============ */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 20;
  margin: 0;
  line-height: 0;
  flex-shrink: 0;
  align-self: center;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--fg);
  transition: transform 0.2s, opacity 0.2s;
}
.burger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.burger.is-open span:nth-child(2) {
  opacity: 0;
}
.burger.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 860px) {
  .burger { display: flex; }

  header nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 240px;
    background: var(--bg1);
    border-left: 1px solid var(--bg3);
    padding: 80px 24px 24px;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 15;
  }
  header nav.is-open {
    transform: translateX(0);
  }
  header nav ul {
    flex-direction: column;
    gap: 24px;
  }
}

/* ============ CODE BLOCKS ============ */
.entry-body pre {
  font-family: 'UbuntuMono', monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--bg3);
  background: var(--bg2);
  margin-bottom: 12px;
}
.entry-body code {
  font-family: 'UbuntuMono', monospace;
  font-size: 0.9em;
}
.entry-body p code {
  background: var(--bg2);
  padding: 2px 6px;
  border: 1px solid var(--bg3);
}

/* ============ PUBLICATION ABSTRACTS ============ */
.publications-list summary {
  cursor: pointer;
  color: var(--gray);
  font-family: 'UbuntuMono', monospace;
  font-size: 12px;
  list-style: none;
  margin-top: 6px;
}
.publications-list summary::-webkit-details-marker { display: none; }
.publications-list summary::before {
  content: "▸ abstract";
  color: var(--aqua-b);
}
.publications-list details[open] summary::before {
  content: "▾ abstract";
}
.publications-list details {
  margin-top: 4px;
  margin-bottom: 10px;
}
.publications-list details p {
  color: var(--fg-dim);
  font-size: 14px;
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--bg3);
}
