:root {
  color-scheme: dark;

  /* Primitives */
  --graphite: hsl(220 8% 6%);
  --graphite-2: hsl(220 8% 9%);
  --bone: hsl(40 25% 91%);
  --bone-dim: hsl(40 10% 66%);
  --signal: hsl(40 88% 58%);
  --hp: hsl(168 62% 52%);
  --cl: hsl(24 82% 62%);

  /* Semantic */
  --bg: var(--graphite);
  --surface: hsl(40 25% 91% / 0.04);
  --line: hsl(40 25% 91% / 0.12);
  --text: var(--bone);
  --text-dim: var(--bone-dim);

  /* Space and shape */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: 7rem;
  --r-1: 0.5rem;
  --r-2: 1.25rem;
  --wrap: 72rem;

  --font-display: "Bricolage Grotesque", ui-rounded, "Avenir Next", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --glow: 0 0 0 2px var(--bg), 0 0 0 4px var(--signal), 0 0 24px hsl(40 88% 58% / 0.45);
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5.25rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-size: 0.875rem; }

:focus-visible { outline: none; box-shadow: var(--glow); border-radius: var(--r-1); }

.skip {
  position: absolute; left: var(--s-2); top: -4rem; z-index: 10;
  background: var(--signal); color: var(--graphite); padding: var(--s-1) var(--s-2); border-radius: var(--r-1);
}
.skip:focus { top: var(--s-2); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) max(var(--s-3), calc((100% - var(--wrap)) / 2));
  background: hsl(220 8% 6% / 0.72);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-mark { width: 2.75rem; height: 2.75rem; }
.brand-word {
  font: 700 1.5rem/1 var(--font-display);
  letter-spacing: -0.03em;
  margin-left: -0.2rem;
}
.nav { display: flex; gap: var(--s-3); margin-left: auto; flex-wrap: wrap; }
.nav a, .lang a { text-decoration: none; color: var(--text-dim); font-size: 0.9375rem; }
.nav a:hover, .lang a:hover { color: var(--text); }
.lang { display: flex; gap: var(--s-1); padding-left: var(--s-3); border-left: 1px solid var(--line); }
.lang a { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; padding: 0.15rem 0.4rem; border-radius: var(--r-1); }
.lang a[aria-current="page"] { color: var(--graphite); background: var(--signal); }

/* Belt scroll indicator: stitched strap with a brass buckle */
.belt {
  position: sticky; top: 4.25rem; z-index: 5; height: 6px;
  background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px);
}
.belt-buckle {
  display: block; width: 2.5rem; height: 6px; background: var(--signal);
  border-radius: 2px;
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes buckle-slide { to { translate: calc(100vw - 2.5rem) 0; } }
    .belt-buckle { animation: buckle-slide linear both; animation-timeline: scroll(root); }
  }
}

/* Layout */
.hero, .section, .foot {
  width: min(100% - 2 * var(--s-3), var(--wrap));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-4);
  min-height: calc(100svh - 4.75rem);
  padding-block: clamp(1.5rem, 4vh, 3rem);
  box-sizing: border-box;
}
.eyebrow { font: 500 0.8125rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--signal); margin-bottom: var(--s-2); }
.hero h1 { font-size: clamp(2.75rem, 6.5vw, 5.5rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
.lead { margin-top: var(--s-2); max-width: 36rem; font-size: clamp(1.0625rem, 1.8vw, 1.25rem); color: var(--text-dim); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }

.btn {
  display: inline-flex; align-items: center; padding: 0.75rem 1.35rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; border: 1px solid var(--line); transition: translate 0.2s, background 0.2s;
  font-size: 0.9375rem;
}
.btn:hover { translate: 0 -2px; }
.btn-primary { background: var(--signal); color: var(--graphite); border-color: var(--signal); }
.btn-ghost:hover { background: var(--surface); }

.hero-art { display: grid; justify-items: center; gap: var(--s-3); }
.hero-mark { width: min(100%, 19rem); aspect-ratio: 1; filter: drop-shadow(0 24px 48px hsl(40 88% 58% / 0.18)); }

.section {
  padding-top: clamp(1.75rem, 3.5vh, 2.5rem);
  padding-bottom: clamp(2rem, 4vh, 3rem);
  scroll-margin-top: 5.25rem;
  box-sizing: border-box;
}
.section-head { display: grid; gap: 0.35rem; margin-bottom: var(--s-3); max-width: 44rem; }
.section-head h2 { font-size: clamp(1.85rem, 3.5vw, 2.75rem); letter-spacing: -0.035em; line-height: 1.08; }
.section-head p { color: var(--text-dim); font-size: 1rem; line-height: 1.45; }

/* Cards: balanced bento grid (3 top, 4 bottom on desktop) */
.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-2);
}

.card {
  --c: var(--signal);
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  backdrop-filter: blur(12px);
  outline: 1px dashed color-mix(in oklab, var(--c) 35%, transparent);
  outline-offset: -0.45rem;
  box-shadow: 0 12px 24px hsl(0 0% 0% / 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--c) 50%, var(--line));
  box-shadow: 0 16px 32px hsl(0 0% 0% / 0.35);
}

/* First 3 cards: 3-column row on desktop (span 4 each) */
.card:nth-child(1),
.card:nth-child(2),
.card:nth-child(3) {
  grid-column: span 4;
}

/* Remaining 4 cards: 4-column row on desktop (span 3 each) */
.card:nth-child(4),
.card:nth-child(5),
.card:nth-child(6),
.card:nth-child(7) {
  grid-column: span 3;
}

.card h3 {
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  color: var(--c);
  margin: 0;
  line-height: 1.15;
}

.card > p:not(.tag):not(.meta) {
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.45;
  flex-grow: 1;
}

.tag {
  font: 600 0.6875rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.card .links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin-top: auto;
  padding-top: 0.35rem;
}
.card .link {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid color-mix(in oklab, var(--c) 60%, transparent);
  transition: color 0.15s, border-color 0.15s;
}
.card .link:hover {
  color: var(--c);
  border-bottom-color: var(--c);
}

.meta { color: var(--c); font-size: 0.75rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2);
  margin-top: var(--s-4); padding-block: var(--s-3); border-top: 1px dashed var(--line); color: var(--text-dim);
}
.foot a:hover { color: var(--text); }

/* Scroll reveal, progressive enhancement */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes rise { from { opacity: 0; translate: 0 1.5rem; } }
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
  }
}

/* Tablet & Mobile Responsiveness */
@media (max-width: 68rem) {
  .cards { grid-template-columns: repeat(6, 1fr); }
  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(3) { grid-column: span 2; }
  .card:nth-child(4),
  .card:nth-child(5) { grid-column: span 3; }
  .card:nth-child(6),
  .card:nth-child(7) { grid-column: span 3; }
}

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100svh - 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: var(--s-3);
  }
  .hero-art { order: -1; justify-items: start; }
  .hero-mark { width: 7.5rem; }
  .nav { display: none; }
  .lang { margin-left: auto; border-left: 0; padding-left: 0; }
  .section {
    min-height: auto;
    padding-block: var(--s-4);
    scroll-margin-top: 3.5rem;
  }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(3),
  .card:nth-child(4),
  .card:nth-child(5),
  .card:nth-child(6) { grid-column: span 1; }
  .card:nth-child(7) { grid-column: span 2; }
}

@media (max-width: 36rem) {
  .cards { grid-template-columns: 1fr; }
  .card:nth-child(n) { grid-column: span 1; }
  .belt { display: none; }
}

