:root{
  --bg:#0c0e0d;
  --card:#131614;
  --ink:#e5dfd5;
  --sub:#7a8078;
  --line:rgba(229,223,213,.08);
  --accent:#d97b3a;
  --accent-ink:#0c0e0d;
  --secondary:#1a1d1b;
  --radius:4px;
  --header-h:56px;
  --serif:'Playfair Display', Georgia, serif;
  --sans:'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:'DM Mono', 'SFMono-Regular', Consolas, monospace;
}

[data-theme="light"]{
  --bg:#f4f0e8;
  --card:#faf7f2;
  --ink:#1a1c1b;
  --sub:#6b6860;
  --line:rgba(26,28,27,.12);
  --accent:#b85e18;
  --accent-ink:#faf7f2;
  --secondary:#ebe6dc;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:var(--sans);
  background:var(--bg);
  color:var(--ink);
  line-height:1.6;
  transition:background-color .2s ease, color .2s ease;
}
a{color:inherit; text-decoration:none;}
ul{list-style:none;}
button{font-family:inherit; cursor:pointer;}
.icon{width:14px; height:14px; stroke:currentColor; fill:none; flex-shrink:0;}

/* Replace the browser's default focus ring (often a blue/white glow)
   with one that matches the accent color, on every focusable element. */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

.wrap{max-width:1024px; margin:0 auto; padding:0 24px;}

/* ---- Header / Nav ---- */
.site-header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:100;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter:blur(10px);
  transform:translateY(0);
  transition:transform .3s ease, background-color .2s ease, border-color .2s ease;
}
.site-header.nav-hidden{transform:translateY(-100%);}
.nav-inner{
  max-width:1024px; margin:0 auto; padding:0 24px;
  height:var(--header-h);
  display:flex; align-items:center; justify-content:space-between;
}
.brand{
  font-family:var(--mono); font-size:12px; letter-spacing:.2em; text-transform:uppercase; color:var(--accent);
}
.nav-desktop{display:flex; align-items:center; gap:24px;}
.navlinks{display:flex; align-items:center; gap:32px;}
.navlinks a{
  font-family:var(--mono); font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sub); transition:color .2s ease;
}
.navlinks a:hover{color:var(--ink);}
.navlinks a.active{color:var(--accent);}

.theme-toggle{
  position:relative;
  display:flex; align-items:center; justify-content:center;
  width:28px; height:28px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:none; color:var(--sub);
}
.theme-toggle:hover{color:var(--ink); border-color:color-mix(in srgb, var(--accent) 40%, var(--line));}
.theme-toggle .icon-moon{display:none;}
[data-theme="light"] .theme-toggle .icon-sun{display:none;}
[data-theme="light"] .theme-toggle .icon-moon{display:block;}

.toggle-tip{
  position:absolute; top:100%; left:50%; margin-top:8px;
  transform:translateX(-50%) translateY(-6px);
  padding:6px 10px; white-space:nowrap; text-align:center; line-height:1.4;
  background:var(--card); border:1px solid var(--line); color:var(--sub);
  font-family:var(--mono); font-size:12px; border-radius:var(--radius);
  opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .25s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.theme-toggle:hover .toggle-tip, .toggle-tip.show-hint{
  opacity:1; transform:translateX(-50%) translateY(0);
}
.toggle-tip .tip-dark{display:none;}
[data-theme="light"] .toggle-tip .tip-light{display:none;}
[data-theme="light"] .toggle-tip .tip-dark{display:inline;}

/* First-visit hint: swaps in its own copy (instead of the hover tip-light/
   tip-dark text) and gets a "flashier" attention treatment on the button —
   see theme-toggle-flash below. The tooltip itself stays put in static
   dark-mode colors the whole time it's shown (no flashing), with a fixed
   width so the message wraps onto a few lines instead of one word per
   line (shrink-to-fit width on an unsized absolutely-positioned box). */
.toggle-tip .tip-hint{display:none; white-space:normal;}
.toggle-tip.show-hint .tip-light, .toggle-tip.show-hint .tip-dark{display:none;}
.toggle-tip.show-hint .tip-hint{display:block;}
.toggle-tip.show-hint{
  width:130px;
  background:#131614; border-color:rgba(229,223,213,.35); color:#e5dfd5;
}
/* Dismiss fades the tooltip out before main.js removes show-hint (see the
   comment there) — this just overrides opacity/transform back to hidden
   while show-hint (and so the hint text/colors) is still applied, so the
   fade never reveals the hover tip-light/tip-dark text underneath. */
.toggle-tip.show-hint.hint-fading{
  opacity:0; transform:translateX(-50%) translateY(-6px);
}

@keyframes theme-toggle-flash{
  0%, 33%, 66%, 100%{background:transparent; border-color:var(--line); color:var(--sub);}
  16%, 50%, 83%{background:#faf7f2; border-color:rgba(26,28,27,.35); color:#1a1c1b;}
}
/* The icon itself is untouched by this animation (no data-theme change
   happens) — .icon-sun/.icon-moon visibility is controlled purely by
   [data-theme], so it stays on whichever icon is already showing (the sun,
   for the default dark theme almost all first-time visitors land on). */
.theme-toggle.hint-flash{animation:theme-toggle-flash 1.8s ease-in-out 1;}

.nav-toggle{
  display:none;
  align-items:center;
  font-family:var(--mono); font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sub); background:none; border:none;
}
.mobile-nav{
  display:none;
  flex-direction:column;
  gap:16px;
  border-top:1px solid var(--line);
  background:var(--bg);
  padding:16px 24px 20px;
}
.mobile-nav.open{display:flex;}
.mobile-nav a, .mobile-nav button.theme-toggle-mobile{
  text-align:left;
  font-family:var(--mono); font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sub); background:none; border:none; display:flex; align-items:center; gap:8px;
}
.mobile-nav a:hover, .mobile-nav button.theme-toggle-mobile:hover{color:var(--ink);}
.mobile-nav a.active{color:var(--accent);}

