/* ==========================================================================
   Nevola Media — stylesheet
   Editorial / warm media-company.
   ========================================================================== */

/* --- Fonts (self-hosted, latin subset) --------------------------------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../assets/fonts/libre-franklin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* primitives */
  --ink: #1a1a1a;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --terracotta: #9c4a2f;
  --terracotta-deep: #7d3a24;
  --muted: #5c5852;
  --hairline: #e2ddd3;
  --ochre-wash: #f0e9dd;

  /* semantic */
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --accent: var(--terracotta);
  --rule: var(--hairline);

  /* type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* fluid type scale */
  --fs-display: clamp(2.6rem, 6vw, 5.2rem);
  --fs-h2: clamp(1.7rem, 3vw, 2.6rem);
  --fs-h3: clamp(1.2rem, 1.6vw, 1.5rem);
  --fs-body: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  --fs-small: 0.9375rem;
  --fs-label: 0.78rem;

  /* spacing (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-24: 6rem;
  --s-32: 8rem;

  /* layout */
  --measure: 64ch;
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* --- Reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--terracotta-deep); }

/* --- Accessibility ------------------------------------------------------ */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: var(--s-3) var(--s-4);
  z-index: 100; border-radius: 0 0 2px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- Layout primitives -------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }
.section { padding-block: var(--s-24); }
.section--tight { padding-block: var(--s-16); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* --- Type --------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; margin: 0; }
.display { font-size: var(--fs-display); line-height: 1.04; letter-spacing: -0.02em; max-width: 16ch; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--s-4); }
.lead { font-size: clamp(1.2rem, 1.4vw, 1.45rem); line-height: 1.5; color: var(--fg); }
.label {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-4);
}
.muted { color: var(--fg-muted); }

/* --- Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-block: var(--s-6); gap: var(--s-6);
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.wordmark span { color: var(--accent); }
.nav { display: flex; gap: var(--s-8); align-items: baseline; }
.nav a {
  font-family: var(--sans); font-size: var(--fs-small); color: var(--ink);
  text-decoration: none; letter-spacing: 0.01em;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; }

/* --- Hero / statement --------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) var(--s-16); }
.hero .display { margin-bottom: var(--s-8); }
.hero .lead { max-width: 52ch; }

/* --- Editorial grid (asymmetric) --------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); }
.col-7 { grid-column: span 12; }
.col-5 { grid-column: span 12; }
.col-8 { grid-column: span 12; }
.col-4 { grid-column: span 12; }
@media (min-width: 768px) {
  .col-7 { grid-column: span 7; }
  .col-5 { grid-column: span 5; }
  .col-8 { grid-column: span 8; }
  .col-4 { grid-column: span 4; }
}

/* --- Pillars (asymmetric, no icons) ------------------------------------ */
.pillars { display: grid; gap: var(--s-12); }
@media (min-width: 768px) { .pillars { grid-template-columns: 1.2fr 1fr 1fr; } }
.pillar h3 { margin-bottom: var(--s-3); }
.pillar p { margin: 0; color: var(--fg-muted); }
.pillar-num { font-family: var(--mono); font-size: var(--fs-label); color: var(--accent); display: block; margin-bottom: var(--s-3); }

/* --- Brand card (single, intentional) ---------------------------------- */
.brand-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent); padding: var(--s-12);
  max-width: 540px;
}
.brand-card .label { margin-bottom: var(--s-6); }
.brand-card h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: var(--s-3); }
.brand-card p { color: var(--fg-muted); margin-bottom: var(--s-6); }
.brand-card .brand-link { font-family: var(--sans); font-size: var(--fs-small); }

/* --- How-we-work strip -------------------------------------------------- */
.note { background: var(--ochre-wash); padding-block: var(--s-16); }
.note p { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.4; max-width: 30ch; margin: 0; }

/* --- About prose -------------------------------------------------------- */
.prose p { max-width: var(--measure); }
.prose p + p { margin-top: var(--s-4); }
.facts { display: grid; gap: var(--s-6); margin-top: var(--s-12); }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact dt { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-2); }
.fact dd { margin: 0; font-size: var(--fs-small); }

/* --- Q&A (home) --------------------------------------------------------- */
.qa { margin: 0; }
.qa-item { padding-block: var(--s-6); border-top: 1px solid var(--hairline); }
.qa-item:first-child { border-top: 0; padding-top: 0; }
.qa dt { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; margin-bottom: var(--s-2); }
.qa dd { margin: 0; max-width: var(--measure); color: var(--muted); }
.qa dd a { color: var(--ink); }

/* --- Contact ------------------------------------------------------------ */
.contact-grid { display: grid; gap: var(--s-12); }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: var(--s-6); }
.field label { display: block; font-size: var(--fs-small); margin-bottom: var(--s-2); }
.field input, .field textarea {
  width: 100%; padding: var(--s-3); border: 1px solid var(--hairline);
  background: var(--surface); font-family: var(--sans); font-size: var(--fs-body); border-radius: 2px;
}
.field textarea { min-height: 140px; resize: vertical; }
.btn {
  transition: background-color .18s ease, color .18s ease;
  display: inline-block; background: var(--ink); color: #fff; border: 0;
  padding: var(--s-3) var(--s-8); font-family: var(--sans); font-size: var(--fs-small);
  letter-spacing: 0.02em; cursor: pointer; border-radius: 2px; text-decoration: none;
}
.btn:hover { background: var(--terracotta-deep); color: #fff; }
address { font-style: normal; line-height: 1.7; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: var(--s-16) var(--s-12); margin-top: var(--s-16); }
.footer-grid { display: grid; gap: var(--s-12); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer .wordmark { font-size: 1.25rem; }
.footer-legal { font-size: var(--fs-small); color: var(--fg-muted); line-height: 1.8; }
.footer-col h4 { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-4); font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--s-2); }
.footer-col a { font-size: var(--fs-small); color: var(--ink); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--rule); font-size: var(--fs-small); color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; }

/* --- Legal pages -------------------------------------------------------- */
.legal h2 { font-size: var(--fs-h3); margin-top: var(--s-12); margin-bottom: var(--s-4); }
.legal h1 { margin-bottom: var(--s-4); }
.legal .updated { font-family: var(--mono); font-size: var(--fs-label); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s-12); }
.legal p, .legal li { max-width: var(--measure); }
.legal ul { padding-left: var(--s-6); }
.legal li { margin-bottom: var(--s-2); }

/* --- Mobile nav --------------------------------------------------------- */
@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block; background: none; border: 1px solid var(--hairline);
    padding: var(--s-2) var(--s-3); font-family: var(--mono); font-size: var(--fs-label);
    letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; border-radius: 2px;
  }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--rule); padding: var(--s-4) var(--gutter);
    z-index: 50;
  }
  .nav.is-open { display: flex; }
  .nav a { padding-block: var(--s-3); border-top: 1px solid var(--rule); }
  .nav a:first-child { border-top: 0; }
  .site-header .wrap { position: relative; }
}

/* --- 404 ---------------------------------------------------------------- */
.error-page { min-height: 52vh; display: flex; flex-direction: column; justify-content: center; }
