/* Inner pages: the original paper, ink and orange look.
   Home page (.home): one glass hub card over soft colour, linking to every page. */

:root {
  --bg: #f4efe6;
  --bg-tint: #ebe4d6;
  --surface: #fbf8f2;
  --ink: #1d1a16;
  --ink-soft: #5b554b;
  --line: #d9d0bf;
  --accent: #e8431f;
  --accent-text: #c93414;
  --accent-ink: #ffffff;
  --accent-soft: #fbd9cf;
  --lime: #d7f171;

  /* glass (home page only) */
  --glass: rgba(255, 255, 255, .5);
  --glass-2: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .85);
  --glass-edge: rgba(29, 26, 22, .1);
  --glass-shadow: 0 30px 70px -30px rgba(120, 50, 20, .4);
  --b1: #ff8a5c;
  --b2: #ffcf86;
  --b3: #a6e6d2;
  --b4: #d7f171;
  --blob-o: .65;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 18px;
  --wrap: 1120px;
  --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --bg-tint: #1c1915;
    --surface: #211e19;
    --ink: #f2ece0;
    --ink-soft: #a9a193;
    --line: #36312a;
    --accent: #ff6b45;
    --accent-text: #ff8b6b;
    --accent-ink: #1a0d08;
    --accent-soft: #3a211a;
    --glass: rgba(52, 43, 35, .45);
    --glass-2: rgba(70, 58, 47, .62);
    --glass-line: rgba(255, 255, 255, .14);
    --glass-edge: rgba(255, 255, 255, .09);
    --glass-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
    --b1: #ff6b45;
    --b2: #b9791f;
    --b3: #2f7364;
    --b4: #5d7a1b;
    --blob-o: .5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f;
  --bg-tint: #1c1915;
  --surface: #211e19;
  --ink: #f2ece0;
  --ink-soft: #a9a193;
  --line: #36312a;
  --accent: #ff6b45;
  --accent-text: #ff8b6b;
  --accent-ink: #1a0d08;
  --accent-soft: #3a211a;
  --glass: rgba(52, 43, 35, .45);
  --glass-2: rgba(70, 58, 47, .62);
  --glass-line: rgba(255, 255, 255, .14);
  --glass-edge: rgba(255, 255, 255, .09);
  --glass-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
  --b1: #ff6b45;
  --b2: #b9791f;
  --b3: #2f7364;
  --b4: #5d7a1b;
  --blob-o: .5;
  color-scheme: dark;
}

/* ---------- Base ---------- */
@view-transition { navigation: auto; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin: 0 0 .8rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons (inner pages) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .97rem; text-decoration: none; border: 1.5px solid var(--ink); transition: transform .2s, background .2s, color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 4px 4px 0 var(--accent); }
.btn-primary:hover { box-shadow: 6px 6px 0 var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.text-link { color: var(--accent-text); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; }
.text-link:hover { color: var(--ink); }
.text-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform .2s, border-color .2s; }
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- Nav (inner pages) ---------- */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .25s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { text-decoration: none; font-size: .92rem; font-weight: 500; padding: 8px 13px; border-radius: 999px; color: var(--ink-soft); transition: background .2s, color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); background: var(--bg-tint); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--bg-tint); }
.nav-links .nav-cta { background: var(--ink); color: var(--bg); margin-left: 4px; }
.nav-links .nav-cta:hover { background: var(--accent); color: var(--accent-ink); }
.nav-links .nav-cta[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; position: relative; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, top .25s; }
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 23px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