/* ---- Section scaffolding ---- */
main{padding-top:var(--header-h);}
.section{padding:96px 0; border-top:1px solid var(--line);}
.section:first-of-type{border-top:none;}
.eyebrow{
  font-family:var(--mono); font-size:12px; letter-spacing:.3em; text-transform:uppercase; color:var(--accent);
  margin-bottom:12px; display:block;
}
h1, h2, h3{font-family:var(--serif); font-weight:600; color:var(--ink);}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:48px; gap:16px; flex-wrap:wrap;}
.section-head h2, .contact-heading{font-size:30px;}
.view-all{
  display:none;
  align-items:center; gap:6px;
  font-family:var(--mono); font-size:12px; color:var(--sub);
  white-space:nowrap;
}
.view-all:hover{color:var(--accent);}

/* ---- Hero ---- */
.hero{padding:72px 0 80px; border-top:none;}
.hero-grid{display:grid; grid-template-columns:1fr; gap:64px; align-items:center;}
.hero .eyebrow{margin-bottom:24px;}
.hero h1{font-size:48px; line-height:1.05; margin-bottom:24px;}
.hero h1 em{font-style:italic; color:var(--accent);}
.hero .lead{color:var(--sub); max-width:560px; margin-bottom:16px; font-size:17px; line-height:1.7;}
.hero .lead + .lead{margin-bottom:40px;}
.hero .lead b, .hero .lead .hl{color:var(--ink); font-weight:500;}
.cta-row{display:flex; flex-wrap:wrap; gap:16px;}
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:11px 22px; font-size:14px; font-weight:500; letter-spacing:.02em;
  border-radius:var(--radius); font-family:var(--sans);
  transition:opacity .2s ease, color .2s ease, border-color .2s ease;
}
.btn.primary{background:var(--accent); color:var(--accent-ink);}
.btn.primary:hover{opacity:.8;}
.btn.ghost{border:1px solid var(--line); color:var(--ink); background:none;}
.btn.ghost:hover{border-color:color-mix(in srgb, var(--accent) 60%, var(--line)); color:var(--accent);}

.hero-badges{display:none; flex-wrap:wrap; gap:12px;}
.hero-badge{
  display:flex; align-items:center; gap:16px;
  border:1px solid var(--line); background:var(--card);
  padding:16px 20px; width:240px;
}
.hero-badge .icon{width:18px; height:18px; color:var(--accent);}
.hero-badge .label{font-size:14px; font-weight:500;}
.hero-badge .sub{font-family:var(--mono); font-size:12px; color:var(--sub);}

/* ---- About ---- */
.about-header{
  display:grid; grid-template-columns:1fr; gap:48px; align-items:start;
  margin-bottom:64px; padding-bottom:64px; border-bottom:1px solid var(--line);
}
.about-photo-wrap{display:flex; justify-content:center;}
.about-photo{
  width:192px; height:192px; overflow:hidden; flex-shrink:0;
  border:1px solid var(--line); background:var(--secondary); border-radius:var(--radius);
}
.about-photo img{
  width:100%; height:100%; object-fit:cover; object-position:top;
  filter:grayscale(1); transition:filter .5s ease;
}
.about-photo:hover img{filter:grayscale(0);}
/* Figma: text-4xl/lg:text-5xl (36px/48px), font-semibold (global h1 rule
   already carries the 600 weight) — this page's h1 previously had no
   explicit size of its own, so it fell back to the browser's default UA
   heading size instead of matching Figma. No max-width here (and none on
   .lead below) — Figma doesn't cap this text either, it just fills the
   1fr grid column next to the photo. A max-width added in an earlier pass
   was capping it well short of that column, causing an extra line wrap
   that Figma doesn't have. */
