:root {
  --clay-900: #1b1310;
  --clay-800: #241a15;
  --clay-700: #30231c;
  --clay-600: #4a352a;

  /* Primary brand rust. Dark enough to carry white text at 7.4:1, but too dark
     to read as small text on --clay-900 — use --rust-tint for that. */
  --rust: #8b4000;
  --rust-hover: #a34c07;
  --rust-tint: #c96f43;
  --ochre: #e8b667;
  --olive: #8a8757;
  --cream: #f6ece0;
  --cream-dim: #cbb8a5;
  --cream-faint: #96826f;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --shell: min(1140px, 100% - 3rem);
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--clay-900);
  color: var(--cream-dim);
  font: 400 1rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* A faint fired-clay grain over the whole page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image: url("assets/grain.svg");
}

h1, h2, h3 { color: var(--cream); font-family: var(--serif); font-weight: 700; line-height: 1.15; }

a { color: var(--ochre); text-decoration: none; }
a:hover { color: var(--cream); }

.shell { width: var(--shell); margin-inline: auto; position: relative; z-index: 1; }

.eyebrow {
  font: 600 .74rem/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rust-tint);
  margin: 0 0 1.1rem;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--clay-900) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--clay-700);
}
.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: .85rem 0;
}
.brand { display: flex; }
.brand svg { height: 22px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a { color: var(--cream-dim); font-size: .93rem; }
.nav a:hover { color: var(--cream); }
.nav .btn { font-size: .88rem; padding: .5rem 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.5rem;
  border-radius: 9px;
  font: 600 .95rem var(--sans);
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-hover); color: #fff; }
.btn-ghost { border-color: var(--clay-600); color: var(--cream); }
.btn-ghost:hover { border-color: var(--rust-tint); color: var(--cream); }
.btn svg { width: 17px; height: 17px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 7rem 0 6rem; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -12%;
  width: 780px;
  height: 780px;
  background: radial-gradient(circle, rgba(163,76,7,.24), transparent 62%);
  pointer-events: none;
}
.hero .shell { display: grid; grid-template-columns: 1.05fr .95fr; gap: 4rem; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 3.9rem); margin: 0 0 1.4rem; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--rust-tint); }
.hero p.lede { font-size: 1.16rem; max-width: 34rem; margin: 0 0 2.3rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-art svg { width: 100%; height: auto; display: block; }

.stats {
  display: flex;
  gap: 3rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--clay-700);
}
.stats dt { font: 700 1.9rem var(--serif); color: var(--ochre); }
.stats dd { margin: .2rem 0 0; font-size: .84rem; color: var(--cream-faint); letter-spacing: .04em; }

/* ---------- sections ---------- */
section { padding: 6rem 0; position: relative; }
.section-head { max-width: 40rem; margin-bottom: 3.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 1rem; }
.section-head p { margin: 0; font-size: 1.06rem; }

.alt { background: var(--clay-800); border-block: 1px solid var(--clay-700); }

/* ---------- what we do ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.pillar {
  padding: 2rem 1.75rem;
  border: 1px solid var(--clay-700);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(74,53,42,.28), transparent 70%);
}
.pillar svg { width: 42px; height: 42px; margin-bottom: 1.25rem; }
.pillar h3 { font-size: 1.2rem; margin: 0 0 .65rem; }
.pillar p { margin: 0; font-size: .95rem; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.project {
  display: flex;
  flex-direction: column;
  padding: 1.85rem;
  border: 1px solid var(--clay-700);
  border-radius: var(--radius);
  background: var(--clay-900);
  transition: border-color .18s ease, transform .18s ease;
}
.alt .project { background: var(--clay-900); }
.project:hover { border-color: var(--rust-tint); transform: translateY(-3px); }
.project.flagship { grid-column: 1 / -1; border-color: var(--clay-600); }

.project-top { display: flex; align-items: center; gap: .85rem; margin-bottom: .9rem; }
.project-top h3 { font-size: 1.28rem; margin: 0; }

.project p { margin: 0 0 1.4rem; font-size: .96rem; flex: 1; }
.project .modules { color: var(--cream-faint); font: .84rem/1.6 var(--mono); }

.meta { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.chip {
  font: 500 .76rem var(--mono);
  padding: .3rem .65rem;
  border-radius: 99px;
  border: 1px solid var(--clay-600);
  color: var(--cream-dim);
}
.chip.lang::before { content: "●"; margin-right: .4rem; color: var(--rust-tint); }
.chip.stars { display: inline-flex; align-items: center; gap: .35rem; }
.chip.stars svg { width: 12px; height: 12px; }
.meta .repo-link { margin-left: auto; font: 600 .86rem var(--sans); display: inline-flex; align-items: center; gap: .4rem; }
.meta .repo-link svg { width: 15px; height: 15px; }

/* ---------- philosophy ---------- */
.philosophy .shell { display: grid; grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: center; }
.tenets { list-style: none; margin: 0; padding: 0; }
.tenets li { display: flex; gap: 1rem; padding: 1.3rem 0; border-bottom: 1px solid var(--clay-700); }
.tenets li:last-child { border-bottom: 0; }
.tenets svg { width: 22px; height: 22px; flex: none; margin-top: .25rem; }
.tenets strong { display: block; color: var(--cream); font-family: var(--serif); font-size: 1.05rem; margin-bottom: .2rem; }
.tenets span { font-size: .94rem; }

.code-card {
  border: 1px solid var(--clay-700);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--clay-800);
}
.code-card header {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--clay-700);
}
.code-card header i { width: 10px; height: 10px; border-radius: 50%; background: var(--clay-600); }
.code-card header i:first-child { background: var(--rust-tint); }
.code-card header span { margin-left: .6rem; font: .78rem var(--mono); color: var(--cream-faint); }
.code-card pre { margin: 0; padding: 1.4rem 1.3rem; overflow-x: auto; font: .84rem/1.85 var(--mono); }
.code-card .c { color: var(--cream-faint); }
.code-card .k { color: var(--rust-tint); }
.code-card .s { color: var(--olive); }
.code-card .f { color: var(--ochre); }

/* ---------- cta / footer ---------- */
.cta { text-align: center; }
.cta .shell { max-width: 42rem; }
.cta h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 1.1rem; }
.cta p { margin: 0 auto 2.4rem; }
.cta .hero-actions { justify-content: center; }

.site-footer { border-top: 1px solid var(--clay-700); padding: 2.6rem 0; }
.site-footer .shell { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-footer svg.logo { height: 17px; width: auto; }
.site-footer p { margin: 0; font-size: .85rem; color: var(--cream-faint); }
.site-footer nav { display: flex; gap: 1.5rem; font-size: .88rem; }

@media (max-width: 900px) {
  .hero { padding: 4.5rem 0; }
  .hero .shell,
  .philosophy .shell { grid-template-columns: 1fr; gap: 3rem; }
  .hero-art { order: -1; max-width: 380px; }
  .pillars, .projects { grid-template-columns: 1fr; }
  .project.flagship { grid-column: auto; }
  .nav a:not(.btn) { display: none; }
  .stats { gap: 2rem; flex-wrap: wrap; }
  section { padding: 4.5rem 0; }
}

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