/* ============================================================
   EXPLORE — shared styles for Resources / Articles pages
   Mirrors the design tokens used on index.html / en.html
   ============================================================ */

:root {
  --accent-base: #5E6B4A;            /* lichen green */
  --bg:    #F2EDE4;
  --bg-2:  #EAE2D3;
  --ink:   #2B2318;
  --ink-soft: #5C5040;
  --ink-faint: #8C8170;
  --rule:  #D3C8B4;
  --display-font: "EB Garamond", Georgia, serif;
  --display-weight: 500;
  --body-font: "IBM Plex Sans", system-ui, sans-serif;
  --mono-font: ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 58rem;
  --pad-x: clamp(1.4rem, 6vw, 7rem);
}
[data-theme="light"] { --accent: var(--accent-base); }
[data-theme="dark"] {
  --accent: color-mix(in oklab, var(--accent-base), white 32%);
  --bg:    #16140F;
  --bg-2:  #1E1A13;
  --ink:   #E9E0CE;
  --ink-soft: #B7AC97;
  --ink-faint: #948975;
  --rule:  #36302594;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (min-width: 1101px) { html { scroll-padding-top: 7rem; } }

/* Accessibility */
.skip-link {
  position: absolute; left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--accent); color: #16140F;
  padding: 0.7rem 1.2rem; z-index: 200;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; border-radius: 0 0 4px 0;
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: color-mix(in oklab, var(--accent), transparent 65%); color: var(--ink); }

/* Grain */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  mix-blend-mode: soft-light; opacity: 0.10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { mix-blend-mode: multiply; opacity: 0.06; }

/* Helpers */
.wrap { padding-inline: var(--pad-x); }
.eyebrow {
  font-family: var(--body-font); text-transform: uppercase;
  letter-spacing: 0.22em; font-size: 0.72rem; font-weight: 600;
  color: var(--accent); margin: 0;
}
h1, h2, h3 { font-family: var(--display-font); font-weight: var(--display-weight); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 8000;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem var(--pad-x);
  background: color-mix(in oklab, var(--bg), transparent 14%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 0.7rem; line-height: 1; text-decoration: none; color: inherit; }
.brand-logo { display: block; height: 46px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(0.9rem, 1.8vw, 1.8rem); margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 500;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.nav a:hover { color: var(--accent); border-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
/* Resources = distinct site area → pill button */
.nav a.nav-cta {
  border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); padding: 0.4rem 1.05rem; line-height: 1;
  align-self: center; margin-left: 0.3rem;
  transition: background .25s, color .25s, border-color .25s;
}
.nav a.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #16140F; }
.nav a.nav-cta[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #16140F; }
.lang-switch {
  display: flex; align-items: center; gap: 0.6rem; margin-left: 1.8rem;
  border: 1px solid var(--rule); border-radius: 4px; padding: 0.34rem 0.66rem;
}
.lang-switch a {
  text-decoration: none; color: var(--ink-faint);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600;
  transition: color .25s;
}
.lang-switch a:hover { color: var(--accent); }
.lang-switch a.active { color: var(--ink); }
.lang-switch .lang-sep { width: 1px; height: 14px; background: var(--rule); font-size: 0; display: inline-block; }
.nav-toggle { display: none; }

@media (max-width: 1100px) {
  .site-header { position: relative; flex-wrap: wrap; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; order: 3; background: none; border: none; cursor: pointer;
  }
  .lang-switch { order: 2; margin-left: auto; margin-right: 0.4rem; }
  .lang-switch a { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 0.3rem; }
  .nav-toggle-bar { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    flex-direction: column; gap: 0; flex-basis: 100%; order: 4; margin-left: 0;
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .3s ease, visibility .3s ease;
  }
  .nav[data-open="true"] { max-height: 28rem; margin-top: 0.5rem; visibility: visible; }
  .nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); font-size: 0.82rem; }
  .nav a:first-child { border-top: 1px solid var(--rule); }
  .nav a.nav-cta { border: 1px solid var(--accent); border-radius: 999px; margin: 0.9rem 0 0.3rem; padding: 0.85rem; text-align: center; align-self: stretch; }
  .nav a.nav-cta:first-child { border-top: 1px solid var(--accent); }
}

/* ---------- Photo + duotone ---------- */
.photo { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--rule); background: var(--bg-2); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: opacity 0.55s ease; }
[data-phototone="warm"] .photo img { filter: contrast(1.06) brightness(1.02) url(#duotone-warm); }
[data-theme="dark"][data-phototone="warm"] .photo img { filter: contrast(1.05) url(#duotone-warm-dark); }

/* ============================================================
   Resources index
   ============================================================ */
.page-head {
  max-width: 60rem;
  padding-block: clamp(2.6rem, 6vw, 4.6rem) clamp(1.6rem, 4vw, 2.8rem);
}
.page-head .eyebrow { margin-bottom: 1.5rem; }
.page-head h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: 1.02;
  letter-spacing: -0.01em; margin: 0 0 1.4rem;
}
.page-head .lead {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.6;
  color: var(--ink-soft); font-weight: 300; max-width: 42rem; margin: 0;
}

.article-list { border-top: 1px solid var(--rule); max-width: 64rem; margin-top: clamp(1.4rem, 3vw, 2.4rem); }
.article-row {
  display: grid; grid-template-columns: 1fr; gap: 0.55rem;
  padding: clamp(1.8rem, 4vw, 2.8rem) 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none; color: inherit;
  transition: padding-left .3s ease;
}
.article-row:hover { padding-left: 0.8rem; }
.article-row .row-meta {
  font-family: var(--mono-font); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap;
}
.article-row .row-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.article-row h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.12; margin: 0;
  letter-spacing: -0.005em; max-width: 24ch; text-wrap: balance;
  transition: color .25s;
}
.article-row:hover h2 { color: var(--accent); }
.article-row .row-excerpt { color: var(--ink-soft); font-weight: 300; max-width: 54ch; margin: 0.2rem 0 0; line-height: 1.6; }
.article-row .row-more {
  font-family: var(--mono-font); font-size: 0.74rem; letter-spacing: 0.08em;
  color: var(--accent); margin-top: 0.4rem; display: inline-flex; align-items: center; gap: 0.4rem;
}
.article-row .row-more::after { content: "\2192"; transition: transform .25s; }
.article-row:hover .row-more::after { transform: translateX(4px); }

/* ============================================================
   Single article
   ============================================================ */
.article { max-width: 62rem; margin-inline: auto; padding-inline: clamp(1.4rem, 4vw, 3rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
#main > .wrap { max-width: 62rem; margin-inline: auto; padding-inline: clamp(1.4rem, 4vw, 3rem); }
.article .wrap { padding-inline: 0; }
.article-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono-font); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); text-decoration: none;
  padding-block: clamp(1.6rem, 4vw, 2.6rem) 0;
}
.article-back::before { content: "\2190"; }
.article-back:hover { color: var(--accent); }

.article-header { max-width: none; margin: 0; padding-block: clamp(1.6rem, 4vw, 2.6rem) clamp(1.4rem, 3vw, 2.2rem); }
.article-header .eyebrow { margin-bottom: 1.3rem; }
.article-header h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.7rem); line-height: 1.05;
  letter-spacing: -0.01em; margin: 0 0 1.5rem; text-wrap: balance;
}
.article-byline {
  display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap;
  font-family: var(--mono-font); font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.article-byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.article-byline .author { color: var(--ink-soft); }

.article-figure {
  max-width: none; margin: 0 0 clamp(2rem, 5vw, 3.4rem);
  aspect-ratio: 16 / 9;
}
.article-figure.photo { border-radius: 2px; }

.prose { max-width: none; margin: 0; }
.prose > * + * { margin-top: 1.4rem; }
.prose p { font-size: clamp(1.08rem, 1.5vw, 1.2rem); line-height: 1.72; color: var(--ink); margin: 0; }
.prose p + p { margin-top: 1.4rem; }
.prose h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin: 2.6rem 0 0;
  letter-spacing: -0.005em;
}
.prose h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); margin: 2rem 0 0; }
.prose h2 + p, .prose h3 + p { margin-top: 0.9rem; }
.prose em { font-style: italic; color: var(--accent); }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent), transparent 60%); }
.prose a:hover { border-bottom-color: currentColor; }
.prose ul, .prose ol { margin: 1.2rem 0; padding-left: 1.3rem; }
.prose li { font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.66; margin-bottom: 0.55rem; color: var(--ink); }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 2rem 0; padding-left: 1.4rem; border-left: 2px solid var(--accent);
  font-family: var(--display-font); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.4; color: var(--ink-soft);
}
.prose figure { margin: 2.2rem 0; }
.prose figure.photo { aspect-ratio: 16 / 9; }
.prose figcaption {
  font-family: var(--mono-font); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--ink-faint); margin-top: 0.7rem; text-align: center;
}