/* line-height matters here too: with no override this inherits body's
   line-height:1.6, which pads a lot of extra visual space above/below a
   single line of heading text (Figma's text-4xl/text-5xl utilities carry
   their own tight line-height, ~1.1). That's why the eyebrow-to-heading and
   heading-to-paragraph gaps read as bigger than Figma even though the
   margin values themselves already matched. */
.about-header h1{font-size:36px; line-height:1.1; margin-bottom:4px;}
.about-header .lead{color:var(--sub); font-size:16px; line-height:1.7; font-family:var(--mono); margin-bottom:20px;}
.about-header .lead + .lead{font-family:var(--sans); margin-bottom:0;}
.about-header + h2{font-size:24px; margin-bottom:40px;}
.about-grid{display:grid; grid-template-columns:1fr; gap:48px;}
.about-copy{color:var(--sub); line-height:1.75;}
.about-copy p{margin-bottom:20px;}
.about-copy p:last-child{margin-bottom:0;}
.timeline-label{font-family:var(--mono); font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--sub); margin-bottom:24px; display:block;}
.timeline{display:flex; flex-direction:column; gap:12px;}
.timeline-item{
  border:1px solid var(--line); background:var(--card); padding:20px;
  position:relative; transition:border-color .3s ease;
}
.timeline-item:hover{border-color:color-mix(in srgb, var(--accent) 30%, var(--line));}
/* Same thicker-left-edge hover treatment as .post-item (blog cards). */
.timeline-item::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:2px;
  background:var(--accent); opacity:0; transition:opacity .3s ease;
}
.timeline-item:hover::before{opacity:1;}
.timeline-year{font-family:var(--mono); font-size:12px; color:var(--accent); margin-bottom:4px;}
.timeline-role{font-size:14px; font-weight:500; margin-bottom:2px;}
.timeline-org{font-size:12px; color:var(--sub); margin-bottom:8px;}
.timeline-detail{font-family:var(--mono); font-size:12px; color:var(--sub);}

.skills-grid{margin-top:64px; display:grid; grid-template-columns:1fr; gap:24px;}
.skill-card{border:1px solid var(--line); background:var(--card); padding:24px;}
.skill-cat{font-family:var(--mono); font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--accent); margin-bottom:16px; display:block;}
.tags{display:flex; flex-wrap:wrap; gap:8px;}
.tag{
  font-family:var(--mono); font-size:12px; padding:4px 10px;
  background:var(--secondary); color:var(--sub); border:1px solid var(--line); border-radius:var(--radius);
}

.now-grid{margin-top:64px; display:grid; grid-template-columns:1fr; gap:24px;}
.now-card{border:1px solid var(--line); background:var(--card); padding:24px;}
.now-cat{font-family:var(--mono); font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--accent); margin-bottom:16px; display:block;}
.now-list{display:flex; flex-direction:column; gap:10px;}
.now-list li{display:flex; align-items:flex-start; gap:10px; color:var(--sub); font-size:14px; line-height:1.6;}
.now-dot{width:4px; height:4px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:8px;}

/* ---- Project cards ---- */
.project-grid{display:grid; grid-template-columns:1fr; gap:16px;}
.project-card{
  display:flex; flex-direction:column; gap:16px;
  border:1px solid var(--line); background:var(--card); padding:24px;
  position:relative; transition:border-color .3s ease;
}
.project-card:hover{border-color:color-mix(in srgb, var(--accent) 30%, var(--line));}
.project-card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px;}
.project-card-name{display:flex; align-items:center; gap:8px;}
.project-card-name .icon{color:var(--sub);}
.project-card-name h3, .project-card-name h2{
  font-family:var(--mono); font-size:14px; font-weight:500; color:var(--ink);
}
.project-card:hover .project-card-name h3, .project-card:hover .project-card-name h2{color:var(--accent);}
.project-card-head > .icon{color:var(--sub); margin-top:2px; transition:color .2s ease;}
/* Covers both the external-link icon (home cards) and the chevron (projects
   page cards) — same markup position (direct child of .project-card-head)
   on both pages, so one rule handles both. */
