/* ───────── Catalogue — layout on top of styles.css tokens ───────── */

body.catalogue {
  background: var(--bg);
  color: var(--ink);
}

/* Dark mode → true black page (project cards keep their colourway) */
[data-theme="dark"][data-variant="citron"] {
  --bg:        oklch(0 0 0);
  --bg-elev:   oklch(0.135 0.004 85);
  --line:      oklch(0.27 0.004 85);
  --line-soft: oklch(0.20 0.004 85);
}

.cat-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 48px) 100px;
}

/* ── Top bar ── */
.cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(48px, 8vw, 88px);
}
.cat-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.cat-brand:hover { text-decoration: none; }
.cat-brand .mark { width: 26px; height: 26px; color: var(--ink); }
.cat-brand .name { text-transform: lowercase; }
.cat-brand .tag {
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  margin-left: 2px;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--ink-mute); color: var(--ink); }
.theme-btn svg { width: 15px; height: 15px; }
.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }
.theme-btn .label::after { content: "Dark"; }
[data-theme="dark"] .theme-btn .label::after { content: "Light"; }

/* ── Masthead ── */
.masthead { margin-bottom: clamp(56px, 9vw, 96px); max-width: 860px; }
.masthead .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 24px;
}
.masthead .eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.masthead h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.masthead h1 em {
  font-style: italic;
  font-family: "Bricolage Grotesque", serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink-soft);
}
.masthead p {
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 26px;
  text-wrap: pretty;
}
.masthead .stat-line {
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.masthead .stat-line .sep { opacity: 0.45; }

/* ── Section heads ── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.025em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-head h2 .count {
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink-mute);
}
.section-head .sub {
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 360px;
  text-align: right;
  text-wrap: pretty;
}

.section { margin-bottom: clamp(56px, 9vw, 96px); }

/* ── Project grid ── */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* ── Project card — colourway dark panel ── */
.proj-card {
  position: relative;
  background: var(--card-dark);
  color: var(--card-dark-fg);
  border-radius: 26px;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
  isolation: isolate;
}
.proj-card .watermark {
  position: absolute;
  right: -38px;
  bottom: -38px;
  width: 180px;
  height: 180px;
  color: currentColor;
  opacity: 0.06;
  z-index: -1;
  pointer-events: none;
}
.proj-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}
.proj-card .kicker {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.66;
}
.proj-card .ver {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  white-space: nowrap;
}
.proj-card .title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.025em;
  text-transform: lowercase;
  margin-bottom: 14px;
}
.proj-card .title .mark { width: 28px; height: 28px; flex-shrink: 0; }
.proj-card .desc {
  font-size: 16px;
  line-height: 1.58;
  margin: 0;
  opacity: 0.9;
  max-width: 42ch;
  text-wrap: pretty;
}
.proj-card .foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  flex-wrap: wrap;
}

/* CTA buttons (scoped to whatever colourway the card sits in) */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 6px 0 20px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 500;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.cta:hover { text-decoration: none; }
.cta .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}
.cta .arrow svg { width: 16px; height: 16px; }
/* primary: accent fill */
.cta.primary { background: var(--accent); color: var(--accent-ink); }
.cta.primary:hover { filter: brightness(1.06); }
.cta.primary .arrow { background: var(--accent-ink); color: var(--accent); }
/* ghost: outline on the coloured panel */
.cta.ghost {
  background: transparent;
  color: currentColor;
  border: 1.5px solid currentColor;
  padding: 0 20px;
  opacity: 0.92;
}
.cta.ghost:hover { opacity: 1; }
.cta.ghost .arrow { display: none; }

/* ── Projects (page-themed cards) ── */
.proj2 { display: flex; flex-direction: column; gap: 22px; }

/* S.Api card — distinct, follows page theme */
.api-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 34px 36px;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 40px;
  overflow: hidden;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
.api-card .pad {
  background: var(--bg-elev);
  border-radius: 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.api-card .badge,
.mini-card .badge {
  align-self: flex-start;
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
}
.api-card .title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.api-card .title b { color: var(--ink); }
.api-card .desc {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 46ch;
  text-wrap: pretty;
}
.api-card .foot,
.mini-card .foot { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }

.cta.dark { background: var(--ink); color: var(--bg); }
.cta.dark .arrow { background: var(--bg); color: var(--ink); }
.cta.dark:hover { filter: brightness(1.08); }
.cta.line {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 0 20px;
}
.cta.line:hover { border-color: var(--ink-mute); }
.cta.line .arrow { display: none; }

.api-card .endpoints {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  align-self: center;
}
.api-card .endpoints .head {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(0.62 0.02 90);
  padding-bottom: 10px;
  border-bottom: 1px solid oklch(0.4 0.02 90 / 0.4);
}
.api-card .endpoints .ep { display: flex; align-items: center; gap: 12px; }
.api-card .endpoints .verb {
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--tk-prop, oklch(0.8 0.12 175));
  color: oklch(0.18 0.02 90);
  font-weight: 500;
}
.api-card .endpoints .path { color: var(--code-fg); opacity: 0.92; }

/* Zemali / Half a Minute — full-width page-themed cards */
.mini-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 180px;
  overflow: hidden;
  isolation: isolate;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
.mini-card .watermark {
  position: absolute;
  right: -30px;
  bottom: -46px;
  width: 196px;
  height: 196px;
  color: var(--ink);
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
}
.mini-card .title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.mini-card .desc {
  font-size: 16px;
  line-height: 1.58;
  color: var(--ink-soft);
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}
.mini-card .foot { margin-top: auto; }

/* ── Footer ── */
.cat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  flex-wrap: wrap;
}
.cat-foot a { color: var(--ink-soft); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .proj-grid { grid-template-columns: 1fr; }
  .api-card { grid-template-columns: 1fr; gap: 26px; }
  .section-head .sub { text-align: left; }
}
