/* =========================================================
   Theme — shared with the blog (viverun.dev/devlith):
   paper and ink, one monospace face, hairline rules, no radii.
   ========================================================= */
/* JetBrains Mono, variable, Latin subset (SIL OFL, see fonts/OFL.txt) */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f4efe6;
  --paper-deep: #ebe4d7;
  --ink: #111111;
  --muted: #66625a;  /* 4.8:1 on paper-deep, 5.3:1 on paper (WCAG AA) */
  --rule: #cfc8bc;

  --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-micro: 0.6875rem;
  --t-small: 0.8125rem;
  --t-body: 0.9375rem;
  --t-h2: clamp(1.5rem, 3.2vw, 2.25rem);
  --t-hero: clamp(2.4rem, 6.4vw, 4.75rem);

  --gutter: clamp(1rem, 3vw, 1.75rem);
  --wide: 1180px;
  --pad: clamp(4rem, 9vw, 7rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.7;
  font-feature-settings: 'calt' 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }
img { max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.skip-link {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 100;
  padding: 0.5rem 0.85rem; background: var(--ink); color: var(--paper);
  font-size: var(--t-micro); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.section-inner, .nav-inner, .hero-inner {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* label voice: small, spaced, uppercase */
.eyebrow, .project-tag, .viz-title, .metric-label,
.credential-key, .fact-label, .cap-head, .tech-chips li, .site-footer {
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* the blog's blinking caret */
.cursor {
  display: inline-block;
  width: 0.06em; height: 0.85em;
  margin-left: 0.08em;
  background: var(--ink);
  vertical-align: -0.05em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   Nav — same mark and voice as the blog header
   ========================================================= */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.nav-inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem;
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: var(--t-small); font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; text-decoration: none;
}
.mark { width: 1.35rem; height: auto; fill: currentColor; }
.nav-logo:hover .cursor-bar { animation: blink 1.1s steps(1) infinite; }



/* =========================================================
   Buttons — the blog's box-link
   ========================================================= */
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ink);
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   Hero — line sketch on the left, the blog's big name on the right
   ========================================================= */
.hero { border-bottom: 1px solid var(--ink); }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  min-height: calc(100svh - 4.25rem);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.hero-art { margin: 0; align-self: center; }
.hero-art img { display: block; width: 100%; height: auto; max-height: calc(100svh - 8rem); object-fit: contain; object-position: center; }

.hero .eyebrow { padding: 0; border: 0; color: var(--muted); }
.hero-title {
  margin: 1.25rem 0 1.5rem;
  font-size: clamp(3.25rem, 9vw, 8rem); font-weight: 800; line-height: 0.92;
  letter-spacing: -0.05em; text-transform: uppercase;
}
.hero-sub { max-width: 52ch; font-size: clamp(1rem, 1.7vw, 1.2rem); font-weight: 600; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }


/* phones and small tablets: portrait and name side by side, the rest below */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    grid-template-areas: "art eyebrow" "art title" "sub sub" "actions actions";
    column-gap: 1rem; row-gap: 0; align-items: center;
    min-height: 0;
  }
  .hero-copy { display: contents; }
  .hero-art { grid-area: art; align-self: center; }
  .hero-art img { max-height: none; }
  .hero .eyebrow { grid-area: eyebrow; align-self: end; font-size: 0.6rem; letter-spacing: 0.12em; }
  .hero-title { grid-area: title; align-self: start; margin: 0.6rem 0 0; font-size: clamp(2.1rem, 10.5vw, 4.5rem); }
  .hero-sub { grid-area: sub; margin-top: 1.75rem; max-width: none; }
  .hero-actions { grid-area: actions; }
}

/* =========================================================
   Pipeline cards — a system written out as numbered steps,
   like a spec sheet, in place of animated diagrams
   ========================================================= */
.viz {
  display: flex; flex-direction: column;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.viz-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--ink);
}
.viz-title { color: var(--paper); }