.project-card:hover .project-card-head > .icon{color:var(--accent);}
.project-desc{color:var(--sub); font-size:14px; line-height:1.7;}
.project-tagline{font-size:12px; color:var(--accent); font-style:normal;}
.project-meta{display:flex; align-items:center; gap:20px; padding-top:12px; border-top:1px solid var(--line); flex-wrap:wrap;}
.project-meta span{display:flex; align-items:center; gap:6px; font-family:var(--mono); font-size:12px; color:var(--sub);}
.lang-dot{width:9px; height:9px; border-radius:50%; flex-shrink:0;}
/* .project-meta .read-report (2 classes) needed, not just .read-report (1
   class) — .project-meta span already matches with equal-or-higher
   specificity (class+element), so a single-class .read-report rule was
   silently losing that specificity fight and never actually showing accent
   color. The underline-on-hover rule below doesn't need the same fix since
   it already has 3 classes worth of specificity. */
.project-meta .read-report{margin-left:auto; font-family:var(--mono); font-size:12px; color:var(--accent);}
.project-card:hover .read-report{text-decoration:underline;}

/* ---- Stat number background-refresh animation ----
   Stars/forks render straight from the DB (see project_stats() /
   get_projects_github_data() in main.py) — no live GitHub call blocks the
   initial page load. main.js quietly re-checks GitHub shortly after load
   and, if a number changed, briefly turns it into two stacked lines (old
   sliding up and out, new sliding up and fading in from below) before
   settling back to plain text. */
.stat-num{position:relative; display:inline-block;}
.stat-num.stat-anim{overflow:hidden; height:1em; vertical-align:bottom; min-width:1ch;}
.stat-slide{
  position:absolute; top:0; left:0; width:100%;
  transition:transform .4s ease, opacity .4s ease;
}
.stat-slide-old{transform:translateY(0); opacity:1;}
.stat-slide-new{transform:translateY(100%); opacity:0;}
.stat-num.stat-anim-active .stat-slide-old{transform:translateY(-100%); opacity:0;}
.stat-num.stat-anim-active .stat-slide-new{transform:translateY(0); opacity:1;}

/* ---- Blog list ---- */
.post-list{display:flex; flex-direction:column; gap:1px;}
.post-item{
  display:flex; flex-direction:column; gap:12px;
  border:1px solid var(--line); background:var(--card); padding:24px;
  position:relative; transition:border-color .3s ease;
}
.post-item:hover{border-color:color-mix(in srgb, var(--accent) 30%, var(--line));}
/* Thicker hover accent on the left edge (matches Figma's absolute bar,
   rather than a plain border-color change on the whole box). */
.post-item::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:2px;
  background:var(--accent); opacity:0; transition:opacity .3s ease;
}
.post-item:hover::before{opacity:1;}
.post-index{font-family:var(--mono); font-size:12px; color:var(--sub);}
.post-title{font-size:18px; margin-bottom:8px; line-height:1.4;}
.post-item:hover .post-title{color:var(--accent);}
.post-excerpt{color:var(--sub); font-size:14px; line-height:1.7; margin-bottom:16px;}
.post-meta{display:flex; flex-wrap:wrap; align-items:center; gap:16px;}
.post-meta span{display:flex; align-items:center; gap:6px; font-family:var(--mono); font-size:12px; color:var(--sub);}
.post-read{margin-left:auto; font-family:var(--mono); font-size:12px; color:var(--sub);}
.post-item:hover .post-read{color:var(--accent);}
/* Trailing arrow on home-page blog cards (Figma: hidden on mobile, shown
   once the card switches to a row layout at the same 780px breakpoint as
   .post-item itself, further down in Responsive). */
.post-arrow{display:none; align-items:center; color:var(--sub); flex-shrink:0; transition:color .2s ease;}
.post-item:hover .post-arrow{color:var(--accent);}
.more-posts{
  margin-top:48px; border:1px dashed var(--line); padding:32px; text-align:center;
}
.more-posts p:first-child{font-family:var(--mono); font-size:12px; color:var(--sub); margin-bottom:8px;}
.more-posts p:last-child{font-size:14px; color:var(--sub);}
.more-posts p:last-child a{color:var(--sub); text-decoration:underline; text-underline-offset:2px;}
.more-posts p:last-child a:hover{color:var(--accent);}

