/* House Of Assets: one stylesheet, system fonts, no external requests. */

/* ---------- Tokens: full light palette here, dark overrides below ---------- */
:root {
  --bg: #f8f5ee;
  --surface: #fffdf8;
  --surface-2: #f0ebdf;
  --ink: #1f241b;
  --ink-soft: #3f4539;
  --muted: #5a6054;
  --line: #dcd4c3;
  --brand: #708952;          /* sampled from the logo */
  --brand-strong: #4a6030;   /* text-safe olive, 6.5:1 on --bg */
  --on-brand: #ffffff;
  --notice-bg: #edf1e3;
  --notice-line: #708952;
  --focus: #2b4a12;
  --shadow: 0 1px 2px rgb(31 36 27 / 0.06), 0 4px 16px rgb(31 36 27 / 0.06);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --radius: 0.75rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --container: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151812;
    --surface: #1d2119;
    --surface-2: #1a1e17;
    --ink: #ece8dd;
    --ink-soft: #d3d5ca;
    --muted: #aeb2a4;
    --line: #353b2f;
    --brand: #8fa96d;
    --brand-strong: #b5cc93;
    --on-brand: #151812;
    --notice-bg: #222a1b;
    --notice-line: #8fa96d;
    --focus: #d6e8b8;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--ink);
  font-weight: 700;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-strong); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-soft); max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--brand-strong); margin-bottom: 0.5rem; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--brand-strong); color: var(--on-brand);
  padding: 0.6rem 1rem; border-radius: 0.5rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.6rem 1.25rem;
  background: var(--brand-strong); color: var(--on-brand);
  border: 2px solid var(--brand-strong); border-radius: 999px;
  font-weight: 700; text-decoration: none; line-height: 1.2; text-align: center;
}
.button:hover { filter: brightness(1.1); }
.button--ghost { background: transparent; color: var(--brand-strong); }
.button--ghost:hover { background: var(--notice-bg); filter: none; }

/* ---------- Header and navigation ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; padding-block: 0.5rem; }
.brand { display: inline-flex; border-radius: 0.25rem; flex-shrink: 0; }
.brand img { height: 3.5rem; width: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0.65rem; border-radius: 0.5rem; }
.nav a:hover { background: var(--notice-bg); color: var(--brand-strong); }
.nav a[aria-current="page"] { color: var(--brand-strong); box-shadow: inset 0 -3px 0 var(--brand); border-radius: 0.5rem 0.5rem 0 0; }

.nav--wide { display: none; }
.nav--wide ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.15rem; }

/* Mobile menu: native <details>, works without JavaScript */
.nav--menu summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 2.75rem; padding: 0.5rem 1rem;
  border: 2px solid var(--line); border-radius: 999px;
  font-weight: 700; color: var(--ink); background: var(--surface);
}
.nav--menu summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 1.1rem; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.nav--menu[open] .menu-icon { background: transparent; }
.nav--menu[open] .menu-icon::before { top: 0; transform: rotate(45deg); }
.nav--menu[open] .menu-icon::after { top: 0; transform: rotate(-45deg); }
.nav--menu nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 0.5rem var(--gutter) 1rem;
}
.nav--menu nav a { padding: 0.8rem 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
.nav--menu nav li:last-child a { border-bottom: 0; }
.nav--menu nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--brand); padding-left: 1rem; }

@media (min-width: 64rem) {
  .nav--wide { display: block; }
  .nav--menu { display: none; }
  .brand img { height: 4rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.section--tint { background: var(--surface-2); border-block: 1px solid var(--line); }
.section--flush-top { padding-top: 0; }
.section__title { margin-bottom: 1.5rem; }
.page-head { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); padding-bottom: 2rem; }
.page-head h2 { margin-top: 2rem; }

/* ---------- Home hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; gap: 1.5rem; padding-block: clamp(2rem, 1.5rem + 4vw, 5rem); align-items: center; }
.hero__logo { width: min(70%, 14rem); margin-inline: auto; }
.hero__text h1 { max-width: 18ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; margin-bottom: 0; }
@media (min-width: 56rem) {
  .hero__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; }
  .hero__logo { width: 100%; max-width: 26rem; }
}

/* ---------- Featured guide ---------- */
.feature {
  display: grid; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.feature__media img { width: 100%; }
.feature__body { padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); }
.feature__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
.feature__title a { color: var(--ink); text-decoration: none; }
.feature__title a:hover { text-decoration: underline; }
@media (min-width: 48rem) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
}

/* ---------- Topic cards ---------- */
.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 36rem) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.topic {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid var(--brand); border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem;
}
.topic:hover { box-shadow: var(--shadow); }
.topic:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.topic__title { font-size: 1.25rem; margin-bottom: 0.4rem; }
.topic__title a { color: var(--ink); text-decoration: none; }
.topic__title a::after { content: ""; position: absolute; inset: 0; }
.topic__title a:focus-visible { outline: none; }
.topic p { color: var(--ink-soft); margin-bottom: 0.5rem; }
.topic__count { font-size: 0.875rem; color: var(--muted) !important; margin: 0; }

