/* ==========================================================================
   Trellis Atomics — site CSS (TA-SITE-02, "The Long Lath")
   Foundation build. Implements ONLY the classes in TA-SITE-02 §5 plus bare
   semantic HTML. No lattice/cross-hatch texture. No band rhythm. No new
   colors beyond the nine tokens below (rgba() of those tokens is allowed).
   ========================================================================== */

:root {
  --canopy: #17402F;
  --fern: #3E7A57;
  --sage: #A9BCA4;
  --seedpaper: #F6F2E8;
  --greenhouse: #FCFAF3;
  --loam: #22271F;
  --glory: #5A6EC8;
  --night-garden: #111811;
  --night-surface: #1A231B;

  /* paper (light) context — the ground for ~85% of every page */
  --bg: var(--seedpaper);
  --surface: var(--greenhouse);
  --ink: var(--loam);
  --ink-muted: rgba(34, 39, 31, .62);
  --heading: var(--canopy);
  --link: var(--fern);
  --hairline: rgba(169, 188, 164, .55);
  --hairline-strong: var(--sage);
  --tick-active: var(--fern);

  /* root context — header, footer, .plate-root only */
  --root-bg: var(--night-garden);
  --root-surface: var(--night-surface);
  --root-ink: var(--seedpaper);
  --root-ink-muted: var(--sage);
  --root-hairline: rgba(169, 188, 164, .25);
  --root-link: var(--sage);

  /* terminal CTA plate context (.plate-cta) */
  --cta-bg: var(--canopy);
  --cta-ink: var(--seedpaper);
  --cta-muted: var(--sage);
  --cta-hairline: rgba(246, 242, 232, .2);

  --node: var(--glory); /* the ONE lit node per page — .root-node only */

  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --lath-offset: 7.5rem; /* the single shared measurement the lath aligns to */
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--fern); outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 .5em;
}
h1 { font-size: 4rem; line-height: 1.05; max-width: 22ch; text-align: left; }
h2 { font-size: 2.5rem; line-height: 1.15; }
h3 { font-size: 1.375rem; line-height: 1.25; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
li { font-size: 1.125rem; line-height: 1.7; }

/* dark-context heading/body color corrections */
.plate-root h2, .plate-root h3 { color: var(--root-ink); }
.plate-root p, .plate-root li { color: var(--root-ink-muted); }
.plate-cta h2, .plate-cta h3 { color: var(--cta-ink); }
.plate-cta p, .plate-cta li { color: var(--cta-muted); }

/* ---------- type utilities ---------- */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--link);
  margin-bottom: .75rem;
}
.plate-root .eyebrow { color: var(--root-link); }
.plate-cta .eyebrow { color: var(--cta-muted); }

.lede {
  font-family: var(--font-text);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 36rem;
}

.mono { font-family: var(--font-mono); font-weight: 500; color: var(--link); }
.plate-root .mono, .site-header .mono, .site-footer .mono { color: var(--root-link); }
.plate-cta .mono { color: var(--cta-muted); }

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--heading);
  max-width: 32rem;
  margin: 1.5rem 0;
}
.plate-root .pull-quote, .plate-cta .pull-quote { color: var(--root-ink); }

.legal {
  font-family: var(--font-text);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--root-ink-muted);
}
.plate-cta .legal { color: var(--cta-muted); }

.caption {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-muted);
  margin-top: .6rem;
}

/* ---------- structure & layout ---------- */
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }

/* The lath: one continuous line, drawn once, spanning the full field.
   .lath-field shares .wrap's horizontal box model so the calc() below
   lands exactly at the split's column boundary, everywhere. */
.lath-field {
  position: relative;
  max-width: 76rem;
  margin: 0 auto;
}
.lath-field::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(1.5rem + var(--lath-offset));
  width: 1px;
  background: var(--hairline-strong);
  z-index: 0;
}