/* ---- Contact ---- */
.contact-grid{display:grid; grid-template-columns:1fr; gap:48px;}
.contact-copy p{color:var(--sub); line-height:1.7; margin-bottom:32px;}
.contact-links{display:flex; flex-direction:column; gap:12px;}
.contact-links a{
  display:inline-flex; align-items:center; gap:12px;
  font-family:var(--mono); font-size:14px; color:var(--sub);
  transition:color .2s ease;
}
.contact-links a:hover{color:var(--accent);}
.contact-card{border:1px solid var(--line); background:var(--card); padding:32px;}
.contact-card-label{font-family:var(--mono); font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--sub); margin-bottom:24px; display:block;}
.field{margin-bottom:16px;}
.field label{display:block; font-family:var(--mono); font-size:12px; color:var(--sub); margin-bottom:6px;}
.field input, .field textarea{
  width:100%; background:var(--secondary); border:1px solid var(--line); color:var(--ink);
  padding:10px 14px; font-family:var(--sans); font-size:14px; border-radius:var(--radius);
  transition:border-color .2s ease;
}
.field textarea{resize:vertical; min-height:100px;}
.field input:focus, .field textarea:focus{outline:none; border-color:color-mix(in srgb, var(--accent) 50%, var(--line));}
.form-note{font-size:12px; color:var(--sub); margin-top:12px; display:none;}
.form-note.show{display:block;}
.btn-submit{
  width:100%; justify-content:center; border:none; background:var(--accent); color:var(--accent-ink);
  padding:11px 22px; font-size:14px; font-weight:500; border-radius:var(--radius);
  display:flex; align-items:center; gap:8px;
}
.btn-submit:hover{opacity:.85;}

/* ---- Footer ---- */
.site-footer{border-top:1px solid var(--line); padding:32px 0;}
.footer-inner{display:flex; flex-direction:column; gap:8px; align-items:center; text-align:center;}
.footer-inner p{font-family:var(--mono); font-size:12px; color:var(--sub);}

/* ---- Back link / subpage header ---- */
.back-link{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--mono); font-size:12px; color:var(--sub);
  margin-bottom:40px; padding-top:56px;
}
.back-link:hover{color:var(--accent);}
.page-wrap > .page-head:first-child{padding-top:56px;}
.page-head{margin-bottom:56px;}
.page-head h1{font-size:36px; margin-bottom:16px;}
.page-head .lead{color:var(--sub); max-width:560px; font-size:15px; line-height:1.7;}
.page-wrap{padding-bottom:96px;}

/* ---- 404 ---- */
.not-found{padding-top:96px;}
.not-found h1{font-size:48px; line-height:1.1; margin-bottom:20px;}
.not-found .lead{color:var(--sub); max-width:560px; font-size:16px; line-height:1.7; margin-bottom:40px;}

/* ---- Project detail ---- */
.detail-header{
  display:flex; flex-direction:column; gap:32px;
  padding-bottom:56px; margin-bottom:56px; border-bottom:1px solid var(--line);
}
.detail-repo-path{display:flex; align-items:center; gap:8px; font-family:var(--mono); font-size:12px; color:var(--sub); margin-bottom:16px;}
.detail-header h1{font-size:36px; margin-bottom:16px; line-height:1.2;}
.detail-tagline{color:var(--sub); font-size:17px; margin-bottom:20px; max-width:600px;}
.detail-header-info .tags{max-width:600px;}
.detail-stats{display:flex; align-items:center; gap:20px; flex-wrap:wrap;}
.detail-stats span{display:flex; align-items:center; gap:6px; font-family:var(--mono); font-size:12px; color:var(--sub);}
.detail-actions{display:flex; flex-direction:row; flex-wrap:wrap; gap:12px;}

.report-grid{display:grid; grid-template-columns:1fr; gap:48px;}
.report-body{display:flex; flex-direction:column; gap:56px; min-width:0; container-type:inline-size;}
/* Links authored inside project (why/how/results/code) and blog post body
   content — themed to the accent color, underline only on hover so they
   don't compete visually with the surrounding prose at rest. */
.report-body a{color:var(--accent);}
.report-body a:hover{text-decoration:underline;}
.report-section h2{font-size:24px; margin-bottom:20px;}
.report-section p{color:var(--sub); line-height:1.75; margin-bottom:16px;}
.report-section p:last-child{margin-bottom:0;}
.results-content{display:flex; flex-direction:column; gap:12px;}
/* Older, results_block()-generated markup (raw <div class="result-item"> rows) —
   kept until every project is migrated to a .md file (see raw_data/ migration). */
