/* Loamist family site: shared tokens and chrome (header, menu, closing Start section, footer).
   Source of truth: design_handoff_loamist_site/README.md sections 2 and 3.
   Brand rules: one accent (gold), green means verified only, no dark mode. */

:root {
  --ink: #1c1917;
  --ink-2: #3a352f;
  --muted: #6b6660;
  --bone: #faf9f7;
  --bone-2: #f3f1ec;
  --card: #ffffff;
  --line: #e7e2da;
  --gold: #AD7F00;
  --gold-2: #936c00;
  --gold-soft: #FBF3DC;
  --green: #2e7d32;
  --green-soft: #e8f3e9;
  --green-line: #cfe5d1;

  --font-display: "Funnel Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Funnel Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(20px, 3.4vw, 48px);
  --section-pad: clamp(96px, 10vw, 160px);
  --figure-pad: clamp(72px, 8vw, 120px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-raised: 0 10px 30px rgba(28, 25, 23, .10);
  --shadow-gold: 0 10px 26px rgba(173, 127, 0, .35);
  --header-h: 76px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
html, body { margin: 0; background: var(--bone); color: var(--ink); }
body { font: 400 16px/1.55 var(--font-sans); }
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* Text equivalents for canvases (section 9): readable by agents and screen readers, not shown. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Textured gold surface (change order 01, CO-1): light gold, white noise, soft white glow.
   At most twice per page. All text on it is ink (muted and ink-2 fail contrast here); rules use --rule-on-gold;
   cards inside it stay white. */
:root { --rule-on-gold: rgba(28, 25, 23, .22); }
.surface-gold {
  background-color: #F0CF78;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .75 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .55), transparent 65%);
  background-size: 220px 220px, 100% 100%;
  color: var(--ink);
}
.surface-gold .mono, .surface-gold .mono-sm { color: var(--ink); }
.surface-gold--card { border-radius: 14px; padding: 22px 26px; }

/* Type roles */
.mono { font: 500 12px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono-sm { font: 500 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h-section { margin: 0; font: 600 clamp(44px, 6vw, 88px)/0.98 var(--font-display); letter-spacing: -0.035em; }
.h-figure { margin: 0; font: 600 clamp(32px, 4vw, 56px)/1.02 var(--font-display); letter-spacing: -0.03em; }
.h-close { margin: 0; font: 600 clamp(52px, 8.9vw, 128px)/0.95 var(--font-display); letter-spacing: -0.04em; max-width: 1200px; }
.lead { margin: 0; font: 400 clamp(18px, 1.5vw, 21px)/1.5 var(--font-sans); color: var(--ink-2); max-width: 640px; }
.body { font: 400 16px/1.55 var(--font-sans); color: var(--ink-2); }
.big-stat { font: 600 clamp(44px, 4.4vw, 64px)/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.gold { color: var(--gold); }

/* Layout */
.wrap { padding-inline: var(--gutter); }
.section { padding-block: var(--section-pad); padding-inline: var(--gutter); }
.section--figure { padding-block: var(--figure-pad); }
.band-white { background: var(--card); border-block: 1px solid var(--line); }
.rule-ink { border-top: 1.5px solid var(--ink); }
.hair { border-top: 1px solid var(--line); }

/* Buttons and pills */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 16px/1 var(--font-sans); padding: 17px 28px; border-radius: 999px; white-space: nowrap; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #000; color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--sm { font-size: 14px; padding: 11px 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--bone-2); color: var(--ink-2); }
.pill--pending { background: var(--gold-soft); color: var(--gold-2); }
.pill--ok { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-line); }
.dot-ok { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); }
.chip { display: inline-block; font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-radius: 5px; background: var(--bone-2); color: var(--ink-2); }

/* Header (section 3) */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); column-gap: 24px; align-items: center; padding-inline: var(--gutter); background: rgba(250, 249, 247, .94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.2) blur(6px); backdrop-filter: saturate(1.2) blur(6px); }
.site-header__left { display: flex; align-items: center; gap: 16px; justify-self: start; min-width: 0; }
.site-header__logo { display: flex; }
.site-header__logo img { height: 20px; width: auto; display: block; }
.site-header__crumb { display: flex; align-items: center; gap: 16px; }
.site-header__crumb::before { content: ""; width: 1px; height: 20px; background: var(--line); }
/* The side columns never shrink below their content; the live label takes what is left and truncates. */
.site-header__label { justify-self: center; white-space: nowrap; color: var(--ink-2); min-height: 1em; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.site-header__right { display: flex; align-items: center; justify-content: flex-end; gap: 24px; }
.site-header__links { display: none; gap: 24px; }
.site-header__links a { color: var(--ink-2); }
.site-header__links a:hover { color: var(--ink); }
.site-header__menu-btn { border: 0; background: transparent; cursor: pointer; padding: 8px 0; color: var(--ink); }
.site-header__cta { display: none; }
/* The reference shows the text links from 1180px; below that they crowd the live section label. */
@media (min-width: 1180px) { .site-header__links { display: flex; } }
@media (min-width: 640px) { .site-header__cta { display: inline-flex; } }
@media (max-width: 639.98px) {
  .site-header { grid-template-columns: auto 1fr; }
  .site-header__label, .site-header__crumb { display: none; }
}

/* Menu overlay (section 3) */
.site-menu { position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 39; background: var(--bone); overflow-y: auto; opacity: 0; transform: translateY(-12px); pointer-events: none; visibility: hidden; transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s linear .55s; }
.site-menu.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s; }
.site-menu__inner { min-height: 100%; padding: clamp(24px, 4vw, 56px) var(--gutter) 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.site-menu__rows { display: flex; flex-direction: column; }
.site-menu__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.site-menu__row:hover, .site-menu__row.is-current { color: var(--gold); }
.site-menu__row .name { font: 600 clamp(40px, 6vw, 88px)/1 var(--font-display); letter-spacing: -0.035em; }
.site-menu__row .tag { text-align: right; }
.site-menu__row.is-current .tag { color: var(--gold); }
.site-menu__cta { margin-top: 28px; }
.site-menu__foot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 16px 32px; border-top: 1.5px solid var(--ink); padding-top: 22px; }
.site-menu__big { display: flex; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; font: 600 clamp(22px, 2.2vw, 30px)/1.1 var(--font-display); letter-spacing: -0.015em; }
.site-menu__big a { color: var(--ink); }
.site-menu__big a:hover { color: var(--gold); }
.site-menu__small { display: flex; gap: 24px; font: 500 13px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.site-menu__small a { color: var(--ink); }
.site-menu__small a:hover { color: var(--gold); }
@media (max-width: 639.98px) { .site-menu__row { grid-template-columns: 40px minmax(0, 1fr); } .site-menu__row .tag { display: none; } }
body.menu-open { overflow: hidden; }

/* Closing Start section + footer (section 3) */
.site-start { min-height: 100vh; padding: clamp(96px, 10vw, 140px) var(--gutter) 0; display: flex; flex-direction: column; justify-content: space-between; gap: 80px; position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.site-start__map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
/* CO-4: hub pulse over the closing map, same box, so its Natural Earth projection lines up with the land dots. */
loamist-hub-pulse.site-start__pulse { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.site-start__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 40px; }
.site-start__ctas { display: flex; gap: 12px; flex-wrap: wrap; }
/* CO-2d: closing entry cards (home). */
.site-start__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; max-width: 1200px; }
.site-start__card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--ink); transition: background-color .3s var(--ease); }
.site-start__card:first-child { border: 1.5px solid var(--ink); }
.site-start__card:hover { background: var(--gold-soft); color: var(--ink); }
.site-start__card-txt { display: flex; flex-direction: column; gap: 6px; }
.site-start__card-t { font: 600 22px/1.2 var(--font-display); }
.site-start__card-arrow { font: 600 24px var(--font-display); color: var(--gold); }
.site-footer { position: relative; z-index: 1; padding-bottom: 40px; display: flex; flex-direction: column; gap: 28px; }
.site-footer__mark { width: 100%; height: auto; display: block; }
.site-footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font: 500 12px/1.5 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.site-footer__row a { color: var(--muted); }
.site-footer__row a:hover { color: var(--ink); }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 24px 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.site-footer__cols h3 { margin: 0 0 10px; }
.site-footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer__cols a { color: var(--ink-2); font-size: 15px; }
.site-footer__cols a:hover { color: var(--gold); }

/* Small phones: display type must never push the page sideways (a long word like "automatically?"
   at 52px is wider than a 320px screen). Smaller floor, then hyphenate as a last resort. */
@media (max-width: 479px) {
  .h-close { font-size: clamp(38px, 12vw, 52px); }
  .h-close, .h-section, .h-figure, .page-hero h1 { hyphens: auto; overflow-wrap: break-word; }
}

/* Touch targets: standalone small links and controls get a 44px-tall hit area on phones and touch screens
   (WCAG 2.5.8 asks for 24px; 44px is the platform guidance). Inline links inside running text are exempt. */
@media (max-width: 767px), (pointer: coarse) {
  .site-header__logo, .site-footer__row a, .site-footer__cols a, .page-hero__meta a, .page-hero__rule a, .blog-back, .blog-prose a.blog-download,
  .content-card .more, .tf-link, .home-sec__link, .lc-dropzone-browse { display: inline-flex; align-items: center; min-height: 44px; }
  .site-header__logo { margin-block: -12px; }
  .site-footer__cols ul { gap: 0; }
  .tf-range input[type=range], .v-weight input[type=range] { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
