:root {
  --bg: #070b14;
  --bg-deep: #04070d;
  --surface: #0d1420;
  --surface-raised: #111b2a;
  --line: #223044;
  --text: #f5f7fa;
  --muted: #a7b2c3;
  --accent: #38e89b;
  --accent-soft: rgba(56, 232, 155, 0.11);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .6rem 1rem; background: var(--accent); color: #03110b; font-weight: 700; }
.skip-link:focus { top: 1rem; }

.site-header { position: relative; z-index: 10; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(7,11,20,.94); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--text); font-size: 1.08rem; font-weight: 750; letter-spacing: .02em; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(56,232,155,.3); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.site-nav a { position: relative; color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.65rem; height: 2px; background: var(--accent); }

.hero { overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 80% 30%, rgba(34,73,89,.28), transparent 36%), linear-gradient(180deg, var(--bg-deep), var(--bg)); }
.hero-grid { min-height: 570px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 4rem; padding-block: 3.5rem; }
.hero-copy { align-self: start; }
.eyebrow { margin: 0 0 .6rem; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1, .page-intro h1, .article-header h1 { margin: 0; max-width: 850px; font-size: clamp(2.7rem, 6.2vw, 5.5rem); line-height: .95; letter-spacing: -.055em; }
.hero h1 span { color: var(--accent); }
.hero-lede { max-width: 650px; margin: 1.25rem 0 0; color: var(--muted); font-size: clamp(1.06rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .65rem 1.25rem; border: 1px solid transparent; border-radius: 4px; font-size: .88rem; font-weight: 750; text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: #04120c; }
.button-secondary { border-color: #3a495c; background: rgba(255,255,255,.02); color: var(--text); }
.button-secondary:hover { border-color: var(--accent); }
.hero-mark { position: relative; justify-self: end; }
.hero-mark::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: var(--accent); filter: blur(80px); opacity: .1; }
.hero-mark img { position: relative; width: min(100%, 420px); border: 1px solid rgba(56,232,155,.22); border-radius: 50%; box-shadow: 0 30px 90px rgba(0,0,0,.45); }

.section { padding-block: 6rem; }
.section-flush { padding-top: 1rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section h2, .content-split h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.025em; }
.text-link, .card-link { color: var(--accent); font-size: .9rem; font-weight: 700; text-decoration: none; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card { display: flex; min-height: 290px; flex-direction: column; padding: 1.7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.card:hover { border-color: #3a4e63; background: var(--surface-raised); }
.card-meta { margin: 0 0 1rem; color: var(--muted); font-size: .73rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card h2, .card h3 { margin: 0; font-size: 1.35rem; line-height: 1.3; letter-spacing: -.015em; }
.card h2 a, .card h3 a { text-decoration: none; }
.card > p:not(.card-meta) { color: var(--muted); font-size: .95rem; }
.card-link { margin-top: auto; }
.projects-callout { display: flex; align-items: center; justify-content: space-between; gap: 3rem; margin-bottom: 6rem; padding-inline: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); border-left: 3px solid var(--accent); background: linear-gradient(100deg, var(--surface), rgba(14,37,42,.6)); }
.projects-callout p:not(.eyebrow) { max-width: 700px; margin-bottom: 0; color: var(--muted); }

.page-intro { padding-block: 3.5rem 3rem; }
.page-intro h1 { max-width: 950px; font-size: clamp(2.5rem, 5.5vw, 4.8rem); }
.page-intro > p:last-child { max-width: 760px; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.15rem; }
.narrow { max-width: 950px; margin-left: max(20px, calc((100% - var(--max)) / 2)); }
.article-list { border-top: 1px solid var(--line); }
.list-item { display: grid; grid-template-columns: 150px 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.list-date { padding-top: .35rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.list-item h2 { margin: 0; font-size: 1.45rem; }
.list-item h2 a { text-decoration: none; }
.list-item p { max-width: 750px; margin: .5rem 0 0; color: var(--muted); }
.mini-tags { color: var(--accent) !important; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }

.article { max-width: 820px; padding-block: 3.5rem 6rem; }
.back-link { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.35rem; padding: .32rem .72rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); color: var(--muted); font-size: .78rem; font-weight: 700; text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.back-link:hover { border-color: rgba(56,232,155,.55); background: var(--accent-soft); color: var(--accent); }
.article-header { padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); }
.lede { margin: 1.25rem 0; color: var(--muted); font-size: 1.15rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .84rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.tag-list li { padding: .22rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: #c2ccda; font-size: .72rem; }
.prose { margin-top: 2.5rem; }
.prose h2, .prose h3 { margin: 2.5rem 0 .7rem; line-height: 1.25; letter-spacing: -.02em; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.3rem; }
.prose p, .prose li { color: #cbd3df; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose blockquote { margin: 2rem 0; padding: .2rem 1.3rem; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.prose code { padding: .15em .35em; border: 1px solid #28384c; border-radius: 3px; background: #0a101a; color: #8bf4c6; font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prose pre { overflow-x: auto; margin: 1.7rem 0; padding: 1.25rem; border: 1px solid #243247; border-radius: 5px; background: #040811; line-height: 1.55; }
.prose pre code { padding: 0; border: 0; background: transparent; color: #d9e2ee; }
.highlight .c, .highlight .c1, .highlight .cm { color: #718096; }
.highlight .k, .highlight .kd, .highlight .nt { color: #65e6aa; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #e4c580; }
.highlight .nb, .highlight .nf { color: #7cc8ff; }
.highlight .o { color: #bd93f9; }
.article-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article-nav-link { display: flex; min-height: 110px; flex-direction: column; justify-content: center; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); text-decoration: none; }
.article-nav-link:hover { border-color: var(--accent); background: var(--surface-raised); }
.article-nav-link span { color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.article-nav-link strong { margin-top: .3rem; line-height: 1.35; }
.article-nav-next { grid-column: 2; text-align: right; }

.content-split { display: grid; grid-template-columns: 1fr 330px; gap: 5rem; padding: 0 0 7rem; }
.principles-card { align-self: start; padding: 1.6rem; border: 1px solid var(--line); background: var(--surface); }
.principles-card ul { padding: 0; margin: 0; list-style: none; }
.principles-card li { padding: .7rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.principles-card li:last-child { border: 0; }
.not-found { min-height: 65vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.error-code { margin: 0; color: var(--accent); font: 800 1rem ui-monospace, monospace; letter-spacing: .2em; }
.not-found h1 { margin: .5rem 0; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.1; }
.not-found > p:not(.error-code) { margin: 0 0 2rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); }
.footer-inner { min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; color: var(--muted); font-size: .82rem; }
.footer-inner a { color: var(--text); text-underline-offset: 3px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }

@media (max-width: 800px) {
  .hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 3rem; padding-block: 3rem; }
  .hero-mark { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 240px; }
  .content-split { grid-template-columns: 1fr; gap: 2rem; }
  .projects-callout { align-items: flex-start; flex-direction: column; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-next { grid-column: 1; text-align: left; }
}

@media (max-width: 580px) {
  body { font-size: 16px; }
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 68px; align-items: flex-start; flex-direction: column; gap: .65rem; padding-block: .75rem; }
  .brand img { width: 36px; height: 36px; }
  .site-nav { width: 100%; justify-content: space-between; gap: .5rem; }
  .site-nav a { font-size: .78rem; }
  .site-nav a[aria-current="page"]::after { bottom: -.45rem; }
  .section { padding-block: 4rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .page-intro { padding-block: 3rem 2.5rem; }
  .list-item { grid-template-columns: 1fr; gap: .4rem; }
  .article { padding-block: 3rem 4rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: .2rem; padding-block: 1.5rem; }
  .footer-inner p { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