.results-content .result-item{display:flex; align-items:flex-start; gap:12px;}
.results-content .result-item .icon{color:var(--accent); margin-top:3px; width:15px; height:15px; flex-shrink:0;}
.results-content .result-item span{color:var(--sub); font-size:14px; line-height:1.7;}
/* New markup: a plain Markdown list authored directly in a project's .md
   file. CSS swaps the default bullet for a checkmark, so a hand-written
   "- point one" list renders identically to the old generated HTML. */
.results-content ul{display:flex; flex-direction:column; gap:12px; list-style:none;}
.results-content li{
  position:relative; padding-left:27px;
  color:var(--sub); font-size:14px; line-height:1.7;
}
.results-content li::before{
  content:"";
  position:absolute; left:0; top:5px; width:15px; height:15px;
  background-color:var(--accent);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.801 10A10 10 0 1 1 17 3.335'%3E%3C/path%3E%3Cpath d='m9 11 3 3L22 4'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.801 10A10 10 0 1 1 17 3.335'%3E%3C/path%3E%3Cpath d='m9 11 3 3L22 4'%3E%3C/path%3E%3C/svg%3E") center / contain no-repeat;
}

.chart-embed{
  width:100%;
  /* 1024px .wrap cap, minus its 48px padding, minus .report-grid's 48px gap,
     minus the 260px sidebar — the widest .report-body (content column) ever
     gets at the 2-column (1024px+) breakpoint. Caps the chart so it doesn't
     balloon past that in the single-column layout below 1024px. */
  max-width:calc(1024px - 48px - 48px - 260px);
  height:clamp(220px, 24cqw + 178px, 350px); margin:8px 0 4px;
  border:1px solid var(--line); border-radius:var(--radius); background:var(--secondary);
  overflow:hidden;
}
/* Project.code is now rendered as one Markdown block (label paragraph +
   fenced code), so the label/box styling that used to target .code-label/
   .code-block targets the markdown filter's own <p>/<pre><code> output
   instead. */
.code-content p{font-family:var(--mono); font-size:12px; color:var(--sub); margin-bottom:10px;}
.code-content pre{
  background:var(--secondary); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; overflow-x:auto;
}
.code-content pre code{font-family:var(--mono); font-size:12px; line-height:1.7; color:var(--ink); white-space:pre;}

.markdown-body h2{font-size:20px; margin:48px 0 16px; scroll-margin-top:calc(var(--header-h) + 20px);}
.markdown-body h2:first-child{margin-top:0;}
.markdown-body p{color:var(--sub); line-height:1.75; margin-bottom:16px;}
.markdown-body ul,.markdown-body ol{color:var(--sub); line-height:1.75; margin:0 0 16px; padding-left:22px;}
.markdown-body li{margin-bottom:6px;}
.markdown-body pre{
  background:var(--secondary); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px; overflow-x:auto; margin-bottom:16px;
}
.markdown-body pre code{font-family:var(--mono); font-size:12px; line-height:1.7; color:var(--ink); white-space:pre;}
.markdown-body code{font-family:var(--mono); font-size:0.9em; color:var(--ink);}

/* Markdown pipe tables (project sections + blog post body). display:block
   + overflow-x lets a wide sample-data table scroll horizontally on
   narrow screens instead of blowing out the layout, same overflow
   treatment as the pre/code blocks above. */
.report-body table{
  width:100%; border-collapse:collapse; margin-bottom:16px;
  display:block; overflow-x:auto; white-space:nowrap;
}
.report-body th,.report-body td{padding:10px 14px; text-align:left; border-bottom:1px solid var(--line);}
.report-body th{
  font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sub); font-weight:500;
}
.report-body td{color:var(--ink); font-size:14px;}

.detail-sidebar{border:1px solid var(--line); background:var(--card); padding:20px; align-self:start;}
.sidebar-label{font-family:var(--mono); font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--sub); margin-bottom:16px; display:block;}
.stack-list{display:flex; flex-direction:column; gap:10px; margin-bottom:24px;}
.stack-list li{display:flex; align-items:center; gap:8px; font-family:var(--mono); font-size:12px; color:var(--sub);}
.stack-dot{width:4px; height:4px; border-radius:50%; background:var(--accent); flex-shrink:0;}
.glance{border-top:1px solid var(--line); padding-top:20px; margin-bottom:24px;}
.glance-row{display:flex; justify-content:space-between; font-family:var(--mono); font-size:12px; padding:4px 0;}
.glance-row > span:first-child{color:var(--sub);}
.glance-row-langs{align-items:flex-start;}
.glance-langs{display:flex; flex-direction:column; align-items:flex-end; gap:2px;}
.glance-langs span{color:var(--ink);}
.other-projects{border-top:1px solid var(--line); padding-top:20px;}
.other-projects a{display:block; font-family:var(--mono); font-size:12px; color:var(--sub); padding:4px 0;}
.other-projects a:hover{color:var(--accent);}

