/* Maluridae — shared styles */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,300;1,6..72,400;1,6..72,500;1,6..72,600&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #0A0A0A;
  --ink-2: #1a1a1a;
  --ink-soft: #555;
  --ink-muted: #888;
  --rule: #e5e3dc;
  --rule-soft: #efede6;
  --paper: #FAFAF7;
  --paper-2: #F4F2EB;
  --accent: oklch(0.72 0.12 220);
  --accent-ink: oklch(0.42 0.14 220);
  --accent-wash: oklch(0.94 0.04 220);

  --f-display: 'Newsreader', 'Times New Roman', serif;
  --f-italic: 'Instrument Serif', 'Newsreader', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1440px;
  --pad: clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-display);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.rule { height: 1px; background: var(--rule); width: 100%; }

/* ---- NAV ---- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  line-height: 1;
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  /* SVG is solid black; respect ink color via filter so it adapts to theme. */
  color: var(--ink);
}
.brand--footer .brand-logo { height: 38px; }
.nav-toggle { display: none; }
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a {
  font-family: var(--f-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-cta {
  border: 1px solid var(--ink);
  padding: 10px 18px;
  font-family: var(--f-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.1em;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---- Type utilities ---- */
.eyebrow {
  font-family: var(--f-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-muted);
}
.eyebrow .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); vertical-align: middle; margin-right: 10px;
  transform: translateY(-1px);
}
.h1 {
  font-family: var(--f-display);
  font-size: clamp(56px, 9vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 400;
  margin: 0;
}
.h1 em {
  font-family: var(--f-italic); font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--f-display);
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
}
.h3 {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 400;
  margin: 0;
}
.lead {
  font-family: var(--f-display);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 56ch;
  font-weight: 400;
}
.kicker {
  font-family: var(--f-italic); font-style: italic;
  font-size: clamp(20px, 1.6vw, 26px);
  color: var(--accent-ink);
}
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--f-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.12em;
  border-radius: 999px;
  transition: transform .2s, background .2s, color .2s;
}
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--rule);
  margin-top: 120px;
  padding: 72px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer h4 {
  font-family: var(--f-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin: 0 0 18px;
  font-weight: 500;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; font-size: 16px; }
.footer li a { color: var(--ink-soft); transition: color .2s; }
.footer li a:hover { color: var(--ink); }
.footer-brand-blurb {
  font-family: var(--f-italic); font-style: italic;
  font-size: 22px; line-height: 1.3;
  max-width: 32ch;
  color: var(--ink);
  margin: 16px 0 0;
}
.footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center;
  padding-top: 24px; border-top: 1px solid var(--rule);
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ---- Covers (SVG-based) ---- */
.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #222;
  box-shadow:
    0 1px 0 rgba(0,0,0,.05),
    0 30px 60px -20px rgba(0,0,0,.35),
    0 10px 20px -10px rgba(0,0,0,.25);
  overflow: hidden;
  border-radius: 2px;
}
.cover svg { width: 100%; height: 100%; display: block; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Utility ---- */
.sr-only { position: absolute; left: -9999px; }
.spacer-sm { height: 24px; }
.spacer { height: 56px; }
.spacer-lg { height: 120px; }

/* Page hero block */
.page-hero {
  padding: clamp(80px, 12vh, 160px) 0 clamp(60px, 10vh, 120px);
  border-bottom: 1px solid var(--rule);
}
.page-hero .eyebrow { margin-bottom: 28px; display: block; }
.page-hero .lead { margin-top: 28px; }

/* Responsive */
@media (max-width: 900px) {
  .nav-inner { height: 60px; }
  .brand-logo { height: 26px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: flex;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 12px 0;
    transform: translateY(calc(-100% - 60px));
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.15);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    padding: 14px var(--pad);
    border-bottom: 0;
    font-size: 13px;
  }
  .nav-links a.active { border-bottom: 0; color: var(--accent-ink); }
  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    margin-left: 8px;
  }
  .nav-toggle span {
    display: block; width: 22px; height: 1.5px;
    background: var(--ink); position: relative;
    transition: background .2s;
  }
  .nav-toggle span::before, .nav-toggle span::after {
    content: ''; position: absolute; left: 0;
    width: 22px; height: 1.5px; background: var(--ink);
    transition: transform .2s;
  }
  .nav-toggle span::before { top: -7px; }
  .nav-toggle span::after  { top: 7px; }
  .nav-toggle.open span { background: transparent; }
  .nav-toggle.open span::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span::after  { transform: translateY(-7px) rotate(-45deg); }
  .nav-cta { display: none; }

  .footer { margin-top: 80px; padding: 56px 0 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; margin-bottom: 48px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand-blurb { font-size: 18px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
  .spacer-lg { height: 64px; }
  .spacer { height: 36px; }
}

/* Tablet-only nav tweak (641px – 900px) — bigger logo than the mobile default,
   but still using the hamburger menu (also scaled up a touch). Logo sits
   centered in the bar; hamburger pinned to the right. */
@media (max-width: 900px) and (min-width: 641px) {
  .nav-inner {
    height: 72px;
    position: relative;
  }
  .nav-inner > .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  /* Push the hamburger wrapper to the right now that brand is absolute */
  .nav-inner > div:last-child { margin-left: auto; }
  .brand-logo { height: 36px; }
  .nav-toggle { width: 48px; height: 48px; }
  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after { width: 28px; height: 2px; }
  .nav-toggle span::before { top: -9px; }
  .nav-toggle span::after  { top: 9px; }
  .nav-toggle.open span::before { transform: translateY(9px) rotate(45deg); }
  .nav-toggle.open span::after  { transform: translateY(-9px) rotate(-45deg); }

  /* Reduce hero padding so page-heroes don't eat half the screen on tablet —
     the desktop clamp uses 12vh which becomes a lot of empty space here. */
  .page-hero {
    padding: 48px 0 40px;
  }
  .page-hero .lead { margin-top: 20px; }
  /* Tighten the footer's top breathing room — the mobile 80px margin leaves
     a big empty band on tablet between content and footer. */
  .footer { margin-top: 40px; padding: 48px 0 24px; }
}

/* Phone-only tweaks (<=640px) */
@media (max-width: 640px) {
  .h1 { font-size: clamp(40px, 11vw, 56px); }
  .h2 { font-size: clamp(30px, 8vw, 40px); }
  .page-hero { padding: 56px 0 40px; text-align: center; }
  .page-hero .lead { margin-top: 20px; margin-left: auto; margin-right: auto; }
  .page-hero .eyebrow .dot { /* keep dot inline with text when centered */ }

  /* Center the wordmark in the bar on phones, hamburger pinned to the right.
     Mirrors the tablet rule above. */
  .nav-inner { position: relative; }
  .nav-inner > .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .nav-inner > div:last-child { margin-left: auto; }
}
