/* ───────────────────────────────────────────────────────────
   Shared foundation: color tokens, typography, layout, nav,
   buttons, section headers, footer, theme toggle.
   Used by index.html, media.html and press-kit.html.
   ─────────────────────────────────────────────────────────── */


  :root {
    --paper: #f1ece1;
    --paper-warm: #ebe4d4;
    --paper-deep: #e3dac6;
    --sage: #7d8d7a;
    --sage-deep: #566a5c;
    --sage-soft: #c4ccbe;
    --sage-mist: #d8ddd1;
    --forest: #2d3e35;
    --ink: #2a2826;
    --ink-soft: #4a4642;
    --ink-mute: #7a766f;
    --clay: #b87a52;
    --clay-deep: #8f5a3a;
    --hairline: #c9bfaa;
    --hairline-soft: #ddd2bc;
    --slab-bg: #2d3e35;
    --slab-fg: #f1ece1;
    --slab-fg-mute: #c4ccbe;
    --slab-hairline: rgba(216, 221, 209, 0.12);
    --slab-link-border: rgba(241, 236, 225, 0.2);
    --portrait-shadow: 0 8px 32px rgba(45, 62, 53, 0.08), 0 2px 8px rgba(45, 62, 53, 0.04);
    --cover-shadow: 0 4px 16px rgba(45, 62, 53, 0.10), 0 1px 4px rgba(45, 62, 53, 0.06);
    --noise-opacity: 0.4;
  }

  [data-theme="dark"] {
    --paper: #1a1815;
    --paper-warm: #221f1a;
    --paper-deep: #2a2620;
    --sage: #8c9c89;
    --sage-deep: #b4c0af;
    --sage-soft: #5b6a5d;
    --sage-mist: #353e36;
    --forest: #d8e0d3;
    --ink: #e8e2d4;
    --ink-soft: #c5beb0;
    --ink-mute: #8e8878;
    --clay: #d49a72;
    --clay-deep: #e8a982;
    --hairline: #3a342a;
    --hairline-soft: #2e2922;
    --slab-bg: #0f1210;
    --slab-fg: #e8e2d4;
    --slab-fg-mute: #8e9a8c;
    --slab-hairline: rgba(232, 226, 212, 0.08);
    --slab-link-border: rgba(232, 226, 212, 0.18);
    --portrait-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
    --cover-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
    --noise-opacity: 0.18;
  }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
      radial-gradient(ellipse at top left, rgba(125, 141, 122, 0.06) 0%, transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(184, 122, 82, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  /* Subtle paper texture */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 1;
    transition: opacity 0.3s ease;
  }

  main { position: relative; z-index: 2; }

  h1, h2, h3, h4, h5 {
    font-family: 'Lora', Georgia, serif;
    color: var(--forest);
    line-height: 1.15;
    letter-spacing: -0.005em;
  }

  p { margin-bottom: 1.1em; }
  p:last-child { margin-bottom: 0; }

  a {
    color: var(--clay-deep);
    text-decoration: none;
    border-bottom: 1px solid rgba(143, 90, 58, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
  }
  a:hover {
    color: var(--clay);
    border-bottom-color: var(--clay);
  }

  /* ─── Layout ─────────────────────────────────────── */

  .container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
  }

  .container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 32px;
  }

  
  .btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
  }

  .btn-primary {
    background-color: var(--forest);
    color: var(--paper);
    border-bottom: none;
  }
  .btn-primary:hover {
    background-color: var(--sage-deep);
    color: var(--paper);
    border-bottom: none;
  }

  .btn-ghost {
    background-color: transparent;
    color: var(--forest);
    border: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
  }
  .btn-ghost:hover {
    background-color: var(--sage-mist);
    color: var(--forest);
    border-color: var(--sage-soft);
    border-bottom: 1px solid var(--sage-soft);
  }

  /* ─── Section base ───────────────────────────────── */

  section {
    padding: 100px 0;
    position: relative;
  }

  .section-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--sage-deep);
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }

  .section-label::before {
    content: '';
    width: 28px;
    height: 1px;
    background-color: var(--clay);
  }

  .section-heading {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(34px, 4.4vw, 50px);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--forest);
    margin-bottom: 28px;
    max-width: 760px;
  }

  .section-subhead {
    font-family: 'Lora', Georgia, serif;
    font-size: 21px;
    font-weight: 300;
    font-style: italic;
    color: var(--sage-deep);
    line-height: 1.5;
    max-width: 640px;
    margin-bottom: 56px;
  }

  #work .section-subhead {
    max-width: none;
  }

  /* ─── Footer ────────────────────────────────────── */

  footer {
    background-color: var(--slab-bg);
    color: var(--slab-fg-mute);
    padding: 32px 0;
    border-top: 1px solid var(--slab-hairline);
    font-size: 13px;
    letter-spacing: 0.02em;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  .footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  /* ─── Theme toggle ──────────────────────────────── */

  .theme-toggle {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 100;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--paper-warm);
    border: 1px solid var(--hairline);
    color: var(--sage-deep);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(45, 62, 53, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }

  .theme-toggle:hover {
    background-color: var(--sage-mist);
    color: var(--forest);
    border-color: var(--sage-soft);
    transform: translateY(-1px);
  }

  .theme-toggle:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 3px;
  }

  .theme-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  .theme-toggle .icon-moon { display: none; }
  [data-theme="dark"] .theme-toggle .icon-sun { display: none; }
  [data-theme="dark"] .theme-toggle .icon-moon { display: block; }

  [data-theme="dark"] .theme-toggle {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  }


  /* ─── Site nav ──────────────────────────────────── */

  .site-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline-soft);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }

  .site-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .site-nav-brand {
    font-family: 'Lora', Georgia, serif;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--forest);
    border-bottom: none;
    white-space: nowrap;
  }
  .site-nav-brand:hover { color: var(--sage-deep); border-bottom: none; }

  .site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
  }

  .site-nav-links a {
    display: inline-block;
    padding: 7px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    border-bottom: none;
    border-radius: 2px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .site-nav-links a:hover {
    color: var(--forest);
    background-color: var(--sage-mist);
    border-bottom: none;
  }

  .site-nav-links a[aria-current="page"] {
    color: var(--forest);
    background-color: var(--paper-deep);
  }

  .site-nav .theme-toggle {
    position: static;
    top: auto;
    right: auto;
    width: 34px;
    height: 34px;
    box-shadow: none;
    flex-shrink: 0;
  }

  .nav-toggle-wrap { display: flex; align-items: center; gap: 10px; }

  @media (max-width: 720px) {
    .site-nav-inner { height: auto; padding: 10px 24px; flex-wrap: wrap; }
    .site-nav-links { flex-wrap: wrap; gap: 2px; order: 3; width: 100%; padding-bottom: 4px; }
    .site-nav-links a { padding: 6px 9px; font-size: 12px; }
  }

  /* Selection */
  ::selection {
    background-color: var(--sage-soft);
    color: var(--forest);
  }

  @media (max-width: 480px) {
    .container, .container-narrow { padding: 0 24px; }
    .btn { justify-content: center; }
  }

  @media (prefers-reduced-motion: reduce) {
    body, footer, .btn, .theme-toggle, body::before, .site-nav { transition: none; }
  }
