/* ==========================================================================
   jualoram.com — Living Landscapes · Knowledge · Development
   main.css — tokens, base, typography, layout, header, navigation, footer
   ========================================================================== */

:root {
  /* Palette */
  --forest-black: #17231D;
  --forest: #20382D;
  --moss: #647A55;
  --moss-ink: #4B5E3F;
  --clay: #A9694A;
  --clay-ink: #8A4F33;
  --ochre: #C5A15A;
  --mist: #D9E4DD;
  --limestone: #F2EEE5;
  --sand: #E5D8C5;
  --charcoal: #252A27;
  --sage: #AAB9A6;

  --ink: var(--charcoal);
  --ink-2: #4A504C;
  --ink-3: #5E655F;
  --paper: var(--limestone);
  --rule: rgba(37, 42, 39, .16);
  --rule-strong: rgba(37, 42, 39, .32);
  --rule-dark: rgba(170, 185, 166, .22);

  /* Type */
  --f-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-xs: .78rem;
  --t-sm: .9rem;
  --t-base: 1.0625rem;
  --t-md: 1.2rem;
  --t-lg: clamp(1.35rem, 1.1rem + .9vw, 1.7rem);
  --t-xl: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  --t-2xl: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  --t-3xl: clamp(2.6rem, 1.6rem + 4.4vw, 5.2rem);

  /* Space & layout */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --max-read: 44rem;
  --s-1: .5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: clamp(3rem, 2rem + 4vw, 6rem);
  --s-7: clamp(4rem, 2.5rem + 6vw, 8.5rem);

  --strip-h: 34px;
  --bar-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 24px); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
@supports (overflow-x: clip) { body { overflow-x: clip; } }

/* Access gate: protected content stays hidden until auth.js confirms */
html.gate:not(.auth-ok) body { visibility: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--clay); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-4) 0; }
abbr[title] { text-decoration: none; border-bottom: 1px dotted currentColor; }
::selection { background: var(--ochre); color: var(--forest-black); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .hdr :focus-visible, .ftr :focus-visible, .drawer :focus-visible { outline-color: var(--ochre); }

.skip {
  position: fixed; left: 16px; top: -100px; z-index: 1000;
  background: var(--ochre); color: var(--forest-black);
  padding: .6rem 1rem; font-weight: 600; text-decoration: none; border-radius: 2px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: inherit;
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 .6em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); letter-spacing: -.015em; }
h4 { font-size: var(--t-md); letter-spacing: -.01em; }

.display { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.045em; line-height: .98; }
.lede { font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); line-height: 1.55; color: var(--ink-2); max-width: 40rem; }
.on-dark .lede { color: var(--mist); }
.measure { max-width: var(--max-read); }
.prose p, .prose li { max-width: var(--max-read); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose h3 { margin-top: 1.6em; }
.prose strong { font-weight: 600; color: var(--ink); }
.small { font-size: var(--t-sm); }
.muted { color: var(--ink-2); }

.meta, .kicker {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
}
.kicker { color: var(--clay-ink); display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.on-dark .kicker { color: var(--ochre); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(58rem + 2 * var(--gutter)); }
.section { padding-block: var(--s-6); position: relative; }
.section--tight { padding-block: var(--s-5); }
.section + .section--rule { border-top: 1px solid var(--rule); }

.on-dark { background: var(--forest-black); color: var(--limestone); }
.on-dark .muted, .on-dark .ink-2 { color: var(--sage); }
.on-forest { background: var(--forest); color: var(--limestone); }
.on-mist { background: var(--mist); }
.on-sand { background: var(--sand); }
.on-paper { background: var(--limestone); }

.topo-bg { position: relative; isolation: isolate; }
.topo-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../assets/topo-a-light.svg") center / cover no-repeat;
}
.on-dark.topo-bg::before, .on-forest.topo-bg::before { background-image: url("../assets/topo-b-dark.svg"); }
.topo-bg--c::before { background-image: url("../assets/topo-c-light.svg"); }
.on-dark.topo-bg--c::before { background-image: url("../assets/topo-c-dark.svg"); }

.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); margin-bottom: var(--s-5); }
.section-head__no { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; color: var(--clay-ink); }
.on-dark .section-head__no { color: var(--ochre); }
@media (min-width: 900px) {
  .section-head { grid-template-columns: 11rem minmax(0, 1fr); align-items: baseline; }
  .section-head > :not(.section-head__no) { grid-column: 2; }
  .section-head .section-head__no { grid-row: 1; }
}
.section-head h2 { margin: 0; max-width: 24ch; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 42rem; }
.on-dark .section-head p { color: var(--sage); }

/* Measurement ruler (archival tick marks) */
.ruler {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 10px) bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 100px) bottom / 100% 14px no-repeat;
}
.on-dark .ruler, .ftr .ruler {
  background:
    repeating-linear-gradient(90deg, var(--rule-dark) 0 1px, transparent 1px 10px) bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, rgba(197,161,90,.55) 0 1px, transparent 1px 100px) bottom / 100% 14px no-repeat;
}

/* ==========================================================================
   HEADER — sticky: the coordinate strip scrolls away, the bar stays
   ========================================================================== */
