/* =========================================================
   Zafiirah Hosenie, personal site
   Palette: pale sky blue · sage green · autumn terracotta/mustard
   ========================================================= */

:root {
  --bg: #f7f4ee;
  --bg-2: #fbfaf6;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(31, 42, 55, 0.08);
  --ink: #1f2a37;
  --ink-soft: #4b5867;
  --ink-mute: #7a8592;

  --sky: #cfe3f3;
  --sky-deep: #5f8fbd;
  --sage: #d3e5d2;
  --sage-deep: #6f9c7c;
  --autumn: #f4d6c1;
  --autumn-deep: #c8774b;
  --mustard: #e6c06e;
  --rose: #ecc7c0;

  --grad: linear-gradient(100deg, #5f8fbd 0%, #6f9c7c 48%, #c8774b 100%);
  --grad-soft: linear-gradient(135deg, #e3eef8 0%, #e6f0e4 50%, #f8e6d8 100%);

  --shadow: 0 10px 30px -12px rgba(31, 42, 55, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(31, 42, 55, 0.28);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 72px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-2: #0f1529;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #141b31;
  --border: rgba(255, 255, 255, 0.09);
  --ink: #eef2f7;
  --ink-soft: #b9c3d0;
  --ink-mute: #8590a0;

  --sky: rgba(143, 188, 230, 0.16);
  --sky-deep: #9cc4ea;
  --sage: rgba(150, 200, 160, 0.15);
  --sage-deep: #a6d2b0;
  --autumn: rgba(232, 160, 120, 0.16);
  --autumn-deep: #f0a87c;
  --mustard: #f1cf86;
  --rose: rgba(236, 199, 192, 0.18);

  --grad: linear-gradient(100deg, #9cc4ea 0%, #a6d2b0 48%, #f0a87c 100%);
  --grad-soft: linear-gradient(135deg, rgba(156,196,234,.10), rgba(166,210,176,.08), rgba(240,168,124,.10));
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 3px; border-radius: 8px; }

/* ---------- Ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.65;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob.b1 { width: 520px; height: 520px; background: #cfe3f3; top: -140px; left: -120px; }
.blob.b2 { width: 460px; height: 460px; background: #d6e8d3; bottom: -160px; right: -80px; animation-delay: -6s; }
.blob.b3 { width: 380px; height: 380px; background: #f6dcc8; top: 35%; right: 22%; animation-delay: -12s; opacity: .5; }
[data-theme="dark"] .blob { opacity: 0.22; }
[data-theme="dark"] .blob.b1 { background: #3b6ea5; }
[data-theme="dark"] .blob.b2 { background: #3f7a55; }
[data-theme="dark"] .blob.b3 { background: #9a5634; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }
#stars { position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
[data-theme="dark"] #stars { opacity: 1; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; gap: 18px; padding: 0 clamp(16px, 4vw, 48px);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; background: none; border: 0; padding: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #fff; background: var(--grad); box-shadow: var(--shadow);
}
.brand-name { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: .2px; }
.tabs { display: flex; gap: 4px; margin-left: auto; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font-size: .9rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; transition: all .25s ease;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--sky) 60%, transparent); }
.tab[aria-selected="true"] { color: #fff; background: var(--ink); box-shadow: var(--shadow); }
[data-theme="dark"] .tab[aria-selected="true"] { color: #0b1020; background: linear-gradient(100deg, #cfe3f3, #d3e5d2, #f4d6c1); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: transform .2s ease;
}
.icon-btn:hover { transform: rotate(-12deg); }
.icon-btn svg { width: 19px; height: 19px; }
.sun { display: none; } [data-theme="dark"] .sun { display: block; } [data-theme="dark"] .moon { display: none; }

/* ---------- Panels ---------- */
main { padding: calc(var(--nav-h) + 28px) clamp(16px, 4vw, 48px) 40px; max-width: 1280px; margin: 0 auto; min-height: 100vh; }
.panel { display: none; animation: rise .55s cubic-bezier(.2,.8,.2,1); }
.panel.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .3px; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--border);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-deep); box-shadow: 0 0 0 4px var(--sage); animation: pulse 2.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; font-weight: 600; }
h2.title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: 14px 0 6px; }
.lead { color: var(--ink-soft); font-size: 1.04rem; max-width: 68ch; margin: 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--sky-deep) 35%, transparent); }
[data-theme="dark"] .card.hover:hover { box-shadow: 0 0 0 1px rgba(156,196,234,.25), 0 20px 50px -20px rgba(120,170,230,.35); }
.card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.card p { margin: 0; color: var(--ink-soft); font-size: .94rem; }
.muted { color: var(--ink-mute); font-size: .88rem; }

