/* ════════════════════════════════════════════════════════════
   MARGINS — built on the Hemingway design system
   Shared tokens, components, page layouts + direction variants
════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=STIX+Two+Text:ital,wght@0,400;0,500;0,600;0,700;1,400;1,700&display=swap');

:root {
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'STIX Two Text', serif;

  --base-50:  oklch(98.5% 0 0);
  --base-100: oklch(97%   0 0);
  --base-200: oklch(92.2% 0 0);
  --base-300: oklch(87%   0 0);
  --base-400: oklch(70.8% 0 0);
  --base-500: oklch(55.6% 0 0);
  --base-600: oklch(43.9% 0 0);
  --base-700: oklch(37.1% 0 0);
  --base-800: oklch(26.9% 0 0);
  --base-900: oklch(20.5% 0 0);
  --base-950: oklch(14.5% 0 0);

  --accent-400: oklch(66% .175 27);
  --accent-500: oklch(57% .205 28);
  --accent-600: oklch(48% .200 29);
  --accent-700: oklch(40% .165 29);

  --color-bg:         oklch(0.985 0 0);
  --color-bg-dark:    #000;
  --color-text:       #000;
  --color-text-muted: oklch(55.6% 0 0);
  --color-border:     oklch(92.2% 0 0);

  --text-xs: 0.75rem;  --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem;  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;--text-4xl: 2.25rem; --text-5xl: 3rem;
  --text-6xl: 3.75rem; --text-7xl: 4.5rem;  --text-8xl: 6rem; --text-9xl: 8rem;

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem;--space-6: 1.5rem;--space-8: 2rem;  --space-10: 2.5rem;
  --space-12: 3rem;  --space-16: 4rem;--space-20: 5rem; --space-24: 6rem;

  --radius-md: .375rem; --radius-lg: .5rem; --radius-full: 9999px;
  --duration: .15s; --ease: cubic-bezier(.4,0,.2,1);

  --page-max: 1200px;

  /* Heading family — swapped by [data-type] */
  --font-display: var(--font-serif);
  --display-weight: 400;
  --display-tracking: -0.02em;
}

/* Typography direction: Modern uses Inter for display */
[data-type="modern"] {
  --font-display: var(--font-sans);
  --display-weight: 600;
  --display-tracking: -0.03em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding-left: var(--space-8); padding-right: var(--space-8); }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding-left: var(--space-6); padding-right: var(--space-6); }

/* ─── Image placeholder ─────────────────────────────────────── */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, oklch(90% 0 0) 0 2px, transparent 2px 11px),
    linear-gradient(160deg, var(--base-200), var(--base-300));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, monospace;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--base-600);
  background: var(--color-bg);
  padding: 4px 10px; border-radius: var(--radius-full);
  box-shadow: 0 0 0 1px var(--color-border);
}
.ph-dark {
  background:
    repeating-linear-gradient(135deg, oklch(30% 0 0) 0 2px, transparent 2px 11px),
    linear-gradient(160deg, var(--base-900), var(--base-700));
}
.ph-dark::after { color: var(--base-300); background: #000; box-shadow: 0 0 0 1px var(--base-800); }

/* ─── Nav ───────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-nav-inner {
  max-width: var(--page-max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-8);
}
.nav-logo {
  font-family: var(--font-serif); font-size: var(--text-xl);
  font-weight: 500; letter-spacing: -0.01em; text-decoration: none; color: var(--color-text);
}
.nav-logo .dot { color: var(--accent-600); }
.nav-links { display: flex; align-items: center; gap: var(--space-6); list-style: none; }
.nav-links a {
  font-size: var(--text-xs); font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none; color: var(--color-text);
  transition: color var(--duration) var(--ease); white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-text-muted); }
.nav-links a[aria-current="page"] { color: var(--accent-600); }
@media (max-width: 760px) {
  .nav-links { gap: var(--space-4); }
  .nav-links li.opt { display: none; }
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500;
  text-decoration: none; cursor: pointer; border: none;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.btn-primary { background: var(--color-text); color: #fff; }
.btn-primary:hover { background: var(--base-700); }
.btn-outline { background: transparent; color: var(--color-text); border: 1px solid var(--color-text); }
.btn-outline:hover { background: var(--color-text); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text-muted); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--color-text); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-circle { width: 48px; height: 48px; padding: 0; border-radius: 50%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.badge-dark { background: var(--color-text); color: #fff; }
.badge-outline { background: transparent; color: var(--color-text); border: 1px solid var(--base-300); }
.badge-muted { background: var(--base-100); color: var(--color-text-muted); }
.badge-accent { background: transparent; color: var(--accent-600); border: 1px solid color-mix(in oklch, var(--accent-600) 35%, transparent); }

/* ─── Section label ─────────────────────────────────────────── */
.section-label {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}
.section-label-text {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--color-text);
}
.section-label-link {
  font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted);
  text-decoration: none; transition: color var(--duration) var(--ease);
}
.section-label-link:hover { color: var(--accent-600); }