.pipeline { counter-reset: step; padding: 0.5rem 1rem; }
.pipeline li {
  counter-increment: step;
  position: relative;
  display: grid; grid-template-columns: 2.25rem 1fr; column-gap: 0.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-small); line-height: 1.5;
}
.pipeline li:last-child { border-bottom: 0; }
.pipeline li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.08em; color: var(--muted);
  line-height: 1.95;
}
.pipeline b { grid-column: 2; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.pipeline i { grid-column: 2; font-style: normal; font-size: var(--t-micro); color: var(--muted); }

/* the outcome: inked in, like the blog's filled box-link */
.pipeline li:last-child b { display: inline-block; justify-self: start; padding: 0.1rem 0.45rem; background: var(--ink); color: var(--paper); }
/* what the gate throws away */
.pipeline li.cut b { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }

.viz figcaption {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
  font-size: var(--t-micro); line-height: 1.6; color: var(--muted);
}

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: var(--pad); border-bottom: 1px solid var(--ink); }
/* in-page links land on the section label, not on its empty top padding
   (the sticky header is ~4.25rem tall; leave a little air below it) */
.section { scroll-margin-top: calc(1.25rem - var(--pad)); }
.section-alt { background: var(--paper-deep); }

.eyebrow {
  display: flex; align-items: baseline; gap: 1rem;
  padding-bottom: 0.9rem; border-bottom: 1px solid var(--ink);
  color: var(--ink);
}
.hero .eyebrow { display: inline-flex; padding-bottom: 0; border-bottom: 0; color: var(--muted); }

.section-title {
  max-width: 24ch;
  margin: 1.75rem 0 clamp(2rem, 5vw, 3.25rem);
  font-size: var(--t-h2); font-weight: 800; line-height: 1.08;
  letter-spacing: -0.035em; text-transform: uppercase; text-wrap: balance;
}

/* =========================================================
   Projects
   ========================================================= */
.project-stack { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }

.project-card { display: grid; gap: 1.1rem; align-content: start; padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.project-card.is-featured { grid-template-columns: 1.15fr 0.85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.project-body { display: grid; gap: 1.1rem; align-content: start; }

.project-tag.verified { color: var(--ink); }
.project-card h3 {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.04em; text-transform: uppercase;
}
.project-alias {
  display: inline-block; margin-left: 0.5rem;
  font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.14em; color: var(--muted); vertical-align: middle;
}
.project-card p:not(.project-tag) { font-size: var(--t-small); line-height: 1.8; max-width: 68ch; }

.tech-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech-chips li { padding: 0.2rem 0.55rem; border: 1px solid var(--rule); color: var(--ink); }

.project-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.project-links a {
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none;
}
.project-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.metric-grid li { display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem 0.85rem 0; }
.metric-grid li + li { padding-left: 0.9rem; border-left: 1px solid var(--rule); }
.metric-num { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }

.credential-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.credential-row li { display: flex; align-items: baseline; gap: 0.6rem; }
.credential-val { font-size: var(--t-small); font-weight: 600; }
a.credential-val { text-underline-offset: 4px; }

.project-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); }
.project-pair .viz { margin: 0.25rem 0; }

/* =========================================================
   Capabilities
   ========================================================= */