/* ---------- Sections and page heads ---------- */
.section { padding: clamp(36px, 6vw, 72px) 0; }
.section-tint { background: var(--bg-tint); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 1.8rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.page-head { padding: clamp(40px, 7vw, 88px) 0 clamp(8px, 2vw, 20px); }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin-bottom: 1rem; }
.page-head h1 .scribble { position: relative; white-space: nowrap; color: var(--accent-text); font-style: italic; }
.page-head h1 .scribble svg { position: absolute; left: 0; bottom: -.14em; width: 100%; height: .28em; overflow: visible; }
.page-head h1 .scribble path { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 1.1s .4s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.page-head p.lede { max-width: 38em; color: var(--ink-soft); font-size: 1.1rem; margin: 0; }

/* ---------- Project cards ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.6rem 0 1.4rem; }
.chip { padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; font-weight: 500; font-size: .93rem; transition: all .2s; }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.work-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.card { grid-column: span 2; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 6px 6px 0 var(--accent); }
.card-feature { grid-column: span 4; padding: 34px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card-feature:hover { box-shadow: 6px 6px 0 var(--lime); }
.card-kind { font-family: var(--mono); font-size: .76rem; color: var(--accent-text); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; }
.card-feature .card-kind { color: var(--lime); }
.card h3 { font-size: 1.35rem; margin-bottom: .7rem; }
.card-feature h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); max-width: 18em; }
.card p { font-size: .98rem; color: var(--ink-soft); }
.card-feature p { color: color-mix(in srgb, var(--bg) 84%, transparent); max-width: 40em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: .6rem; }
.tags li { font-family: var(--mono); font-size: .74rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.card-feature .tags li { color: color-mix(in srgb, var(--bg) 72%, transparent); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.card .text-link { margin-top: 14px; width: fit-content; font-size: .93rem; }
.card-feature .text-link { color: var(--lime); }
.card.is-hidden { display: none; }
.empty { color: var(--ink-soft); margin-top: 20px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 330px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-side { display: grid; gap: 26px; position: sticky; top: calc(var(--nav-h) + 24px); }
.avatar { width: 100%; max-width: 300px; margin-inline: auto; aspect-ratio: 1; border-radius: 50%; padding: 8px; background: conic-gradient(from 200deg, var(--accent), var(--lime), var(--accent)); }
.avatar-in { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--surface); display: grid; place-items: center; border: 4px solid var(--bg); }
.avatar-fb { font-family: var(--serif); font-size: clamp(3.4rem, 9vw, 5.4rem); font-weight: 600; color: var(--accent-text); letter-spacing: -0.03em; }
.avatar-in img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.facts { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: 8px 8px 0 var(--lime); transform: rotate(1deg); }
:root[data-theme="dark"] .facts { box-shadow: 8px 8px 0 #4a5a1a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .facts { box-shadow: 8px 8px 0 #4a5a1a; } }
.facts dl { margin: 0; display: grid; gap: 12px; }
.facts dt { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.facts dd { margin: 0; font-size: .97rem; }
.story p { font-size: 1.1rem; max-width: 38em; }
.story p.big { font-family: var(--serif); font-size: clamp(1.45rem, 2.7vw, 1.95rem); line-height: 1.28; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 2rem; }
.how > div { padding: 22px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.how h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.how p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

.toolkit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; }
.tool-group { padding: 22px 0; border-top: 1.5px solid var(--ink); }
.tool-group h3 { font-size: 1.15rem; margin-bottom: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; transition: background .2s, color .2s, transform .2s; }
.pills li:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px) rotate(-1.5deg); }

.beyond-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.note { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); }
.note:nth-child(1) { transform: rotate(-.8deg); }
.note:nth-child(2) { transform: rotate(.6deg); background: var(--accent-soft); }
.note:nth-child(3) { transform: rotate(-.4deg); }
.note h3 { font-size: 1.3rem; margin-bottom: .3rem; }
.note-when { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); margin-bottom: 1rem; }
.note p:last-child { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.note:nth-child(2) p:last-child { color: var(--ink); }

/* ---------- Experience ---------- */
.bar-tools { display: flex; justify-content: flex-end; margin: 1rem 0 1.4rem; }
.timeline { border-left: 2px solid var(--ink); margin-left: 6px; }
.timeline > li { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 0 0 30px 30px; position: relative; }
.timeline > li::before { content: ""; position: absolute; left: -9px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
.timeline > li:first-child::before { background: var(--accent); }
.when { font-size: .82rem; color: var(--ink-soft); padding-top: 6px; }
details summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding-right: 38px; position: relative; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 1.1rem; line-height: 1; }
details[open] summary::after { content: "–"; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.role { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.org { color: var(--ink-soft); font-size: .95rem; }
.timeline details ul { margin-top: 14px; }
.timeline details li { position: relative; padding-left: 20px; margin-bottom: .6em; color: var(--ink-soft); font-size: .98rem; }
.timeline details li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 2px; background: var(--accent); }

/* ---------- Publications ---------- */
.papers { display: grid; gap: 18px; margin-top: 1.4rem; }
.paper { display: grid; grid-template-columns: 92px 1fr; gap: 20px; padding: 28px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); transition: transform .25s, border-color .25s, box-shadow .25s; }
.paper:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 6px 6px 0 var(--accent); }
.paper-year { font-family: var(--mono); font-size: 1.5rem; color: var(--accent-text); margin: 0; }
.paper h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.paper-meta { color: var(--ink-soft); font-size: .93rem; margin-bottom: .4rem; }
.research-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.research-list > div { padding: 26px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.research-list h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.research-list p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.research-list .note-when { margin-bottom: .8rem; }

/* ---------- Certifications ---------- */
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 1.4rem; }
.cert { padding: 22px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); transition: transform .25s, border-color .25s, box-shadow .25s; }
.cert:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 5px 5px 0 var(--lime); }
.cert h3 { font-size: 1.15rem; }
.cert-by { color: var(--ink-soft); font-size: .93rem; margin: 0; }
.cert-date { margin: auto 0 0; padding-top: 10px; font-family: var(--mono); font-size: .78rem; color: var(--accent-text); }
.event { padding: 26px; margin-top: 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.event h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.event p:last-child { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 20px; align-items: start; margin-top: 1.4rem; }
.contact-card { padding: 32px; border-radius: var(--radius); }
.contact-info { background: var(--ink); color: var(--bg); }
.contact-info h2 { font-size: 1.7rem; margin-bottom: .8rem; }
.contact-info p { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.contact-lines { margin: 1.4rem 0 0; display: grid; gap: 10px; }
.contact-lines li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.contact-lines .mono { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: color-mix(in srgb, var(--bg) 62%, transparent); min-width: 78px; }
.contact-info .text-link { color: var(--lime); }
.contact-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.contact-info .btn { border-color: var(--bg); }
.contact-info .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 4px 4px 0 var(--lime); }
.contact-info .btn-ghost { color: var(--bg); }
.contact-info .btn-ghost:hover { background: var(--bg); color: var(--ink); }
.form-card { background: var(--surface); border: 1.5px solid var(--line); }
.form { display: grid; gap: 16px; }
.form h2 { font-size: 1.6rem; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-note { font-size: .86rem; color: var(--ink-soft); margin: 0; }

/* ---------- Footer & floaters ---------- */
.footer { padding: 30px 0; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; font-size: .92rem; color: var(--ink-soft); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-row p { margin: 0; }
.to-top { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; z-index: 40; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .25s, transform .25s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }

.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.pre { opacity: .35; transform: translateY(16px); }
main { animation: pagein .5s ease both; }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } }

/* =====================================================
   HOME: glass hub
   ===================================================== */
.home { position: relative; min-height: 100vh; padding-bottom: 40px; }
.home .bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.home .bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--blob-o); will-change: transform; }
.home .bg span:nth-child(1) { width: 52vmax; height: 52vmax; background: var(--b1); top: -20vmax; left: -14vmax; animation: drift1 26s ease-in-out infinite alternate; }
.home .bg span:nth-child(2) { width: 42vmax; height: 42vmax; background: var(--b2); top: 20vh; right: -16vmax; animation: drift2 32s ease-in-out infinite alternate; }
.home .bg span:nth-child(3) { width: 44vmax; height: 44vmax; background: var(--b3); bottom: -22vmax; left: 10vw; animation: drift3 29s ease-in-out infinite alternate; }
.home .bg span:nth-child(4) { width: 26vmax; height: 26vmax; background: var(--b4); top: 46vh; left: -6vmax; animation: drift2 24s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(.92); } }
@keyframes drift3 { to { transform: translate(10vmax, -12vmax) scale(1.1); } }