/* ─── Eyebrow / kicker ──────────────────────────────────────── */
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--color-text-muted);
}

/* ─── Meta line ─────────────────────────────────────────────── */
.meta {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--base-400); }

/* ─── Article card ──────────────────────────────────────────── */
.card { display: flex; flex-direction: column; gap: var(--space-3); text-decoration: none; color: inherit; }
.card-image { width: 100%; aspect-ratio: 4/3; }
.card-image.square { aspect-ratio: 1; }
.card-title {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--display-weight);
  line-height: 1.3; letter-spacing: var(--display-tracking); color: var(--color-text);
  transition: color var(--duration) var(--ease);
}
.card:hover .card-title { color: var(--accent-600); }
.card:hover .card-image::before {
  content: ''; position: absolute; inset: 0; z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.card-byline { font-size: var(--text-xs); color: var(--color-text-muted); }

.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards-grid, .cards-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-grid, .cards-grid.cols-3 { grid-template-columns: 1fr; } }

/* ─── Numbered article row (editorial index) ────────────────── */
.article-row {
  display: flex; align-items: baseline; gap: var(--space-6);
  padding: var(--space-6) 0; border-bottom: 1px solid var(--color-border);
  text-decoration: none; color: inherit;
  transition: padding-left var(--duration) var(--ease);
}
.article-row:hover { padding-left: var(--space-3); }
.article-row-num {
  font-family: var(--font-serif); font-size: var(--text-sm);
  color: var(--color-text-muted); flex-shrink: 0; width: 28px;
}
.article-row-body { flex: 1; }
.article-row-title {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--display-weight);
  line-height: 1.25; letter-spacing: var(--display-tracking);
  transition: color var(--duration) var(--ease);
}
.article-row:hover .article-row-title { color: var(--accent-600); }
.article-row-excerpt {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6;
  margin-top: var(--space-2); max-width: 60ch;
}
.article-row-meta { font-size: var(--text-xs); color: var(--color-text-muted); flex-shrink: 0; text-align: right; width: 96px; }

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer { background: var(--color-bg-dark); color: #fff; margin-top: var(--space-24); }
.site-footer .wrap { padding-left: var(--space-16); padding-right: var(--space-16); }
@media (max-width: 760px) { .site-footer .wrap { padding-left: var(--space-8); padding-right: var(--space-8); } }
.footer-mark {
  font-family: var(--font-serif); font-size: clamp(4rem, 14vw, var(--text-9xl));
  font-weight: 400; line-height: .82; letter-spacing: -0.03em; color: #fff;
  padding-top: var(--space-16);
}
.footer-mark .dot { color: var(--accent-500); }
.footer-body { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-12); padding: var(--space-12) 0 var(--space-16); }
.footer-body p { font-size: var(--text-sm); line-height: 1.7; color: var(--base-400); max-width: 42ch; }
.footer-col-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--base-500); margin-bottom: var(--space-4); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.footer-links a { font-size: var(--text-sm); font-weight: 500; color: #fff; text-decoration: none; transition: color var(--duration) var(--ease); }
.footer-links a:hover { color: var(--base-400); }
.footer-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) 0 var(--space-8); border-top: 1px solid var(--base-900); flex-wrap: wrap; gap: var(--space-4); }
.footer-copy { font-size: var(--text-xs); color: var(--base-500); }
@media (max-width: 760px) { .footer-body { grid-template-columns: 1fr; gap: var(--space-8); } }

/* ─── Newsletter strip ──────────────────────────────────────── */
.nl-strip { padding-top: var(--space-20); padding-bottom: var(--space-20); }
.nl-heading {
  font-family: var(--font-display); font-size: clamp(2rem, 5vw, var(--text-5xl));
  font-weight: var(--display-weight); line-height: 1.1; letter-spacing: var(--display-tracking);
  max-width: 18ch; margin-bottom: var(--space-10);
}
.nl-form {
  display: flex; align-items: center; gap: var(--space-4);
  border-bottom: 1px solid var(--color-text); padding-bottom: var(--space-3); max-width: 560px;
}
.nl-input { flex: 1; border: none; background: transparent; font-family: var(--font-sans); font-size: var(--text-base); color: var(--color-text); outline: none; }
.nl-input::placeholder { color: var(--color-text-muted); }
.nl-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--color-text); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--duration) var(--ease); }
.nl-btn:hover { background: var(--accent-600); }
.nl-btn svg { width: 16px; height: 16px; color: #fff; }
.nl-note { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-4); }

/* ─── Inputs ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.field-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.input { width: 100%; padding: var(--space-3) 0; border: none; border-bottom: 1px solid var(--color-text); background: transparent; font-family: var(--font-sans); font-size: var(--text-base); color: var(--color-text); outline: none; }
.input::placeholder { color: var(--color-text-muted); }
.input-bordered { padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.input-bordered:focus { border-color: var(--base-500); }

hr.rule { border: none; border-top: 1px solid var(--color-border); }
.rule-dark { border-color: var(--base-900); }
