/* ══════════════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════════════════════════
   TOKENS
══════════════════════════════════════════════════════════ */
:root {
  /* colour */
  --bg:     #F5F4F0;
  --text:   #1F2937;
  --accent: #2563EB;
  --dim:    rgba(31,41,55,0.42);
  --rule:   rgba(31,41,55,0.12);

  /* type */
  --mono:  'JetBrains Mono', monospace;
  --serif: 'Libre Baskerville', Georgia, serif;

  /* ── 10-size type scale ─────────────────────────────────
     fs-1   8px    micro: badges, status, tiny labels
     fs-2  10px    small: nav, breadcrumbs, captions
     fs-3  12px    base mono: code, tags, read-more links
     fs-4  15px    body serif: paragraphs, descriptions
     fs-5  18px    medium: sidebar desc, sub-body
     fs-6  24px    heading-sm: blog titles, h2
     fs-7  36px    heading-lg: section titles, h1
     fs-8  42px    display: sidebar titles
     fs-9  responsive nav
     fs-10 responsive hero
  ────────────────────────────────────────────────────── */
  --fs-1:  8px;
  --fs-2:  10px;
  --fs-3:  12px;
  --fs-4:  15px;
  --fs-5:  18px;
  --fs-6:  24px;
  --fs-7:  36px;
  --fs-8:  42px;
  --fs-9:  clamp(14px, 1.4vw, 20px);
  --fs-10: clamp(22px, 4.2vw, 68px);

  /* rag-guide code blocks */
  --cell-dark: #0F172A;
}

/* ══════════════════════════════════════════════════════════
   BASE
══════════════════════════════════════════════════════════ */
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }

/* ══════════════════════════════════════════════════════════
   PAGE OVERLAY  (transition fade — JS controls opacity)
══════════════════════════════════════════════════════════ */
#pg-ov {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  transition: opacity 400ms ease;
}

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
header {
  position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 30;
  background: rgba(245,244,240,0.96); border-bottom: 0.5px solid var(--rule);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.back {
  font-family: var(--mono); font-size: var(--fs-2); letter-spacing: 0.14em;
  color: var(--dim); text-decoration: none; text-transform: uppercase; transition: color 150ms;
}
.back:hover { color: var(--accent); }
.sec-label {
  font-family: var(--mono); font-size: var(--fs-2); font-weight: 500;
  letter-spacing: 0.22em; color: var(--accent); text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   SHELL  (between header and nav)
══════════════════════════════════════════════════════════ */
.shell { position: fixed; top: 48px; bottom: 80px; left: 0; right: 0; display: flex; z-index: 5; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
aside {
  flex-shrink: 0;
  border-right: 0.5px solid var(--rule);
  display: flex; flex-direction: column;
  width: 280px; padding: 52px 36px 36px;
}

/* rag-guide: narrower sidebar with scrollable TOC */
aside.narrow {
  width: 230px; padding: 36px 24px; overflow-y: auto;
}
aside.narrow::-webkit-scrollbar { width: 2px; }
aside.narrow::-webkit-scrollbar-thumb { background: rgba(37,99,235,0.15); }

/* about: photo fills the whole aside */
aside.photo-aside { overflow: hidden; padding: 0; }

.s-title  { font-family: var(--serif); font-size: var(--fs-8); font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 24px; }
.s-rule   { height: 0.5px; background: var(--rule); margin: 20px 0; }
.s-desc   { font-family: var(--serif); font-size: var(--fs-5); line-height: 1.78; color: rgba(31,41,55,0.58); }
.s-foot   { margin-top: auto; }
.s-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: var(--fs-2); font-weight: 300;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 9px;
}
.s-row .k { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   CONTENT PANEL
══════════════════════════════════════════════════════════ */
.content { flex: 1; overflow-y: auto; padding: 52px 64px; }
.content::-webkit-scrollbar { width: 2px; }
.content::-webkit-scrollbar-thumb { background: rgba(37,99,235,0.2); }

/* rag-guide: slightly tighter padding to give notebook more room */
.content.guide { padding: 40px 52px 60px; }

/* ══════════════════════════════════════════════════════════
   BOTTOM NAV
══════════════════════════════════════════════════════════ */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 80px; z-index: 30;
  background: rgba(245,244,240,0.96); border-top: 0.5px solid var(--rule);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; gap: 100px;
}
#nav a {
  font-family: var(--mono); font-size: var(--fs-9); font-weight: 400;
  letter-spacing: 0.18em; text-decoration: none; color: rgba(31,41,55,0.5);
  text-transform: uppercase; display: flex; align-items: center; gap: 10px;
  transition: color 180ms; user-select: none;
}
#nav a:hover, #nav a.active { color: var(--accent); }
#nav a .ico { font-size: 20px; }
.nd, .nav-div { width: 0.5px; height: 20px; background: var(--rule); }


/* ══════════════════════════════════════════════════════════
   INDEX PAGE
══════════════════════════════════════════════════════════ */
body.page-index { cursor: crosshair; }

#three      { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#grain      { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0.035; mix-blend-mode: multiply; }
#ruler-h    { position: fixed; top: 26px; left: 0; right: 0; height: 8px; pointer-events: none; z-index: 9; background: repeating-linear-gradient(90deg, rgba(37,99,235,0.2) 0px, rgba(37,99,235,0.2) 0.5px, transparent 0.5px, transparent 72px); }
#ruler-v    { position: fixed; top: 0; left: 0; bottom: 0; width: 8px; pointer-events: none; z-index: 9; background: repeating-linear-gradient(180deg, rgba(37,99,235,0.2) 0px, rgba(37,99,235,0.2) 0.5px, transparent 0.5px, transparent 72px); }

#grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background-image:
    linear-gradient(rgba(31,41,55,0.055) 0.5px, transparent 0.5px),
    linear-gradient(90deg, rgba(31,41,55,0.055) 0.5px, transparent 0.5px);
  background-size: 72px 72px;
}
#scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.012) 3px, rgba(0,0,0,0.012) 4px);
}

