:root {
  color-scheme: dark;
  --paper: #0f172a;
  --panel: #1e293b;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --blue: #38bdf8;
  --amber: #38bdf8;
  --rose: #0ea5e9;
  --sage: #7dd3fc;
  --grid: #334155;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius-sm: .3rem;
  --radius-md: .5rem;
  --radius-pill: 999px;
  --text-body: 1.0625rem;
  --text-control: .95rem;
  --button-primary-bg: var(--blue);
  --button-primary-hover-bg: var(--sage);
  --button-primary-text: var(--paper);
  --button-border: var(--grid);
  --button-radius: var(--radius-md);
  --button-min-height: 2.75rem;
  --button-padding-inline: var(--space-4);
  --head: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--text-body)/1.6 var(--body);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.wrap { width: min(100% - 2.5rem, 68rem); margin: 0 auto; }

.button {
  display: inline-flex;
  min-height: var(--button-min-height);
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--button-padding-inline);
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font: 700 var(--text-control)/1.2 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button--primary { background: var(--button-primary-bg); color: var(--button-primary-text); }
.button--primary:hover:not(:disabled) { background: var(--button-primary-hover-bg); }
.button--secondary { border-color: var(--button-border); color: var(--ink); }
.button--secondary:hover:not(:disabled) { border-color: var(--blue); background: var(--panel); }
.button--quiet { color: var(--muted); }
.button--quiet:hover:not(:disabled) { background: var(--panel); color: var(--ink); }
.button:disabled { opacity: .55; cursor: not-allowed; }

