/* =============================================================
   Heart Seeds Alchemy — shared stylesheet
   Tokens · typography · texture · nav · footer · fade utilities
   ============================================================= */

/* ---------- Color tokens (from design system) ---------- */
:root {
  /* Earth & Light */
  --cream: #FDFAF4;
  --parchment: #F5EDDA;
  --linen: #EAD9B8;
  --root: #5C3D22;
  --deep-soil: #1C0D08;

  /* Red Thread */
  --blush: #F5E8E5;
  --thread-light: #E06040;
  --red-thread: #C0391F;
  --deep-thread: #A8301C;

  /* Gold */
  --pale-gold: #F2DEB8;
  --honey-gold: #D4AA3F;

  /* Fern & Growth */
  --seedling: #E8F0E3;
  --fern-light: #7AAF68;
  --fern: #4A7A3A;
  --forest-deep: #2D4A25;

  /* Rain & Water */
  --mist: #EAF2F5;
  --cloud: #C2D8E0;
  --rain: #7BA8B8;
  --river: #4D7F94;
  --deep-water: #2D5A6E;

  /* Semantic */
  --bg-page: var(--cream);
  --bg-section-alt: var(--parchment);
  --text-body: var(--root);
  --text-display: var(--deep-soil);
  --accent-primary: var(--red-thread);
  --accent-warm: var(--honey-gold);

  /* Typography */
  --font-display: 'Baskervville', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Serif Pro', 'EB Garamond', Georgia, serif;
  --font-label: 'Inter', system-ui, -apple-system, sans-serif;

  /* Layout */
  --measure-narrow: 36rem;     /*  ~576px reading column */
  --measure-text:   40rem;     /*  ~640px primary column */
  --measure-wide:   64rem;     /* 1024px content cap     */
  --pad-section:    clamp(3rem, 8vw, 6rem);
  --pad-edge:       clamp(1.25rem, 5vw, 2.5rem);
}

/* ---------- Reset + base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;        /* 17px base — invites lingering */
  line-height: 1.7;
  color: var(--text-body);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Paper texture (subtle, ~3% noise) ---------- */
/* Inline SVG turbulence — no extra asset, no blocking */
.has-paper-texture {
  position: relative;
  isolation: isolate;
}
.has-paper-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.36  0 0 0 0 0.24  0 0 0 0 0.13  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  color: var(--text-display);
  line-height: 1.18;
  margin: 0 0 0.6em;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }

p { margin: 0 0 1.1em; }
em, i { font-style: italic; }

.label {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-body);
}

.lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.45;
  color: var(--text-display);
}

/* ---------- Layout primitives ---------- */
.section {
  padding: var(--pad-section) var(--pad-edge);
  background-color: var(--bg-page);
}
.section--parchment { background-color: var(--bg-section-alt); }
.container {
  width: 100%;
  max-width: var(--measure-wide);
  margin: 0 auto;
}
.container--narrow { max-width: var(--measure-narrow); }
.container--text   { max-width: var(--measure-text); }
.text-center { text-align: center; }

/* ---------- Red thread divider ---------- */
.thread-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 2.5rem auto;
  width: 100%;
}
.thread-divider::before,
.thread-divider::after {
  content: '';
  display: block;
  height: 1px;
  width: 3.5rem;
  background: var(--accent-primary);
  opacity: 0.85;
}
.thread-divider::after { width: 3.5rem; }
.thread-divider .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* Single thin line with no dot — for the hero */
.thread-line {
  display: block;
  height: 1px;
  width: 5rem;
  background: var(--accent-primary);
  margin: 1.75rem auto 0;
  opacity: 0.9;
}