.zone-line { position: fixed; left: 0; right: 0; height: 0.5px; background: rgba(37,99,235,0.08); pointer-events: none; z-index: 5; }
.zone-line::after { content: attr(data-label); position: absolute; right: 12px; top: -8px; font-family: var(--mono); font-size: var(--fs-1); color: rgba(37,99,235,0.35); letter-spacing: 0.1em; }
#zone1 { top: 33.33%; }
#zone2 { top: 66.66%; }

#xhair { position: fixed; pointer-events: none; z-index: 15; transform: translate(-50%, -50%); width: 0; height: 0; }
#xhair::before { content: ''; position: absolute; width: 14px; height: 0.5px; background: rgba(37,99,235,0.5); top: 0; left: -7px; }
#xhair::after  { content: ''; position: absolute; width: 0.5px; height: 14px; background: rgba(37,99,235,0.5); top: -7px; left: 0; }

#coord-cursor { position: fixed; font-family: var(--mono); font-size: var(--fs-1); color: var(--accent); pointer-events: none; z-index: 16; letter-spacing: 0.05em; opacity: 0.7; transform: translate(12px, -14px); }

#statusbar {
  position: fixed; top: 0; left: 0; right: 0; height: 26px;
  background: rgba(245,244,240,0.92); border-bottom: 0.5px solid rgba(31,41,55,0.14);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  z-index: 20; font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; letter-spacing: 0.08em; color: var(--dim);
}
#statusbar .id   { color: var(--accent); font-weight: 500; }
#statusbar .live { display: inline-flex; align-items: center; gap: 5px; }
#statusbar .dot  { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

.corner { position: fixed; font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; color: var(--dim); letter-spacing: 0.07em; pointer-events: none; z-index: 10; line-height: 1.85; }
.corner .k { color: var(--accent); }
.c-tl { top: 36px; left: 18px; }
.c-tr { top: 36px; right: 18px; text-align: right; }
.c-bl { bottom: 68px; left: 18px; }
.c-br { bottom: 68px; right: 18px; text-align: right; }

