/* ==========================================================================
   soupcleanse.com — shared stylesheet
   Palette: broth (paper), forest (ink), brass (structure), ember (field notes)
   Type:    Newsreader (display) / Karla (body) / IBM Plex Mono (labels, data)
   ========================================================================== */

:root {
  --broth:      #F3F0E4;
  --broth-deep: #E9E4D3;
  --ink:        #16281D;
  --forest:     #24402E;
  --forest-mid: #3D6349;
  --brass:      #A8853C;
  --ember:      #C05A24;
  --gray:       #6E7167;
  --rule:       rgba(22, 40, 29, 0.15);
  --rule-firm:  rgba(22, 40, 29, 0.32);

  --measure: 34rem;
  --gut: clamp(1.25rem, 4vw, 3rem);

  --step--1: 0.8125rem;
  --step-0:  1.0625rem;
  --step-1:  1.25rem;
  --step-2:  clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3:  clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --step-4:  clamp(2.75rem, 1.8rem + 4.4vw, 5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--broth);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--forest); color: var(--broth);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* --- shared utilities ---------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gut);
}

.label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 40rem;
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--broth);
  transition: background 160ms ease, color 160ms ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }

.btn--ghost { background: transparent; color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--broth); }

.btn--onDark { background: var(--broth); color: var(--forest); border-color: var(--broth); }
.btn--onDark:hover { background: var(--brass); border-color: var(--brass); color: var(--ink); }

.textlink {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 2px;
  transition: border-color 160ms ease;
}
.textlink:hover { border-color: var(--ember); }
.textlink::after { content: " \2192"; }

/* --- masthead ------------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--broth);
  position: sticky;
  top: 0;
  z-index: 40;
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}

.wordmark {
  font-family: "Newsreader", serif;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.wordmark img { height: 2.1rem; width: auto; display: block; margin-right: 0.55rem; }
.wordmark em { font-style: italic; color: var(--forest-mid); margin-left: 0.2rem; }

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gray);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--brass); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember); }
.nav a[data-external]::after { content: " \2197"; color: var(--brass); }

.navToggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-firm);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 56rem) {
  .navToggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--broth);
    border-bottom: 1px solid var(--rule-firm);
    padding: 0.5rem var(--gut) 1.25rem;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { width: 100%; padding-block: 0.85rem; border-bottom: 1px solid var(--rule); }
}

/* --- hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(3.5rem, 8vw, 7rem) clamp(2.5rem, 5vw, 4rem); }

.hero h1 {
  font-size: var(--step-4);
  max-width: 16ch;
  margin-block: 1.25rem 1.5rem;
}
.hero h1 em { font-style: italic; color: var(--forest-mid); }

.hero__lede { max-width: 34rem; font-size: var(--step-1); line-height: 1.55; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* --- convergence strip (signature) --------------------------------------- */

.convergence {
  background: var(--forest);
  color: var(--broth);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.convergence .label { color: var(--brass); }

.convergence__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(243, 240, 228, 0.22);
}
.convergence__head h2 { font-size: var(--step-3); max-width: 20ch; margin-top: 0.75rem; }
.convergence__head p { max-width: 26rem; color: rgba(243, 240, 228, 0.78); font-size: var(--step--1) ; line-height: 1.7; margin: 0; }

.traditions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.traditions li {
  padding: 1.75rem 1.5rem 1.75rem 0;
  border-bottom: 1px solid rgba(243, 240, 228, 0.16);
  border-right: 1px solid rgba(243, 240, 228, 0.16);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease;
  transition-delay: calc(var(--i) * 90ms);
}
.traditions li:nth-child(3n) { border-right: none; }
.traditions.is-visible li { opacity: 1; transform: none; }

.traditions .place {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
  margin-bottom: 0.6rem;
}
.traditions .name {
  font-family: "Newsreader", serif;
  font-size: 1.5rem;
  font-style: italic;
  display: block;
  margin-bottom: 0.4rem;
}
.traditions .note { font-size: 0.875rem; line-height: 1.6; color: rgba(243, 240, 228, 0.72); margin: 0; }

.convergence__foot { margin-top: 2.5rem; }
.convergence__foot .textlink { color: var(--broth); border-color: var(--brass); }