.cap-list { border-top: 1px solid var(--ink); }
.cap-list li {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr) 9rem; gap: 1.5rem;
  align-items: baseline; padding: 0.85rem 0; border-bottom: 1px solid var(--rule);
}
.cap-list li.cap-head { padding-block: 0.6rem; border-bottom-color: var(--ink); }
.cap-head span:last-child { justify-self: end; }
.cap-name { font-size: var(--t-small); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cap-what { font-size: var(--t-small); color: var(--muted); }
.cap-proof {
  justify-self: end;
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.cap-proof::after { content: " →"; }
.cap-proof:hover { text-decoration: underline; text-underline-offset: 4px; }

/* =========================================================
   About
   ========================================================= */
.about-grid { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-copy p:not(.eyebrow) { font-size: var(--t-small); line-height: 1.85; max-width: 64ch; }
.about-copy p + p { margin-top: 1.1rem; }

.fact-list { border-top: 1px solid var(--ink); }
.fact-list li { display: grid; gap: 0.25rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.fact-value { font-size: var(--t-small); font-weight: 600; }
.fact-value.verified::before { content: "✓ "; }
.fact-value a { text-underline-offset: 4px; }

/* =========================================================
   Contact
   ========================================================= */
.contact-title {
  max-width: 18ch; margin: 1.75rem 0 1rem;
  font-size: clamp(2rem, 5.5vw, 4rem); font-weight: 800; line-height: 0.98;
  letter-spacing: -0.045em; text-transform: uppercase; text-wrap: balance;
}
.contact-sub { color: var(--muted); font-size: var(--t-small); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.contact-links .btn-primary { text-transform: none; letter-spacing: 0.02em; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { padding-block: 2rem 2.5rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; }
.footer-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem clamp(1rem, 3vw, 2rem);
}
.footer-nav a {
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none; color: var(--ink);
}
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.footer-meta a { text-decoration: none; }
.footer-meta a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 940px) {
  .project-card.is-featured { grid-template-columns: 1fr; }
  .project-viz .viz { max-width: 560px; }
}

@media (max-width: 860px) {
  .about-grid, .project-pair { grid-template-columns: 1fr; }

  .cap-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; }
  .cap-list li.cap-head { display: none; }
  .cap-name { grid-column: 1; }
  .cap-proof { grid-column: 2; grid-row: 1; }
  .cap-what { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 700px) {
  /* metrics as a clean 2x2 grid: no divider or indent at the start of a row */
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .metric-grid li:nth-child(n+3) { border-top: 1px solid var(--rule); }


}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .nav-logo:hover .cursor-bar { animation: none; }
}

/* =========================================================
   Writing — points readers at the journal
   ========================================================= */
.writing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.writing-sub { max-width: 52ch; margin-bottom: 2rem; font-size: var(--t-small); line-height: 1.8; color: var(--muted); }

.post-list { border: 1px solid var(--ink); }
.post-list-head {
  padding: 0.6rem 1rem; background: var(--ink); color: var(--paper);
  font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
}
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 0; }
.post-list a { display: block; padding: 0.9rem 1rem; text-decoration: none; }
.post-list li:last-child a {
  font-size: var(--t-micro); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
.post-list a:hover { background: var(--paper-deep); }
.post-list a.post { display: grid; gap: 0.35rem; }
.post-meta { font-size: var(--t-micro); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.post-title { font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.3; }
.post-desc { font-size: var(--t-small); color: var(--muted); line-height: 1.6; }

@media (max-width: 860px) {
  .writing-grid { grid-template-columns: 1fr; }
}

/* LLM-style streaming (script.js): each letter fades and sharpens in */
.word { display: inline-block; white-space: nowrap; }
.is-streaming .tok {
  display: inline-block;
  opacity: 0; filter: blur(6px); transform: translateY(0.12em);
  transition: opacity 0.45s var(--ease), filter 0.45s var(--ease), transform 0.45s var(--ease);
}
.is-streaming .tok.on { opacity: 1; filter: none; transform: none; }
.cursor.is-typing { animation: none; }

/* a quiet footnote under the projects */
.aside-note {
  margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--t-small); color: var(--muted); font-style: italic;
}


/* ink trophy for hackathon wins, drawn in the page's line weight */
.trophy {
  width: 1.45em; height: 1.45em; margin-right: 0.35em;
  vertical-align: -0.38em;
  fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* hero primary button: "See the work" on wide screens, "About me" on phones
   (where the projects are already right below) */
.only-narrow { display: none; }
@media (max-width: 860px) {
  .only-wide { display: none; }
  .only-narrow { display: inline-block; }
}
