/* ── Global — site-wide foundation ── */
/* Tokens, reset, typography, nav, page wrapper, footer, shared utilities. */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

:root {
  --canvas:   #f5f1e5;
  --surface:  #eceadd;
  --text:     #2a2a2b;
  --text-2:   #383839;
  --text-3:   #8a8778;
  --rule:     #d8d4c8;
  --rule-s:   #e4e0d3;

  /* Aliases retained for case-study.css compatibility */
  --border:   var(--rule);
  --border-s: var(--rule-s);

  --sans:  'DM Sans', 'Inter', system-ui, sans-serif;
  --serif: 'Newsreader', 'Tiempos Text', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap:    1280px;
  --gutter:  56px;
  --measure: 640px;
  --radius:  10px;
  --shadow:  0 2px 16px rgba(56,56,57,0.06);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--serif);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "onum";
  animation: fadeIn 0.6s ease both;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

img[loading="lazy"] { opacity: 0; transition: opacity 0.5s ease; }
img[loading="lazy"].loaded { opacity: 1; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--canvas);
  border-bottom: 1px solid var(--rule-s);
  font-family: var(--sans);
}
.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-name {
  font-size: 0.8125rem; font-weight: 500; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.6875rem; font-weight: 400; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text-3); }

/* ── Page wrapper ── */
.page {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Footer ── */
.footer {
  padding: 72px 0;
  border-top: 1px solid var(--rule-s);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  font-family: var(--sans);
}
.footer-left {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-3);
}
.footer-right { display: flex; gap: 28px; }
.footer-right a {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0;
  transition: color 0.2s ease;
}
.footer-right a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 960px) {
  :root { --gutter: 32px; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .footer { grid-template-columns: 1fr; align-items: start; }
}