.tstrip { position: fixed; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; color: var(--dim); line-height: 2; pointer-events: none; z-index: 10; letter-spacing: 0.06em; }
.tstrip .k   { color: var(--accent); display: block; }
.tstrip .v   { display: block; color: var(--text); opacity: 0.75; }
.tstrip .sep { display: block; height: 12px; }
#tl { left: 18px; border-left: 0.5px solid rgba(37,99,235,0.25); padding-left: 10px; }
#tr { right: 18px; border-right: 0.5px solid rgba(37,99,235,0.25); padding-right: 10px; text-align: right; }

#hero { position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 6; pointer-events: none; will-change: transform; }
#hero h1  { font-family: var(--serif); font-weight: 900; font-size: var(--fs-10); letter-spacing: 0.26em; color: var(--text); text-transform: uppercase; line-height: 1; margin-bottom: 20px; text-shadow: 0 1px 0 rgba(245,244,240,0.8); }
#hero .sub { font-family: var(--mono); font-size: var(--fs-3); font-weight: 400; letter-spacing: 0.42em; color: var(--text); text-transform: uppercase; }


/* ══════════════════════════════════════════════════════════
   BLOG PAGE
══════════════════════════════════════════════════════════ */
.yr { font-family: var(--mono); font-size: var(--fs-3); font-weight: 500; color: var(--accent); letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 36px; }

.post { padding: 40px 0; border-bottom: 0.5px solid var(--rule); max-width: 720px; }
.post:first-of-type { border-top: 0.5px solid var(--rule); }
.post-meta { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.tag { font-family: var(--mono); font-size: var(--fs-3); color: var(--accent); padding: 2px 7px; border: 0.5px solid rgba(37,99,235,0.3); letter-spacing: 0.1em; }
a.p-title { font-family: var(--serif); font-size: var(--fs-6); font-weight: 400; color: var(--text); line-height: 1.3; text-decoration: none; display: block; margin-bottom: 16px; transition: color 150ms; }
a.p-title:hover { color: var(--accent); }
.p-exc { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.85; color: rgba(31,41,55,0.82); margin-bottom: 20px; }
a.read { font-family: var(--mono); font-size: var(--fs-3); letter-spacing: 0.2em; color: var(--accent); text-decoration: none; text-transform: uppercase; transition: opacity 150ms; }
a.read:hover { opacity: 0.5; }


/* ══════════════════════════════════════════════════════════
   PROJECTS PAGE
══════════════════════════════════════════════════════════ */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 1200px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .projects-grid { grid-template-columns: 1fr; } }

.proj-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.proj-card:hover .proj-img-wrap img { opacity: 0.82; }
.proj-card:hover .proj-card-title   { color: var(--accent); }

.proj-img-wrap { width: 100%; aspect-ratio: 1; overflow: hidden; background: rgba(31,41,55,0.06); border: 0.5px solid var(--rule); margin-bottom: 16px; }
.proj-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 150ms; }
.proj-img-placeholder { display: flex; align-items: center; justify-content: center; }
.proj-ph-label { font-family: var(--mono); font-size: var(--fs-7); font-weight: 300; letter-spacing: 0.22em; color: rgba(31,41,55,0.15); }

.proj-card-head  { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.proj-card-title { font-family: var(--serif); font-size: var(--fs-5); font-weight: 700; color: var(--text); line-height: 1.2; transition: color 150ms; }

.badge        { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; padding: 3px 9px; flex-shrink: 0; }
.badge-active { color: var(--accent); border: 0.5px solid rgba(37,99,235,0.4); }
.badge-wip    { color: var(--dim);    border: 0.5px solid rgba(31,41,55,0.2); }

.proj-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ptag { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(31,41,55,0.72); padding: 2px 7px; background: rgba(31,41,55,0.08); }


/* ══════════════════════════════════════════════════════════
   ABOUT PAGE
══════════════════════════════════════════════════════════ */
.photo-wrap     { width: 100%; height: 260px; flex-shrink: 0; overflow: hidden; border-bottom: 0.5px solid var(--rule); }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.sidebar-info   { padding: 28px 32px; display: flex; flex-direction: column; flex: 1; }

.s-name { font-family: var(--serif); font-size: var(--fs-5); font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: 6px; }
.s-role { font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; margin-bottom: 24px; }

.s-contact-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.s-ck { font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); min-width: 50px; }
.s-cv { font-family: var(--mono); font-size: var(--fs-2); color: var(--text); }
.s-cv a { color: var(--accent); text-decoration: none; transition: opacity 150ms; }
.s-cv a:hover { opacity: 0.6; }

