/* The Signs -- design tokens from templates/brand/design-brief.md */
:root {
  --bg: #FBF3EA;
  --fg: #1F2A44;
  --fg-dim: #6B6058;
  --muted: #8B7E74;
  --ochre: #C8863B;
  --ochre-text: #7A4D1C;
  --clay: #C97B63;
  --clay-text: #8E4530;
  --surface: #FFFCF7;
  --border: #E4D8C8;
  --dusk: #2B2440;
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Karla', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2B2440; --fg: #FBF3EA; --fg-dim: #D8CFC0; --muted: #B6A8A0;
    --ochre: #E0A05C; --ochre-text: #F3D9B4; --clay: #E0A08E; --clay-text: #F3D4C8;
    --surface: #352C4C; --border: #473C63; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2B2440; --fg: #FBF3EA; --fg-dim: #D8CFC0; --muted: #B6A8A0;
  --ochre: #E0A05C; --ochre-text: #F3D9B4; --clay: #E0A08E; --clay-text: #F3D4C8;
  --surface: #352C4C; --border: #473C63; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body);
  margin: 0; line-height: 1.5;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--ochre-text); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Header */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 18px; gap: 16px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; position: sticky; top: 0; z-index: 30;
  background: var(--bg);
}
.logo {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-display);
  font-weight: 600; font-size: 1.3rem; color: var(--fg); text-decoration: none;
}
nav.primary { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.95rem; }
nav.primary a { color: var(--fg); text-decoration: none; font-weight: 500; }
nav.primary a:hover { color: var(--ochre-text); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  font-size: 0.95rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 3px 9px 3px 9px; padding: 7px 14px; letter-spacing: 0.02em;
}
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--ochre-text); }
.lang-switch a.active { color: var(--fg); font-weight: 700; }
.header-search {
  display: flex; align-items: center; gap: 6px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px 12px 4px 12px;
  padding: 6px 10px; width: 170px;
}
.header-search input {
  border: none; background: none; outline: none; color: var(--fg);
  font-family: var(--font-body); font-size: 0.85rem; width: 100%;
}
.header-search input::placeholder { color: var(--muted); }
.nav-toggle {
  display: none; background: none; border: none; color: var(--fg);
  font-size: 1.5rem; cursor: pointer; padding: 4px;
}

/* Mobile off-canvas menu */
.mobile-menu-backdrop {
  position: fixed; inset: 0; background: rgba(20, 16, 12, 0.5);
  z-index: 40; opacity: 0; transition: opacity 0.2s ease;
}
.mobile-menu-backdrop.open { opacity: 1; }
.mobile-menu {
  position: fixed; top: 0; right: 0; height: 100%; width: min(84vw, 320px);
  background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  z-index: 50; padding: 24px 22px; display: flex; flex-direction: column;
  gap: 22px; transform: translateX(100%); transition: transform 0.25s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; background: none; border: none; color: var(--fg);
  font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 4px;
}
.mobile-nav { display: flex; flex-direction: column; gap: 18px; font-size: 1.1rem; margin-top: 4px; }
.mobile-nav a { color: var(--fg); text-decoration: none; font-weight: 600; }
.mobile-nav a:hover { color: var(--ochre-text); }
.mobile-search { width: 100%; }
.mobile-lang { align-self: flex-start; }

