/* ============================================================
   FOLIO — public profile page. Same token system as the editor,
   but a calm, reader-facing personal site. Vanilla CSS, responsive.
   ============================================================ */

:root {
  --accent:#1f7a4d; --accent-strong:#186040; --accent-soft:#e6f1ea; --accent-ring:rgba(31,122,77,.28);
  --maxw: 940px;
  --ui-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 12px; --r-sm: 8px; --pill: 999px;
  --ease: cubic-bezier(.2,.6,.2,1);
}
[data-theme="light"]{
  --bg:#f1f0ec; --bg-2:#ecebe6; --surface:#ffffff; --surface-2:#f7f6f3; --surface-3:#f0efeb;
  --text:#1b1b18; --text-2:#56554d; --text-3:#8a897f; --border:#e6e5df; --hairline:#edece8;
  --ink:#15140f; --ink-text:#fff;
  --shadow:0 1px 2px rgba(24,24,20,.04),0 8px 28px rgba(24,24,20,.06);
  --shadow-sm:0 1px 2px rgba(24,24,20,.05);
}
[data-theme="dark"]{
  --bg:#16150f; --bg-2:#131209; --surface:#1e1d16; --surface-2:#24231b; --surface-3:#2a2920;
  --text:#ecebe3; --text-2:#a3a299; --text-3:#71706a; --border:#2c2b22; --hairline:#262520;
  --ink:#f3f2ea; --ink-text:#16150f;
  --accent:#46a873; --accent-strong:#5cbe89; --accent-soft:#182a20; --accent-ring:rgba(70,168,115,.30);
  --shadow:0 2px 6px rgba(0,0,0,.45),0 18px 44px rgba(0,0,0,.5);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:84px; }
body {
  margin:0; font-family:var(--ui-font); background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased; font-size:16px; line-height:1.6; text-rendering:optimizeLegibility;
}
::selection{ background:var(--accent-ring); }
a{ color:inherit; }
img{ max-width:100%; }

.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 28px; }

/* ---------- top nav ---------- */
.nav{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--hairline);
}
.nav-in{ max-width:var(--maxw); margin:0 auto; padding:0 28px; height:60px; display:flex; align-items:center; gap:20px; }
.nav-brand{ display:flex; align-items:center; gap:10px; font-weight:640; letter-spacing:-.01em; font-size:15px; }
.nav-mark{ width:28px; height:28px; border-radius:8px; background:var(--ink); color:var(--ink-text); display:grid; place-items:center; font-size:12px; font-weight:700; letter-spacing:.02em; flex:none; }
.nav-links{ display:flex; gap:2px; margin-left:8px; }
.nav-links a{ font-size:13.5px; color:var(--text-2); text-decoration:none; padding:7px 12px; border-radius:var(--r-sm); font-weight:500; transition:color .15s, background .15s; }
.nav-links a:hover{ color:var(--text); background:var(--surface-2); }
.nav-links a.active{ color:var(--accent-strong); background:var(--accent-soft); }
.nav-right{ margin-left:auto; display:flex; align-items:center; gap:10px; }

.seg{ display:inline-flex; padding:2px; gap:2px; background:var(--surface-3); border:1px solid var(--border); border-radius:var(--r-sm); }
.seg button{ font:inherit; font-size:12px; font-weight:600; border:none; background:transparent; color:var(--text-2); padding:5px 10px; border-radius:6px; cursor:pointer; transition:.15s; }
.seg button:hover{ color:var(--text); }
.seg button.on{ background:var(--surface); color:var(--text); box-shadow:var(--shadow-sm); }
.iconbtn{ width:32px; height:32px; display:grid; place-items:center; border-radius:var(--r-sm); border:1px solid transparent; background:transparent; color:var(--text-2); cursor:pointer; transition:.15s; }
.iconbtn:hover{ background:var(--surface-2); color:var(--text); }