.site-header { padding: 1.35rem 0; border-bottom: 1px solid var(--grid); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .55rem; font: 700 1.2rem var(--head); text-decoration: none; white-space: nowrap; }
.brand-icon { display: block; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem 1.2rem; }
nav a { color: var(--muted); font-size: .95rem; text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.intro { padding: clamp(4rem, 10vw, 8rem) 0 2rem; }
.eyebrow, .card-kicker { color: var(--blue); font-size: .78rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { margin: 0 0 .75rem; }
h1, h2, h3, h4 { font-family: var(--head); }
h1 { max-width: 15ch; margin: 0 0 1.1rem; font-size: clamp(2.8rem, 8vw, 5.7rem); line-height: .98; letter-spacing: -.035em; }
.placeholder { color: var(--blue); }
.intro-copy { margin: 0 0 1.25rem; color: var(--muted); font-size: clamp(1.1rem, 2.5vw, 1.3rem); }
.text-link { font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-link span { display: inline-block; margin-left: .2rem; color: var(--blue); }
.linkedin-logo { width: 1.15em; height: 1.15em; margin-right: .25rem; vertical-align: -.2em; }

.featured-post { margin-bottom: 2rem; }
.featured-post > h2, .latest-content > h2 { margin-bottom: 1.3rem; }
.latest-content { padding: 2rem 0 2.6rem; border-top: 1px solid var(--grid); }
.featured-post-link { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: 1.5rem; color: inherit; text-decoration: none; }
.featured-post-link:hover .featured-post-action { text-decoration: underline; text-underline-offset: 4px; }
.featured-post-thumb { margin: 0; }
.featured-post-copy { display: flex; flex-direction: column; justify-content: center; }
.featured-post-copy h3 { margin: 0 0 .4rem; font-size: 1.5rem; line-height: 1.2; }
.featured-post-copy > p:not(.card-kicker) { margin: 0 0 1.25rem; color: var(--muted); }
.featured-post-action { font-weight: 700; }
.featured-post-action span { display: inline-block; margin-left: .2rem; color: var(--blue); }

.work-section { padding: 1rem 0 2rem; }
.section-heading { margin-bottom: 2rem; }
h2 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.02em; }
.category { padding: 2rem 0 2.6rem; border-top: 1px solid var(--grid); }
.category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.category-heading h3 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.85rem); line-height: 1.2; }
.category-heading .text-link { font-size: .95rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.project-card { min-width: 0; }
.project-link { display: block; text-decoration: none; }
.project-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.thumb { aspect-ratio: 5 / 3; margin: 0 0 1rem; overflow: hidden; border-radius: .3rem; background: var(--panel); }
.thumb svg { display: block; width: 100%; height: 100%; }
.gif-thumb { background: #0f172a; }
.gif-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.screenshot-thumb { background: #faf8f4; }
.screenshot-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-detail { max-width: 62rem; margin: 0 auto; padding: 3rem 0 5rem; text-align: center; }
.project-detail h1 { max-width: none; margin-bottom: 1.5rem; }
.project-description { max-width: 46rem; margin: 0 auto 1.5rem; color: var(--muted); text-align: left; }
.project-description h2 { margin: 0 0 .75rem; font-size: 1.25rem; }
.project-description p { margin: 0; }
.project-detail img { display: block; width: 100%; max-height: 42rem; margin: 0 auto; object-fit: contain; border-radius: .3rem; background: #0f172a; }
.card-kicker { margin: 0 0 .35rem; font-size: .7rem; }
.project-card h3, .project-card h4 { margin: 0 0 .4rem; font-size: 1.3rem; line-height: 1.25; }
.project-card h2 { margin: 0 0 .4rem; font-size: 1.3rem; line-height: 1.25; }
.project-card > p:last-child { max-width: 35rem; margin: 0; color: var(--muted); font-size: .98rem; }

.about-section { max-width: 46rem; padding: 4rem 0 5rem; border-top: 1px solid var(--grid); }
.about-section h2 { margin-bottom: 1rem; }
.about-copy { margin: 0 0 1.2rem; color: var(--muted); }
.page-intro { padding: 4rem 0 2.5rem; }
.page-intro h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.page-intro p:last-child { max-width: 42rem; margin: .8rem 0 0; color: var(--muted); }
.collection { padding: 2rem 0 5rem; }
.design-section { padding: 0 0 3rem; }
.design-section > h2 { margin-bottom: .75rem; }
.design-section > p { max-width: 46rem; color: var(--muted); }
.button-examples { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5rem 0; }
.button-example-label { min-width: 6rem; color: var(--muted); font-size: .9rem; }
.design-note { max-width: 46rem; padding: 1rem 1.25rem; border-left: 3px solid var(--blue); background: var(--panel); color: var(--muted); }
.design-note p { margin: 0; }
.design-note p + p { margin-top: .5rem; }
.design-code { display: inline-block; padding: .1rem .35rem; border-radius: .25rem; background: var(--panel); color: var(--ink); font: .9em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; max-width: 46rem; margin: 1.5rem 0; }
.token-item { display: flex; align-items: center; gap: .75rem; padding: .65rem; border: 1px solid var(--grid); border-radius: var(--radius-md); color: var(--muted); font-size: .9rem; }
.token-swatch { flex: 0 0 2rem; width: 2rem; height: 2rem; border: 1px solid var(--grid); border-radius: var(--radius-sm); }
.token-swatch--paper { background: var(--paper); }
.token-swatch--panel { background: var(--panel); }
.token-swatch--ink { background: var(--ink); }
.token-swatch--muted { background: var(--muted); }
.token-swatch--blue { background: var(--blue); }
.token-swatch--grid { background: var(--grid); }

.site-footer { padding: 1.5rem 0 2rem; border-top: 1px solid var(--grid); color: var(--muted); font-size: .9rem; }

@media (max-width: 650px) {
  .wrap { width: min(100% - 2rem, 68rem); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: .8rem; }
  nav { justify-content: flex-start; gap: .3rem 1rem; }
  .intro { padding: 4rem 0 2rem; }
  .featured-post-link { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; }
  .featured-post-copy h3 { font-size: 1.15rem; }
  .featured-post-copy > p:not(.card-kicker) { margin-bottom: .75rem; font-size: .95rem; }
  .category-heading { align-items: flex-start; flex-direction: column; gap: .45rem; }
  .project-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-section { padding: 3rem 0 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
