/* ============================================================
   SYNTHETIC MATERIALS — unit page styles
   Journey strip hero · plankton-to-plastic stepper · natural
   vs synthetic sorter · chain builder (dark) · honest ledger ·
   myth flips · flashcards · exit ticket
   ============================================================ */

/* the hidden attribute must always win over the display rules below */
[hidden] { display: none !important; }

/* ---------- hero ---------- */
.sy-hero {
  position: relative;
  padding-top: clamp(150px, 20vh, 200px);
  overflow: hidden;
  background: linear-gradient(180deg, #F7F2E4 0%, var(--sand-50) 60%, var(--sand-100) 100%);
}
.sy-hero-grid {
  position: relative; z-index: 1; /* above .sun */
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  align-items: center; gap: clamp(30px, 5vw, 60px);
  padding-bottom: 70px;
}
.sy-hero-grid > * { min-width: 0; }
.sy-title { font-size: clamp(2.6rem, 5.6vw, 4.7rem); margin-bottom: 26px; }
.sy-title .char { display: inline-block; }
.sy-hero .lede em { font-style: italic; color: var(--iris-500); }
.sy-chips { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }

.hero-journey {
  max-width: 420px; margin-left: auto; width: 100%;
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 18px 18px 10px;
}
.journey-svg { display: block; width: 100%; height: auto; }
.journey-cap { margin-top: 8px; text-align: center; }

/* ---------- the phenomenon: journey stepper ---------- */
.sy-bottle { background: var(--sand-100); }
.jr-lab { max-width: 780px; margin-inline: auto; }
.jr-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.jr-dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sand-300); transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}
.jr-dots i.done { background: var(--iris-500); }
.jr-dots i.current { background: var(--amber-500); transform: scale(1.3); }
.jr-stage { text-align: center; padding: 10px 20px 6px; }
.jr-num {
  display: block; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--iris-500);
  margin-bottom: 14px;
}
.jr-stage h3 { margin-bottom: 12px; font-size: clamp(1.3rem, 2.8vw, 1.7rem); }
.jr-text {
  font-size: 15.5px; line-height: 1.7; color: var(--ink-700);
  max-width: 56ch; margin: 0 auto; min-height: 5.2em;
}
.jr-change {
  margin-top: 16px; color: var(--amber-500) !important;
  font-size: 12px !important;
}
.jr-controls { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.bottle-explain { max-width: 780px; margin: 34px auto 0; }
.bottle-explain p { font-size: 16px; line-height: 1.75; color: var(--ink-700); }
.bottle-explain strong { color: var(--ink-900); }

/* ---------- the recipe ---------- */
.sy-recipe { background: var(--sand-50); }

/* ---------- polymers (dark band) ---------- */
.sy-polymers {
  background: var(--ink-900); color: var(--sand-50);
  border-radius: clamp(24px, 4vw, 48px);
  margin: 0 clamp(10px, 2vw, 24px);
  padding: var(--section-pad) 0;
}
.eyebrow-light { color: var(--iris-300); }
.lede-light { color: rgb(250 246 235 / 0.72); }
.chain-lab {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 22px;
  align-items: stretch;
}
.chain-stage-wrap {
  background: #08080C; border: 1px solid rgb(250 246 235 / 0.12);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.chain-svg { display: block; width: 100%; height: auto; min-height: 90px; }
.chain-read { text-align: center; }
.chain-n { display: block; }
.chain-prop {
  display: block; margin-top: 8px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--sand-50);
  letter-spacing: -0.01em;
}
.chain-side {
  background: rgb(250 246 235 / 0.05); border: 1px solid rgb(250 246 235 / 0.12);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.chain-note { line-height: 1.7; color: rgb(250 246 235 / 0.5) !important; margin-top: auto; }
.chain-bead { animation: bead-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes bead-in {
  from { opacity: 0; transform: scale(0.3); }
}
.standards-note {
  margin-top: 44px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7;
  color: var(--ink-300); max-width: 70ch;
}
.standards-note strong { color: var(--ink-500); }
.standards-dark { color: rgb(250 246 235 / 0.35) !important; }
.standards-dark strong { color: rgb(250 246 235 / 0.65) !important; }

/* ---------- impact ---------- */
.sy-impact { background: var(--sand-100); }
.imp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.imp-card h3 { margin-bottom: 12px; }
.imp-give h3 { color: #2F9E5F; }
.imp-cost h3 { color: #C26A2B; }
.imp-next h3 { color: var(--iris-500); }
.landing { font-size: 14.5px; line-height: 1.6; color: var(--ink-700); padding: 8px 0; }
.landing + .landing { border-top: 1px dashed rgb(13 13 17 / 0.1); }
.landing strong { color: var(--ink-900); }

/* ---------- sorters (shared manipulative) ---------- */
.sorter-status {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
  color: var(--ink-500); min-height: 1.55em; margin-bottom: 14px;
  transition: color 0.3s;
}
.sorter-status.ok { color: #2F9E5F; }
.sorter-status.hint { color: #C26A2B; }
.sorter-bank {
  display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
  min-height: 96px; padding: 14px;
  border: 1.5px dashed rgb(13 13 17 / 0.2); border-radius: 18px;
  background: rgb(255 253 246 / 0.55);
}
.sort-card {
  font: inherit; font-size: 14px; line-height: 1.4; text-align: left;
  padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid rgb(13 13 17 / 0.14);
  background: #FFFDF6; color: var(--ink-900);
  cursor: pointer;
  box-shadow: 0 2px 8px -4px rgb(13 13 17 / 0.18);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s, border-color 0.22s;
}
.sort-card:hover { transform: translateY(-2px); border-color: var(--iris-500); }
.sort-card:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 2px; }
.sort-card.selected {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgb(232 112 58 / 0.25), 0 10px 22px -8px rgb(13 13 17 / 0.3);
  transform: translateY(-3px) rotate(-1deg);
}
.sorter-bins { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sort-bin {
  border: 1.5px dashed rgb(13 13 17 / 0.22); border-radius: 18px;
  padding: 16px; min-height: 128px; cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.sort-bin:hover, .sort-bin:focus-visible { border-color: var(--iris-500); outline: none; }
.sorter.armed .sort-bin { border-style: solid; }
.sorter.armed .sort-bin:hover, .sorter.armed .sort-bin:focus-visible {
  border-color: var(--amber-500); background: rgb(232 112 58 / 0.05);
}
.bin-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
.bin-sub { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-300); margin-top: 3px; }
.bin-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.bin-cards .sort-card {
  cursor: default; font-size: 13px;
  background: rgb(123 227 154 / 0.12);
  border-color: rgb(47 158 95 / 0.45);
  box-shadow: none;
}
.bin-cards .sort-card::before { content: "✓ "; color: #2F9E5F; font-weight: 700; }
.bin-cards .sort-card:hover { transform: none; }
.sort-card.just-placed { animation: pop-in 0.38s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
}
.sort-bin.done { border-color: rgb(47 158 95 / 0.55); background: rgb(123 227 154 / 0.07); border-style: solid; }
.sort-bin.shake { animation: shake 0.42s; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
.sorter-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 15px;
}
.sorter-progress { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); }
.sorter-reset {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink-500); background: none; border: 0; cursor: pointer;
  border-bottom: 1px dashed var(--ink-300); padding: 2px 0;
}
.sorter-reset:hover { color: var(--amber-500); border-color: var(--amber-500); }
.sorter-wide { max-width: 940px; margin-inline: auto; }
.sorter-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--amber-500); margin-bottom: 10px;
  text-align: center;
}
.sorter-wide .sorter-status { text-align: center; }

/* antenna wiggle — applies to every <use> of the beetle symbol */
.beetle-antenna { transform-origin: 11px 54px; animation: ant-wig 2.6s ease-in-out infinite; }
@keyframes ant-wig {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-7deg); }
}

/* ---------- myth flip cards ---------- */
.sy-myths { background: var(--sand-50); }
.myth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.myth-flip {
  position: relative; min-height: 210px; padding: 0; border: 0;
  background: none; cursor: pointer; font: inherit; text-align: left;
  perspective: 1100px; border-radius: var(--radius);
}
.myth-flip:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 3px; }
.myth-face {
  position: absolute; inset: 0; border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.65s cubic-bezier(0.3, 1.3, 0.4, 1);
  font-family: var(--font-display); font-weight: 600; font-size: 1.14rem;
  line-height: 1.3; letter-spacing: -0.01em;
}
.myth-front {
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  box-shadow: var(--shadow-card); color: var(--ink-900);
}
.myth-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-500);
  border: 1px solid rgb(232 112 58 / 0.4); border-radius: 999px;
  padding: 4px 10px; align-self: flex-start;
}
.myth-back {
  background: var(--ink-900); color: var(--sand-50);
  font-family: var(--font-body); font-weight: 400; font-size: 0.98rem;
  line-height: 1.55; letter-spacing: 0;
  transform: rotateY(180deg);
}
.myth-back strong { color: var(--amber-300); font-family: var(--font-display); font-size: 1.15rem; display: block; margin-bottom: 4px; }
.myth-flip.flipped .myth-front { transform: rotateY(-180deg); }
.myth-flip.flipped .myth-back { transform: rotateY(0deg); }