.btn{ display:inline-flex; align-items:center; gap:8px; font:inherit; font-size:14px; font-weight:560; padding:10px 16px; border-radius:var(--r-sm); border:1px solid var(--border); background:var(--surface); color:var(--text); text-decoration:none; cursor:pointer; transition:background .15s, transform .06s, box-shadow .15s, border-color .15s; }
.btn:hover{ background:var(--surface-2); }
.btn:active{ transform:translateY(.5px); }
.btn.ink{ background:var(--ink); color:var(--ink-text); border-color:var(--ink); box-shadow:var(--shadow-sm); }
.btn.ink:hover{ background:color-mix(in srgb,var(--ink) 88%, var(--text-2)); }
.btn.sm{ padding:7px 12px; font-size:13px; }

/* ---------- hero ---------- */
.hero{ padding:64px 0 28px; }
.hero-top{ display:flex; gap:26px; align-items:flex-start; }
.mono{ width:84px; height:84px; border-radius:20px; background:var(--surface); border:1px solid var(--border); display:grid; place-items:center; font-size:30px; font-weight:680; letter-spacing:-.02em; color:var(--text); box-shadow:var(--shadow); flex:none; }
.hero h1{ margin:0; font-size:42px; line-height:1.05; letter-spacing:-.025em; font-weight:680; }
.hero .role{ margin-top:10px; font-size:18px; color:var(--text-2); font-weight:500; }
.hero .role b{ color:var(--accent-strong); font-weight:600; }
.hero-lead{ margin:22px 0 0; font-size:18px; line-height:1.6; color:var(--text-2); max-width:62ch; }
.hero-meta{ margin-top:22px; display:flex; flex-wrap:wrap; gap:10px 12px; align-items:center; }
.meta-chip{ display:inline-flex; align-items:center; gap:8px; font-size:13.5px; color:var(--text-2); text-decoration:none; padding:8px 13px; border:1px solid var(--border); border-radius:var(--pill); background:var(--surface); transition:.15s; }
.meta-chip:hover{ color:var(--text); border-color:var(--text-3); }
.meta-chip svg{ color:var(--text-3); }
.hero-cta{ margin-top:26px; display:flex; flex-wrap:wrap; gap:10px; }

/* status line under hero */
.avail{ display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--text-2); }
.avail .dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px var(--accent-ring); }

/* ---------- section frame ---------- */
section.block{ padding:46px 0; border-top:1px solid var(--hairline); }
.eyebrow{ font-size:12px; font-weight:680; letter-spacing:.09em; text-transform:uppercase; color:var(--text-3); margin:0 0 6px; }
.block h2{ margin:0 0 22px; font-size:25px; letter-spacing:-.02em; font-weight:660; }
.lead{ font-size:18px; line-height:1.65; color:var(--text-2); max-width:64ch; margin:0; }
.lead b{ color:var(--text); font-weight:620; }

/* expertise pillars */
.pillars{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:26px; }
.pillar{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:22px; box-shadow:var(--shadow-sm); }
.pillar .pic{ width:38px; height:38px; border-radius:10px; background:var(--surface-3); color:var(--accent-strong); display:grid; place-items:center; margin-bottom:14px; }
.pillar h3{ margin:0 0 4px; font-size:16px; font-weight:620; letter-spacing:-.01em; }
.pillar .pk{ font-size:13px; color:var(--text-3); margin:0 0 12px; }
.pillar ul{ margin:0; padding:0; list-style:none; }
.pillar li{ font-size:14px; color:var(--text-2); padding:6px 0 6px 18px; position:relative; border-top:1px solid var(--hairline); }
.pillar li:first-child{ border-top:none; }
.pillar li::before{ content:""; position:absolute; left:2px; top:13px; width:6px; height:6px; border-radius:50%; background:var(--accent); }

