/* Shampoo Reset — site layout on top of Iris Editorial tokens.
   One page, one accent: Steel Blue (matches the photography). */

:root { --accent: var(--steel-500); --accent-700: var(--steel-700); --accent-900: var(--steel-900); }

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

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

/* ---- Content container ---- */
.wrap { max-width: 920px; margin: 0 auto; padding: 0 var(--gutter); }

/* ===========================================================
   HERO — edge to edge, image 1, single line of text
   =========================================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  width: 100%;
  background-image: url('../img/hero.jpg');
  background-size: cover;
  background-position: 50% 30%;
  display: flex;
  align-items: flex-end;
}
.hero::after { /* legibility wash, bottom-weighted */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(19,18,16,.10) 0%, rgba(19,18,16,.10) 45%, rgba(19,18,16,.78) 100%);
}
.hero__title {
  position: relative; z-index: 1;
  width: 100%;
  padding: 0 var(--gutter) clamp(40px, 8vh, 96px);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: .9;
  color: var(--text-primary);
  font-size: clamp(3.25rem, 13vw, 11rem);
}
.scroll-cue {
  position: absolute; z-index: 1; left: var(--gutter); bottom: 18px;
  font-family: var(--font-subtitle); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-secondary);
}

/* ===========================================================
   SECTIONS
   =========================================================== */
section { padding: clamp(64px, 9vh, 112px) 0; scroll-margin-top: var(--space-7); }
section + section { border-top: var(--hairline) solid var(--divider); }

.sec-num {
  font-family: var(--font-subtitle); font-weight: 500;
  font-size: var(--text-sm); letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-4);
}
section h2 { margin-bottom: var(--space-6); }
section h3 {
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  margin: var(--space-9) 0 var(--space-4);
}
section h4 {
  font-family: var(--font-subtitle); font-weight: 600;
  font-size: var(--text-lg); letter-spacing: .01em; text-transform: none;
  color: var(--text-primary);
  margin: var(--space-7) 0 var(--space-3);
}
section h5 {
  font-family: var(--font-subtitle); font-weight: 600;
  font-size: var(--text-base); letter-spacing: .02em; text-transform: uppercase;
  color: var(--accent);
  margin: var(--space-6) 0 var(--space-2);
}

p { margin: 0 0 var(--space-4); max-width: 70ch; }
section ul, section ol { max-width: 70ch; padding-left: 1.3em; margin: 0 0 var(--space-4); }
section li { margin: 0 0 var(--space-2); }
section li::marker { color: var(--accent); }
strong { color: var(--text-primary); font-weight: 600; }
em { color: var(--text-body); }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--divider-strong); }
a:hover { border-bottom-color: var(--accent); }

/* ---- Divider image between sections — show the whole frame, never crop the figure ---- */
.divider-img { display: block; width: min(92vw, 1180px); height: auto; margin: 0 auto; }

/* ===========================================================
   TABLES — lines, not boxes
   =========================================================== */
.table-scroll { overflow-x: auto; margin: var(--space-5) 0 var(--space-6); }
table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-body); font-size: var(--text-base);
  min-width: 560px;
}
thead th {
  text-align: left; vertical-align: bottom;
  font-family: var(--font-subtitle); font-weight: 600;
  font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-primary);
  padding: 0 var(--space-4) var(--space-3);
  border-bottom: var(--hairline) solid var(--divider-strong);
}
tbody td {
  vertical-align: top;
  padding: var(--space-4);
  border-bottom: var(--hairline) solid var(--divider);
  color: var(--text-body);
}
tbody td:first-child, thead th:first-child { padding-left: 0; }
tbody td strong { color: var(--text-primary); }

/* ===========================================================
   CALLOUT (the bold code-fence asides in the source)
   =========================================================== */
.callout {
  border-left: 2px solid var(--accent);
  padding: var(--space-4) 0 var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  color: var(--text-body);
  font-size: var(--text-lg); line-height: 1.5;
  max-width: 70ch;
}
blockquote {
  border-left: 2px solid var(--divider-strong);
  margin: var(--space-6) 0; padding: var(--space-2) 0 var(--space-2) var(--space-5);
  color: var(--text-body); max-width: 70ch;
}