.ico {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px; flex: none;
}
.ico svg { width: 22px; height: 22px; }
.ico.sky { background: var(--sky); color: var(--sky-deep); }
.ico.sage { background: var(--sage); color: var(--sage-deep); }
.ico.autumn { background: var(--autumn); color: var(--autumn-deep); }
.ico.mustard { background: color-mix(in srgb, var(--mustard) 35%, transparent); color: #a8822d; }
[data-theme="dark"] .ico.mustard { color: var(--mustard); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 600; font-size: .95rem; transition: transform .2s ease, box-shadow .2s ease; text-decoration: none !important;
}
.btn svg { width: 18px; height: 18px; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { color: #fff; background: var(--grad); box-shadow: 0 12px 30px -10px rgba(95,143,189,.6); }
[data-theme="dark"] .btn.primary { color: #0b1020; box-shadow: 0 0 30px -4px rgba(156,196,234,.55); }
.btn.ghost { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.btn:hover { transform: translateY(-2px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .8rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); color: var(--ink-soft); }
.chip.sky { background: var(--sky); border-color: transparent; color: var(--ink); }
.chip.sage { background: var(--sage); border-color: transparent; color: var(--ink); }
.chip.autumn { background: var(--autumn); border-color: transparent; color: var(--ink); }

/* ---------- Sub-tabs ---------- */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.subtab { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink-soft); transition: all .2s; }
.subtab:hover { color: var(--ink); }
.subtab[aria-selected="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow); }
.subpanel { display: none; animation: rise .45s ease; }
.subpanel.active { display: block; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.3rem); font-weight: 600; letter-spacing: -1px; margin: 18px 0 6px; }
.hero h1 .sub { display: block; font-size: .5em; font-weight: 500; letter-spacing: -.3px; margin-top: 10px; color: var(--ink); }
.hero .lead { margin-top: 16px; font-size: 1.08rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.portrait-wrap { position: relative; justify-self: center; width: min(360px, 80vw); }
.portrait {
  border-radius: 200px 200px 28px 28px; overflow: hidden; aspect-ratio: 5/6; box-shadow: var(--shadow-lg);
  border: 6px solid var(--surface-solid); background: var(--grad-soft);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-wrap::before {
  content: ""; position: absolute; inset: -18px -18px auto auto; width: 120px; height: 120px; border-radius: 50%;
  background: var(--autumn); z-index: -1;
}
.portrait-wrap::after {
  content: ""; position: absolute; left: -26px; bottom: 40px; width: 90px; height: 90px; border-radius: 28px; transform: rotate(18deg);
  background: var(--sage); z-index: -1;
}
.float-chip {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; font-size: .82rem; font-weight: 600;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
}
.float-chip .em { font-size: 1.05rem; }
.float-chip.c1 { top: 12%; left: -22%; }
.float-chip.c2 { top: 50%; right: -8%; animation-delay: -2s; }
.float-chip.c3 { bottom: 6%; left: -14%; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.stat span { font-size: .78rem; color: var(--ink-mute); line-height: 1.3; display: block; }

.quote {
  position: relative; margin-top: 34px; padding: 28px clamp(22px, 4vw, 44px); border-radius: var(--radius);
  background: var(--grad-soft); border: 1px solid var(--border); overflow: hidden;
}
.quote::before {
  content: "\201C" / ""; position: absolute; top: -34px; left: 12px; font-family: var(--font-display); font-size: 9rem; line-height: 1;
  color: var(--autumn-deep); opacity: .22;
}
.quote blockquote { margin: 0; font-family: var(--font-display); font-style: italic; font-size: clamp(1.15rem, 2.1vw, 1.55rem); line-height: 1.45; position: relative; }
.quote figcaption { margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }
.quote figcaption b { color: var(--ink); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px; }
.feature { cursor: pointer; text-align: left; font: inherit; }

/* ---------- Journey ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.story p { color: var(--ink-soft); margin: 0 0 12px; }
.story p:first-of-type::first-letter { font-family: var(--font-display); float: left; font-size: 3.4rem; line-height: .9; padding: 6px 10px 0 0; color: var(--autumn-deep); }
.traits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.trait { display: flex; gap: 12px; align-items: flex-start; }
.trait .ico { margin: 0; width: 40px; height: 40px; }
.trait h4 { margin: 0 0 2px; font-size: .98rem; }
.trait p { font-size: .86rem; }

.timeline { display: grid; grid-template-columns: 320px 1fr; gap: 22px; }
.tl-list { display: flex; flex-direction: column; gap: 6px; position: relative; padding-left: 18px; }
.tl-list::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--sky-deep), var(--sage-deep), var(--autumn-deep)); border-radius: 2px; opacity: .5; }
.tl-item {
  position: relative; text-align: left; border: 1px solid transparent; background: transparent; padding: 9px 12px; border-radius: 12px; cursor: pointer; transition: all .2s;
}
.tl-item::before { content: ""; position: absolute; left: -17px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--sky-deep); transition: all .2s; }
.tl-item .yr { font-size: .74rem; font-weight: 600; color: var(--ink-mute); letter-spacing: .3px; display: block; }
.tl-item .rl { font-size: .92rem; font-weight: 600; }
.tl-item:hover { background: var(--surface); }
.tl-item[aria-selected="true"] { background: var(--surface-solid); border-color: var(--border); box-shadow: var(--shadow); }
.tl-item[aria-selected="true"]::before { background: var(--autumn-deep); border-color: var(--autumn-deep); transform: scale(1.2); }
.tl-detail { min-height: 100%; }
.tl-detail .org { color: var(--sky-deep); font-weight: 600; font-size: .92rem; }
.tl-detail h3 { font-size: 1.5rem; margin: 6px 0 4px; }
.tl-detail ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-soft); }
.tl-detail li { margin-bottom: 6px; }
.tl-detail img { border-radius: 14px; margin-top: 16px; max-height: 260px; object-fit: cover; width: 100%; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skills-grid .card h3 { display: flex; align-items: center; gap: 10px; }
.skills-grid .ico { margin: 0; width: 36px; height: 36px; border-radius: 11px; }
.skills-grid .chips { margin-top: 12px; }

/* ---------- Research ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: .84rem; font-weight: 500; color: var(--ink-soft); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pub { cursor: pointer; display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: inherit; width: 100%; }
.pub .yr { font-size: .75rem; font-weight: 700; letter-spacing: .4px; color: var(--autumn-deep); }
.pub h3 { font-size: 1.02rem; font-family: var(--font-body); font-weight: 600; line-height: 1.35; }
.pub .venue { font-size: .8rem; color: var(--ink-mute); }
.pub .me { font-weight: 600; color: var(--ink); }
.pub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 16px; }
.pager button { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 12px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

.repo { display: flex; flex-direction: column; gap: 10px; }
.repo .top { display: flex; justify-content: space-between; align-items: center; }
.repo .stars { font-size: .8rem; color: var(--ink-mute); display: flex; gap: 4px; align-items: center; }
.repo h3 { font-family: var(--font-body); font-size: 1.04rem; }

.media-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.media-card img { aspect-ratio: 2/1; object-fit: cover; width: 100%; cursor: zoom-in; background: #fff; }
.media-card .body { padding: 14px 18px 16px; }
.media-card h3 { font-size: 1.04rem; }

/* ---------- AI & Evals ---------- */
.evals-layout { display: grid; grid-template-columns: 1fr 1.05fr; gap: 22px; align-items: start; }
.pipeline { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.step .n { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: var(--grad); }
[data-theme="dark"] .step .n { color: #0b1020; }
.step h4 { margin: 0; font-size: .95rem; }
.step p { margin: 2px 0 0; font-size: .85rem; color: var(--ink-soft); }

.trace { font-size: .86rem; }
.trace-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.trace-head h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.trace-row { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); opacity: 0; transform: translateY(6px); transition: all .4s ease; }
.trace-row.show { opacity: 1; transform: none; }
.trace-row .k { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 8px; height: fit-content; text-align: center; }
.k.user { background: var(--sky); color: var(--sky-deep); }
.k.plan { background: var(--sage); color: var(--sage-deep); }
.k.tool { background: var(--autumn); color: var(--autumn-deep); }
.k.obs { background: color-mix(in srgb, var(--mustard) 30%, transparent); color: #9a7524; }
[data-theme="dark"] .k.obs { color: var(--mustard); }
.k.answer { background: var(--ink); color: var(--bg); }
.trace code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: var(--surface-solid); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.score { padding: 10px 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); }
.score .lbl { font-size: .76rem; color: var(--ink-mute); display: flex; justify-content: space-between; }
.bar { height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.verdict { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sage); font-size: .84rem; opacity: 0; transition: opacity .5s; }
.verdict.show { opacity: 1; }

.evo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; position: relative; margin-top: 8px; }
.evo::before { content: ""; position: absolute; top: 31px; left: 6%; right: 6%; height: 2px; background: var(--grad); opacity: .45; }
.evo-step { position: relative; text-align: center; }
.evo-step .badge { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; z-index: 1; }
.evo-step.now .badge { background: var(--grad); color: #fff; box-shadow: 0 0 0 6px var(--sky); }
.evo-step h4 { margin: 0; font-size: .95rem; }
.evo-step .when { font-size: .74rem; color: var(--ink-mute); font-weight: 600; }
.evo-step p { font-size: .82rem; color: var(--ink-soft); margin: 6px 0 0; }
.evo-step .then { margin-top: 8px; font-size: .76rem; padding: 6px 8px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); color: var(--ink-soft); }
.evo-step.old .then { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--autumn-deep) 60%, transparent); }

/* ---------- Quant ---------- */
.disclaimer { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border); font-size: .84rem; color: var(--ink-soft); margin-bottom: 18px; }
.disclaimer svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--sky-deep); }
.insight { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: center; }
.insight .plot { border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--border); cursor: zoom-in; }
.insight .plot img { width: 100%; }
.insight .tag { font-size: .76rem; font-weight: 700; color: var(--autumn-deep); letter-spacing: .4px; text-transform: uppercase; }
.insight h3 { font-size: 1.45rem; margin: 6px 0 10px; }
.insight ul { padding-left: 18px; margin: 10px 0 0; color: var(--ink-soft); font-size: .92rem; }
.insight li { margin-bottom: 6px; }
.carousel-nav { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 16px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--ink) 18%, transparent); cursor: pointer; padding: 0; transition: all .25s; }
.dots button[aria-current="true"] { width: 26px; background: var(--autumn-deep); }