/* ---- Blog post ---- */
.post-header{max-width:680px; padding-bottom:56px; margin-bottom:56px; border-bottom:1px solid var(--line);}
.post-header .tags{margin-bottom:20px;}
.post-header h1{font-size:30px; margin-bottom:20px; line-height:1.35;}
.post-header .lead{color:var(--sub); font-size:16px; line-height:1.7; margin-bottom:24px;}
.post-header-meta{display:flex; align-items:center; gap:20px;}
.post-header-meta span{display:flex; align-items:center; gap:6px; font-family:var(--mono); font-size:12px; color:var(--sub);}

.toc-list{display:flex; flex-direction:column; gap:10px; margin-bottom:24px;}
.toc-list li{display:flex; align-items:flex-start; gap:8px; font-family:var(--mono); font-size:12px; color:var(--sub); line-height:1.6;}
.toc-list a:hover{color:var(--accent);}
.toc-num{color:var(--accent); flex-shrink:0;}

.post-nav{
  margin-top:80px; padding-top:40px; border-top:1px solid var(--line);
  display:grid; grid-template-columns:1fr; gap:16px;
}
.post-nav-link{
  display:block; border:1px solid var(--line); background:var(--card);
  padding:20px; transition:border-color .2s ease;
}
.post-nav-link:hover{border-color:color-mix(in srgb, var(--accent) 30%, var(--line));}
.post-nav-label{display:block; font-family:var(--mono); font-size:12px; color:var(--sub); margin-bottom:8px;}
.post-nav-title{
  display:block; font-family:var(--serif); font-size:14px; color:var(--ink); line-height:1.4;
  transition:color .2s ease;
}
.post-nav-link:hover .post-nav-title{color:var(--accent);}
.post-nav-next{text-align:right;}

/* ---- Responsive ---- */
@media (min-width: 780px){
  .nav-desktop{display:flex;}
  .mobile-nav, .nav-toggle{display:none !important;}
  .hero-grid{grid-template-columns:1fr auto;}
  .hero h1{font-size:72px;}
  .section-head h2, .contact-heading{font-size:36px;}
  .about-header + h2{font-size:30px;}
  .about-grid{grid-template-columns:1fr 1fr;}
  .skills-grid{grid-template-columns:repeat(3,1fr);}
  .now-grid{grid-template-columns:repeat(3,1fr);}
  .project-grid{grid-template-columns:1fr 1fr;}
  .contact-grid{grid-template-columns:1fr 1fr;}
  .view-all{display:inline-flex;}
  .page-head h1{font-size:48px;}
  .detail-header h1{font-size:48px;}
  .post-item{flex-direction:row; align-items:flex-start; gap:32px;}
  .post-index{flex-shrink:0; width:24px;}
  .post-arrow{display:flex; align-self:center;}
  .post-nav{grid-template-columns:1fr 1fr;}
  .post-header h1{font-size:36px;}
}

/* Matches Figma's lg: (1024px) breakpoint rather than the site's usual
   780px "desktop" breakpoint — scoped to just the sections asked for. */
@media (min-width: 1024px){
  .hero-badges{display:flex; flex-direction:column;}
  .detail-header{flex-direction:row; align-items:flex-start; justify-content:space-between;}
  .detail-header-info{min-width:0; flex:1 1 auto;}
  .detail-actions{flex-direction:column; align-items:flex-end; flex-shrink:0;}
  .report-grid{grid-template-columns:1fr 260px;}
  .detail-sidebar{position:sticky; top:80px;}
  .about-header{grid-template-columns:auto 1fr;}
  .about-photo-wrap{justify-content:flex-start;}
  .about-photo{width:224px; height:224px;}
  .about-header h1{font-size:48px;}
}

@media (max-width: 779px){
  .nav-desktop{display:none;}
  .nav-toggle{display:flex;}
}

/* ---- Load-in animation ----
   Since pages are server-rendered, this content is already in the HTML by
   the time it reaches the browser — there's no client-side wait on the
   GitHub data anymore (that's what get_projects_github_data's parallel
   fetch fixed, server-side). This is purely a cosmetic entrance: nav fades
   in, hero slides up, then cards/posts follow in staggered rows, all on a
   short fixed timeline rather than being gated on anything actually
   loading. */
@keyframes reveal-up{
  from{opacity:0; transform:translateY(18px);}
  to{opacity:1; transform:translateY(0);}
}

