/* ==========================================================================
   Larch — site styles
   Layered on Bootstrap 5.3. Colours, type and accessible pairings follow the
   Larch Visual Identity (Refined V0.1).
   ========================================================================== */

:root {
  /* Brand palette */
  --larch-amber: #E5A400;
  --larch-sapwood: #F1E4CE;
  --larch-russet: #BD5800;
  --larch-paper: #F9F6EC;
  --larch-heartwood: #825A40;
  --larch-driftwood: #D2C5B2;
  --larch-bark: #381712;
  --larch-white: #FFFFFF;

  /* Type */
  --larch-serif: "Sentient", Georgia, "Times New Roman", serif;
  --larch-sans: "Source Sans 3", Arial, Helvetica, sans-serif;
  --larch-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--larch-sans);
  --bs-body-color: var(--larch-bark);
  --bs-body-bg: var(--larch-paper);
  --bs-emphasis-color: var(--larch-bark);
  --bs-heading-color: var(--larch-bark);
  --bs-link-color: var(--larch-russet);
  --bs-link-color-rgb: 189, 88, 0;
  --bs-link-hover-color: var(--larch-bark);
  --bs-link-hover-color-rgb: 56, 23, 18;
  --bs-border-color: var(--larch-driftwood);
  --bs-focus-ring-color: rgba(189, 88, 0, .35);

  --larch-radius: 1rem;
  --larch-section-y: clamp(4rem, 9vw, 7.5rem);
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--larch-paper);
  color: var(--larch-bark);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3, .display-serif {
  font-family: var(--larch-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

h4, h5, h6 { font-family: var(--larch-sans); font-weight: 700; }

.display-hero { font-size: clamp(2.75rem, 6.2vw, 5rem); }
.display-section { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
.display-statement { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.15; }

.lead { font-size: 1.2rem; font-weight: 400; }

.eyebrow {
  font-family: var(--larch-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.mono {
  font-family: var(--larch-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tagline { font-size: .9rem; letter-spacing: .16em; }

.text-russet { color: var(--larch-russet) !important; }
.text-heartwood { color: var(--larch-heartwood) !important; }
.text-bark { color: var(--larch-bark) !important; }
.text-sapwood { color: var(--larch-sapwood) !important; }
.text-amber { color: var(--larch-amber) !important; }

.measure { max-width: 38rem; }
.measure-wide { max-width: 48rem; }

/* --- Surfaces (only the accessible pairings from the guidelines) ---------- */

.bg-paper { background-color: var(--larch-paper); }
.bg-sapwood { background-color: var(--larch-sapwood); }
.bg-amber { background-color: var(--larch-amber); color: var(--larch-bark); }
.bg-bark { background-color: var(--larch-bark); color: var(--larch-sapwood); }
.bg-bark h1, .bg-bark h2, .bg-bark h3 { color: var(--larch-sapwood); }

.textured {
  background-color: var(--larch-amber);
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .22 0 0 0 0 .09 0 0 0 0 .07 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 15% 20%, rgba(189, 88, 0, .55), transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(189, 88, 0, .45), transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(229, 164, 0, .9), transparent 45%);
}

.section { padding-block: var(--larch-section-y); }

/* --- Buttons ------------------------------------------------------------- */

.btn { border-radius: 999px; font-weight: 600; padding: .7rem 1.6rem; }

.btn-russet {
  --bs-btn-color: var(--larch-white);
  --bs-btn-bg: var(--larch-russet);
  --bs-btn-border-color: var(--larch-russet);
  --bs-btn-hover-color: var(--larch-white);
  --bs-btn-hover-bg: #9f4a00;
  --bs-btn-hover-border-color: #9f4a00;
  --bs-btn-active-color: var(--larch-white);
  --bs-btn-active-bg: #8a4000;
  --bs-btn-active-border-color: #8a4000;
  --bs-btn-focus-shadow-rgb: 189, 88, 0;
}

.btn-amber {
  --bs-btn-color: var(--larch-bark);
  --bs-btn-bg: var(--larch-amber);
  --bs-btn-border-color: var(--larch-amber);
  --bs-btn-hover-color: var(--larch-bark);
  --bs-btn-hover-bg: #f0b31a;
  --bs-btn-hover-border-color: #f0b31a;
  --bs-btn-active-color: var(--larch-bark);
  --bs-btn-active-bg: #d69900;
  --bs-btn-active-border-color: #d69900;
  --bs-btn-focus-shadow-rgb: 229, 164, 0;
}

.btn-bark {
  --bs-btn-color: var(--larch-sapwood);
  --bs-btn-bg: var(--larch-bark);
  --bs-btn-border-color: var(--larch-bark);
  --bs-btn-hover-color: var(--larch-paper);
  --bs-btn-hover-bg: #52241c;
  --bs-btn-hover-border-color: #52241c;
  --bs-btn-active-color: var(--larch-paper);
  --bs-btn-active-bg: #2a100c;
  --bs-btn-active-border-color: #2a100c;
  --bs-btn-focus-shadow-rgb: 56, 23, 18;
}

.btn-outline-paper {
  --bs-btn-color: var(--larch-paper);
  --bs-btn-border-color: var(--larch-paper);
  --bs-btn-hover-color: var(--larch-bark);
  --bs-btn-hover-bg: var(--larch-paper);
  --bs-btn-hover-border-color: var(--larch-paper);
  --bs-btn-active-color: var(--larch-bark);
  --bs-btn-active-bg: var(--larch-sapwood);
  --bs-btn-active-border-color: var(--larch-sapwood);
  --bs-btn-focus-shadow-rgb: 249, 246, 236;
}

.btn-outline-bark {
  --bs-btn-color: var(--larch-bark);
  --bs-btn-border-color: var(--larch-bark);
  --bs-btn-hover-color: var(--larch-paper);
  --bs-btn-hover-bg: var(--larch-bark);
  --bs-btn-hover-border-color: var(--larch-bark);
  --bs-btn-active-color: var(--larch-paper);
  --bs-btn-active-bg: var(--larch-bark);
  --bs-btn-active-border-color: var(--larch-bark);
  --bs-btn-focus-shadow-rgb: 56, 23, 18;
}

/* --- Navigation ---------------------------------------------------------- */

.site-nav {
  background: rgba(249, 246, 236, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  transition: box-shadow .25s ease;
  padding-block: .85rem;
}
.site-nav.is-scrolled { box-shadow: 0 1px 0 var(--larch-driftwood); }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--larch-bark);
  text-decoration: none;
}
.brand-lockup:hover { color: var(--larch-bark); }
.brand-lockup img { height: 2.1rem; width: auto; }
.wordmark {
  font-family: var(--larch-serif);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
  transform: translateY(-1px);
}

.site-nav .nav-link {
  color: var(--larch-bark);
  font-weight: 500;
  padding-inline: .9rem !important;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active { color: var(--larch-russet); }
.site-nav .navbar-toggler { border: 0; box-shadow: none; }

/* --- Hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 8vw, 7rem); }

/* Full-bleed photo hero: from lg up the photo fills the right of the band and fades into bark behind the text */
.hero-photo {
  position: relative;
  display: grid;
  min-height: clamp(34rem, 82vh, 50rem);
  padding-block: 0;
  overflow: hidden;
  background: var(--larch-bark);
  color: var(--larch-paper);
}
.hero-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 35%;
}
.hero-photo-content {
  position: relative;
  display: grid;
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
  background: linear-gradient(rgba(56, 23, 18, .55), rgba(56, 23, 18, .85) 45%, rgba(56, 23, 18, .9));
}
.hero-photo h1 { color: var(--larch-paper); }
@media (min-width: 992px) {
  .hero-photo-img { left: 40%; width: 60%; object-position: 55% 35%; }
  .hero-photo-content { background: linear-gradient(90deg, var(--larch-bark) 0%, var(--larch-bark) 40%, rgba(56, 23, 18, .6) 44%, rgba(56, 23, 18, 0) 54%); }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-photo-img { object-position: 40% 35%; } /* narrower box: pull the crop left so the hand stays whole */
}

/* Personal-baseline chart (statement section) */
.baseline-chart {
  position: relative;
  border-radius: calc(var(--larch-radius) * 1.5);
  overflow: hidden;
}
.baseline-chart svg { display: block; width: 100%; height: auto; }

/* Data-label motif (the "pinchClose 0.97" callouts used across the brand) */
.data-tag {
  font-family: var(--larch-mono);
  font-size: 11px;
  letter-spacing: .08em;
}

.baseline-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
}
.js .baseline-line { stroke-dashoffset: 1000; }
.js .is-visible .baseline-line { animation: draw-line 2.2s .3s ease-out forwards; }
.js .baseline-point, .js .baseline-today { opacity: 0; }
.js .is-visible .baseline-point { animation: fade-in .4s ease-out forwards; }
.js .is-visible .baseline-today { animation: fade-in .6s 2.3s ease-out forwards; }

@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* --- Timeline (stages of change) ----------------------------------------- */

.stage-track { display: flex; gap: 4px; margin-top: 2.5rem; }
.stage {
  min-width: 0;
  padding: 1.1rem 1rem 1rem;
  border-radius: .5rem;
}
.stage-preclinical { flex: 40 1 0; background: var(--larch-driftwood); color: var(--larch-bark); }
.stage-sci { flex: 22 1 0; background: var(--larch-amber); color: var(--larch-bark); }
.stage-mci { flex: 16 1 0; background: var(--larch-russet); color: var(--larch-white); }
.stage-dementia { flex: 22 1 0; background: var(--larch-bark); color: var(--larch-sapwood); }
.stage-name { font-weight: 700; display: block; line-height: 1.2; }
.stage-years { font-family: var(--larch-mono); font-size: .8rem; letter-spacing: .04em; }

.stage-window {
  position: relative;
  margin-top: .9rem;
  width: 62%;
  border-top: 2px solid var(--larch-bark);
  padding-top: .6rem;
  font-size: .8rem;
}
.stage-window::before,
.stage-window::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 2px;
  height: 14px;
  background: var(--larch-bark);
}
.stage-window::before { left: 0; }
.stage-window::after { right: 0; }

@media (max-width: 767.98px) {
  .stage-track { flex-direction: column; }
  .stage { flex: none !important; }
  .stage-window { width: 100%; }
}

/* --- Why movement -------------------------------------------------------- */

.signal-list { list-style: none; padding: 0; margin: 2rem 0; }
.signal-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1rem;
  border-top: 1px solid rgba(241, 228, 206, .2);
  font-size: 1.15rem;
}
.signal-list li:last-child { border-bottom: 1px solid rgba(241, 228, 206, .2); }
.signal-list .mono { color: var(--larch-amber); font-size: .78rem; flex: 0 0 auto; min-width: 7.5rem; }

.feature-card {
  height: 100%;
  border-radius: var(--larch-radius);
  overflow: hidden;
  background: rgba(241, 228, 206, .06);
  border: 1px solid rgba(241, 228, 206, .16);
}
.feature-media { aspect-ratio: 3 / 2; }
.feature-body { padding: 1.75rem 2rem 2rem; }
.feature-card h3 { color: var(--larch-amber); font-size: 1.6rem; margin-bottom: .75rem; }

/* --- How it works -------------------------------------------------------- */

.moments { counter-reset: moment; position: relative; }
@media (min-width: 992px) {
  .moments::before {
    content: "";
    position: absolute;
    top: calc(var(--bs-gutter-y) + 1.05rem);
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: var(--larch-amber);
  }
}
.moment { text-align: center; position: relative; padding-inline: .5rem; }
.moment-tag {
  display: inline-block;
  position: relative;
  background: var(--larch-paper);
  border: 1px solid var(--larch-amber);
  color: var(--larch-bark);
  font-family: var(--larch-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .45rem .9rem;
  margin-bottom: 1.5rem;
}
.moment-tag::before {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: var(--larch-amber);
}
.moment-num { font-family: var(--larch-mono); font-size: .75rem; color: var(--larch-heartwood); display: block; }
.moment h3 { font-size: 2rem; margin: .25rem 0 .6rem; }
.moment p { color: var(--larch-heartwood); max-width: 15rem; margin-inline: auto; }

/* --- Audiences ----------------------------------------------------------- */

.audience-card {
  height: 100%;
  background: var(--larch-paper);
  border-radius: var(--larch-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.audience-media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.audience-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
}
.audience-card h3 { font-family: var(--larch-sans); font-weight: 700; font-size: 1.6rem; line-height: 1.15; margin-bottom: 1.25rem; }
.audience-card .btn { align-self: flex-start; margin-top: auto; }
.audience-card p:last-of-type { margin-bottom: 1.75rem; }

/* --- Mood imagery ------------------------------------------------------- */

/* A light warm grade so stock photography sits inside the amber/bark palette */
.mood-img { filter: sepia(.22) saturate(1.05) contrast(1.03); }

.photo-tagged { position: relative; overflow: hidden; }
.photo-tagged img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-portrait { border-radius: var(--larch-radius); aspect-ratio: 4 / 5; max-width: 26rem; }

/* HTML version of the brand's data-label callout */
.photo-tag {
  position: absolute;
  font-family: var(--larch-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--larch-paper);
  background: rgba(56, 23, 18, .35);
  border: 1px solid var(--larch-amber);
  padding: .3rem .6rem;
  white-space: nowrap;
  pointer-events: none;
}
.photo-tag::before {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: var(--larch-amber);
}

.mood-band {
  position: relative;
  min-height: clamp(22rem, 48vw, 36rem);
  display: grid;
  overflow: hidden;
  background: var(--larch-bark);
}
.mood-band-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(.3) saturate(1.05);
}
.mood-band-content {
  position: relative;
  display: grid;
  align-items: center;
  padding-block: 4rem;
  color: var(--larch-paper);
  background: linear-gradient(rgba(56, 23, 18, .45), rgba(56, 23, 18, .6));
}
.brand-lockup-xl { gap: clamp(.9rem, 2vw, 1.6rem); margin-bottom: 1.25rem; }
.brand-lockup-xl, .brand-lockup-xl:hover { color: var(--larch-paper); }
.brand-lockup-xl img { height: clamp(4.5rem, 10vw, 7.5rem); }
.brand-lockup-xl .wordmark { font-size: clamp(4.5rem, 11vw, 8.5rem); }
.mood-band .tagline { font-size: clamp(.8rem, 1.6vw, 1.15rem); color: var(--larch-paper); }

.mood-strip { height: clamp(14rem, 32vw, 26rem); overflow: hidden; }
.mood-strip img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }

/* --- Evidence ------------------------------------------------------------ */

.stat { border-top: 2px solid var(--larch-bark); padding-top: 1.25rem; height: 100%; }
.stat-value { font-family: var(--larch-serif); font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1; display: block; margin-bottom: .5rem; }
.stat-label { color: var(--larch-heartwood); }

/* --- Team ---------------------------------------------------------------- */

.team-avatar {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 50%;
  background: var(--larch-sapwood);
  color: var(--larch-russet);
  display: grid;
  place-items: center;
  font-family: var(--larch-serif);
  font-size: 2.6rem;
  margin: 0 auto 1.5rem;
  overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-member { text-align: center; }
.team-member h3 { font-size: 1.45rem; color: var(--larch-russet); margin-bottom: .2rem; }
.team-role { font-weight: 700; font-size: .9rem; display: block; margin-bottom: .75rem; }
.team-member p { font-size: .95rem; color: var(--larch-bark); max-width: 17rem; margin-inline: auto; }

/* --- Contact ------------------------------------------------------------- */

.contact-card {
  background: var(--larch-paper);
  border-radius: calc(var(--larch-radius) * 1.25);
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow: 0 30px 60px -30px rgba(56, 23, 18, .45);
}
.form-label { font-weight: 600; font-size: .95rem; }
.form-control, .form-select {
  border-color: var(--larch-driftwood);
  background-color: var(--larch-white);
  border-radius: .6rem;
  padding: .7rem .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--larch-russet);
  box-shadow: 0 0 0 .25rem rgba(189, 88, 0, .2);
}
.form-check-input:checked { background-color: var(--larch-russet); border-color: var(--larch-russet); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; border-radius: .6rem; padding: 1rem 1.25rem; margin-top: 1.25rem; }
.form-status.is-success { display: block; background: var(--larch-sapwood); }
.form-status.is-error { display: block; background: var(--larch-bark); color: var(--larch-sapwood); }

/* --- Science page -------------------------------------------------------- */

.method-step { border-top: 2px solid var(--larch-amber); padding-top: 1.25rem; height: 100%; }
.method-step h3 { font-size: 1.75rem; margin-bottom: .75rem; }

.doc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--larch-paper);
  border: 1px solid var(--larch-driftwood);
  border-radius: var(--larch-radius);
  padding: 1.75rem;
  color: var(--larch-bark);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.doc-card:hover {
  color: var(--larch-bark);
  border-color: var(--larch-russet);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px rgba(56, 23, 18, .45);
}
.doc-card h3 { font-family: var(--larch-sans); font-weight: 700; font-size: 1.25rem; line-height: 1.25; margin: 1rem 0 .5rem; }
.doc-card p { color: var(--larch-heartwood); font-size: .95rem; }
.doc-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .9rem; font-weight: 600; color: var(--larch-russet); }
.doc-type {
  align-self: flex-start;
  font-family: var(--larch-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  border: 1px solid var(--larch-amber);
  padding: .3rem .6rem;
}

.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { padding-block: 1.25rem; border-top: 1px solid var(--larch-driftwood); }
.pub-list li:last-child { border-bottom: 1px solid var(--larch-driftwood); }
.pub-title { font-family: var(--larch-serif); font-size: 1.3rem; line-height: 1.25; display: block; margin-bottom: .3rem; }
.pub-meta { color: var(--larch-heartwood); font-size: .95rem; }

/* --- Footer -------------------------------------------------------------- */

.site-footer { padding-block: 4rem 2.5rem; }
.site-footer a { color: var(--larch-sapwood); text-decoration: none; }
.site-footer a:hover { color: var(--larch-amber); }
.site-footer .brand-lockup { color: var(--larch-sapwood); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-legal { border-top: 1px solid rgba(241, 228, 206, .18); margin-top: 3rem; padding-top: 1.5rem; font-size: .875rem; color: var(--larch-driftwood); }

/* --- Reveal on scroll ---------------------------------------------------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .baseline-line { stroke-dashoffset: 0; animation: none !important; }
  .js .baseline-point, .js .baseline-today { opacity: 1; animation: none !important; }
}

/* --- Utilities ----------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 2000;
  background: var(--larch-bark);
  color: var(--larch-paper);
  padding: .5rem 1rem;
  border-radius: .5rem;
}
.skip-link:focus { top: 1rem; color: var(--larch-paper); }

:focus-visible { outline: 3px solid var(--larch-russet); outline-offset: 3px; }