.page-title { font-family: var(--serif); font-size: var(--fs-6); font-weight: 700; color: var(--text); margin-bottom: 40px; line-height: 1.1; }
.bio p { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.88; color: var(--text); margin-bottom: 24px; max-width: 680px; }
.bio p:last-child { margin-bottom: 0; }
.bio h2 { font-family: var(--serif); font-size: var(--fs-5); font-weight: 700; color: var(--text); margin: 40px 0 14px; line-height: 1.3; }
.bio ul { list-style: none; margin: 0 0 24px; }
.bio li { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.75; color: rgba(31,41,55,0.82); padding: 3px 0 3px 22px; position: relative; margin-bottom: 4px; max-width: 680px; }
.bio li::before { content: '—'; color: var(--accent); position: absolute; left: 0; }
.bio strong { font-weight: 700; color: var(--text); }
.bio .note { margin: 28px 0; padding: 14px 20px; border-left: 2px solid rgba(37,99,235,0.25); font-family: var(--serif); font-size: var(--fs-4); line-height: 1.78; color: rgba(31,41,55,0.65); font-style: italic; max-width: 680px; }
hr.div { border: none; border-top: 0.5px solid var(--rule); margin: 44px 0; max-width: 680px; }

.chat-hdr    { display: flex; align-items: center; justify-content: space-between; max-width: 680px; margin-bottom: 4px; }
.chat-lbl    { font-family: var(--mono); font-size: var(--fs-2); font-weight: 500; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; }
.chat-status { font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.chat-status .dot { width: 5px; height: 5px; border-radius: 50%; background: #22c55e; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
.chat-sub { font-family: var(--mono); font-size: var(--fs-1); font-weight: 300; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 18px; max-width: 680px; }

#chat-win  { max-width: 680px; border: 0.5px solid rgba(31,41,55,0.18); background: rgba(255,255,255,0.45); }
#chat-msgs { height: 280px; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
#chat-msgs::-webkit-scrollbar       { width: 2px; }
#chat-msgs::-webkit-scrollbar-thumb { background: rgba(37,99,235,0.2); }

.msg      { display: flex; flex-direction: column; gap: 5px; max-width: 86%; }
.msg.ai   { align-self: flex-start; }
.msg.usr  { align-self: flex-end; }
.msg-s    { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.msg.ai  .msg-s { color: var(--accent); }
.msg.usr .msg-s { color: var(--dim); text-align: right; }
.msg-b    { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.7; padding: 11px 15px; }
.msg.ai  .msg-b { background: rgba(245,244,240,0.9); border: 0.5px solid var(--rule); color: var(--text); }
.msg.usr .msg-b { background: rgba(37,99,235,0.07); border: 0.5px solid rgba(37,99,235,0.18); color: var(--text); }

#typing       { display: none; }
#typing.show  { display: flex; }
.tdots { display: flex; align-items: center; gap: 5px; padding: 14px 15px; }
.td    { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); animation: bop 1.1s infinite; }
.td:nth-child(2) { animation-delay: .18s; }
.td:nth-child(3) { animation-delay: .36s; }
@keyframes bop { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }

#chat-row { display: flex; border-top: 0.5px solid rgba(31,41,55,0.13); }
#chat-in  { flex: 1; font-family: var(--mono); font-size: var(--fs-3); font-weight: 300; color: var(--text); background: transparent; border: none; outline: none; padding: 15px 20px; letter-spacing: 0.04em; }
#chat-in::placeholder { color: rgba(31,41,55,0.28); }
#chat-btn { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); background: transparent; border: none; border-left: 0.5px solid rgba(31,41,55,0.13); padding: 0 20px; cursor: pointer; transition: background 150ms; }
#chat-btn:hover { background: rgba(37,99,235,0.05); }


/* ══════════════════════════════════════════════════════════
   RAG-GUIDE PAGE
══════════════════════════════════════════════════════════ */
.breadcrumb     { font-family: var(--mono); font-size: var(--fs-2); letter-spacing: 0.12em; color: var(--dim); }
.breadcrumb .cur { color: var(--accent); font-weight: 500; }

.toc-title { font-family: var(--mono); font-size: var(--fs-3); font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.toc-item  { display: block; font-family: var(--mono); font-size: var(--fs-2); font-weight: 300; letter-spacing: 0.06em; color: var(--text); text-decoration: none; padding: 5px 0 5px 10px; border-left: 1.5px solid transparent; line-height: 1.4; transition: all 150ms; }
.toc-item:hover { color: var(--accent); border-left-color: var(--accent); }
.toc-sep   { height: 0.5px; background: var(--rule); margin: 12px 0; }
.proj-meta { margin-top: auto; padding-top: 24px; }
.meta-row  { font-family: var(--mono); font-size: var(--fs-2); font-weight: 300; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-bottom: 9px; display: flex; justify-content: space-between; }
.meta-row .k { color: var(--accent); }

.nb       { max-width: 820px; }
.nb.wide  { max-width: none; }

.cell-title    { margin-bottom: 24px; padding-bottom: 28px; border-bottom: 0.5px solid var(--rule); }
.cell-title h1 { font-family: var(--serif); font-size: var(--fs-7); font-weight: 700; color: var(--text); margin-bottom: 10px; line-height: 1.2; }
.cell-title .sub { font-family: var(--mono); font-size: var(--fs-2); font-weight: 300; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }

.cell-md { margin-bottom: 20px; padding: 22px 24px; background: rgba(255,255,255,0.5); border: 0.5px solid var(--rule); border-left: 2.5px solid rgba(37,99,235,0.18); }
.cell-md h2 { font-family: var(--serif); font-size: var(--fs-6); font-weight: 700; color: var(--text); margin-bottom: 14px; }
.cell-md h3 { font-family: var(--mono); font-size: var(--fs-2); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.cell-md p  { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.82; color: rgba(31,41,55,0.85); margin-bottom: 10px; }
.cell-md p:last-child { margin-bottom: 0; }
.cell-md ul { list-style: none; margin: 6px 0; }
.cell-md li { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.75; color: rgba(31,41,55,0.82); padding: 2px 0 2px 24px; position: relative; }
.cell-md li::before { content: '—'; color: var(--accent); position: absolute; left: 0; }
.cell-md ol { counter-reset: n; list-style: none; margin: 6px 0; }
.cell-md ol li { counter-increment: n; padding-left: 32px; }
.cell-md ol li::before { content: counter(n) '.'; color: var(--accent); left: 0; font-family: var(--mono); font-size: var(--fs-3); }
.cell-md code   { font-family: var(--mono); font-size: var(--fs-3); background: rgba(37,99,235,0.08); padding: 1px 5px; color: var(--accent); }
.cell-md strong { font-weight: 700; color: var(--text); }

.cell-code { margin-bottom: 20px; }
.cell-code-hdr { display: flex; align-items: center; justify-content: space-between; background: #1E293B; border: 0.5px solid rgba(255,255,255,0.07); border-bottom: none; padding: 6px 16px; }
.cell-lang { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.cell-copy { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.28); background: none; border: none; cursor: pointer; transition: color 150ms; padding: 2px 4px; }
.cell-copy:hover { color: rgba(255,255,255,0.75); }
.cell-copy.ok    { color: #4ADE80; }

pre.cell-pre { margin: 0; background: var(--cell-dark) !important; border: 0.5px solid rgba(255,255,255,0.07); border-top: none; overflow-x: auto; font-family: var(--mono); font-size: var(--fs-3); line-height: 1.65; }
pre.cell-pre code.hljs { background: var(--cell-dark) !important; padding: 20px; font-size: var(--fs-3); }
pre.cell-pre.scroll { max-height: 480px; overflow-y: auto; }
pre.cell-pre.scroll::-webkit-scrollbar       { width: 3px; height: 3px; }
pre.cell-pre.scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.callout      { margin-bottom: 20px; padding: 14px 20px; border: 0.5px solid; display: flex; gap: 14px; align-items: flex-start; }
.callout.note { background: rgba(37,99,235,0.04); border-color: rgba(37,99,235,0.22); }
.callout.warn { background: rgba(234,179,8,0.05); border-color: rgba(234,179,8,0.30); }
.callout-lbl  { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 1px; white-space: nowrap; }
.callout.note .callout-lbl { color: var(--accent); }
.callout.warn .callout-lbl { color: #B45309; }
.callout p    { font-family: var(--mono); font-size: var(--fs-3); line-height: 1.7; color: rgba(31,41,55,0.72); }

.pipeline   { margin-bottom: 20px; background: var(--cell-dark); border: 0.5px solid rgba(255,255,255,0.07); padding: 28px; }
.pipe-title { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 24px; }
.pipe-row   { display: flex; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.pipe-box   { font-family: var(--mono); font-size: var(--fs-2); font-weight: 400; letter-spacing: 0.06em; padding: 8px 14px; border: 0.5px solid rgba(255,255,255,0.15); color: #CBD5E1; background: rgba(255,255,255,0.03); white-space: nowrap; }
.pipe-box.accent { border-color: rgba(37,99,235,0.5); color: #93C5FD; background: rgba(37,99,235,0.08); }
.pipe-box.output { border-color: rgba(74,222,128,0.4); color: #86EFAC; background: rgba(74,222,128,0.06); }
.pipe-arr   { font-family: var(--mono); font-size: var(--fs-3); color: rgba(255,255,255,0.2); padding: 0 6px; }
.pipe-gap   { height: 4px; }

.nb-table    { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: var(--fs-3); }
.nb-table th { text-align: left; padding: 10px 16px; background: rgba(37,99,235,0.06); border: 0.5px solid var(--rule); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; font-size: var(--fs-1); color: var(--accent); }
.nb-table td { padding: 10px 16px; border: 0.5px solid var(--rule); color: rgba(31,41,55,0.75); line-height: 1.55; }
.nb-table tr:nth-child(even) td { background: rgba(255,255,255,0.35); }
.nb-table .dim { color: var(--dim); }
.nb-table .hi  { color: var(--text); font-weight: 500; }

.sec-anchor { display: block; height: 0; margin-top: -20px; padding-top: 20px; }
.step-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.step-n { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.18em; color: var(--accent); border: 0.5px solid rgba(37,99,235,0.35); padding: 3px 9px; text-transform: uppercase; }
.step-t { font-family: var(--mono); font-size: var(--fs-2); font-weight: 400; letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }


/* ══════════════════════════════════════════════════════════
   DASHBOARDS INDEX PAGE
══════════════════════════════════════════════════════════ */
.dash-grid { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }

.dash-card { display: block; text-decoration: none; color: inherit; border: 0.5px solid var(--rule); padding: 28px 32px; transition: border-color 150ms; }
.dash-card:hover { border-color: var(--accent); }
.dash-card:hover .dash-card-title { color: var(--accent); }

.dash-live  { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); border: 0.5px solid rgba(37,99,235,0.4); display: inline-block; padding: 3px 9px; margin-bottom: 14px; }
.dash-card-title { font-family: var(--serif); font-size: var(--fs-6); font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.2; transition: color 150ms; }
.dash-card-desc  { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.82; color: rgba(31,41,55,0.75); margin-bottom: 18px; }
.dash-card-foot  { font-family: var(--mono); font-size: var(--fs-2); color: var(--dim); display: flex; justify-content: space-between; }


/* ══════════════════════════════════════════════════════════
   SCIENTIFIC INTELLIGENCE DASHBOARD
══════════════════════════════════════════════════════════ */
.si-charts-row { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 20px; }

.si-cell       { border: 0.5px solid var(--rule); padding: 24px; margin-bottom: 20px; background: rgba(255,255,255,0.45); min-width: 0; overflow: hidden; }
.si-cell-title { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }

.si-chart-sm { position: relative; height: 260px; width: 100%; }
.si-chart-lg { position: relative; height: 300px; width: 100%; }

.si-range        { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.si-range label  { font-family: var(--mono); font-size: var(--fs-1); color: var(--dim); }
.si-range input[type=date] { font-family: var(--mono); font-size: var(--fs-1); background: transparent; border: 0.5px solid var(--rule); color: var(--text); padding: 5px 10px; outline: none; }
.si-range button { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); background: transparent; border: 0.5px solid rgba(37,99,235,0.35); padding: 5px 14px; cursor: pointer; transition: background 150ms; }
.si-range button:hover { background: rgba(37,99,235,0.05); }

.exec         { font-family: var(--serif); font-size: var(--fs-4); line-height: 1.9; color: rgba(31,41,55,0.85); }
.exec strong  { font-weight: 700; color: var(--text); }
.exec a.cite  { font-family: var(--mono); font-size: var(--fs-1); color: var(--accent); text-decoration: none; vertical-align: super; margin-left: 2px; }
.exec a.cite:hover { text-decoration: underline; }

.si-details { border: 0.5px solid var(--rule); margin-bottom: 20px; }
.si-details summary { font-family: var(--mono); font-size: var(--fs-2); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); padding: 14px 20px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; transition: background 150ms; }
.si-details summary::-webkit-details-marker { display: none; }
.si-details summary::before { content: '▶'; font-size: var(--fs-1); opacity: 0.6; }
.si-details[open] summary::before { content: '▼'; }
.si-details summary:hover { background: rgba(37,99,235,0.03); }

.si-papers-inner { border-top: 0.5px solid var(--rule); }
.si-week-label   { font-family: var(--mono); font-size: var(--fs-1); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 12px 20px 8px; }
.si-paper-item   { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 20px; border-bottom: 0.5px solid var(--rule); gap: 20px; }
.si-paper-item:last-child { border-bottom: none; }
.si-paper-title  { font-family: var(--serif); font-size: var(--fs-4); color: rgba(31,41,55,0.82); flex: 1; line-height: 1.5; }
.si-paper-link   { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: 0.12em; color: var(--accent); text-decoration: none; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.si-paper-link:hover { opacity: 0.6; }


/* ══════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Header */
  header { padding: 0 16px; }

  /* Hide regular sidebars; keep photo-aside (About page) */
  aside:not(.photo-aside) { display: none; }
  .content { padding: 32px 20px 40px; }
  .content.guide { padding: 24px 16px 40px; }

  /* About: photo-aside becomes a compact horizontal strip */
  aside.photo-aside { width: 100%; flex-direction: row; border-right: none; border-bottom: 0.5px solid var(--rule); flex-shrink: 0; height: auto; }
  .shell { flex-direction: column; }
  .photo-wrap { width: 90px; height: 90px; flex-shrink: 0; border-bottom: none; border-right: 0.5px solid var(--rule); }
  .sidebar-info { padding: 14px 16px; }
  .s-name { font-size: var(--fs-4); }
  .s-role { font-size: var(--fs-1); margin-bottom: 10px; }

  /* Nav: icons + stacked labels, no dividers, evenly spaced */
  .nd, .nav-div { display: none; }
  #nav { justify-content: space-evenly; gap: 0; height: 64px; padding: 0; }
  #nav a { flex-direction: column; align-items: center; gap: 3px; font-size: 9px; letter-spacing: 0.06em; }
  #nav a .ico { font-size: 22px; }
  .shell { bottom: 64px; }

  /* Index: hero letter-spacing overflows on narrow screens */
  #hero h1  { letter-spacing: 0.05em; }
  #hero .sub { letter-spacing: 0.12em; font-size: var(--fs-2); }

  /* Decorative chrome: useless on mobile */
  .corner, .tstrip, #ruler-h, #ruler-v, #statusbar { display: none; }

  /* Content widths */
  .bio p, .bio li, .bio .note, hr.div { max-width: 100%; }
  .post { max-width: 100%; }

  /* Dashboard: stack chart columns */
  .si-charts-row { grid-template-columns: 1fr; }
}