.split {
  position: relative;
  z-index: 1; /* sit above the lath line */
  display: grid;
  grid-template-columns: var(--lath-offset) 1fr;
  gap: 2.5rem;
  align-items: start;
}
.split-margin { display: flex; flex-direction: column; }
.split-wide { min-width: 0; }
/* stacked, unclassed content blocks inside the wide column (e.g. the
   homepage Journey blocks) space themselves out without a new class */
.split-wide > div + div { margin-top: 2.5rem; }

.tie { padding: 4.5rem 0; }
.tie .wrap { position: relative; z-index: 1; }

.hero {
  background: var(--bg);
  padding: 5.5rem 0 4.5rem;
}

/* ---------- margin-column components ---------- */
.tie-tick {
  width: 1.25rem;
  height: 2px;
  background: var(--tick-active);
  margin: 0 0 .6rem auto;
}
.tie-tag {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tick-active);
  margin-bottom: .85rem;
}
.plate-root .tie-tag { color: var(--root-link); }

.tie-fact .figure {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}
.plate-root .tie-fact .figure { color: var(--root-ink); }
.tie-fact .figure .unit { font-size: 1rem; color: var(--link); margin-left: .2rem; }
.plate-root .tie-fact .figure .unit { color: var(--root-link); }
.tie-fact p {
  font-family: var(--font-text);
  font-size: .8125rem;
  color: var(--ink-muted);
  margin: .3rem 0 0;
}
.plate-root .tie-fact p { color: var(--root-ink-muted); }

.tie-meta {
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--ink-muted);
}
.plate-root .tie-meta { color: var(--root-ink-muted); }

.hero-specs { display: flex; flex-direction: column; }
.hero-specs .tie-fact {
  padding-top: .9rem;
  margin-top: .9rem;
  border-top: 1px solid var(--hairline);
}
.hero-specs .tie-fact:first-child { padding-top: 0; margin-top: 0; border-top: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--font-text);
  font-size: .98rem;
  padding: .7rem 1.4rem;
  border-radius: 8px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--fern); color: var(--greenhouse); }
.btn--primary:hover { background: var(--canopy); }
.btn--outline { border-color: var(--canopy); color: var(--canopy); }
.btn--outline:hover { background: var(--canopy); color: var(--greenhouse); }
.btn--ghost {
  border-color: rgba(246, 242, 232, .35);
  color: var(--seedpaper);
}
.btn--ghost:hover { border-color: var(--seedpaper); background: rgba(246, 242, 232, .08); }
.btn--sm { padding: .5rem 1rem; font-size: .88rem; }

/* ---------- hero-only ---------- */
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-image { border-radius: 12px; overflow: hidden; margin-top: 2.5rem; }
.hero-image img { width: 100%; }

/* ---------- icons ---------- */
.icon-chip { width: 3.75rem; height: 3.75rem; margin-bottom: 1.1rem; }

/* ---------- Root Zone ---------- */
.plate-root {
  border-radius: 1.25rem;
  background: var(--root-bg);
  padding: 3rem;
  position: relative;
  z-index: 1;
}
.root-node {
  position: absolute;
  top: -.4rem;
  left: var(--lath-offset);
  width: 8px; height: 8px;
  background: var(--node);
  transform: rotate(45deg);
}

/* ---------- terminal CTA ---------- */
.plate-cta {
  background: var(--cta-bg);
  color: var(--cta-ink);
  padding: 4.5rem 0;
}
.plate-cta__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.plate-cta__intro { display: flex; flex-direction: column; gap: .6rem; max-width: 30rem; }
.plate-cta__contact {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1rem;
  text-align: right;
}
.plate-cta__contact div {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--cta-muted);
  line-height: 1.8;
}
.plate-cta__contact a { text-decoration: none; }
.plate-cta__contact a:hover { text-decoration: underline; }