.hdr {
  position: sticky;
  top: calc(-1 * var(--strip-h));
  z-index: 100;
  color: var(--limestone);
}
.hdr__strip {
  height: var(--strip-h);
  background: var(--forest-black);
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
}
.hdr__strip .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hdr__strip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr__strip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ochre); margin-right: .55rem; vertical-align: 1px; }

.hdr__bar {
  height: var(--bar-h);
  background: rgba(23, 35, 29, .96);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-dark);
  transition: box-shadow .3s var(--ease);
}
.hdr.is-stuck .hdr__bar { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6); }
.hdr__bar > .wrap { height: 100%; display: flex; align-items: center; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--limestone); flex-shrink: 0; }
.brand__mark { width: 34px; height: 34px; color: var(--ochre); }
.brand__text { display: grid; line-height: 1.1; }
.brand__name { font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__role { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); margin-top: 3px; }

.nav { margin-left: auto; height: 100%; }
.nav__list { list-style: none; display: flex; align-items: stretch; height: 100%; gap: .25rem; }
.nav__list > li { display: flex; align-items: center; }
.nav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: .4rem;
  height: 100%;
  padding: 0 .85rem;
  background: none; border: 0;
  font-family: var(--f-display); font-weight: 600; font-size: .92rem; letter-spacing: -.005em;
  color: var(--mist); text-decoration: none;
}
.nav__link::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 18px; height: 1px;
  background: var(--ochre); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav__link:hover, .nav__link[aria-expanded="true"] { color: #fff; }
.nav__link:hover::after, .nav__link[aria-expanded="true"]::after, .nav__link[aria-current="page"]::after, .nav__link.is-current::after { transform: scaleX(1); }
.nav__link[aria-current="page"], .nav__link.is-current { color: #fff; }
.nav__link .chev { width: 10px; height: 10px; transition: transform .3s var(--ease); }
.nav__link[aria-expanded="true"] .chev { transform: rotate(180deg); }

.hdr__cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem;
  border: 1px solid rgba(197, 161, 90, .6);
  color: var(--limestone); text-decoration: none;
  font-family: var(--f-display); font-weight: 600; font-size: .88rem;
  border-radius: 2px;
  transition: background .25s, color .25s, border-color .25s;
  flex-shrink: 0;
}
.hdr__cta:hover, .hdr__cta[aria-current="page"] { background: var(--ochre); color: var(--forest-black); border-color: var(--ochre); }

/* Mega menu */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--forest-black);
  border-bottom: 1px solid var(--rule-dark);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
}
.mega::before { content: ""; position: absolute; inset: 0; background: url("../assets/topo-c-dark.svg") right center / 70% auto no-repeat; opacity: .8; pointer-events: none; }
.mega.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mega__inner { position: relative; display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; padding-block: 2.2rem 2.6rem; }
.mega__intro .meta { color: var(--ochre); }
.mega__intro p { color: var(--sage); font-size: var(--t-sm); margin-top: .8rem; }
.mega__grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 2rem; }
.mega__grid a {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0 .6rem;
  padding: .95rem 0; border-top: 1px solid var(--rule-dark);
  text-decoration: none; color: var(--limestone);
}
.mega__grid a .n { grid-row: span 2; font-family: var(--f-mono); font-size: .75rem; color: var(--ochre); padding-top: .2rem; }
.mega__grid a .t { font-family: var(--f-display); font-weight: 700; font-size: 1rem; }
.mega__grid a .d { font-size: .86rem; color: var(--sage); line-height: 1.45; }
.mega__grid a:hover .t, .mega__grid a[aria-current="page"] .t { color: var(--ochre); }