/* ---------- Article cards ---------- */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card__media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card__title a:focus-visible { outline: none; }
.card:hover .card__title a { text-decoration: underline; }
.card__desc { color: var(--ink-soft); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta > :not([aria-hidden]) { white-space: nowrap; }
.card__meta { margin-top: auto; margin-bottom: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Resources band ---------- */
.resources-band { display: grid; gap: 1rem; align-items: center; }
.resources-band p { max-width: 60ch; color: var(--ink-soft); }
@media (min-width: 48rem) { .resources-band { grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; } .resources-band .section__title { margin-bottom: 0.75rem; } }

/* ---------- Breadcrumb ---------- */
.breadcrumb ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.breadcrumb li { min-width: 0; }
.breadcrumb li + li::before { content: "/"; margin-inline: 0.5rem; color: var(--line); }
@media (prefers-color-scheme: dark) { .breadcrumb li + li::before { color: var(--muted); } }
.breadcrumb [aria-current] { color: var(--ink-soft); }

/* ---------- Article ---------- */
.article { --article-width: 48rem; padding-bottom: 3rem; }
.article > .container { max-width: calc(var(--article-width) + 2 * var(--gutter)); }
.article__header { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); }
.article__header h1 { max-width: 24ch; }
.article__meta { color: var(--muted); font-size: 0.95rem; }
.notice {
  background: var(--notice-bg); border-left: 4px solid var(--notice-line);
  border-radius: 0 0.5rem 0.5rem 0; padding: 0.9rem 1.1rem; margin: 1.25rem 0 0; max-width: 48rem;
  font-size: 0.95rem; color: var(--ink-soft);
}
.notice p { margin: 0; }
.notice__updated { color: var(--ink); font-size: 1rem; margin-bottom: 0.3rem !important; }
.article__hero { margin-block: 2rem 0; }
.article__hero img {
  width: 100%; max-height: 26rem; object-fit: contain;
  background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--line);
}
.article__layout { display: grid; gap: 2rem; margin-top: 2rem; }
.article__layout > * { min-width: 0; }
@media (min-width: 70rem) {
  .article:has(.has-toc) { --article-width: 70rem; }
  .article__layout.has-toc { grid-template-columns: minmax(0, 46rem) minmax(14rem, 1fr); gap: 3.5rem; align-items: start; }
  .article__layout.has-toc .toc { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
  .article__layout.has-toc .prose { grid-column: 1; grid-row: 1; }
  .article:has(.has-toc) .article__header,
  .article:has(.has-toc) .article__hero,
  .article:has(.has-toc) .article__footer { padding-right: calc(var(--gutter) + 17.5rem); }
}

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.95rem; }
.toc__title { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.5rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin-block: 0.35rem; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--brand-strong); text-decoration: underline; }

/* ---------- Prose (article body) ---------- */
.prose { font-size: 1.125rem; line-height: 1.75; max-width: 68ch; overflow-wrap: break-word; }
.prose > * + * { margin-top: 0; }
.prose h2 { margin-top: 2.25em; margin-bottom: 0.6em; scroll-margin-top: 1rem; }
.prose h3, .prose h4, .prose h5, .prose h6 { margin-top: 1.8em; scroll-margin-top: 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose figure, .prose .table-wrap { margin-bottom: 1.25em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-block: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; margin-bottom: 0.4em; }
.prose li::marker { color: var(--brand-strong); }
.prose strong { color: var(--ink); }
.prose a { overflow-wrap: anywhere; }
.prose img { border-radius: 0.5rem; border: 1px solid var(--line); }
.prose figure { margin-inline: 0; }
.prose figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; font-style: italic; }
.md-figure img { margin-inline: auto; }
.prose img.is-portrait { max-width: min(100%, 26rem); }
.prose blockquote { margin-inline: 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 4px solid var(--brand); color: var(--ink-soft); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 0.3em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }

.video-link a {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.4; font-size: 1rem;
}
.video-link a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.video-link__badge {
  flex-shrink: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--brand-strong); color: var(--on-brand); padding: 0.3rem 0.55rem; border-radius: 0.35rem;
}
.video-link__title { overflow-wrap: anywhere; }

/* ---------- Article footer ---------- */
.article__footer { margin-top: 2.5rem; }
.tags { margin-bottom: 2rem; max-width: 48rem; }
.tags__title { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tags ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags a {
  display: inline-block; padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.875rem; color: var(--ink-soft); text-decoration: none; background: var(--surface);
}
.tags a:hover { border-color: var(--brand); color: var(--brand-strong); }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: 48rem; }
.callout h2 { font-size: 1.2rem; }
.callout p:last-child { margin-bottom: 0; }
.contact-cta { margin-block: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 3rem; font-size: 0.95rem; color: var(--ink-soft); }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.site-footer__brand { font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem; color: var(--ink); margin-bottom: 0.4rem; }
.site-footer__heading { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer a { overflow-wrap: anywhere; }
.site-footer__base { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-block: 1.25rem; font-size: 0.875rem; color: var(--muted); }
.site-footer__base p { margin: 0; }

@media print {
  .site-header, .site-footer, .toc, .section--tint, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