/* ---------- content-area components ---------- */
.timeline { display: flex; flex-direction: column; gap: 1.1rem; max-width: 40rem; margin-top: 1.5rem; }
.timeline-row { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: baseline; }
.timeline-row .time { font-family: var(--font-mono); font-weight: 500; color: var(--link); }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.spec-table tr { border-bottom: 1px solid var(--hairline); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: .85rem .5rem; vertical-align: baseline; }
.spec-table td.k {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-muted); width: 42%;
}
.spec-table td.v { font-family: var(--font-mono); font-size: .95rem; text-align: right; color: var(--ink); }
.plate-root .spec-table tr { border-bottom-color: var(--root-hairline); }
.plate-root .spec-table td.k { color: var(--root-ink-muted); }
.plate-root .spec-table td.v { color: var(--root-ink); }

.faq { border-top: 1px solid var(--hairline); margin-top: 1.5rem; }
.faq details { border-bottom: 1px solid var(--hairline); padding: 1.2rem 0; }
.faq summary {
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem;
  color: var(--heading); cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.3rem; color: var(--link); flex-shrink: 0; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: .8rem; color: var(--ink-muted); max-width: 40rem; }

.role-list { display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.role-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 1.2rem; align-items: center;
  padding: 1.4rem 0; border-bottom: 1px solid var(--hairline);
}
.role-row .title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--heading); }
.role-row .dept { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.role-row .loc { font-family: var(--font-mono); font-size: .85rem; color: var(--ink-muted); }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2rem; margin-top: 1.5rem; }
.team-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; margin-bottom: .9rem; }
.team-card .name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--heading); }
.team-card .role { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .03em; color: var(--link); margin: .2rem 0 .6rem; }
.team-card p { color: var(--ink-muted); font-size: .96rem; }

.news-card { display: block; }
.news-card .date { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .03em; color: var(--link); }
.news-card h3 { margin: .4rem 0 .6rem; }
.news-card p { color: var(--ink-muted); }
.news-card:hover h3 { color: var(--fern); }

.post { max-width: 42rem; }
.post h2 { margin-top: 2rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--root-bg);
  border-bottom: 1px solid var(--root-hairline);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.25rem;
}
.brand-lockup { display: flex; align-items: center; gap: .6rem; }
.brand-lockup img { height: 2.5rem; width: auto; }

.nav-links {
  display: flex; align-items: center; gap: 1.4rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  font-size: .95rem;
  color: var(--root-link);
  white-space: nowrap;
  transition: color .15s ease;
  padding-bottom: .35rem;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--root-ink); }
.nav-links a[aria-current="page"] { color: var(--root-ink); border-bottom-color: var(--fern); }
.nav-links .btn--primary { display: none; }

.nav-right { display: flex; align-items: center; gap: 1.6rem; }
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--root-ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .25rem;
}