/* ---- ASCII cascade diagrams: keep monospace, themed ---- */
pre.flow {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-sm); line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface);
  border-left: 2px solid var(--divider-strong);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  overflow-x: auto;
  white-space: pre;
}

/* ===========================================================
   POPUP TRIGGERS + MODAL (SLES, Dimethicone)
   =========================================================== */
.term {
  color: var(--accent);
  border-bottom: 1px dashed var(--accent-700);
  cursor: pointer;
  background: none; border-top: 0; border-left: 0; border-right: 0;
  font: inherit; padding: 0;
}
.term::after { content: "\00b9"; /* superscript marker */ font-size: .7em; vertical-align: super; color: var(--text-muted); }

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10,9,8,.72);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--gutter);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: var(--hairline) solid var(--divider-strong);
  max-width: 640px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  padding: clamp(28px, 5vw, 48px);
}
.modal h3 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 var(--space-2); }
.modal .eyebrow { margin-bottom: var(--space-5); display: block; }
.modal-close {
  float: right; margin: -8px -8px 0 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-subtitle); font-weight: 600;
  font-size: var(--text-sm); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-secondary);
}
.modal-close:hover { color: var(--text-primary); }

/* ===========================================================
   PAGE HEADER (ingredients subpage) + footer
   =========================================================== */
.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--space-6) var(--gutter);
  border-bottom: var(--hairline) solid var(--divider);
}
.topbar .back { font-family: var(--font-subtitle); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; }
.page-head { padding: clamp(56px,10vh,120px) 0 var(--space-7); }

footer {
  border-top: var(--hairline) solid var(--divider);
  padding: var(--space-8) 0;
  color: var(--text-muted);
  font-family: var(--font-subtitle); font-size: var(--text-sm);
}

/* ===========================================================
   FLOATING INDEX  — launcher chip + section menu (reuses .modal-overlay)
   =========================================================== */
.index-fab {
  position: fixed; z-index: 40;
  right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 32px);
  font-family: var(--font-subtitle); font-weight: 600;
  font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-primary);
  background: var(--surface);
  border: var(--hairline) solid var(--divider-strong);
  border-radius: var(--radius);
  padding: 13px 20px;
  cursor: pointer;
}
.index-fab:hover { border-color: var(--accent); color: var(--accent); }

.index-menu .eyebrow { display: block; margin-bottom: var(--space-4); }
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { border-top: var(--hairline) solid var(--divider); }
.index-list li:last-child { border-bottom: var(--hairline) solid var(--divider); }
.index-list a {
  display: flex; align-items: baseline; gap: var(--space-4);
  padding: var(--space-4) 0;
  border: 0;
  font-family: var(--font-subtitle); font-weight: 500; font-size: var(--text-lg);
  color: var(--text-primary);
}
.index-list a:hover { color: var(--accent); }
.index-list .n {
  flex: none; min-width: 2.4em;
  font-size: var(--text-sm); color: var(--accent); letter-spacing: .06em;
}
.index-list li.current a { color: var(--accent); }
.index-list .now {
  margin-left: auto; align-self: center;
  font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
}
.index-list li.current .now { opacity: 1; }

/* ===========================================================
   MOBILE  (verified target: ~390px phone width)
   - no horizontal page scroll
   - text legible (bumped a step for the accessibility reader)
   - wide tables scroll inside their box instead of squashing
   =========================================================== */
@media (max-width: 640px) {
  :root { --gutter: 22px; }
  body { font-size: 15px; }                 /* readability on small screens */
  .table-scroll { -webkit-overflow-scrolling: touch; } /* momentum scroll */
  #shopping table { min-width: 820px; }     /* 7 columns: keep legible, scroll don't squash */
  .modal { max-height: 86vh; }
}
@media (max-width: 380px) {
  .hero__title { font-size: clamp(2.75rem, 15vw, 4rem); } /* guard tiny phones */
}