.home-theme { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 50; border-radius: 50%; background: var(--glass-2); border-color: var(--glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

.glass { background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .3); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--glass-2); } }

.hub-wrap { width: min(1000px, 100%); margin-inline: auto; padding: clamp(24px, 5vw, 56px) max(16px, env(safe-area-inset-left, 0px)) 0; padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hub { border-radius: 36px; padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 48px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.hub-avatar { width: 148px; height: 148px; border-radius: 50%; padding: 5px; background: linear-gradient(140deg, var(--accent), #ffb347, var(--lime)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 46px color-mix(in srgb, var(--accent) 45%, transparent); margin-bottom: 26px; }
.hub-avatar .avatar-in { border-width: 3px; background: var(--glass-2); }
.hub-avatar .avatar-fb { font-size: 3.2rem; }
.hub-name { font-size: clamp(2.5rem, 7.6vw, 5rem); letter-spacing: -0.025em; margin-bottom: .6rem; }
.hub-name span { background: linear-gradient(95deg, var(--accent), #ff9a3c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-roles { font-size: clamp(.98rem, 1.8vw, 1.2rem); color: var(--ink-soft); max-width: 36em; margin: 0 0 1.8rem; line-height: 1.7; }
.hub-roles i { font-style: normal; color: var(--accent-text); margin: 0 .55em; }

.hub-pill { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding: 14px 30px; border-radius: 999px; text-decoration: none; background: linear-gradient(95deg, #ff7a45, var(--accent)); color: #fff; box-shadow: 0 14px 38px -10px color-mix(in srgb, var(--accent) 80%, transparent); transition: transform .25s, box-shadow .25s; max-width: 100%; }
.hub-pill:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.hub-pill svg { flex: none; }
.hub-pill strong { font-size: 1.1rem; }
.hub-pill .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .45); }
.hub-pill span:last-child { font-size: .98rem; }

.hub-nav { margin: 2rem 0 1.6rem; width: min(640px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--glass-edge); border-radius: 18px; overflow: hidden; background: color-mix(in srgb, var(--glass) 70%, transparent); }
.hub-nav a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; text-decoration: none; font-weight: 500; font-size: .96rem; border-right: 1px solid var(--glass-edge); border-bottom: 1px solid var(--glass-edge); transition: background .2s, color .2s; }
.hub-nav a:nth-child(4n) { border-right: 0; }
.hub-nav a:nth-last-child(-n+4) { border-bottom: 0; }
.hub-nav a:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.hub-nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); font-weight: 600; }
.hub-nav .cv { color: var(--accent-text); font-weight: 600; }

.hub-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.hub-social a { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--glass-line); text-decoration: none; transition: transform .25s, background .25s, color .25s; }
.hub-social a:hover { transform: translateY(-4px) scale(1.06); background: var(--accent); color: var(--accent-ink); }

.more { width: min(1000px, 100%); margin: 28px auto 0; padding: 0 max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 26px; padding: 6px; }
.stats li { padding: 20px; border-right: 1px solid var(--glass-edge); }
.stats li:last-child { border-right: 0; }
.stats strong { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.5rem); line-height: 1; margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.stats span { display: block; font-size: .88rem; color: var(--ink-soft); line-height: 1.4; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 26px; text-decoration: none; min-height: 190px; transition: transform .25s; }
.tile:hover { transform: translateY(-4px); }
.tile .card-kind { margin-bottom: .2rem; }
.tile h3 { font-size: 1.35rem; }
.tile p { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.tile-go { margin-top: auto; align-self: flex-end; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; transition: transform .25s, background .25s; }
.tile:hover .tile-go { background: var(--accent); color: var(--accent-ink); transform: translateX(4px); }
.home-foot { text-align: center; font-size: .86rem; color: var(--ink-soft); padding: 26px 16px 0; }
.home-foot p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .menu-btn { display: grid; }
  .nav-links { position: absolute; left: 0; right: 0; top: calc(100% + 6px); flex-direction: column; align-items: stretch; gap: 4px; background: var(--bg); padding: 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .35); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s; }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 13px 16px; font-size: 1.02rem; }
  .nav-links .nav-cta { margin: 6px 0 0; text-align: center; }
}
@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .card, .card-feature { grid-column: span 1; }
  .card-feature { grid-column: span 2; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .how, .beyond-grid, .toolkit, .certs { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; }
  .when { padding-top: 0; }
  .tiles { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(2) { border-right: 0; }
  .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--glass-edge); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-name { display: none; }
  .work-grid, .how, .beyond-grid, .toolkit, .certs, .research-list { grid-template-columns: 1fr; }
  .card-feature { grid-column: span 1; padding: 26px; }
  .paper { grid-template-columns: 1fr; gap: 6px; }
  .hub { border-radius: 28px; }
  .hub-nav { grid-template-columns: repeat(2, 1fr); }
  .hub-nav a { border-right: 1px solid var(--glass-edge) !important; border-bottom: 1px solid var(--glass-edge) !important; }
  .hub-nav a:nth-child(2n) { border-right: 0 !important; }
  .hub-nav a:nth-last-child(-n+2) { border-bottom: 0 !important; }
  .hub-pill { padding: 12px 22px; }
  .hub-pill .sep { display: none; }
  .page-head h1 .scribble { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.pre { opacity: 1; transform: none; }
  .page-head h1 .scribble path { stroke-dashoffset: 0; }
}
@media print { .nav, .to-top, .progress, .home .bg, .filters, .home-theme { display: none; } }