/* ---------- footer ---------- */
.site-footer { background: var(--root-bg); color: var(--root-ink-muted); padding: 3.5rem 0 2rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--root-hairline);
}
.footer-grid .brand-lockup img { height: 1.6rem; }
.footer-grid .legal { margin-top: .9rem; max-width: 18rem; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--root-ink); margin: 0 0 .9rem; font-weight: 500;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; color: var(--root-ink-muted); }
.footer-col a { color: var(--root-ink-muted); }
.footer-col a:hover { color: var(--root-ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem;
  padding-top: 1.6rem; font-family: var(--font-mono); font-size: .78rem; color: var(--root-ink-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .lath-field::before { display: none; }
  .split { grid-template-columns: 1fr; gap: 1.25rem; }
  .split-margin {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem;
    padding-bottom: 1rem; border-bottom: 1px solid var(--hairline);
  }
  .plate-root .split-margin { border-bottom-color: var(--root-hairline); }
  .split-margin .tie-tick { margin: 0; }
  .split-margin .tie-tag { margin-bottom: 0; }
  .hero-specs { flex-direction: row; flex-wrap: wrap; gap: 1rem 1.5rem; }
  .hero-specs .tie-fact { padding-top: 0; margin-top: 0; border-top: none; }
}

@media (max-width: 900px) {
  .team-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .role-row { grid-template-columns: 1fr auto; row-gap: .3rem; }
  .role-row .dept, .role-row .loc { grid-column: 1; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 4.25rem 0 0 0; height: calc(100vh - 4.25rem);
    background: var(--root-bg); flex-direction: column; align-items: flex-start;
    padding: 2rem 1.5rem; gap: 1.4rem; transform: translateX(100%);
    transition: transform .2s ease; overflow-y: auto;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; border-bottom: none; }
  .nav-links a[aria-current="page"] { border-bottom: none; color: var(--fern); }
  .nav-toggle { display: block; }
  .nav-right .btn--primary { display: none; }
  .nav-links .btn--primary { display: inline-flex; margin-top: .5rem; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .plate-cta__grid { flex-direction: column; align-items: flex-start; }
  .plate-cta__contact { align-items: flex-start; text-align: left; }
  .role-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Homepage-only: a bigger, bolder opening (does not affect other pages)
   ========================================================================== */

.hero--home { padding: 4rem 0 0; }
.hero--home .hero-kicker {
  display: flex; align-items: center; gap: .9rem; margin-bottom: 2rem;
}
.hero--home .hero-kicker .tie-tag { margin-bottom: 0; white-space: nowrap; }
.hero--home .hero-kicker .eyebrow { margin-bottom: 0; }
.hero--home .hero-kicker::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.hero--home h1 {
  font-size: 6.75rem;
  max-width: 17ch;
  letter-spacing: -.01em;
}
.hero--home .lede { font-size: 1.375rem; max-width: 40rem; }
.hero--home .hero-actions { margin-top: 2.5rem; }

.hero-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: 3.5rem;
}

.hero-bleed img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}

.hero-bleed .caption {
  max-width: 76rem;
  margin: .85rem auto 0;
  padding: 0 1.5rem;
}

/* Mobile */
@media (max-width: 700px) {
  .hero-bleed {
    margin-top: 2rem;
  }

  .hero-bleed img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* ---------- monument stat band ---------- */
.monument { background: var(--root-bg); padding: 4rem 0; }
.monument-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.monument-stats__item { padding: 0 1.75rem; border-left: 1px solid var(--root-hairline); }
.monument-stats__item:first-child { border-left: none; padding-left: 0; }
.monument-stats__value {
  font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: 4rem; line-height: 1; color: var(--root-ink);
}
.monument-stats__value span { font-size: .38em; color: var(--root-link); margin-left: .3rem; font-weight: 500; }
.monument-stats__label {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--root-ink-muted); margin-top: .7rem;
}

/* ---------- product diagram (Anatomy section) ---------- */
.diagram-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; margin-top: 2.25rem; }
.diagram-art { width: 100%; }
.diagram-callouts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.85rem; }
.diagram-callouts__tag {
  display: block; font-family: var(--font-mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--link); margin-bottom: .4rem;
}
.diagram-callouts p { color: var(--ink); margin: 0; }

/* ---------- network diagram ---------- */
.network-art { max-width: 20rem; margin-top: 1.75rem; }

@media (max-width: 1000px) {
  .diagram-grid { grid-template-columns: 1fr; gap: 2rem; }
  .diagram-art { max-width: 24rem; }
}

@media (max-width: 720px) {
  .hero--home h1 { max-width: none; }
  .monument-stats { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .monument-stats__item:nth-child(3) { border-left: none; padding-left: 0; }
}

/* ---------- type scale & spacing: mobile ---------- */
@media (max-width: 720px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  .tie { padding: 3rem 0; }
  .hero { padding: 4rem 0 3rem; }
  .plate-root { padding: 2rem; }
  .plate-cta { padding: 3rem 0; }
  .hero--home { padding: 2.5rem 0 0; }
  .hero--home h1 { font-size: 3rem; }
  .monument { padding: 2.75rem 0; }
  .monument-stats__value { font-size: 2.5rem; }
}
