:root {
  --bg: #f3f1ec;
  --bg-alt: #ebe8e1;
  --ink: #111111;
  --ink-soft: #2a2a2a;
  --muted: #8a857b;
  --line: #d9d5cc;
  --accent: #c3412a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss02" on, "liga" on;
}

/* subtle grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

/* ─── NAV ─────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(243, 241, 236, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
  font-size: 12px;
  letter-spacing: 0.02em;
}

nav .logo {
  font-weight: 700;
  letter-spacing: 0.05em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

nav ul a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.2s;
}

nav ul a:hover { color: var(--accent); }

nav ul a::before {
  content: "→ ";
  opacity: 0;
  margin-right: 2px;
  transition: opacity 0.2s;
}

nav ul a:hover::before { opacity: 1; }

/* ─── HERO ────────────────────────────────── */
header.hero {
  min-height: 100vh;
  padding: 160px 40px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 48px;
}

.hero h1 .italic {
  font-style: italic;
  color: var(--muted);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  font-size: 12px;
  margin-top: auto;
  padding-top: 48px;
}

.hero-footer .col h4 {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-footer .col p {
  color: var(--ink-soft);
}

/* ─── SECTION HEADER ──────────────────────── */
.section {
  padding: 120px 40px;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 40px;
  margin-bottom: 64px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line);
}

.section-num {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-title .arrow {
  display: inline-block;
  margin-right: 12px;
  color: var(--accent);
  transform: translateY(-4px);
}

.section-count {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── GRID ────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
  position: relative;
}

.card:hover {
  background: var(--bg-alt);
}

.card:hover .preview {
  transform: scale(1.015);
}

.card:hover .card-title {
  color: var(--accent);
}

.preview {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  transition: transform 0.4s ease;
}

.preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(17,17,17,0.04));
  pointer-events: none;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 4px;
}

.card-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: color 0.2s;
}

.card-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.chip {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.25s, color 0.25s;
}

.card:hover .card-arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}

/* ─── FOOTER ──────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 80px 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

footer .big {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 48px;
}

footer .big a {
  color: var(--accent);
  font-style: italic;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

footer .big a:hover { border-color: var(--accent); }

.footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}

.footer-row ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 16px 20px; }
  nav ul { gap: 16px; }
  header.hero, .section, footer { padding-left: 20px; padding-right: 20px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
  .section-head {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }
  .section-num { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero-footer { grid-template-columns: 1fr; gap: 24px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── FADE IN ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }