/* =========================================================
   WASTRA — Threads of the Archipelago
   Palette drawn from the moodboard: maroon, indigo, saffron,
   terracotta, teal, leaf green on warm cream paper.
   ========================================================= */
:root {
  --cream: #f7eedb;
  --paper: #fbf5e8;
  --paper-2: #f1e4c8;
  --ink: #1c1f3a;
  --ink-soft: #4a4560;
  --indigo: #1e2a5a;
  --maroon: #7b1e22;
  --terracotta: #c8552b;
  --saffron: #e8a33d;
  --gold: #c9973a;
  --teal: #1f6b6b;
  --leaf: #3d6b3f;
  --pink: #e98a7a;
  --soga: #8a5a2b;
  --line: rgba(28, 31, 58, .14);
  --shadow: 0 18px 40px -18px rgba(60, 30, 10, .35);
  --radius: 18px;
  --f-display: "Fraunces", Georgia, serif;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-sans: "Work Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* paper grain over everything */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .18 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: var(--saffron); color: var(--ink); }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; position: relative; z-index: 2; }
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.eyebrow {
  font: 600 12px/1 var(--f-sans); letter-spacing: .22em; text-transform: uppercase;
  color: var(--terracotta); margin: 0 0 14px; display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.h2 {
  font: 400 clamp(36px, 5.6vw, 72px)/1.02 var(--f-display);
  letter-spacing: -.02em; margin: 0 0 18px; font-variation-settings: "SOFT" 100, "WONK" 1;
}
.h2 em, .h3 em { font-style: italic; color: var(--maroon); }
.h3 { font: 500 clamp(24px, 2.6vw, 32px)/1.15 var(--f-display); margin: 0 0 12px; letter-spacing: -.01em; }
.lead { font: 500 clamp(19px, 1.8vw, 23px)/1.5 var(--f-serif); color: var(--ink-soft); max-width: 62ch; }
.section-head { margin-bottom: clamp(36px, 5vw, 60px); }
.section-head-sm { margin-bottom: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; border: 2px solid var(--ink);
  border-radius: 999px; padding: 13px 24px; font-weight: 600; font-size: 15px; text-decoration: none;
  background: transparent; transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary { background: var(--maroon); color: var(--cream); border-color: var(--maroon); }
.btn-primary:hover { box-shadow: 4px 4px 0 var(--saffron); }
.btn-ghost { background: var(--paper); }
.btn-small { padding: 9px 16px; font-size: 14px; }

/* ---------- reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--maroon); display: grid; place-items: center;
  transition: clip-path 1s var(--ease) .1s; clip-path: circle(150% at 50% 50%);
}
#loader.done { clip-path: circle(0% at 50% 50%); pointer-events: none; }
.loader-inner { text-align: center; color: var(--cream); }
.loader-kawung { width: 110px; animation: spin 3.5s linear infinite; }
.loader-kawung g:first-child { fill: var(--cream); }
.loader-word { font: italic 400 42px/1 var(--f-display); margin: 22px 0 4px; }
.loader-word span { animation: blink 1s steps(2) infinite; }
.loader-sub { font: 500 13px var(--f-sans); letter-spacing: .25em; text-transform: uppercase; opacity: .7; margin: 0 0 18px; }
.loader-thread { width: 200px; height: 2px; background: rgba(247, 238, 219, .25); margin: 0 auto; overflow: hidden; border-radius: 2px; }
.loader-thread span { display: block; height: 100%; width: 40%; background: var(--saffron); animation: thread 1.2s var(--ease) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes thread { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- cursor (canting) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid var(--maroon); border-radius: 50%; transition: width .25s, height .25s, margin .25s, background .25s, opacity .3s; opacity: 0; }
.cursor-tip { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--maroon); }
.cursor.hover { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(232, 163, 61, .18); border-color: var(--saffron); }
.wax-drop { position: fixed; z-index: 998; pointer-events: none; width: 10px; height: 10px; border-radius: 50% 50% 50% 0;
  background: var(--saffron); animation: drop 900ms var(--ease) forwards; }
@keyframes drop { 0% { transform: translate(0, 0) scale(1) rotate(-45deg); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(-45deg); opacity: 0; } }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- thread progress ---------- */
.thread-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.thread-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--maroon) 0 10px, var(--saffron) 10px 14px); }
.thread-needle { position: absolute; top: -9px; left: 0; color: var(--maroon); font-size: 16px; transform: translateX(-50%); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 110;
  width: min(1200px, calc(100% - 24px)); display: flex; align-items: center; gap: 18px;
  padding: 10px 14px 10px 20px; border-radius: 999px; background: rgba(251, 245, 232, .82);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: 0 10px 30px -18px rgba(60, 30, 10, .4);
  transition: transform .5s var(--ease);
}
.nav.hide { transform: translate(-50%, -140%); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 600 24px/1 var(--f-display); color: var(--maroon); }
.brand em { color: var(--saffron); font-style: normal; }
.brand-mark { width: 30px; transition: transform .8s var(--ease); }
.brand:hover .brand-mark { transform: rotate(180deg); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: 14.5px; padding: 8px 12px; border-radius: 999px; transition: background .25s, color .25s; }
.nav-links a:hover, .nav-links a.active { background: var(--paper-2); color: var(--maroon); }
.nav-links .nav-pill { background: var(--maroon); color: var(--cream); }
.nav-links .nav-pill:hover { background: var(--terracotta); color: var(--cream); }
.sound-toggle { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.sound-toggle[aria-pressed="true"] { background: var(--saffron); border-color: var(--saffron); }
.sound-toggle[aria-pressed="true"] svg { animation: wobble .6s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.burger { display: none; background: none; border: 0; width: 42px; height: 42px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: .3s; }
.burger span:nth-child(1) { top: 14px; } .burger span:nth-child(2) { top: 20px; } .burger span:nth-child(3) { top: 26px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 30px;
  padding: 120px max(20px, calc((100% - 1200px) / 2)) 80px; position: relative; overflow: hidden;
}
.hero-bg-kawung {
  position: absolute; inset: 0; opacity: .07; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='%237b1e22'%3E%3Cellipse cx='40' cy='18' rx='10' ry='17'/%3E%3Cellipse cx='40' cy='62' rx='10' ry='17'/%3E%3Cellipse cx='18' cy='40' rx='17' ry='10'/%3E%3Cellipse cx='62' cy='40' rx='17' ry='10'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px; animation: drift 60s linear infinite;
}
@keyframes drift { to { background-position: 400px 400px; } }
.hero-text { position: relative; z-index: 3; }
.kicker { font: 600 13px var(--f-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--teal); margin: 0; }
.hero-title {
  font: 400 clamp(84px, 15vw, 210px)/.9 var(--f-display); letter-spacing: -.045em; margin: 10px 0 18px;
  color: var(--maroon); font-variation-settings: "SOFT" 100, "WONK" 1; display: flex;
}
.ht-letter { display: inline-block; transform: translateY(110%) rotate(8deg); opacity: 0; transition: transform 1s var(--ease), opacity 1s, color .3s; }
.loaded .ht-letter { transform: none; opacity: 1; }
.ht-letter:nth-child(2) { transition-delay: .07s; font-style: italic; color: var(--terracotta); }
.ht-letter:nth-child(3) { transition-delay: .14s; } .ht-letter:nth-child(4) { transition-delay: .21s; }
.ht-letter:nth-child(5) { transition-delay: .28s; font-style: italic; color: var(--indigo); } .ht-letter:nth-child(6) { transition-delay: .35s; }
.ht-letter:hover { animation: jiggle .6s; }
@keyframes jiggle { 25% { transform: translateY(-14px) rotate(-6deg); } 60% { transform: translateY(4px) rotate(3deg); } }
.hero-sub { font: 500 clamp(22px, 2.3vw, 30px)/1.35 var(--f-serif); max-width: 30ch; margin: 0 0 30px; }
.hero-sub em { color: var(--maroon); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-tags { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags li { font-size: 13px; font-weight: 600; letter-spacing: .06em; border: 1.5px dashed var(--maroon); color: var(--maroon); padding: 5px 12px; border-radius: 999px; }

.hero-art { position: relative; height: min(76vh, 680px); z-index: 2; }
.hero-art > * { position: absolute; transition: transform .4s ease-out; }
.hero-sun { width: 62%; aspect-ratio: 1; border-radius: 50%; right: 4%; top: 6%;
  background: radial-gradient(circle at 35% 35%, #f3c46a, var(--saffron) 55%, #c9822b); box-shadow: 0 0 0 16px rgba(232, 163, 61, .15), 0 0 0 34px rgba(232, 163, 61, .07); }
.hero-sun::after { content: ""; position: absolute; inset: -40px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(200, 85, 43, .35) 0 2deg, transparent 2deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 70%, transparent 71%); mask: radial-gradient(circle, transparent 58%, #000 59%, #000 70%, transparent 71%);
  animation: spin 50s linear infinite; }
.arch-frame { width: 52%; height: 78%; left: 24%; top: 10%; border-radius: 999px 999px 18px 18px; overflow: hidden;
  border: 10px solid var(--maroon); outline: 2px solid var(--saffron); outline-offset: -18px; box-shadow: var(--shadow); background: var(--teal); }
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.round-frame { width: 30%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; left: 0; bottom: 4%; border: 8px solid var(--indigo);
  box-shadow: var(--shadow); }
.round-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: sepia(.35) contrast(1.05); }
.hero-mask { width: 28%; right: -2%; bottom: 0; mix-blend-mode: multiply; filter: drop-shadow(0 18px 18px rgba(60, 20, 10, .35)); animation: bob 5s ease-in-out infinite; }
.hero-lotus { width: 20%; left: 10%; top: 4%; }
.hero-lotus .lotus-petals path { transform-origin: 60px 82px; animation: bloom 4s ease-in-out infinite alternate; }
.hero-lotus .lotus-petals path:nth-child(2) { animation-delay: .2s; } .hero-lotus .lotus-petals path:nth-child(3) { animation-delay: .4s; }
@keyframes bloom { from { transform: scale(.9) rotate(-2deg); } to { transform: scale(1.04) rotate(2deg); } }
@keyframes bob { 50% { translate: 0 -14px; rotate: 3deg; } }
.sticker { font: 600 13px var(--f-sans); background: var(--paper); border: 2px solid var(--ink); padding: 8px 14px; border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.sticker-1 { right: 6%; top: 2%; rotate: 8deg; } .sticker-2 { left: 4%; top: 48%; rotate: -7deg; background: var(--saffron); }
.hero-birds { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.bird { position: absolute; width: 54px; animation: fly linear forwards; }
.bird .wing { transform-origin: 26px 20px; animation: flap .35s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.5); } }
@keyframes fly { from { transform: translateX(-80px); } to { transform: translateX(calc(100vw + 80px)); } }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; width: 26px; height: 42px; border: 2px solid var(--ink); border-radius: 20px; z-index: 3; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--maroon); border-radius: 2px; animation: cue 1.6s infinite; }
@keyframes cue { to { transform: translateY(14px); opacity: 0; } }

/* ---------- marquee ---------- */
.marquee { background: var(--maroon); color: var(--cream); overflow: hidden; padding: 18px 0; position: relative; z-index: 2;
  border-block: 6px solid var(--saffron); rotate: -1.2deg; margin: 0 -20px; }
.marquee-track { display: flex; gap: 28px; width: max-content; animation: marquee 40s linear infinite; font: italic 400 30px/1 var(--f-display); white-space: nowrap; align-items: center; }
.marquee-track i { font-style: normal; color: var(--saffron); font-size: 20px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- prologue ---------- */
.prologue-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: center; }
.pull { font: italic 500 28px/1.3 var(--f-serif); color: var(--maroon); border-left: 4px solid var(--saffron); margin: 30px 0 0; padding: 4px 0 4px 22px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px 20px; position: relative; overflow: hidden; transition: transform .3s var(--ease); }
.stat:hover { transform: translateY(-4px) rotate(-1deg); }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 70px; height: 70px; border-radius: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23e8a33d' opacity='.5'%3E%3Cellipse cx='16' cy='8' rx='4' ry='7'/%3E%3Cellipse cx='16' cy='24' rx='4' ry='7'/%3E%3Cellipse cx='8' cy='16' rx='7' ry='4'/%3E%3Cellipse cx='24' cy='16' rx='7' ry='4'/%3E%3C/g%3E%3C/svg%3E") center/contain; }
.stat-num, .plus { font: 500 46px/1 var(--f-display); color: var(--indigo); }
.plus { color: var(--terracotta); }
.stat p { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.4; }

/* ---------- swimming fish ---------- */
.fish-school { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.fish { position: absolute; width: 70px; color: var(--indigo); opacity: .8; animation: swim linear infinite; }
.fish.rev { animation-name: swimRev; }
.fish svg { animation: wiggle 1.2s ease-in-out infinite alternate; transform-origin: 70% 50%; }
@keyframes swim { from { transform: translateX(-120px); } to { transform: translateX(calc(100vw + 120px)); } }
@keyframes swimRev { from { transform: translateX(calc(100vw + 120px)) scaleX(-1); } to { transform: translateX(-120px) scaleX(-1); } }
@keyframes wiggle { from { transform: rotate(-4deg) translateY(-4px); } to { transform: rotate(4deg) translateY(4px); } }

/* ---------- timeline (pinned horizontal) ---------- */
.timeline-section { position: relative; background: var(--indigo); color: var(--cream); }
.timeline-section .h2 em { color: var(--saffron); }
.timeline-section .eyebrow { color: var(--saffron); }
.timeline-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.timeline-sticky::before { content: ""; position: absolute; inset: 0; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 30 q15 -15 30 0 t30 0' fill='none' stroke='%23e8a33d' stroke-width='2'/%3E%3C/svg%3E"); }
.timeline-head { padding-top: 96px; flex: none; }
.timeline-head .h2 { margin-bottom: 4px; font-size: clamp(32px, 4.4vw, 58px); }
.hint { font: italic 500 20px var(--f-serif); opacity: .75; margin: 0; }
.timeline-track { display: flex; gap: 28px; padding: 26px max(20px, calc((100vw - 1200px) / 2)) 26px; will-change: transform; align-items: stretch; flex: none; }
.era-card {
  flex: none; width: min(430px, 82vw); background: var(--paper); color: var(--ink); border-radius: 22px; padding: 22px 24px 20px;
  position: relative; box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .6); border-top: 10px solid var(--era);
  transition: transform .4s var(--ease); max-height: calc(100vh - 260px); overflow: auto; scrollbar-width: thin;
}
.era-card:hover { transform: translateY(-8px) rotate(-.6deg); }
.era-top { display: flex; justify-content: space-between; align-items: center; }
.era-num { font: italic 500 44px/1 var(--f-display); color: var(--era); }
.era-date { font: 600 12px var(--f-sans); letter-spacing: .12em; text-transform: uppercase; background: var(--era); color: var(--cream); padding: 5px 10px; border-radius: 999px; }
.era-icon { width: 96px; height: 64px; margin: 4px 0 2px; }
.era-card h3 { font: 500 23px/1.15 var(--f-display); margin: 0 0 8px; }
.era-card p { font-size: 14.5px; line-height: 1.55; margin: 0 0 10px; }
.era-list { padding-left: 18px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; }
.era-list li::marker { color: var(--era); content: "✦  "; }
.era-sig { font: italic 500 16px var(--f-serif); border-top: 1.5px dashed var(--line); padding-top: 8px; margin: 0 !important; }
.era-sig span { color: var(--era); font-weight: 600; }
.era-end { flex: none; width: 260px; display: grid; place-items: center; text-align: center; font: italic 500 24px var(--f-serif); }
.era-end .gunungan { width: 120px; animation: sway 4s ease-in-out infinite alternate; transform-origin: bottom center; }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.timeline-rail { width: min(1200px, calc(100% - 40px)); margin: 0 auto 26px; position: relative; flex: none; }
.rail-line { height: 4px; background: rgba(247, 238, 219, .18); border-radius: 4px; position: relative; overflow: hidden; }
.rail-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--saffron); }
.rail-boat { position: absolute; top: -34px; left: 0; width: 46px; transform: translateX(-50%); animation: rock 2s ease-in-out infinite alternate; }
@keyframes rock { from { rotate: -5deg; } to { rotate: 5deg; } }
.rail-labels { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-top: 10px; }

/* ---------- regions ---------- */
.regions { background: linear-gradient(180deg, var(--cream), #f2e6cf); }
.map-wrap { display: grid; grid-template-columns: 1.45fr 1fr; gap: 26px; align-items: stretch; }
.map { width: 100%; height: auto; border-radius: 24px; border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: #dbeae4; }
.islands path { fill: #e8d6aa; stroke: #8a5a2b; stroke-width: 1.5; transition: fill .4s, transform .4s; }
.islands path.on { fill: var(--saffron); }
.sea-label { font: italic 500 16px var(--f-serif); fill: #2a6a66; opacity: .7; }
.sea-label.sm { font-size: 13px; }
.map-labels text { font: 600 11px var(--f-sans); letter-spacing: .2em; fill: #6b4a2a; opacity: .7; pointer-events: none; }
.pin { cursor: pointer; outline: none; }
.pin-dot { fill: var(--maroon); stroke: var(--cream); stroke-width: 2.5; transition: fill .3s; }
.pin text { font: 700 11px var(--f-sans); fill: var(--cream); pointer-events: none; }
.pin-pulse { fill: var(--maroon); opacity: .3; transform-box: fill-box; transform-origin: center; animation: pulse 2s infinite; }
.pin.active .pin-dot, .pin:hover .pin-dot, .pin:focus .pin-dot { fill: var(--teal); }
@keyframes pulse { from { transform: scale(.8); opacity: .5; } to { transform: scale(2.2); opacity: 0; } }
.map-boat { animation: sail 26s linear infinite; }
.mb1 { offset-path: path("M120 380 C300 420 500 400 700 440 S900 420 980 360"); }
.mb2 { offset-path: path("M980 120 C800 90 700 80 560 60 S300 40 200 20"); animation-duration: 34s; animation-delay: -10s; }
@keyframes sail { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.compass { animation: none; }

.region-panel { background: var(--paper); border-radius: 24px; border: 2px solid var(--ink); padding: 26px; position: relative; overflow: hidden; }
.region-panel .rp-band { position: absolute; inset: 0 0 auto 0; height: 14px; }
.region-panel h3 { font: 500 30px/1.1 var(--f-display); margin: 8px 0 4px; }
.region-panel .rp-sub { font: italic 500 18px var(--f-serif); color: var(--terracotta); margin: 0 0 12px; }
.region-panel p { font-size: 15px; margin: 0 0 12px; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.rp-chips span { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); }
.rp-palette { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.rp-palette i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); }
.rp-anim { animation: panelIn .6s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px); } }
.region-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.region-tabs button, .seg button, .chips button, .lens-tabs button, .route-keys button {
  border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 14px; transition: all .25s var(--ease);
}
.region-tabs button:hover, .chips button:hover, .seg button:hover { transform: translateY(-2px); }
.region-tabs button.active, .seg button.active, .chips button.active { background: var(--ink); color: var(--cream); }
.peresean { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; margin-top: 80px; }
.peresean figure { margin: 0; border-radius: 200px 200px 20px 20px; overflow: hidden; border: 8px solid var(--terracotta); box-shadow: var(--shadow); }
.tilt { transition: transform .3s ease-out; transform-style: preserve-3d; }

/* ---------- textiles ---------- */
.textiles { background: var(--paper); }
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.swatch { perspective: 1200px; height: 330px; outline: none; }
.swatch-inner { position: relative; width: 100%; height: 100%; transition: transform .8s var(--ease); transform-style: preserve-3d; }
.swatch:hover .swatch-inner, .swatch:focus .swatch-inner, .swatch.flipped .swatch-inner { transform: rotateY(180deg); }
.swatch-front, .swatch-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; overflow: hidden; border: 2px solid var(--ink); }
.swatch-front { background: var(--cream); display: flex; flex-direction: column; }
.swatch-front svg { width: 100%; height: 66%; display: block; border-bottom: 2px solid var(--ink); }
.swatch-front h3 { font: 500 22px/1.1 var(--f-display); margin: 14px 16px 2px; }
.swatch-front p { margin: 0 16px; font: italic 500 17px var(--f-serif); color: var(--terracotta); }
.swatch-back { background: var(--indigo); color: var(--cream); transform: rotateY(180deg); padding: 18px; overflow: auto; }
.swatch-back h4 { font: 500 20px var(--f-display); margin: 0 0 8px; color: var(--saffron); }
.swatch-back p { font-size: 13.5px; line-height: 1.5; margin: 0 0 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-row span { font-size: 11px; border: 1px solid rgba(247, 238, 219, .4); padding: 2px 8px; border-radius: 999px; }

.process, .ikat-lab, .dye-garden { margin-top: 90px; }
.process { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; background: var(--cream); border-radius: 28px; padding: clamp(24px, 4vw, 48px); border: 2px solid var(--ink); }
.process-step-title { font: 500 26px var(--f-display); color: var(--maroon); margin: 18px 0 6px; min-height: 1.2em; }
.process-step-title small { font: 600 12px var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); display: block; margin-bottom: 4px; }
.process-step-text { min-height: 6.5em; font-size: 15.5px; }
.process-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.process-dots { display: flex; gap: 6px; }
.process-dots button { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; padding: 0; }
.process-dots button.on { background: var(--maroon); border-color: var(--maroon); }
.process-art { position: relative; }
.cloth { width: 100%; max-width: 420px; display: block; margin: auto; filter: drop-shadow(0 18px 20px rgba(60, 30, 10, .25)); }
.cloth .c-bg { fill: #f5ecd8; transition: fill 1s; }
.cloth .c-motif ellipse { fill: transparent; stroke: transparent; stroke-width: 2.5; transition: all 1s; }
.cloth .c-dots circle { fill: transparent; transition: fill 1s; }
.cloth .c-crackle { opacity: 0; transition: opacity 1s; mix-blend-mode: multiply; }
.cloth.step-1 .c-motif ellipse { stroke: #8f8a80; stroke-dasharray: 4 4; stroke-width: 1.5; }
.cloth.step-2 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; }
.cloth.step-3 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; } .cloth.step-3 .c-dots circle { fill: #e3b955; }
.cloth.step-4 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; fill: rgba(233, 196, 106, .55); } .cloth.step-4 .c-dots circle { fill: #e3b955; }
.cloth.step-5 .c-bg { fill: #24356f; } .cloth.step-5 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; fill: rgba(233, 196, 106, .7); } .cloth.step-5 .c-dots circle { fill: #e3b955; }
.cloth.step-6 .c-bg { fill: #24356f; } .cloth.step-6 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; fill: #f1e6cc; } .cloth.step-6 .c-dots circle { fill: #e3b955; }
.cloth.step-7 .c-bg { fill: #24356f; } .cloth.step-7 .c-motif ellipse { stroke: #e3b955; stroke-width: 3.5; fill: #8a5a2b; } .cloth.step-7 .c-dots circle { fill: #e3b955; }
.cloth.step-8 .c-bg { fill: #1f2650; } .cloth.step-8 .c-motif ellipse { stroke: #f5ecd8; stroke-width: 3.5; fill: #8a5a2b; } .cloth.step-8 .c-dots circle { fill: #f5ecd8; } .cloth.step-8 .c-crackle { opacity: .55; }
.canting { position: absolute; width: 90px; right: 4%; top: 2%; transition: transform 1s var(--ease), opacity .5s; pointer-events: none; }
.canting.drawing { animation: draw 2.4s ease-in-out infinite; }
@keyframes draw { 0% { transform: translate(-200px, 120px); } 25% { transform: translate(-80px, 60px); } 50% { transform: translate(-160px, 200px); } 75% { transform: translate(-60px, 220px); } 100% { transform: translate(-200px, 120px); } }
.wax-drip { animation: drip 1.4s infinite; }
@keyframes drip { 0%, 60% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

.ikat-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.seg-sm button { font-size: 13px; padding: 7px 13px; }
.ikat-canvas-wrap { position: relative; border-radius: 22px; overflow: hidden; border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--maroon); background: #2a1a14; aspect-ratio: 1; }
#ikatCanvas { width: 100%; height: 100%; display: block; }
.shuttle { position: absolute; left: 0; width: 46px; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #8a5a2b, #c9973a, #8a5a2b); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); top: 0; transform: translate(-50%, -50%); opacity: 0; transition: opacity .3s; }
.ikat-note { font: italic 500 18px var(--f-serif); color: var(--teal); min-height: 3em; }

.dye-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: start; }
.dye-plants { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plant { border: 1.5px solid var(--line); background: var(--cream); border-radius: 18px; padding: 12px 10px; text-align: center; transition: transform .3s var(--ease), border-color .3s; }
.plant:hover { transform: translateY(-4px) rotate(-1deg); }
.plant.active { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.plant .drop { display: block; width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--c); }
.plant b { display: block; font: 600 14px var(--f-sans); }
.plant small { display: block; font: italic 500 14px var(--f-serif); color: var(--ink-soft); }
.dye-vat { background: var(--cream); border: 2px solid var(--ink); border-radius: 24px; padding: 22px; text-align: center; position: relative; }
.vat-cloth { width: 120px; height: 150px; margin: 0 auto; background: #f5ecd8; border: 1.5px solid var(--line); border-radius: 4px 4px 16px 16px; display: grid; place-items: center;
  font: italic 500 18px var(--f-serif); color: rgba(0, 0, 0, .3); transition: background 1.2s, transform .9s var(--ease); position: relative; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 0h8M0 4h8' stroke='%23000' stroke-opacity='.05'/%3E%3C/svg%3E"); }
.vat-cloth.dip { transform: translateY(70px); }
.vat-bath { width: 190px; height: 90px; margin: -30px auto 14px; border-radius: 0 0 90px 90px; background: var(--bath, #b8a98a); border: 3px solid #5a3b22; border-top-width: 8px; position: relative; overflow: hidden; z-index: 3; transition: background .6s; }
.bubbles i { position: absolute; bottom: -10px; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .4); animation: bubble 2.6s infinite; }
.bubbles i:nth-child(1) { left: 20%; } .bubbles i:nth-child(2) { left: 40%; animation-delay: .5s; } .bubbles i:nth-child(3) { left: 60%; animation-delay: 1.1s; } .bubbles i:nth-child(4) { left: 75%; animation-delay: 1.7s; } .bubbles i:nth-child(5) { left: 32%; animation-delay: 2.1s; }
@keyframes bubble { to { transform: translateY(-90px); opacity: 0; } }
#mordant { justify-content: center; }
.dye-info { font-size: 14.5px; color: var(--ink-soft); min-height: 4.5em; margin: 6px 0 0; }

/* ---------- lenses ---------- */
.lenses { background: var(--cream); }
.lens-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.lens-tabs button { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 11px 18px; }
.lens-tabs button span { font-size: 18px; }
.lens-tabs button.active { background: var(--maroon); color: var(--cream); border-color: var(--maroon); }
.lens-panel { display: none; background: var(--paper); border: 2px solid var(--ink); border-radius: 28px; padding: clamp(22px, 4vw, 44px); }
.lens-panel.active { display: block; animation: panelIn .6s var(--ease); }
.lens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.lens-grid p { font-size: 15.5px; }
.trade-grid { grid-template-columns: .8fr 1.2fr; }
.motif-meaning { display: grid; gap: 12px; }
.mm { display: flex; gap: 14px; align-items: center; background: var(--cream); padding: 10px; border-radius: 16px; border: 1.5px solid var(--line); transition: transform .3s var(--ease); }
.mm:hover { transform: translateX(6px); }
.mm svg { width: 60px; height: 60px; border-radius: 12px; flex: none; border: 1.5px solid var(--ink); }
.mm b { font: 500 19px var(--f-display); display: block; }
.mm span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; display: block; }
.route-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.route-keys button { border-color: var(--c); }
.route-keys button.active { background: var(--c); color: var(--cream); }
.route-info { background: var(--cream); border-radius: 16px; padding: 16px 18px; border-left: 5px solid var(--c, var(--terracotta)); font-size: 14.5px; min-height: 180px; }
.route-info h4 { font: 500 21px var(--f-display); margin: 0 0 6px; }
.route-info p { margin: 0 0 8px; font-size: 14.5px; }
.trade-map { width: 100%; height: auto; border-radius: 18px; border: 2px solid var(--ink); }
.routes path { opacity: .35; transition: opacity .4s, stroke-width .4s; animation: dash 1.2s linear infinite; }
.routes path.on { opacity: 1; stroke-width: 6; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.ports circle { fill: var(--ink); }
.trade-ship { animation: sail 7s linear infinite; }
.time-chart { background: var(--cream); padding: 22px; border-radius: 20px; border: 1.5px solid var(--line); }
.time-chart h4 { font: 500 20px var(--f-display); margin: 0 0 14px; }
.time-chart h4 small { font: 500 12px var(--f-sans); color: var(--ink-soft); }
.bar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.bar-label { font-weight: 600; line-height: 1.2; }
.bar-track { height: 16px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar-track i { display: block; height: 100%; width: 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--maroon) 0 6px, var(--terracotta) 6px 12px); transition: width 1.6s var(--ease); }
.time-chart.in .bar-track i, .lens-panel.active .bar-track i.go { width: var(--w); }
.bar-val { font: italic 500 15px var(--f-serif); color: var(--ink-soft); }
.chart-foot { font-size: 13px !important; color: var(--ink-soft); margin: 12px 0 0; }
.indigo-demo { background: var(--cream); border-radius: 20px; padding: 22px; text-align: center; border: 1.5px solid var(--line); }
.indigo-steps { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.is { font: 600 13px/1.25 var(--f-sans); padding: 10px 12px; border-radius: 14px; color: #fff; }
.is small { font-weight: 400; opacity: .85; }
.is-1 { background: #1e2a5a; } .is-2 { background: #9ab04a; color: #1c1f3a; } .is-3 { background: #2c4aa0; }
.arrow { font-size: 20px; color: var(--ink-soft); }
.indigo-stage { position: relative; height: 210px; }
.indigo-vat { position: absolute; bottom: 0; left: 50%; width: 200px; height: 90px; margin-left: -100px; border-radius: 0 0 100px 100px; background: linear-gradient(#a4b84d, #6f8a2d); border: 3px solid #4a3220; border-top-width: 8px; z-index: 2;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, .15); }
.indigo-cloth { position: absolute; left: 50%; top: 0; width: 100px; height: 130px; margin-left: -50px; background: var(--ic, #f5ecd8); border-radius: 4px 4px 14px 14px; transition: transform .9s var(--ease), background 1.4s; z-index: 1; border: 1.5px solid var(--line); }
.indigo-cloth.dip { transform: translateY(80px); }

/* ---------- garments ---------- */
.garments { background: linear-gradient(180deg, var(--paper), var(--cream)); }
.dressup { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.dress-stage { position: relative; display: grid; place-items: center; padding: 20px; }
.stage-arch { position: absolute; inset: 0 10%; border-radius: 999px 999px 24px 24px; background: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 4 L36 20 L20 36 L4 20Z' fill='none' stroke='%23e8a33d' stroke-opacity='.25' stroke-width='2'/%3E%3C/svg%3E");
  border: 8px solid var(--maroon); outline: 2px solid var(--saffron); outline-offset: -16px; }
.figure { position: relative; width: min(340px, 80%); height: auto; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .25)); }
.figure .head { animation: nod 4s ease-in-out infinite; transform-origin: 150px 100px; }
@keyframes nod { 50% { transform: rotate(3deg); } }
.figure #upperG, .figure #lowerG, .figure #selendangG { transition: opacity .4s; }
.figure .swap { animation: pop .5s var(--ease); transform-origin: 150px 250px; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.ctrl-group { margin-bottom: 20px; }
.ctrl-group h4 { font: 600 12px var(--f-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--teal); margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font-size: 13.5px; padding: 8px 14px; }
.swatch-chips button { display: inline-flex; align-items: center; gap: 8px; }
.swatch-chips button::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--chip, #ccc); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 42px; height: 24px; border-radius: 999px; background: var(--paper-2); border: 1.5px solid var(--ink); position: relative; transition: background .3s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); transition: transform .3s var(--ease); }
.toggle input:checked + span { background: var(--saffron); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--maroon); outline-offset: 2px; }
.dress-notes { margin-top: 20px; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 18px 20px; box-shadow: 6px 6px 0 var(--saffron); }
.dress-notes h5 { font: 500 20px var(--f-display); margin: 0 0 4px; color: var(--maroon); }
.dress-notes p { margin: 0 0 10px; font-size: 14.5px; }
.dress-notes p:last-child { margin: 0; }
.garment-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 80px; }
.g-card { background: var(--paper); border-radius: 24px; padding: 26px; border: 2px solid var(--ink); position: relative; }
.g-card::before { content: ""; position: absolute; top: -14px; left: 26px; width: 60px; height: 28px; border-radius: 6px; background: var(--maroon);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 7px, #000 8px); mask: radial-gradient(circle at 50% 100%, transparent 7px, #000 8px); }
.g-card:nth-child(2)::before { background: var(--teal); } .g-card:nth-child(3)::before { background: var(--saffron); }
.g-card p, .g-card li { font-size: 14.5px; }
.life { padding-left: 20px; margin: 0; }
.life li { margin-bottom: 8px; }
.life li::marker { color: var(--maroon); font-weight: 700; }
.adapt { list-style: none; padding: 0; margin: 0 0 12px; }
.adapt li { padding: 7px 0; border-bottom: 1.5px dashed var(--line); }
.adapt span { font: 500 17px var(--f-display); color: var(--maroon); }

/* ---------- ecosystem ---------- */
.ecosystem { background: var(--paper); overflow: hidden; }
.eco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.eco-card { background: var(--cream); border-radius: 26px; overflow: hidden; border: 2px solid var(--ink); transition: transform .4s var(--ease), box-shadow .4s; }
.eco-card:hover { transform: translateY(-8px); box-shadow: 8px 8px 0 var(--c); }
.eco-art { height: 230px; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--c); }
.eco-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.eco-card:hover .eco-art img { transform: scale(1.08); }
.eco-art-pattern svg { width: 100%; height: 100%; display: block; }
.eco-card h3 { font: 500 23px/1.15 var(--f-display); margin: 20px 22px 8px; color: var(--c); }
.eco-card p { margin: 0 22px 24px; font-size: 14.5px; }
.pledge { margin-top: 70px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; background: var(--indigo); color: var(--cream); border-radius: 28px; padding: clamp(24px, 4vw, 48px); }
.pledge .eyebrow { color: var(--saffron); }
.pledge-list { list-style: none; padding: 0; margin: 14px 0 0; }
.pledge-list li { margin-bottom: 8px; }
.pledge-list label { display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: 15.5px; }
.pledge-list input { appearance: none; width: 24px; height: 24px; border: 2px solid var(--saffron); border-radius: 50%; flex: none; display: grid; place-items: center; transition: background .3s; cursor: pointer; }
.pledge-list input:checked { background: var(--saffron); }
.pledge-list input:checked::after { content: "✦"; color: var(--indigo); font-size: 13px; }
.pledge-lotus { width: 100%; max-width: 300px; margin: auto; }
.pl-petal { transform-origin: 100px 150px; transform: scale(0); transition: transform .9s cubic-bezier(.3, 1.6, .5, 1); }
.pl-petal.on { transform: scale(1); }
.designer-marquee { margin-top: 60px; overflow: hidden; border-block: 1.5px solid var(--ink); padding: 14px 0; }
.dm-track { display: flex; width: max-content; animation: marquee 50s linear infinite reverse; }
.dm-track span { font: italic 400 26px var(--f-display); padding: 0 26px; white-space: nowrap; }
.dm-track span::after { content: "✿"; color: var(--terracotta); margin-left: 52px; font-style: normal; font-size: 18px; }

/* ---------- studio ---------- */
.studio { background: var(--cream); }
.studio-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: start; }
.studio-tools { background: var(--paper); border: 2px solid var(--ink); border-radius: 24px; padding: 22px; }
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.palettes button { border: 1.5px solid var(--line); background: var(--cream); border-radius: 12px; padding: 8px; text-align: left; font-size: 12.5px; font-weight: 600; }
.palettes button.active { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.palettes .pal-row { display: flex; gap: 2px; margin-top: 5px; }
.palettes .pal-row i { flex: 1; height: 10px; border-radius: 2px; }
.ink-row { display: flex; gap: 8px; margin-top: 12px; }
.ink-row button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1.5px var(--line); padding: 0; transition: transform .2s; }
.ink-row button.active { box-shadow: 0 0 0 2.5px var(--ink); transform: scale(1.15); }
input[type="range"] { width: 100%; accent-color: var(--maroon); }
.studio-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-btns .toggle { width: 100%; margin-bottom: 4px; }
.studio-canvas { position: relative; aspect-ratio: 1; max-width: 640px; width: 100%; margin: auto; border-radius: 24px; overflow: hidden; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--indigo); }
#batikCanvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.canvas-hint { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; pointer-events: none; font: italic 500 30px var(--f-serif); color: rgba(28, 31, 58, .35); transition: opacity .4s; }
.canvas-hint.gone { opacity: 0; }

/* ---------- gallery ---------- */
.gallery { background: var(--paper); }
.masonry { columns: 4 240px; column-gap: 18px; }
.m-item { break-inside: avoid; margin: 0 0 18px; border-radius: 18px; overflow: hidden; position: relative; cursor: zoom-in; border: 2px solid var(--ink); background: var(--cream); }
.m-item img { width: 100%; transition: transform .8s var(--ease); }
.m-item:hover img { transform: scale(1.06); }
.m-item figcaption { position: absolute; left: 10px; bottom: 10px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
  transform: translateY(8px); opacity: 0; transition: .4s var(--ease); }
.m-item:hover figcaption { transform: none; opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(28, 31, 58, .92); display: grid; place-items: center; padding: 30px; animation: panelIn .4s; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 900px; text-align: center; }
.lightbox img { max-height: 76vh; width: auto; margin: auto; border-radius: 14px; border: 6px solid var(--cream); }
.lightbox figcaption { color: var(--cream); font: italic 500 20px/1.4 var(--f-serif); margin-top: 14px; }
.lb-close { position: absolute; top: 20px; right: 24px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--saffron); font-size: 28px; line-height: 1; }

/* ---------- flipbook ---------- */
.flipbook-section { background: var(--maroon); color: var(--cream); overflow: hidden; }
.flipbook-section .eyebrow { color: var(--saffron); }
.flipbook-section .h2 em { color: var(--saffron); }
.flipbook-section .lead { color: rgba(247, 238, 219, .8); }
.flipbook-section::before { content: ""; position: absolute; inset: 0; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M0 28 L28 0 L56 28 L28 56Z' fill='none' stroke='%23e8a33d' stroke-width='2'/%3E%3Ccircle cx='28' cy='28' r='4' fill='%23e8a33d'/%3E%3C/svg%3E"); }
.book-stage { display: flex; align-items: center; justify-content: center; gap: 14px; position: relative; z-index: 2; }
.book-wrap { width: min(980px, 100%); container-type: inline-size; perspective: 2600px; }
.book { position: relative; width: 100%; aspect-ratio: 1.42; transition: transform .8s var(--ease); transform-style: preserve-3d; }
.book.closed-front { transform: translateX(-25%); }
.book.closed-back { transform: translateX(25%); }
.leaf { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(.45, .05, .25, 1); cursor: pointer; }
.leaf.flipped { transform: rotateY(-180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  background: #fbf3e2; color: var(--ink); padding: 5.5cqw 4.4cqw 4.4cqw; border-radius: 0 10px 10px 0; box-shadow: inset 12px 0 22px -12px rgba(0, 0, 0, .35); }
.face.back { transform: rotateY(180deg); border-radius: 10px 0 0 10px; box-shadow: inset -12px 0 22px -12px rgba(0, 0, 0, .35); }
.face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .06), transparent 12%); }
.face.back::after { background: linear-gradient(270deg, rgba(0, 0, 0, .06), transparent 12%); }
.leaf:not(.flipped):hover .face.front { box-shadow: inset 12px 0 22px -12px rgba(0, 0, 0, .35), -6px 0 20px rgba(0, 0, 0, .1); }
.face .pg-num { position: absolute; bottom: 1.6cqw; font: italic 500 1.5cqw var(--f-serif); color: var(--ink-soft); }
.face.front .pg-num { right: 2.4cqw; } .face.back .pg-num { left: 2.4cqw; }
.face h3 { font: 500 3.4cqw/1.05 var(--f-display); margin: 0 0 1.2cqw; color: var(--maroon); }
.face h4 { font: 600 1.15cqw var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--terracotta); margin: 0 0 .8cqw; }
.face p, .face li { font-size: 1.42cqw; line-height: 1.5; margin: 0 0 .9cqw; }
.face ul { padding-left: 1.6cqw; margin: 0; }
.face .pg-border { position: absolute; inset: 1.4cqw; border: .25cqw solid var(--gold); border-radius: 6px; pointer-events: none; }
.face .pg-strip { position: absolute; left: 0; right: 0; top: 0; height: 2.6cqw; }
.face .pg-img { width: 100%; height: 62%; object-fit: cover; border-radius: 8px; border: .3cqw solid var(--ink); margin-bottom: 1.2cqw; }
.face .pg-cap { font: italic 500 1.8cqw/1.3 var(--f-serif); color: var(--ink-soft); }
.face.cover { background: var(--indigo); color: var(--cream); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.face.cover h3 { color: var(--saffron); font-size: 6.4cqw; font-style: italic; margin: 1cqw 0; }
.face.cover p { font: italic 500 2cqw var(--f-serif); max-width: 80%; }
.face.cover .cover-k { width: 9cqw; animation: spin 20s linear infinite; }
.face.cover .pg-border { border-color: var(--saffron); inset: 2cqw; }
.face.backcover { background: var(--indigo); color: var(--cream); display: grid; place-items: center; text-align: center; }
.face.backcover h3 { color: var(--saffron); }
.face .toc { list-style: none; padding: 0; }
.face .toc li { display: flex; justify-content: space-between; border-bottom: .12cqw dashed var(--line); padding: .5cqw 0; }
.face .toc b { color: var(--maroon); font-family: var(--f-display); font-weight: 500; }
.face .pg-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqw; }
.face .pg-swatches div { text-align: center; font: 600 1.1cqw var(--f-sans); }
.face .pg-swatches svg { width: 100%; aspect-ratio: 1; border-radius: 8px; border: .2cqw solid var(--ink); display: block; margin-bottom: .4cqw; }
.face.user .pg-frame { position: absolute; inset: 0; z-index: 0; }
.face.user .pg-inner { position: absolute; inset: 3cqw; background: #fbf3e2; border-radius: 10px; padding: 3cqw; z-index: 1; overflow: hidden; display: flex; flex-direction: column; }
.face.user .pg-inner img { width: 100%; flex: 1; min-height: 0; object-fit: cover; border-radius: 8px; margin-bottom: 1cqw; border: .25cqw solid var(--ink); }
.face.user .pg-badge { font: 600 1cqw var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--teal); }
.face .pg-foot { position: absolute; left: 4.4cqw; right: 4.4cqw; bottom: 4cqw; height: 7cqw; border-radius: 8px; overflow: hidden; border: .2cqw solid var(--ink); }
.face .deco-center { display: grid; place-items: center; height: 100%; }
.face .deco-center svg { width: 70%; }
.book-nav { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--saffron); background: transparent; color: var(--saffron); font-size: 30px; line-height: 1; transition: .25s; position: relative; z-index: 5; }
.book-nav:hover:not(:disabled) { background: var(--saffron); color: var(--maroon); }
.book-nav:disabled { opacity: .3; cursor: default; }
.book-counter { text-align: center; font: italic 500 20px var(--f-serif); margin: 18px 0 0; position: relative; z-index: 2; }
.book-maker { margin-top: 60px; background: rgba(0, 0, 0, .18); border: 1.5px solid rgba(247, 238, 219, .25); border-radius: 26px; padding: clamp(22px, 4vw, 40px); display: grid; grid-template-columns: .8fr 1.6fr; gap: 30px; position: relative; z-index: 2; }
.bm-form { display: grid; gap: 14px; }
.bm-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--saffron); }
.bm-form input[type="text"], .bm-form textarea, .bm-form select, .gloss-search {
  font: 400 16px var(--f-sans); letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--paper); border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; width: 100%; }
.bm-form input:focus, .bm-form textarea:focus, .bm-form select:focus, .gloss-search:focus { outline: none; border-color: var(--saffron); }
.bm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bm-actions .btn-ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.bm-actions .btn-primary { background: var(--saffron); border-color: var(--saffron); color: var(--maroon); }

/* ---------- quiz ---------- */
.quiz-section { background: var(--cream); }
.quiz-card { max-width: 820px; margin: auto; background: var(--paper); border: 2px solid var(--ink); border-radius: 30px; padding: clamp(24px, 5vw, 54px); box-shadow: 10px 10px 0 var(--teal); position: relative; overflow: hidden; }
.q-progress { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin: 10px 0 24px; }
.q-progress span { display: block; height: 100%; background: var(--maroon); transition: width .5s var(--ease); }
.q-text { font: 500 clamp(22px, 2.6vw, 28px)/1.3 var(--f-display); margin: 0 0 18px; }
.q-opts { display: grid; gap: 10px; }
.q-opts button { text-align: left; border: 2px solid var(--ink); background: var(--cream); border-radius: 16px; padding: 14px 18px; font-size: 15.5px; font-weight: 500; transition: .25s var(--ease); }
.q-opts button:hover:not(:disabled) { transform: translateX(6px); background: var(--paper-2); }
.q-opts button.right { background: #cfe6c9; border-color: var(--leaf); }
.q-opts button.wrong { background: #f3c9c1; border-color: var(--maroon); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-explain { margin: 16px 0 0; font: italic 500 18px var(--f-serif); color: var(--teal); min-height: 1.5em; }
.q-next { margin-top: 14px; }
.q-result { text-align: center; }
.q-result .big { font: 400 90px/1 var(--f-display); color: var(--maroon); }
.confetti { position: absolute; top: -20px; width: 12px; height: 12px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(900px) rotate(720deg); opacity: .2; } }

/* ---------- glossary ---------- */
.glossary { background: var(--paper); }
.gloss-search { max-width: 520px; border: 2px solid var(--ink); margin-top: 10px; }
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.gloss { background: var(--cream); border-radius: 18px; padding: 16px 18px; border: 1.5px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.gloss:hover { transform: translateY(-3px); border-color: var(--ink); }
.gloss b { font: 500 21px var(--f-display); color: var(--maroon); }
.gloss i { font: italic 500 15px var(--f-serif); color: var(--teal); margin-left: 6px; }
.gloss p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.gloss-empty { font: italic 500 20px var(--f-serif); color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--cream); padding: 0 0 30px; position: relative; z-index: 2; }
.footer-border { height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23f7eedb'/%3E%3Cpolygon points='0,40 20,0 40,40' fill='%237b1e22'/%3E%3Cpolygon points='8,40 20,14 32,40' fill='%23e8a33d'/%3E%3Ccircle cx='20' cy='31' r='3' fill='%231e2a5a'/%3E%3C/svg%3E") repeat-x; background-size: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1.4fr .8fr; gap: 40px; padding-top: 60px; }
.brand-lg { font-size: 44px; color: var(--saffron); }
.footer h4 { font: 600 12px var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--saffron); margin: 0 0 14px; }
.footer p { font-size: 15px; opacity: .85; }
.footer .small { font-size: 12.5px; opacity: .6; }
.refs { padding-left: 18px; margin: 0; font-size: 14px; opacity: .85; }
.refs li { margin-bottom: 8px; }
.foot-links { list-style: none; padding: 0; margin: 0; columns: 1; }
.foot-links a { text-decoration: none; font-size: 14.5px; opacity: .85; line-height: 2; }
.foot-links a:hover { color: var(--saffron); opacity: 1; }
.footer-end { text-align: center; font: italic 500 18px var(--f-serif); opacity: .6; margin: 40px 0 0; }
.to-top { position: fixed; right: 20px; bottom: 20px; width: 54px; height: 70px; border: 0; background: none; z-index: 100; opacity: 0; transform: translateY(20px); transition: .4s var(--ease); padding: 0; }
.to-top.show { opacity: 1; transform: none; }
.to-top:hover { transform: translateY(-6px) rotate(-6deg); }
.to-top svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); }

/* ---------- print (flipbook PDF) ---------- */
#printArea { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.printing > *:not(#printArea):not(.defs) { display: none !important; }
  body.printing::before { display: none; }
  body.printing { background: #fff; }
  body.printing #printArea { display: block; }
  #printArea .print-page { width: 250mm; height: 176mm; margin: 0 auto; container-type: inline-size; position: relative; break-after: page; page-break-after: always; }
  #printArea .print-page .face { position: absolute; top: 0; bottom: 0; left: 25%; width: 50%; transform: none !important; backface-visibility: visible; border-radius: 10px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; border: 1px solid #ddd; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links a { padding: 8px 8px; font-size: 13.5px; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .garment-cards, .eco-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  body { font-size: 16px; }
  .nav-links { position: fixed; top: 74px; left: 12px; right: 12px; flex-direction: column; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 24px; padding: 14px;
    transform: translateY(-20px); opacity: 0; pointer-events: none; transition: .35s var(--ease); }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 17px; padding: 10px 14px; }
  .burger { display: block; }
  .sound-label { display: none; }
  .sound-toggle { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 110px; text-align: left; }
  .hero-art { height: 440px; max-width: 520px; width: 100%; margin: 0 auto; }
  .prologue-grid, .map-wrap, .process, .ikat-lab, .dye-layout, .lens-grid, .trade-grid, .dressup, .pledge, .studio-wrap, .book-maker, .peresean { grid-template-columns: 1fr; }
  .dye-plants { grid-template-columns: repeat(4, 1fr); }
  .timeline-section { height: auto !important; }
  .timeline-sticky { position: relative; height: auto; padding-bottom: 30px; }
  .timeline-track { overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; padding-bottom: 20px; }
  .era-card { scroll-snap-align: center; max-height: none; }
  .timeline-rail { display: none; }
  .book-nav { position: absolute; bottom: -70px; }
  .book-nav.prev { left: calc(50% - 70px); } .book-nav.next { right: calc(50% - 70px); }
  .book-counter { margin-top: 84px; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .hero { padding-inline: 16px; }
  .swatch-grid, .garment-cards, .eco-grid, .stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-num, .plus { font-size: 34px; }
  .dye-plants { grid-template-columns: repeat(2, 1fr); }
  .bar { grid-template-columns: 1fr 70px; }
  .bar-label { grid-column: 1 / -1; }
  .bm-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .marquee-track { font-size: 22px; }
  .hero-art { height: 380px; }
  .sticker { font-size: 11px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
