@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,500;12..96,700;12..96,800&family=Hanken+Grotesk:wght@400;500&display=swap');

:root {
  --bg:      #FEFCF4;
  --surface: #F3F0E4;
  --ink:     #0E0D0B;
  --muted:   #9A9182;
  --accent:  #2A7CC7;
  --a-light: #E6F2FB;
  --blue:    #1530CC;
  --b-light: #EAF0FF;
  --border:  rgba(14,13,11,.1);
}

[data-theme="dark"] {
  --bg:      #0F0E0C;
  --surface: #1A1813;
  --ink:     #ECE6DA;
  --muted:   #8A8071;
  --accent:  #5AA9E0;
  --a-light: #14222E;
  --blue:    #7B9BFF;
  --b-light: #15192B;
  --border:  rgba(236,230,218,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.5rem; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: 14px; color: var(--muted); text-decoration: none; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.theme-toggle { background: none; border: none; cursor: pointer; font-family: monospace; font-size: 13px; color: var(--muted); padding: 0; transition: color .15s; }
.theme-toggle:hover { color: var(--ink); }

/* ── Page header ── */
.page-header {
  padding: 5rem 2.5rem 3rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800; font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -.03em; margin-bottom: .75rem;
}
.page-header p { color: var(--muted); font-size: 1.05rem; max-width: 540px; }

/* ── Section header ── */
.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 4rem 2.5rem 2rem; }
.sec-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: -.025em; }
.sec-link { font-size: 14px; color: var(--muted); text-decoration: none; font-weight: 500; transition: color .15s; }
.sec-link:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
  padding: 7rem 2.5rem 5rem; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: end;
}
.hero-tag { display: inline-block; background: var(--a-light); color: var(--accent); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px; margin-bottom: 2.5rem; }
.hero-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(3.2rem, 7vw, 6.5rem); line-height: 1; letter-spacing: -.03em; margin-bottom: 2rem; }
.hero-title .hl { color: var(--accent); }
.hero-title .lnbr { display: block; }
.hero-body { max-width: 500px; color: var(--muted); font-size: 1.05rem; line-height: 1.75; margin-bottom: 2.5rem; }
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .75rem 1.5rem; background: var(--ink); color: var(--bg); font-family: 'Hanken Grotesk', sans-serif; font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 6px; transition: background .18s, transform .12s; }
.btn:hover { background: var(--accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); margin-left: .75rem; }
.btn-ghost:hover { background: var(--surface); transform: translateY(-1px); }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1.5rem; padding-bottom: .25rem; flex-shrink: 0; }
.hero-stat { text-align: right; padding: 1.25rem 1.5rem; background: var(--surface); border-radius: 12px; min-width: 140px; }
.hero-stat-n { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 2.5rem; line-height: 1; }
.hero-stat-l { font-size: 12px; color: var(--muted); margin-top: .25rem; font-weight: 500; }

