@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f5f1e8;
  --bg-2: #efe9dc;
  --surface: #fbf9f4;
  --ink: #1c1a17;
  --muted: #5b554b;
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.22);
  --accent: #9a4320;
  --accent-soft: rgba(154, 67, 32, 0.08);
  --code-bg: #1c1a17;
  --code-ink: #efe7da;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(28,26,23,.04), 0 12px 32px -12px rgba(28,26,23,.14);
  --shadow-hover: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 4px rgba(28,26,23,.05), 0 24px 48px -16px rgba(28,26,23,.22);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 68rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --bg-2: #181614;
    --surface: #1b1917;
    --ink: #ede7db;
    --muted: #a69e90;
    --line: rgba(237, 231, 219, 0.10);
    --line-strong: rgba(237, 231, 219, 0.20);
    --accent: #e3946a;
    --accent-soft: rgba(227, 148, 106, 0.10);
    --code-bg: #0b0a09;
    --code-ink: #ede7db;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -12px rgba(0,0,0,.6);
    --shadow-hover: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 48px -16px rgba(0,0,0,.75);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background:
    radial-gradient(60rem 32rem at 85% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .6rem 1rem; background: var(--ink); color: var(--bg); border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3.75rem; }
.mark { font: italic 400 1.5rem/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.mark span { color: var(--accent); }
.topbar nav { display: flex; gap: clamp(.9rem, 3vw, 2rem); }
.topbar nav a { font-size: .875rem; font-weight: 500; color: var(--muted); text-decoration: none; letter-spacing: .01em; }
.topbar nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(3.5rem, 8vw, 6rem); }
.eyebrow, .kicker {
  margin: 0 0 1.25rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { display: inline-flex; align-items: center; gap: .75rem; }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--accent); }
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 {
  font: 400 clamp(4rem, 13vw, 9.5rem)/.92 var(--serif);
  letter-spacing: -.035em;
}
h1 em { font-style: italic; color: var(--accent); padding-right: .04em; }
.lead {
  margin: 1.75rem 0 0; max-width: 32ch;
  font: 400 clamp(1.5rem, 3.4vw, 2.25rem)/1.2 var(--serif); letter-spacing: -.01em;
}
.hero { display: grid; gap: 3.5rem; align-items: end; }
@media (min-width: 64rem) { .hero { grid-template-columns: 1fr 20rem; } }
.index { padding: 1.5rem 1.5rem .5rem; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--surface) 75%, transparent); box-shadow: var(--shadow); }
.index .minor { margin-bottom: .5rem; }
.index ul { list-style: none; margin: 0; padding: 0; }
.index li + li { border-top: 1px solid var(--line); }
.index a { display: grid; gap: .1rem; padding: .85rem 0; text-decoration: none; }
.index a span:first-child { font: 400 1.375rem/1.15 var(--serif); }
.index .note { font-size: .8125rem; color: var(--muted); }
.index a:hover span:first-child { color: var(--accent); }
.tagline { margin: .9rem 0 0; color: var(--muted); font-size: 1.0625rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.5rem; }