/* ============================================================
   FLASHCARDS (spaced repetition)
   ============================================================ */
.sy-cards { background: var(--sand-100); }
.deck-wrap {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 22px; align-items: start; max-width: 980px; margin-inline: auto;
}
.deck-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.deck-stat { text-align: center; }
.deck-stat-num {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.9rem; line-height: 1.05; color: var(--ink-900);
}
.deck-stat-label {
  display: block; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-300);
  margin-top: 5px;
}
.deck-bar {
  grid-column: 1 / -1; height: 8px; border-radius: 4px;
  background: var(--sand-200); overflow: hidden; margin-top: 6px;
}
.deck-bar-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--iris-500), var(--amber-500));
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.deck-next { grid-column: 1 / -1; margin-top: 4px; line-height: 1.6; }
.deck-stats .sorter-reset { grid-column: 1 / -1; justify-self: start; }
.deck-main { min-width: 0; }
.flashcard {
  position: relative; display: block; width: 100%; height: 270px;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit;
  perspective: 1300px; border-radius: var(--radius);
}
.flashcard:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 3px; }
.fc-face {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.62s cubic-bezier(0.3, 1.25, 0.4, 1);
}
.fc-front {
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  box-shadow: var(--shadow-card);
}
.fc-back {
  background: var(--ink-900); color: var(--sand-50);
  transform: rotateY(180deg);
}
.flashcard.flipped .fc-front { transform: rotateY(-180deg); }
.flashcard.flipped .fc-back { transform: rotateY(0deg); }
.fc-kicker {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--iris-500);
}
.fc-back .fc-kicker { color: var(--amber-300); }
.fc-term {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.02em;
  color: var(--ink-900); text-align: center;
}
.fc-def {
  font-size: clamp(0.98rem, 2vw, 1.2rem); line-height: 1.55;
  color: rgb(250 246 235 / 0.88); text-align: center; max-width: 46ch;
}
.fc-hint {
  position: absolute; bottom: 18px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--ink-300);
}
.deck-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.grade-btn {
  font: inherit; font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid; background: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.grade-btn small { font-family: var(--font-mono); font-weight: 400; font-size: 10px; opacity: 0.75; }
.grade-btn:hover { transform: translateY(-2px); }
.grade-btn:disabled { opacity: 0.35; pointer-events: none; }
.grade-again { border-color: var(--amber-500); color: var(--amber-500); }
.grade-again:hover { box-shadow: 0 8px 20px -8px rgb(232 112 58 / 0.5); }
.grade-good { border-color: var(--iris-500); background: var(--iris-500); color: #fff; }
.grade-good:hover { box-shadow: 0 8px 20px -8px rgb(91 84 214 / 0.6); }
.grade-easy { border-color: var(--ink-900); color: var(--ink-900); }
.grade-easy:hover { box-shadow: 0 8px 20px -8px rgb(13 13 17 / 0.4); }
.deck-status { margin-top: 14px; text-align: center; }

/* ============================================================
   EXIT TICKET
   ============================================================ */
.sy-quiz { background: var(--sand-50); }
.quiz { max-width: 780px; margin-inline: auto; }
.quiz-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.quiz-dots { display: flex; gap: 7px; }
.quiz-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sand-300); transition: background 0.3s;
}
.quiz-dots i.current { background: var(--amber-500); }
.quiz-dots i.answered { background: var(--iris-500); }
.quiz-q {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem); line-height: 1.25;
  letter-spacing: -0.01em; margin-bottom: 20px;
}
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  font: inherit; font-size: 15px; text-align: left;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid rgb(13 13 17 / 0.14);
  background: var(--sand-50); color: var(--ink-900);
  transition: border-color 0.25s, background 0.25s, transform 0.2s, opacity 0.25s;
}
.quiz-opt:hover { border-color: var(--iris-500); transform: translateY(-1px); }
.quiz-opt:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 2px; }
.quiz-opt.correct { border-color: #2F9E5F; background: rgb(123 227 154 / 0.14); }
.quiz-opt.wrong { border-color: #D64545; background: rgb(214 69 69 / 0.08); animation: shake 0.42s; }
.quiz-opt.dim { opacity: 0.45; pointer-events: none; }
.quiz-opt.locked { pointer-events: none; }
.quiz-feedback {
  min-height: 1.7em; margin-top: 14px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  color: var(--ink-500);
}
.quiz-feedback.ok { color: #2F9E5F; }
.quiz-feedback.no { color: #C26A2B; }
.quiz-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.quiz-result { text-align: center; padding-top: 10px; }
.quiz-stamp { width: 150px; margin: 0 auto 20px; color: var(--iris-500); animation: stamp-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
.quiz-stamp svg { width: 100%; height: auto; display: block; }
@keyframes stamp-in {
  from { transform: rotate(-9deg) scale(2.3); opacity: 0; }
}
.quiz-score {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -0.02em;
}
.quiz-note { color: var(--ink-500); font-size: 15px; margin-top: 8px; }
.quiz-result .sorter-reset { margin-top: 18px; }

/* ---------- closer ---------- */
.sy-closer { padding: clamp(80px, 10vw, 130px) 0; text-align: center; background: var(--sand-100); }
.sy-closer .btn { margin: 6px; }
.sy-closer-big {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 34px;
}

/* ---------- chapter dots ---------- */
.chapters {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 900; display: flex; flex-direction: column; gap: 13px;
}
.chapters a {
  position: relative; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ink-500);
  box-shadow: 0 0 0 3px rgb(250 246 235 / 0.5);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.chapters a:hover { transform: scale(1.35); }
.chapters a.active { background: var(--amber-500); border-color: var(--amber-500); }
.chapters a span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap;
  background: var(--ink-900); color: var(--sand-50);
  padding: 4px 9px; border-radius: 7px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.chapters a:hover span, .chapters a:focus-visible span { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .chapters { display: none; }
}
@media (max-width: 1020px) {
  .sy-hero-grid { grid-template-columns: 1fr; }
  .hero-journey { margin: 10px auto 0; }
  .chain-lab { grid-template-columns: 1fr; }
  .imp-grid { grid-template-columns: 1fr; }
  .myth-grid { grid-template-columns: 1fr; }
  .myth-flip { min-height: 170px; }
  .deck-wrap { grid-template-columns: 1fr; }
  .deck-stats { max-width: 460px; }
}
@media (max-width: 640px) {
  .sorter-bins { grid-template-columns: 1fr; }
  .sort-bin { min-height: 0; }
  .flashcard { height: 300px; }
  .jr-text { min-height: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .beetle-antenna, .chain-bead { animation: none !important; }
}