/* Tables */
.prose .table-wrap { margin: 2rem 0; overflow-x: auto; }
.prose table {
  width: 100%; border-collapse: collapse; font-size: clamp(0.96rem, 1.3vw, 1.05rem);
  line-height: 1.5;
}
.prose table:has(colgroup) { table-layout: fixed; }
.prose table:has(colgroup) td { word-break: normal; overflow-wrap: break-word;
}
.prose thead th {
  text-align: left; vertical-align: bottom;
  font-family: var(--body-font); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem;
  color: var(--accent);
  padding: 0 1.1rem 0.7rem 0; border-bottom: 1px solid var(--accent);
}
.prose tbody th, .prose tbody td {
  text-align: left; vertical-align: top;
  padding: 0.85rem 1.1rem 0.85rem 0; border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.prose tbody th { font-weight: 600; white-space: nowrap; color: var(--ink); width: 1%; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }

/* Example / objective callout */
.prose .callout {
  margin: 1.8rem 0; padding: 1.5rem 1.6rem;
  background: color-mix(in oklab, var(--accent), transparent 92%);
  border-left: 2px solid var(--accent); border-radius: 0 3px 3px 0;
}
.prose .callout p + p { margin-top: 2rem; }
.prose .callout p {
  font-family: var(--body-font); font-style: normal;
  font-size: clamp(1.05rem, 1.4vw, 1.15rem); line-height: 1.55; color: var(--ink); margin: 0;
  text-wrap: pretty;
}
.prose .callout strong {
  display: block; font-family: var(--body-font); font-style: normal; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; margin-bottom: 0.35rem;
}

/* Placeholder marker — remove once real content is in */
.is-placeholder {
  border: 1px dashed color-mix(in oklab, var(--accent), transparent 40%);
  background: color-mix(in oklab, var(--accent), transparent 92%);
  padding: 0.9rem 1.1rem; border-radius: 3px;
  font-family: var(--mono-font); font-size: 0.74rem; letter-spacing: 0.04em;
  color: var(--ink-soft); text-transform: none;
}

.article-foot { max-width: none; margin: clamp(2.6rem, 6vw, 4.2rem) 0 0; padding-top: 1.8rem; border-top: 1px solid var(--rule); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: 2.2rem var(--pad-x);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  align-items: center; justify-content: space-between;
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
}
.site-footer .brand-logo { height: 34px; }