.button {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: .9375rem; font-weight: 500; text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.button:hover { color: var(--bg); background: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 24px -10px var(--accent); }
.button.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button.ghost:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: .25rem; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.kicker { margin-bottom: .9rem; }
.kicker span { color: var(--accent); font-family: var(--mono); font-weight: 500; letter-spacing: 0; margin-right: .6rem; }
h2 { font: 400 clamp(2.25rem, 5.5vw, 3.5rem)/1.02 var(--serif); letter-spacing: -.02em; }
.minor { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }

/* Feature cards */
.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.feature {
  display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.feature-top { display: grid; gap: .4rem; }
.feature { position: relative; overflow: hidden; }
.feature > * { position: relative; z-index: 1; }
.radar::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  width: 22rem; height: 22rem; right: -6rem; bottom: -8rem; border-radius: 50%;
  background:
    conic-gradient(from 0deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 22%),
    repeating-radial-gradient(circle, transparent 0 2.7rem, var(--line-strong) 2.7rem calc(2.7rem + 1px));
  -webkit-mask: radial-gradient(circle, #000 55%, transparent 71%);
          mask: radial-gradient(circle, #000 55%, transparent 71%);
  opacity: .9;
}
@media (prefers-reduced-motion: no-preference) {
  .radar::after { animation: sweep 9s linear infinite; }
  @keyframes sweep { to { transform: rotate(1turn); } }
}
.meta { margin: 0; font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.feature h3 { font: 400 clamp(2.25rem, 4.5vw, 2.875rem)/1 var(--serif); letter-spacing: -.02em; }
.feature h3 a { text-decoration: none; }
.feature p { margin: 0; color: var(--muted); }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: auto 0 0; padding: .5rem 0 0; }
.links a { font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--accent); }
.links a span { display: inline-block; transition: transform .25s var(--ease); }
.links a:hover span { transform: translate(2px, -2px); }
.badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .8125rem; font-weight: 500;
  color: var(--accent) !important; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.badge::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.install { margin: auto 0 0; }
.install figcaption { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
pre {
  margin: 0; padding: 1rem 1.1rem; border-radius: 12px;
  background: var(--code-bg); color: var(--code-ink);
  font: 400 .8125rem/1.6 var(--mono);
  white-space: pre-wrap; word-break: break-all;
  border: 1px solid var(--line);
}
pre code { user-select: all; -webkit-user-select: all; }

/* Smaller tools */
.tools { margin-top: clamp(2.5rem, 6vw, 4rem); }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); border-top: 1px solid var(--line); }
.tool-grid li { border-bottom: 1px solid var(--line); }
.tool-grid a { display: grid; align-content: start; gap: .2rem; padding: 1.1rem .25rem 1.1rem 0; text-decoration: none; height: 100%; }
@media (min-width: 42rem) { .tool-grid li:nth-child(odd) a { padding-right: 2rem; } }
.tool-grid strong { font: 500 .9375rem/1.4 var(--mono); color: var(--ink); transition: color .2s var(--ease); }
.tool-grid span { color: var(--muted); font-size: .9375rem; }
.tool-grid a:hover strong { color: var(--accent); }

/* Ledger */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger li { border-bottom: 1px solid var(--line); }
.ledger a {
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1.5rem; align-items: baseline;
  padding: 1.15rem 0; text-decoration: none;
  transition: padding .3s var(--ease), background .3s var(--ease);
}
.ledger .repo { grid-column: 1 / -1; font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
.ledger .title { font: 400 1.375rem/1.25 var(--serif); letter-spacing: -.005em; }
.ledger .year { font-family: var(--mono); font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ledger a:hover .title { color: var(--accent); }
@media (min-width: 48rem) {
  .ledger a { grid-template-columns: 13rem 1fr auto; }
  .ledger .repo { grid-column: auto; }
  .ledger a:hover { padding-left: .75rem; background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
}

/* Club */
.club {
  position: relative; overflow: hidden;
  padding: clamp(2.25rem, 6vw, 4rem);
  border-radius: 24px; border: 1px solid var(--line);
  background:
    radial-gradient(40rem 20rem at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}
.club-text { margin: 1.25rem 0 2rem; max-width: 34ch; font: italic 400 clamp(1.5rem, 3.2vw, 2rem)/1.25 var(--serif); color: var(--ink); }

/* Contact */
.contact { display: grid; gap: 3rem; }
@media (min-width: 52rem) { .contact { grid-template-columns: 1.2fr 1fr; align-items: end; } }
.email { margin: 1.25rem 0 0; font: italic 400 clamp(2rem, 6vw, 3.5rem)/1.1 var(--serif); letter-spacing: -.02em; }
.email a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-decoration-thickness: 2px; text-underline-offset: .15em; }
.elsewhere ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.elsewhere li { border-bottom: 1px solid var(--line); }
.elsewhere a { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; text-decoration: none; font-weight: 500; }
.elsewhere a span { color: var(--muted); font-weight: 400; font-size: .9375rem; text-align: right; }
.elsewhere a:hover span { color: var(--accent); }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.footer p { margin: 0; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .9s var(--ease) both; }
  .hero .reveal:nth-child(2) { animation-delay: .08s; }
  .hero .reveal:nth-child(3) { animation-delay: .18s; }
  .hero .reveal:nth-child(4) { animation-delay: .26s; }
  .hero .reveal:nth-child(5) { animation-delay: .34s; }
  .index.reveal { animation-delay: .45s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 30rem) {
  .topbar nav a:nth-child(2) { display: none; }
  .elsewhere a { flex-direction: column; gap: .1rem; }
  .elsewhere a span { text-align: left; }
}