/* Rotating hero (real content, see homepage-structure.md 2026-10-18) */
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay-text);
  font-weight: 600; margin: 32px 0 18px;
}
.hero-feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: center; padding-block: 8px 48px;
}
.hero-feature img {
  border-radius: 4px 20px 4px 20px; aspect-ratio: 16/9; object-fit: cover;
  border: 1px solid var(--border);
}
.hero-feature h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 600; line-height: 1.12; }
.hero-feature p.lead { font-size: 1.02rem; color: var(--fg-dim); margin-top: 14px; max-width: 46ch; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem; padding: 13px 22px; cursor: pointer;
  text-decoration: none; border-radius: 4px 14px 4px 14px; border: 1px solid transparent;
  margin-top: 22px;
}
.btn-primary { background: var(--ochre); color: #1F2A44; }
:root[data-theme="dark"] .btn-primary { color: #2B2440; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #2B2440; } }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* Discovery section */
.discovery h2 { font-size: 1.7rem; margin-bottom: 6px; }
.discovery > p.intro { color: var(--fg-dim); margin: 0 0 30px; max-width: 56ch; }
.cat { margin-block: 36px; }
.cat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.cat-head h3 { font-size: 1.25rem; }
.cat-head p { color: var(--fg-dim); font-size: 0.9rem; margin: 2px 0 0; }
.cat-head a { font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.card-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 16px 4px 16px; overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
  text-decoration: none; color: var(--fg);
}
.card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card .card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.card .kicker { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.card h4 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; margin: 0; }
.card p { font-size: 0.85rem; color: var(--fg-dim); margin: 0; }

/* Hub pages: a 2-column article-list layout -- large image on top,
   title/text below, like a blog listing rather than a small discovery
   card grid. */
.hub-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.hub-list-item {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 16px 4px 16px; overflow: hidden; text-decoration: none; color: var(--fg);
}
.hub-list-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hub-list-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.hub-list-body .kicker { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.hub-list-body h4 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 0; }
.hub-list-body p { font-size: 0.92rem; color: var(--fg-dim); margin: 0; }
@media (max-width: 640px) {
  .hub-list { grid-template-columns: 1fr; }
}

/* About-the-author callout */
.callout {
  display: flex; align-items: center; justify-content: flex-start; gap: 24px;
  background: var(--dusk); color: #FBF3EA; border-radius: 4px 24px 4px 24px;
  padding: 36px 32px; margin-block: 56px; flex-wrap: wrap;
}
.callout-avatar {
  /* align-items: stretch on .callout + aspect-ratio + width:auto on
     this element created a circular sizing dependency (nothing else
     tall enough to bound the row, so the image rendered at its full
     intrinsic size). Bounded explicitly instead: height matches the
     text block in the common case without the feedback loop. */
  flex: none; width: auto; height: 110px; aspect-ratio: 1; align-self: center;
  object-fit: cover; border-radius: 4px 18px 4px 18px;
}
.callout-copy { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.callout .written-by { display: block; color: var(--ochre); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.callout .author-name { font-size: 1.5rem; margin: 4px 0 0; color: #FBF3EA; }
.callout .author-title { font-size: 0.85rem; color: var(--clay); margin: 2px 0 0; }
.callout p { color: #D8CFC0; margin-top: 8px; font-size: 0.92rem; }
.callout .btn-primary { align-self: center; }

footer.site {
  border-top: 1px solid var(--border); padding-block: 32px; margin-top: 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted);
}
footer.site a { color: var(--muted); }

/* Article page */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 18px 0; }
.breadcrumb a { color: var(--muted); }
.article-hero img { border-radius: 4px 20px 4px 20px; aspect-ratio: 16/9; object-fit: cover; width: 100%; border: 1px solid var(--border); }
.article-meta { display: flex; align-items: center; gap: 10px; margin: 16px 0 28px; font-size: 0.9rem; color: var(--fg-dim); }
.article-meta img { width: 32px; height: 32px; border-radius: 50%; }
.article-body { font-size: 1.05rem; line-height: 1.7; max-width: 76ch; margin-inline: auto; }
.article-body h2 { font-size: 1.4rem; margin-top: 2.2em; }
.article-body p { margin: 1em 0; }
.signature-underline { text-decoration: none; border-bottom: 2px solid var(--ochre); }
.ad-slot {
  min-height: 250px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 4px;
  color: var(--muted); font-size: 0.8rem; margin: 2.2em 0;
}
.share-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 20px 4px 20px; padding: 24px; margin: 2.2em 0; text-align: center;
}
.share-block p { font-family: var(--font-display); font-size: 1.15rem; font-style: italic; margin: 0 0 16px; }
.share-row { display: flex; justify-content: center; gap: 10px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none;
}
.share-btn:hover { background: var(--ochre); color: #1F2A44; border-color: var(--ochre); }
.share-btn.copied { background: var(--ochre); color: #1F2A44; border-color: var(--ochre); }
.share-btn-wrap { position: relative; display: inline-flex; }
.copy-feedback {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--dusk); color: #FBF3EA; font-size: 0.78rem; font-weight: 600;
  padding: 5px 10px; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-feedback::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--dusk);
}
.copy-feedback.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.related-block { margin: 3em 0 1em; max-width: 76ch; margin-inline: auto; }
.related-block h3 { font-size: 1.25rem; margin-bottom: 16px; }
.related-block .card-row { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .related-block .card-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .related-block .card-row { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero-feature { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: repeat(2, 1fr); }
  nav.primary { display: none; }
  .header-actions { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 480px) {
  .card-row { grid-template-columns: 1fr; }
}