/* certifications strip */
.certs{ display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
.cert{ display:inline-flex; align-items:center; gap:9px; font-size:13.5px; font-weight:540; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:var(--pill); padding:8px 14px; }
.cert svg{ color:var(--accent); }

/* timeline */
.timeline{ margin-top:8px; }
.tl{ display:grid; grid-template-columns:158px 1fr; gap:24px; padding:24px 0; border-top:1px solid var(--hairline); }
.tl:first-child{ border-top:none; }
.tl .period{ font-size:13.5px; color:var(--text-3); font-variant-numeric:tabular-nums; padding-top:2px; }
.tl .org{ font-size:13.5px; color:var(--accent-strong); font-weight:560; margin-top:4px; }
.tl h3{ margin:0; font-size:17px; font-weight:620; letter-spacing:-.01em; }
.tl ul{ margin:12px 0 0; padding:0 0 0 18px; }
.tl li{ font-size:14.5px; color:var(--text-2); margin:6px 0; }
.tl li::marker{ color:var(--text-3); }

/* skills */
.skill-groups{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-top:8px; }
.skg h3{ margin:0 0 12px; font-size:13px; letter-spacing:.05em; text-transform:uppercase; color:var(--text-3); font-weight:680; }
.tags{ display:flex; flex-wrap:wrap; gap:8px; }
.tag{ display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:var(--pill); padding:7px 13px; }
.tag .d{ width:5px; height:5px; border-radius:50%; background:var(--accent); }

/* projects */
.projects{ display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-top:8px; }
.proj{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:22px; box-shadow:var(--shadow-sm); transition:transform .18s var(--ease), box-shadow .18s; }
.proj:hover{ transform:translateY(-2px); box-shadow:var(--shadow); }
.proj-h{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.proj h3{ margin:0; font-size:17px; font-weight:620; letter-spacing:-.01em; }
.proj .yr{ font-size:12.5px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.proj p{ margin:10px 0 14px; font-size:14.5px; color:var(--text-2); line-height:1.55; }
.proj .ptags{ display:flex; flex-wrap:wrap; gap:6px; }
.ptag{ font-size:12px; color:var(--text-2); background:var(--surface-3); border-radius:6px; padding:4px 9px; }

/* teaching */
.teach-head{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:4px 0 18px; }
.teach-badge{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:560; color:var(--accent-strong); background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 30%, transparent); border-radius:var(--pill); padding:6px 13px; }
.courses{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:22px; }
.course{ display:flex; gap:14px; align-items:flex-start; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:16px 18px; box-shadow:var(--shadow-sm); transition:transform .16s var(--ease), box-shadow .16s, border-color .16s; }
.course:hover{ transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--text-3); }
.course .idx{ font-size:13px; font-weight:700; color:var(--accent-strong); font-variant-numeric:tabular-nums; padding-top:2px; min-width:20px; }
.course .ct{ font-size:15px; font-weight:560; line-height:1.4; }
.course .cc{ font-size:11px; letter-spacing:.07em; text-transform:uppercase; color:var(--text-3); font-weight:680; margin-top:6px; }
@media(max-width:820px){ .courses{ grid-template-columns:1fr; } }

/* contact / footer */
.contact{ background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:38px; text-align:center; box-shadow:var(--shadow); }
.contact h2{ margin:0 0 8px; font-size:26px; letter-spacing:-.02em; }
.contact p{ margin:0 auto 22px; color:var(--text-2); font-size:16px; max-width:46ch; }
.contact .row{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }

.foot{ padding:30px 0 56px; display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; color:var(--text-3); font-size:13px; }
.foot .l{ display:flex; align-items:center; gap:9px; }

/* ---------- responsive ---------- */
@media (max-width: 820px){
  .nav-links{ display:none; }
  .hero{ padding:40px 0 18px; }
  .hero-top{ flex-direction:column; gap:18px; }
  .mono{ width:64px; height:64px; border-radius:16px; font-size:24px; }
  .hero h1{ font-size:33px; }
  .hero .role{ font-size:16px; }
  .hero-lead, .lead{ font-size:16px; }
  .pillars{ grid-template-columns:1fr; }
  .skill-groups{ grid-template-columns:1fr; gap:20px; }
  .projects{ grid-template-columns:1fr; }
  .tl{ grid-template-columns:1fr; gap:8px; }
  .tl .period{ order:-1; }
  .contact{ padding:28px 20px; }
  .wrap, .nav-in{ padding:0 18px; }
}
@media (max-width: 480px){
  .hero h1{ font-size:28px; }
  .block h2{ font-size:22px; }
}