/* --- generic section ----------------------------------------------------- */

.band { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band--rule { border-top: 1px solid var(--rule); }
.band--deep { background: var(--broth-deep); }

.band__title { font-size: var(--step-3); max-width: 22ch; margin-block: 0.75rem 1.5rem; }

/* --- two-column definition ----------------------------------------------- */

.pair {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  margin-top: 2.5rem;
}
.pair h3 { font-size: var(--step-2); margin-bottom: 0.9rem; }
.pair ul { margin: 0; padding-left: 1.1rem; }
.pair li { margin-bottom: 0.6rem; }

/* --- field note ---------------------------------------------------------- */

.fieldnote {
  border-left: 2px solid var(--ember);
  padding: 0.1rem 0 0.1rem 1.1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}
.fieldnote .label { color: var(--ember); display: block; margin-bottom: 0.4rem; }
.fieldnote p { margin-bottom: 0.6rem; }
.fieldnote cite { display: block; font-style: normal; font-size: 0.8125rem; color: var(--gray); }

/* --- books --------------------------------------------------------------- */

.books {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: 3rem;
}

.book { text-align: center; max-width: 24rem; margin-inline: auto; }

.book__cover {
  display: block;
  width: 100%;
  max-width: 15rem;
  aspect-ratio: 2 / 3;
  margin: 0 auto 1.75rem;
  background: var(--forest);
  color: var(--broth);
  border: 1px solid var(--rule-firm);
  box-shadow: 0 14px 30px rgba(22, 40, 29, 0.16);
  display: grid;
  place-content: center;
  padding: 1.5rem;
  text-align: center;
  font-family: "Newsreader", serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.3;
  object-fit: cover;
}

.book h3 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.book .label { display: block; margin-bottom: 1rem; }
.book p { font-size: 0.9375rem; line-height: 1.65; color: var(--ink); margin-bottom: 1.5rem; }

/* --- signup -------------------------------------------------------------- */

.signup { background: var(--forest); color: var(--broth); padding-block: clamp(3rem, 7vw, 5rem); }
.signup .label { color: var(--brass); }
.signup h2 { font-size: var(--step-3); max-width: 18ch; margin-block: 0.75rem 1rem; }
.signup p { max-width: 34rem; color: rgba(243, 240, 228, 0.78); }

.form { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; max-width: 34rem; }
.form input[type="email"] {
  flex: 1 1 15rem;
  background: transparent;
  border: 1px solid rgba(243, 240, 228, 0.4);
  color: var(--broth);
  font-family: inherit;
  font-size: var(--step-0);
  padding: 0.85rem 1rem;
}
.form input::placeholder { color: rgba(243, 240, 228, 0.5); }
.form input:focus { border-color: var(--brass); }
.form button { border: none; cursor: pointer; font-family: "IBM Plex Mono", monospace; }
.form__note { font-size: 0.8125rem; color: rgba(243, 240, 228, 0.6); margin-top: 0.9rem; }

/* --- footer -------------------------------------------------------------- */

.footer { border-top: 1px solid var(--rule); padding-block: 3rem 2.5rem; }
.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.footer h4 { font-family: "IBM Plex Mono", monospace; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray); margin-bottom: 1rem; font-weight: 400; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer a { text-decoration: none; border-bottom: 1px solid transparent; font-size: 0.9375rem; }
.footer a:hover { border-bottom-color: var(--brass); }
.footer__legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.8125rem; color: var(--gray); display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }

/* ==========================================================================
   Reading page (History & Benefits)
   ========================================================================== */

.readHero { padding-block: clamp(3rem, 7vw, 5.5rem) 2.5rem; border-bottom: 1px solid var(--rule); }
.readHero h1 { font-size: var(--step-4); max-width: 15ch; margin-block: 1rem 1.5rem; }

.readLayout {
  display: grid;
  grid-template-columns: 12rem minmax(0, var(--measure)) 14rem;
  gap: clamp(2rem, 5vw, 4rem);
  justify-content: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}