.scoreboard { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.sb-row { display: grid; grid-template-columns: 200px 1fr 54px; align-items: center; gap: 12px; padding: 8px 0; font-size: .88rem; }
.sb-row .bar { height: 12px; margin: 0; }
.sb-row .v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sb-group { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); margin: 14px 0 2px; }
.sb-group:first-child { margin-top: 0; }

.playground { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.control { margin-bottom: 16px; }
.control label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.control label output { font-variant-numeric: tabular-nums; color: var(--autumn-deep); }
input[type="range"] { width: 100%; accent-color: var(--sky-deep); }
.chart-wrap { position: relative; }
#simChart { width: 100%; height: 300px; display: block; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.legend { display: flex; gap: 16px; font-size: .82rem; margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 3px; display: inline-block; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.kpi { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.kpi span { font-size: .72rem; color: var(--ink-mute); display: block; }
.kpi b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------- Impact ---------- */
.award { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.award img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; background: #fff; }
.award .yr { font-size: .78rem; font-weight: 700; color: var(--autumn-deep); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; }
.contact h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.link-card { display: flex; gap: 12px; align-items: center; padding: 16px; color: var(--ink); text-decoration: none !important; }
.link-card .ico { margin: 0; }
.link-card b { display: block; font-size: .95rem; }
.link-card span { font-size: .8rem; color: var(--ink-mute); word-break: break-all; }

/* ---------- Footer ---------- */
footer { text-align: center; font-size: .8rem; color: var(--ink-mute); padding: 20px 16px 30px; }
footer em { font-family: var(--font-display); }

/* ---------- Modal / Lightbox ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(11, 16, 32, .55); backdrop-filter: blur(6px); }
.modal.open { display: grid; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-box { position: relative; max-width: 760px; width: 100%; max-height: 86vh; overflow: auto; background: var(--surface-solid); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-box h3 { font-size: 1.35rem; margin: 8px 0 8px; }
.modal-box p { color: var(--ink-soft); }
.modal-close { position: absolute; top: 14px; right: 14px; }
.lightbox img { max-width: min(1200px, 94vw); max-height: 84vh; border-radius: 14px; box-shadow: var(--shadow-lg); background: #fff; }
.lightbox figcaption { color: #fff; text-align: center; margin-top: 10px; font-size: .9rem; }

/* ---------- Ask-my-agent widget ---------- */
.agent-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer;
  color: #fff; background: var(--grad); box-shadow: 0 14px 34px -10px rgba(95,143,189,.7); font-weight: 600; font-size: .9rem;
}
[data-theme="dark"] .agent-fab { color: #0b1020; }
.agent-fab svg { width: 18px; height: 18px; }
.agent {
  position: fixed; right: 22px; bottom: 86px; z-index: 60; width: min(380px, calc(100vw - 32px)); height: min(520px, calc(100vh - 140px));
  display: none; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.agent.open { display: flex; animation: rise .3s ease; }
.agent-head { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); background: var(--grad-soft); }
.agent-head b { font-size: .95rem; }
.agent-head small { display: block; font-size: .72rem; color: var(--ink-mute); }
.agent-head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.agent-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.5; }
.msg.bot { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-top-right-radius: 4px; }
.msg a { font-weight: 600; cursor: pointer; color: var(--sky-deep); }
.msg.me a { color: inherit; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.suggest button { font-size: .76rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.agent form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.agent input { flex: 1; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); color: var(--ink); font: inherit; font-size: .9rem; }
.agent form button { border: 0; border-radius: 12px; padding: 0 14px; background: var(--ink); color: var(--bg); cursor: pointer; font-weight: 600; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; border-radius: 50%; background: var(--ink-mute); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .brand-name { display: none; }
  .feature-grid, .stats { grid-template-columns: repeat(2, 1fr); }
  .pub-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .evo { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .evo::before { display: none; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  .hero, .two-col, .timeline, .evals-layout, .insight, .scoreboard, .playground, .contact { grid-template-columns: 1fr; }
  .hero .portrait-wrap { order: -1; width: min(260px, 70vw); }
  .float-chip { display: none; }
  .tabs { margin-left: 0; flex: 1; }
  .tl-list { flex-direction: row; overflow-x: auto; padding: 0 0 6px; }
  .tl-list::before, .tl-item::before { display: none; }
  .tl-item { flex: none; border-color: var(--border); }
  .sb-row { grid-template-columns: 130px 1fr 46px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pub-grid, .grid-3, .grid-2, .skills-grid, .traits, .links, .feature-grid { grid-template-columns: 1fr; }
  .evo { grid-template-columns: 1fr 1fr; }
  .award { grid-template-columns: 90px 1fr; }
  .agent-fab .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   v2: scorecards, blog reader, framework, agent sources
   ========================================================= */
button.card { font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.now-card { display: block; }
.card .chip + h3, .card > .chip + h3 { margin-top: 10px; }
.portrait img { object-position: center 25%; }
.section-title { font-size: 1.5rem; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sub-lead { margin: 0 0 18px; font-size: .98rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.score-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sc-thumb { aspect-ratio: 12 / 5; background: #fff; overflow: hidden; border-bottom: 1px solid var(--border); }
.sc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.score-card:hover .sc-thumb img { transform: scale(1.04); }
.sc-band { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--border); }
.sc-band .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; opacity: .85; }
.sc-band svg { width: 26px; height: 26px; opacity: .8; }
.sc-band.sage { background: var(--sage); color: var(--sage-deep); }
.sc-band.autumn { background: var(--autumn); color: var(--autumn-deep); }
.sc-band.sky { background: var(--sky); color: var(--sky-deep); }
.sc-band.mustard { background: color-mix(in srgb, var(--mustard) 35%, transparent); color: #a8822d; }
.sc-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.sc-go { color: var(--sky-deep); font-weight: 600; }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-read { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--ink-mute); white-space: nowrap; }
.sc-read svg { width: 13px; height: 13px; }
.score-card h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 650; line-height: 1.3; margin: 0; }
.score-card p { font-size: .87rem; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.metric { font-size: .74rem; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-more { margin-top: auto; padding-top: 4px; font-size: .82rem; font-weight: 600; color: var(--sky-deep); }
.chip.mustard { background: color-mix(in srgb, var(--mustard) 35%, transparent); border-color: transparent; color: var(--ink); }

.framework { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0 0 18px; }
.fw-step { position: relative; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.fw-step b { display: block; font-size: .88rem; }
.fw-step span { font-size: .78rem; color: var(--ink-mute); }
.fw-step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--sage-deep); font-weight: 700; z-index: 1; }

/* Reader */
.reader { padding: 3vh 16px; align-items: start; overflow-y: auto; }
.reader-box { position: relative; width: 100%; max-width: 860px; margin: 0 auto; background: var(--surface-solid); border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; }
.r-head { padding: 30px clamp(20px, 5vw, 44px) 10px; background: var(--grad-soft); border-bottom: 1px solid var(--border); }
.r-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 10px 0 8px; padding-right: 40px; }
.r-head .lead { font-size: 1.02rem; }
.r-head .metrics { margin: 14px 0 16px; }
.r-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.r-body { padding: 22px clamp(20px, 5vw, 44px) 30px; }
.r-media { margin: 0 0 18px; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--border); }
.r-media img { width: 100%; cursor: zoom-in; background: #fff; }
.r-media video { width: 100%; display: block; }
.r-sec { margin: 0 0 20px; }
.r-sec h3 { font-size: 1.2rem; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.r-sec h3::before { content: ""; width: 6px; height: 20px; border-radius: 4px; background: var(--grad); }
.r-sec p { margin: 0 0 8px; color: var(--ink-soft); }
.r-sec ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.r-sec li { margin-bottom: 7px; }
.r-sec b { color: var(--ink); }
.r-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.r-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-mute); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.r-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.r-table tr:first-child td { font-weight: 600; }
.r-fig { margin: 12px 0 4px; }
.r-fig img { border-radius: 12px; border: 1px solid var(--border); background: #fff; cursor: zoom-in; width: 100%; }
.r-fig figcaption { font-size: .8rem; color: var(--ink-mute); margin-top: 6px; }
.r-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border); font-size: .84rem; color: var(--ink-soft); margin: 6px 0 18px; }
.r-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--sky-deep); }
.r-refs { margin: 0; padding-left: 20px; font-size: .88rem; }
.r-refs li { margin-bottom: 5px; }
.r-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.r-nav button { flex: 1; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.r-nav button:last-child { text-align: right; }
.r-nav button small { display: block; font-size: .72rem; color: var(--ink-mute); }
.r-nav button span { font-weight: 600; font-size: .9rem; }
.r-nav button:disabled { visibility: hidden; }

/* Slice report & agent */
#sliceRows .sb-row { grid-template-columns: 150px 1fr 46px; }
.agent-note { margin: 0; padding: 0 14px 10px; font-size: .68rem; color: var(--ink-mute); }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.srcs a { font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--surface-solid); border: 1px solid var(--border); text-decoration: none !important; cursor: pointer; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }

@media (max-width: 1100px) { .framework { grid-template-columns: repeat(3, 1fr); } .fw-step::after { display: none; } }
@media (max-width: 560px) { .framework { grid-template-columns: 1fr 1fr; } .r-nav { flex-direction: column; } .r-nav button:last-child { text-align: left; } }