.site-header{animation:reveal-up .5s ease both;}
.hero-grid > *:first-child{animation:reveal-up .6s ease both .08s;}
.hero-badges{animation:reveal-up .6s ease both .22s;}

.project-card{animation:reveal-up .6s ease both;}
.project-card:nth-child(1),.project-card:nth-child(2){animation-delay:.1s;}
.project-card:nth-child(3),.project-card:nth-child(4){animation-delay:.22s;}
.project-card:nth-child(5),.project-card:nth-child(6){animation-delay:.34s;}
.project-card:nth-child(n+7){animation-delay:.46s;}

.post-item{animation:reveal-up .6s ease both;}
.post-item:nth-child(1){animation-delay:.1s;}
.post-item:nth-child(2){animation-delay:.2s;}
.post-item:nth-child(3){animation-delay:.3s;}
.post-item:nth-child(n+4){animation-delay:.4s;}

@media (prefers-reduced-motion: reduce){
  .site-header, .hero-grid > *:first-child, .hero-badges, .project-card, .post-item{
    animation:none;
  }
}

/* ---- Contact form honeypot ----
   Hidden from real visitors (and off the tab order / screen readers), but
   present in the DOM so bots that blindly fill every input on a form will
   fill this one too. Not display:none — some bots specifically skip
   display:none fields, so this is hidden visually/positionally instead. */
.hp-field{
  position:absolute; left:-9999px; top:-9999px;
  width:1px; height:1px; overflow:hidden;
  opacity:0; pointer-events:none;
}

/* ---- Admin ---- */
.admin-filter-bar{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin-bottom:32px; padding-bottom:32px; border-bottom:1px solid var(--line);
}
.admin-filter-bar input[type="text"]{
  flex:1 1 240px; background:var(--secondary); border:1px solid var(--line); color:var(--ink);
  padding:10px 14px; font-family:var(--sans); font-size:14px; border-radius:var(--radius);
}
.admin-filter-bar input[type="text"]:focus{outline:none; border-color:color-mix(in srgb, var(--accent) 50%, var(--line));}
.admin-filter-bar select{
  background:var(--secondary); border:1px solid var(--line); color:var(--ink);
  padding:10px 12px; font-family:var(--sans); font-size:14px; border-radius:var(--radius);
}
.admin-filter-checkbox{
  display:flex; align-items:center; gap:8px;
  font-family:var(--mono); font-size:12px; color:var(--sub); white-space:nowrap;
}
.admin-message{display:flex; flex-direction:column; gap:12px;}
.admin-message-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px;}
.admin-message-head-right{display:flex; align-items:center; gap:12px;}
.admin-message-body{color:var(--sub); font-size:14px; line-height:1.7; white-space:pre-wrap;}
.admin-message-meta{display:flex; gap:16px; flex-wrap:wrap; font-family:var(--mono); font-size:12px; color:var(--sub);}
.admin-message-actions{display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.admin-message-actions select{
  background:var(--secondary); border:1px solid var(--line); color:var(--ink);
  padding:8px 12px; font-family:var(--sans); font-size:13px; border-radius:var(--radius);
}
.admin-comment-form{display:flex; flex-direction:column; gap:8px; border-top:1px solid var(--line); padding-top:16px;}
.admin-comment-form label{font-family:var(--mono); font-size:12px; color:var(--sub);}
.admin-comment-form textarea{
  width:100%; background:var(--secondary); border:1px solid var(--line); color:var(--ink);
  padding:10px 14px; font-family:var(--sans); font-size:14px; border-radius:var(--radius);
  resize:vertical; min-height:60px;
}
.admin-comment-form textarea:focus{outline:none; border-color:color-mix(in srgb, var(--accent) 50%, var(--line));}
.admin-comment-form .btn.ghost{align-self:flex-start;}
.star-toggle{
  background:none; border:none; padding:4px; color:var(--sub); cursor:pointer;
  display:inline-flex; align-items:center; transition:color .2s ease;
}
.star-toggle .icon{width:16px; height:16px;}
.star-toggle:hover{color:var(--accent);}
.star-toggle.starred{color:var(--accent);}
.star-toggle.starred .icon{fill:currentColor;}
.delete-btn:hover{border-color:#c65f4a; color:#c65f4a;}
.status-badge{
  font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  padding:4px 10px; border-radius:var(--radius); border:1px solid var(--line); white-space:nowrap;
}
.status-new{color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, var(--line));}
.status-potential{color:var(--accent); border-color:color-mix(in srgb, var(--accent) 70%, var(--line));}
.status-responded{color:var(--ink);}
.status-resolved{color:var(--sub);}
.form-note.error{color:#c65f4a;}