/* ---------- Fade-in on scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.95s ease-out,
    transform 0.95s ease-out;
  will-change: opacity, transform;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero entrance (timed sequence on landing) ---------- */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem var(--pad-edge) 4rem;
  text-align: center;
  background-color: var(--cream);
}
.hero__logo {
  width: clamp(110px, 16vw, 160px);
  height: auto;
  opacity: 0;
  transform: translateY(8px);
  animation: heroFade 1.2s ease-out 0.4s forwards;
}
.hero__tagline {
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(8px);
  animation: heroFade 1.2s ease-out 1.0s forwards;
}
.hero__welcome {
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  color: var(--text-display);
  opacity: 0;
  transform: translateY(8px);
  animation: heroFade 1.2s ease-out 1.5s forwards;
}
.hero__thread {
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  margin-top: 2rem;
  opacity: 0;
  animation: heroThread 1.4s ease-out 2.1s forwards;
}
@keyframes heroFade {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroThread {
  to { width: 5rem; opacity: 0.9; }
}

/* ---------- Site nav (sticky, fades in last) ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem var(--pad-edge);
  background: rgba(253, 250, 244, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(92, 61, 34, 0.08);
}
/* Hero-staggered entrance only on the home page */
.page-home .site-nav {
  opacity: 0;
  animation: heroFade 1s ease-out 2.4s forwards;
}
.site-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.site-nav__home img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.site-nav__home-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-display);
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.75rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav__links a {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-body);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}
.site-nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}
.site-nav__links a:hover,
.site-nav__links a:focus-visible {
  color: var(--accent-primary);
}
.site-nav__links a:hover::after,
.site-nav__links a:focus-visible::after,
.site-nav__links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Mobile nav: collapse the wordmark next to logo, allow links to wrap */
@media (max-width: 640px) {
  .site-nav { padding: 0.75rem 1rem; }
  .site-nav__home-text { display: none; }
  .site-nav__links { gap: 0.85rem; }
  .site-nav__links a { font-size: 0.68rem; letter-spacing: 0.13em; }
}

/* ---------- Cards ---------- */
.pathway-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}
@media (min-width: 800px) {
  .pathway-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
}
.pathway-card {
  padding: 2rem 1.5rem;
  background: rgba(253, 250, 244, 0.55);
  border-top: 1px solid rgba(192, 57, 31, 0.4);
  text-align: center;
  transition: background 0.4s ease, transform 0.4s ease;
}
.pathway-card:hover {
  background: rgba(253, 250, 244, 0.85);
  transform: translateY(-2px);
}
.pathway-card h3 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
}
.pathway-card p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-body);
  margin-bottom: 1.5rem;
  min-height: 3rem;
}
.pathway-card a.enter {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-primary);
  transition: letter-spacing 0.3s ease;
}
.pathway-card a.enter:hover,
.pathway-card a.enter:focus-visible {
  letter-spacing: 0.24em;
}

/* ---------- Four I's preview ---------- */
.four-is {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 2rem auto;
  max-width: var(--measure-wide);
}
@media (min-width: 720px) {
  .four-is { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}
.four-is__item {
  text-align: center;
  padding: 1.25rem 0.5rem;
}
.four-is__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--accent-primary);
  margin-bottom: 0.4rem;
  display: block;
}
.four-is__phase {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-body);
  opacity: 0.75;
}

.about-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-primary);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.about-link:hover,
.about-link:focus-visible { border-color: var(--accent-primary); }

/* ---------- Footer (only dark surface on the site) ---------- */
.site-footer {
  background-color: var(--deep-soil);
  color: var(--cream);
  padding: 4rem var(--pad-edge) 2.5rem;
}
.site-footer__grid {
  max-width: var(--measure-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 800px) {
  .site-footer__grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 3rem; }
}
.site-footer__brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: brightness(1.05);
}
.site-footer__brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--cream);
  margin-bottom: 0.3rem;
}
.site-footer__brand-tag {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.site-footer__col h4 {
  color: var(--cream);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: var(--font-label);
  font-style: normal;
  font-weight: 300;
  margin-bottom: 1rem;
  opacity: 0.7;
}
.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__col li { margin-bottom: 0.55rem; }
.site-footer__col a {
  font-family: var(--font-body);
  color: var(--cream);
  font-size: 0.95rem;
  opacity: 0.85;
  transition: color 0.3s ease, opacity 0.3s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.site-footer__col a:hover,
.site-footer__col a:focus-visible {
  color: var(--thread-light);
  opacity: 1;
  border-bottom-color: var(--thread-light);
}
.site-footer__bottom {
  max-width: var(--measure-wide);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 232, 229, 0.1);
  text-align: center;
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}

/* ---------- Stub / placeholder pages ---------- */
.stub {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem var(--pad-edge);
}
.stub h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 1.5rem;
}
.stub__note {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-body);
  opacity: 0.7;
  margin-top: 1rem;
}

/* ---------- Focus + accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
  .fade-in { opacity: 1; transform: none; }
  .hero__logo,
  .hero__tagline,
  .hero__welcome,
  .page-home .site-nav { opacity: 1; transform: none; }
  .hero__thread { width: 5rem; opacity: 0.9; }
}