.menu-btn {
  display: none; margin-left: auto;
  align-items: center; gap: .6rem;
  background: none; border: 1px solid var(--rule-dark); color: var(--limestone);
  padding: .55rem .85rem; border-radius: 2px;
  font-family: var(--f-display); font-weight: 600; font-size: .9rem;
}
.menu-btn__icon { width: 18px; height: 12px; position: relative; }
.menu-btn__icon::before, .menu-btn__icon::after, .menu-btn__icon span {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .2s;
}
.menu-btn__icon::before { top: 0; }
.menu-btn__icon span { top: 5.25px; }
.menu-btn__icon::after { bottom: 0; }
.menu-btn[aria-expanded="true"] .menu-btn__icon::before { transform: translateY(5.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__icon::after { transform: translateY(-5.25px) rotate(-45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__icon span { opacity: 0; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: var(--bar-h) 0 0 0; z-index: 99;
  background: var(--forest-black); color: var(--limestone);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem var(--gutter) 3rem;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
}
.drawer.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.drawer__home { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--rule-dark); text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
.drawer__home[aria-current="page"] { color: var(--ochre); }
.drawer__group { border-bottom: 1px solid var(--rule-dark); }
.drawer__toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; color: var(--limestone);
  padding: 1rem 0; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; text-align: left;
}
.drawer__toggle .chev { width: 12px; height: 12px; transition: transform .3s var(--ease); color: var(--ochre); }
.drawer__toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.drawer__list { list-style: none; padding-bottom: .8rem; }
.drawer__list[hidden] { display: none; }
.drawer__list a { display: flex; gap: .9rem; padding: .6rem 0; text-decoration: none; color: var(--mist); font-size: 1rem; }
.drawer__list a .n { font-family: var(--f-mono); font-size: .75rem; color: var(--ochre); min-width: 1.6rem; padding-top: .15rem; }
.drawer__list a[aria-current="page"] { color: #fff; font-weight: 600; }
.drawer__list a[aria-current="page"]::after { content: "Current"; margin-left: auto; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ochre); padding-top: .25rem; }
.drawer__contact { margin-top: 1.6rem; display: grid; gap: .4rem; font-size: .95rem; color: var(--sage); }
.drawer__contact a { color: var(--limestone); }
body.menu-open { overflow: hidden; }

/* ==========================================================================
   PAGE INTRO + BREADCRUMB (shared scaffold)
   ========================================================================== */
.crumbs { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs li { display: inline-flex; align-items: center; gap: .4rem; }
.crumbs li + li::before { content: "/"; opacity: .5; }
.crumbs a { text-decoration: none; opacity: .8; }
.crumbs a:hover { opacity: 1; text-decoration: underline; }
.crumbs [aria-current] { opacity: 1; }

/* ==========================================================================
   FOOTER — "field ledger"
   ========================================================================== */
.ftr { background: var(--forest-black); color: var(--mist); position: relative; isolation: isolate; overflow: hidden; }
.ftr::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../assets/topo-a-dark.svg") center / cover no-repeat; opacity: .9; }
.ftr__head { padding-block: var(--s-6) var(--s-4); display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: end; }
.ftr__title { font-family: var(--f-display); font-weight: 800; letter-spacing: -.04em; font-size: clamp(2.4rem, 1.4rem + 5vw, 5.4rem); line-height: .95; color: var(--limestone); margin: 0; }
.ftr__title span { color: var(--ochre); }
.ftr__note { color: var(--sage); max-width: 30rem; font-size: .98rem; margin: 0; }
.ftr__coords { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); padding-top: .6rem; flex-wrap: wrap; }
.ftr__grid { display: grid; gap: 2.5rem; padding-block: var(--s-5); border-top: 1px solid var(--rule-dark); grid-template-columns: minmax(0, 1fr); }
.ftr h2 { font-family: var(--f-mono); font-size: .74rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ochre); margin-bottom: 1.1rem; }
.ftr__index { list-style: none; columns: 2; column-gap: 1.5rem; }
.ftr__index li { break-inside: avoid; }
.ftr__index a { display: flex; gap: .7rem; padding: .32rem 0; text-decoration: none; color: var(--mist); font-size: .95rem; }
.ftr__index a .n { font-family: var(--f-mono); font-size: .72rem; color: var(--sage); padding-top: .2rem; min-width: 1.4rem; }
.ftr__index a:hover { color: #fff; }
.ftr__index a:hover .n { color: var(--ochre); }
.ftr__contact { display: grid; gap: .35rem; font-style: normal; }
.ftr__contact .name { font-family: var(--f-display); font-weight: 700; color: var(--limestone); font-size: 1.1rem; }
.ftr__contact a { color: var(--mist); text-decoration: none; display: inline-flex; gap: .6rem; align-items: center; padding: .2rem 0; }
.ftr__contact a:hover { color: #fff; text-decoration: underline; }
.ftr__contact svg { width: 16px; height: 16px; color: var(--ochre); flex-shrink: 0; }
.social { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; }
.social a, .social span {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--rule-dark); border-radius: 50%;
  color: var(--limestone); transition: background .25s, color .25s, border-color .25s;
}
.social a:hover { background: var(--ochre); color: var(--forest-black); border-color: var(--ochre); }
.social svg { width: 18px; height: 18px; }
.social span[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.social__note { font-size: .82rem; color: var(--sage); margin-top: .9rem; max-width: 20rem; }
.ftr__bottom { border-top: 1px solid var(--rule-dark); padding-block: 1.4rem; display: flex; flex-wrap: wrap; gap: .8rem 2rem; justify-content: space-between; align-items: center; font-size: .86rem; color: var(--sage); }
.ftr__bottom a { color: var(--mist); }
.ftr__bottom a:hover { color: #fff; }
.lock-btn { background: none; border: 1px solid var(--rule-dark); color: var(--mist); padding: .4rem .8rem; border-radius: 2px; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.lock-btn:hover { border-color: var(--ochre); color: var(--ochre); }

@media (min-width: 760px) {
  .ftr__head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .ftr__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); }
  .ftr__index { columns: 3; }
}
@media (max-width: 759px) {
  .ftr__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Reveal (progressive; content visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Forest-toned sections share the dark-surface text treatment */
.on-forest .lede { color: var(--mist); }
.on-forest .kicker, .on-forest .section-head__no { color: var(--ochre); }
.on-forest .muted, .on-forest .section-head p { color: var(--sage); }
.on-forest h1, .on-forest h2, .on-forest h3 { color: var(--limestone); }