.toc { position: sticky; top: 6rem; }
.toc h2 { font-family: "IBM Plex Mono", monospace; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray); margin-bottom: 1rem; font-weight: 400; }
.toc ol { list-style: none; margin: 0 0 1.5rem; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 0.7rem; }
.toc a {
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.35;
  display: block;
  color: var(--gray);
  border-left: 1px solid var(--rule-firm);
  padding-left: 0.75rem;
  transition: color 140ms ease, border-color 140ms ease;
}
.toc a::before {
  content: counter(toc, upper-roman) ".";
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  color: var(--brass);
  display: block;
  margin-bottom: 0.15rem;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--ember); }

.chapter { scroll-margin-top: 6rem; margin-bottom: clamp(3rem, 7vw, 5rem); }
.chapter:last-child { margin-bottom: 0; }
.chapter__num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
  margin-bottom: 0.75rem;
}
.chapter h2 { font-size: var(--step-3); margin-bottom: 1.25rem; }
.chapter h3 { font-size: var(--step-1); margin-block: 2rem 0.75rem; }
.chapter p, .chapter li { font-size: 1.0625rem; line-height: 1.75; }
.chapter ul { padding-left: 1.15rem; margin-bottom: 1.1em; }
.chapter li { margin-bottom: 0.5rem; }

.pullquote {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--forest-mid);
  border-top: 1px solid var(--rule-firm);
  border-bottom: 1px solid var(--rule-firm);
  padding-block: 1.5rem;
  margin-block: 2.5rem;
}

.margin { position: relative; }
.margin .fieldnote { position: sticky; top: 6rem; margin-bottom: 2.5rem; }

/* Inline field notes used inside the flow on narrow screens */
.chapter .fieldnote { margin-block: 1.75rem; }

@media (max-width: 68rem) {
  .readLayout { grid-template-columns: minmax(0, var(--measure)); }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
  .toc li { margin-bottom: 0; }
  .margin { display: none; }
}

/* ==========================================================================
   Specimen drawer (ingredient cards)
   ========================================================================== */

.drawer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--rule-firm);
  border: 1px solid var(--rule-firm);
  margin-top: 2.5rem;
}

.specimen {
  position: relative;
  background: var(--broth);
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 12rem;
  perspective: 800px;
}

.specimen__face {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  transition: transform 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
.specimen__front { background: var(--broth); }
.specimen__back {
  background: var(--forest);
  color: var(--broth);
  transform: rotateY(180deg);
}
.specimen[aria-expanded="true"] .specimen__front { transform: rotateY(-180deg); }
.specimen[aria-expanded="true"] .specimen__back { transform: rotateY(0); }

.specimen__id { font-family: "IBM Plex Mono", monospace; font-size: 0.625rem; letter-spacing: 0.14em; color: var(--brass); }
.specimen__name { font-family: "Newsreader", serif; font-size: 1.375rem; line-height: 1.15; }
.specimen__latin { font-family: "Newsreader", serif; font-style: italic; font-size: 0.875rem; color: var(--gray); }
.specimen__back .specimen__latin { color: rgba(243, 240, 228, 0.6); }
.specimen__body { font-size: 0.875rem; line-height: 1.55; }
.specimen__hint { font-family: "IBM Plex Mono", monospace; font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray); }

@media (prefers-reduced-motion: reduce) {
  .specimen__face { transition: none; }
}

/* ==========================================================================
   Kit / product page
   ========================================================================== */

.product {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.product__art {
  background: var(--broth-deep);
  border: 1px solid var(--rule);
  aspect-ratio: 4 / 5;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--gray);
  object-fit: cover;
}

.product h1 { font-size: var(--step-3); margin-block: 0.75rem 1rem; }
.product__price { font-family: "IBM Plex Mono", monospace; font-size: 1rem; letter-spacing: 0.08em; margin-bottom: 1.5rem; }
.product__contents { list-style: none; margin: 1.5rem 0; padding: 0; border-top: 1px solid var(--rule); }
.product__contents li { border-bottom: 1px solid var(--rule); padding-block: 0.75rem; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; }
.product__contents .qty { font-family: "IBM Plex Mono", monospace; font-size: 0.8125rem; color: var(--gray); }

.blends { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.blends h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.blends .label { display: block; margin-bottom: 0.5rem; }
.blends p { font-size: 0.9375rem; }

/* Image covers: override the placeholder's grid centring */
img.book__cover { display: block; padding: 0; }
img.product__art { display: block; padding: 0; }