/* ── Project rows ── */
.project-rows { border-top: 1px solid var(--border); }
.prow { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 0 2rem; padding: 2rem 2.5rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; align-items: center; transition: background .18s; }
.prow:hover { background: var(--surface); }
.prow:hover .prow-arrow { opacity: 1; transform: rotate(-45deg); }
.prow:hover .prow-name { color: var(--accent); }
.prow-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--muted); transition: color .18s; }
.prow:hover .prow-num { color: var(--accent); }
.prow-top { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .3rem; }
.prow-name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -.015em; transition: color .18s; }
.prow-cat { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prow-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }
.prow-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 5px; background: var(--surface); color: var(--muted); }
.prow:hover .tag { background: var(--bg); }
.badge { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.badge.app  { background: var(--a-light); color: var(--accent); }
.badge.tool { background: var(--b-light); color: var(--blue); }
.badge.exp  { background: #EEF9EC; color: #1A7A2E; }
.badge.lib  { background: #F5ECFF; color: #7B2FBE; }
.badge.game { background: #FFF6E0; color: #A3620A; }
.prow-arrow { font-size: 1.1rem; color: var(--accent); opacity: 0; transition: opacity .18s, transform .18s; }

/* ── Posts / Writing ── */
.posts { border-top: 1px solid var(--border); }
.post { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; padding: 1.75rem 2.5rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; align-items: center; transition: background .18s; }
.post:hover { background: var(--surface); }
.post-kicker { display: flex; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.post-tag { font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface); color: var(--muted); transition: background .18s; }
.post:hover .post-tag { background: var(--a-light); color: var(--accent); }
.post-date { font-size: 12px; color: var(--muted); font-weight: 500; }
.post-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -.015em; transition: color .18s; }
.post:hover .post-title { color: var(--accent); }
.post-arrow { font-size: 1.1rem; color: var(--accent); opacity: 0; transition: opacity .18s, transform .18s; }
.post:hover .post-arrow { opacity: 1; transform: rotate(-45deg); }

/* ── Post body (single post page) ── */
.post-body { padding: 4rem 2.5rem; max-width: 720px; }
.post-body h1 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 2.5rem; letter-spacing: -.03em; margin-bottom: 1rem; line-height: 1.1; }
.post-body .post-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.post-body .content { color: var(--ink); font-size: 1.05rem; line-height: 1.85; }
.post-body .content p { margin-bottom: 1.5rem; }
.post-body .content h2 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.post-body .content h3 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.2rem; margin: 2rem 0 .75rem; }
.post-body .content code { font-size: .9em; background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.post-body .content pre { background: var(--surface); padding: 1.25rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1.5rem; }
.post-body .content pre code { background: none; padding: 0; }
.post-body .content blockquote { border-left: 3px solid var(--accent); padding-left: 1.25rem; color: var(--muted); margin: 1.5rem 0; }
.post-body .content a { color: var(--accent); text-underline-offset: 3px; }

/* ── Signals ── */
.signal-row { display: flex; align-items: flex-start; gap: 1.25rem; padding: 1.25rem 2.5rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background .15s; }
.signal-row:first-child { border-top: 1px solid var(--border); }
.signal-row:hover { background: var(--surface); }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; margin-top: .45rem; transition: background .2s; }
.signal-row:hover .signal-dot { background: var(--accent); }
.signal-body { flex: 1; }
.signal-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: .25rem; transition: color .15s; }
.signal-row:hover .signal-title { color: var(--accent); }
.signal-meta { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.signal-source { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.signal-note { font-size: 13px; color: var(--muted); font-style: italic; }
.signal-strength { font-size: 11px; color: var(--accent); opacity: .5; flex-shrink: 0; letter-spacing: .15em; padding-top: .3rem; }
.signal-row:hover .signal-strength { opacity: 1; }

/* ── CV ── */
.cv-body { padding: 0 2.5rem 5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0 5rem; align-items: start; }
.cv-col-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 2rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.cv-entries { display: flex; flex-direction: column; gap: 2.25rem; margin-bottom: 3.5rem; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .2rem; }
.cv-entry-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.cv-entry-period { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; margin-left: 1rem; }
.cv-entry-org { font-size: 14px; color: var(--accent); font-weight: 500; margin-bottom: .4rem; }
.cv-entry-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }
.cv-skills { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3.5rem; }
.cv-skill-label { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.cv-skill-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.cv-skill-tag { font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 6px; background: var(--surface); color: var(--ink); }
.cv-patent { margin-bottom: 3.5rem; }
.cv-patent-box { padding: 1.25rem 1.5rem; background: var(--a-light); border-radius: 12px; border: 1px solid rgba(42,124,199,.15); }
.cv-patent-num { font-size: 11px; font-weight: 500; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .35rem; }
.cv-patent-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: -.01em; margin-bottom: .3rem; }
.cv-patent-meta { font-size: 13px; color: var(--muted); }

/* ── About ── */
.about-inner { max-width: 680px; padding: 4rem 2.5rem 5rem; }
.about-inner h1 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: -.025em; margin-bottom: 2rem; }
.about-text { color: var(--muted); font-size: 1.05rem; line-height: 1.85; }
.about-text p + p { margin-top: 1.25rem; }
.about-text a { color: var(--ink); text-underline-offset: 3px; transition: color .15s; }
.about-text a:hover { color: var(--accent); }

/* ── Tools ── */
.tool-rows { border-top: 1px solid var(--border); }

/* ── Footer ── */
footer { padding: 1.75rem 2.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.foot-logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: .95rem; color: var(--ink); text-decoration: none; }
.foot-logo span { color: var(--accent); }
.foot-links { display: flex; gap: 1.25rem; }
.foot-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color .15s; }
.foot-links a:hover { color: var(--ink); }
.foot-copy { font-size: 13px; color: var(--muted); }
.foot-ascii { font-family: monospace; font-size: 13px; color: var(--border); letter-spacing: -.05em; user-select: none; transition: color .3s; }
.foot-ascii:hover { color: var(--accent); }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(14px); animation: revealIn .5s ease forwards; }
@keyframes revealIn { to { opacity: 1; transform: none; } }
.reveal:nth-child(1) { animation-delay: .05s; }
.reveal:nth-child(2) { animation-delay: .10s; }
.reveal:nth-child(3) { animation-delay: .15s; }
.reveal:nth-child(4) { animation-delay: .20s; }
.reveal:nth-child(5) { animation-delay: .25s; }
.reveal:nth-child(6) { animation-delay: .30s; }
.reveal:nth-child(7) { animation-delay: .35s; }
.reveal:nth-child(8) { animation-delay: .40s; }
.reveal:nth-child(9) { animation-delay: .45s; }
.reveal:nth-child(10) { animation-delay: .50s; }

/* ── Responsive ── */
@media (max-width: 900px) { .cv-body { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 800px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.25rem; }
  .nav-links a { font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding: 4rem 1.5rem 3rem; }
  .hero-right { flex-direction: row; }
  .sec-head { padding: 3rem 1.5rem 1.5rem; }
  .prow { grid-template-columns: 2.5rem 1fr; padding: 1.5rem; }
  .prow-right { display: none; }
  .prow-arrow { opacity: 1; }
  .post { padding: 1.5rem; }
  .signal-row { padding: 1.25rem 1.5rem; }
  .about-inner { padding: 3rem 1.5rem; }
  .cv-body { padding: 0 1.5rem 3.5rem; }
  footer { padding: 1.5rem; flex-direction: column; gap: 1rem; text-align: center; }
}
