/* ================= Taalegari — rosewood, palm leaf, lamp-black & gold ================= */

:root {
  --ink: #1c120b;
  --ink2: #2a1b10;
  --wood: #3b2416;
  --wood2: #5a3820;
  --rose: #24150d;
  --leaf: #e8cf98;
  --leaf2: #d9b779;
  --paper: #f3e6c8;
  --paper2: #ead6ab;
  --gold: #d6a640;
  --gold2: #f0cd7a;
  --kumkum: #a3262a;
  --turmeric: #e0a91f;
  --indigo: #3d4f9a;
  --text: #2b1d12;
  --muted: #7a6046;
  --cream: #f6ead0;
  --cream2: #cdb48b;
  --serif: "Cormorant Garamond", "Spectral", Georgia, serif;
  --body: "Spectral", Georgia, serif;
  --kn: "Tiro Kannada", "Noto Serif Kannada", serif;
  --r: 14px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 6px 18px -8px rgba(0, 0, 0, 0.4);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .25' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .05 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--body);
  color: var(--cream);
  background: var(--rose);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.reading { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--gold2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font: 600 11px/1 var(--body);
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid currentColor;
  opacity: 0.55;
}
.kn, [lang="kn"] { font-family: var(--kn); }
.s-knda { font-family: var(--kn); }
.s-deva { font-family: "Tiro Devanagari Hindi", serif; }
.s-telu { font-family: "Tiro Telugu", serif; }
.s-taml { font-family: "Tiro Tamil", serif; }
.s-mlym { font-family: "Noto Serif Malayalam", serif; }
.s-latn { font-family: var(--body); font-style: italic; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1220px, 100% - 48px); margin-inline: auto; }
.fine { font-size: 13px; opacity: 0.65; }
.muted { opacity: 0.6; }

/* ---------- buttons, chips, tags ---------- */

.btn {
  --b: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--b);
  background: linear-gradient(180deg, #e6b955, #b8862d);
  color: var(--ink);
  font: 600 15px/1 var(--body);
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.6), 0 8px 20px -10px rgba(214, 166, 64, 0.8);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--gold2); box-shadow: none; }
.btn.ghost:hover { background: rgba(214, 166, 64, 0.12); }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }
.paper .btn.ghost { color: var(--wood2); --b: var(--wood2); }
.rbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(240, 205, 122, 0.35);
  background: rgba(240, 205, 122, 0.06);
  color: var(--gold2);
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.rbtn:hover { background: rgba(240, 205, 122, 0.18); transform: scale(1.06); }
.linkbtn { background: none; border: 0; color: var(--gold2); text-decoration: underline; padding: 4px 0; }
.tag {
  --tc: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tc) 70%, transparent);
  background: color-mix(in srgb, var(--tc) 18%, transparent);
  white-space: nowrap;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tc); }
.ok { color: #7fb069; }
.wait { color: #c9a46a; }

/* ---------- header ---------- */

.hdr {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  transition: background 0.35s, padding 0.35s, box-shadow 0.35s;
}
.hdr.solid {
  background: rgba(28, 18, 11, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  padding-block: 9px;
  box-shadow: 0 1px 0 rgba(214, 166, 64, 0.22), 0 10px 30px -18px #000;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; }
.brand svg { width: 42px; fill: var(--leaf2); }
.brand svg circle { fill: var(--ink); }
.brand-kn { font: 400 24px/1 var(--kn); color: var(--gold2); }
.brand-en { font: 600 19px/1 var(--serif); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative;
  padding: 8px 12px;
  color: var(--cream);
  text-decoration: none;
  font-size: 15px;
  opacity: 0.78;
  transition: opacity 0.2s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s;
}
.nav a:hover, .nav a.on { opacity: 1; }
.nav a.on::after, .nav a:hover::after { transform: scaleX(1); }
.nav-ocr { color: var(--gold2) !important; }
.hdr-tools { display: flex; align-items: center; gap: 10px; }
.kbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(240, 205, 122, 0.3);
  background: rgba(240, 205, 122, 0.06);
  color: var(--cream);
  padding: 7px 10px;
  border-radius: 10px;
}
.kbtn svg, .hero-search svg, .lib-q svg, .pal-q svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lang select {
  appearance: none;
  border: 1px solid rgba(240, 205, 122, 0.3);
  background: rgba(240, 205, 122, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f0cd7a' stroke-width='1.4'/%3E%3C/svg%3E") right 10px center/10px no-repeat;
  padding: 7px 28px 7px 12px;
  border-radius: 10px;
}
.lang option { background: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; width: 38px; height: 38px; padding: 9px 8px; }
.nav-toggle i { display: block; height: 2px; background: var(--gold2); margin: 4px 0; border-radius: 2px; }

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

.hero {
  --mx: 70%;
  --my: 40%;
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 110px 0 80px;
  background:
    radial-gradient(900px 600px at var(--mx) var(--my), rgba(232, 160, 60, 0.2), transparent 60%),
    radial-gradient(1200px 800px at 80% 10%, #4a2a17 0%, transparent 60%),
    linear-gradient(180deg, #1a0f08, #2a170d 60%, #24150d);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--noise);
  opacity: 0.35;
  mix-blend-mode: overlay;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(transparent, var(--rose));
  z-index: -1;
}
.hero-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  left: calc(var(--mx) - 260px);
  top: calc(var(--my) - 260px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 110, 0.16), transparent 65%);
  pointer-events: none;
  z-index: -1;
  transition: left 0.25s ease-out, top 0.25s ease-out;
}
.hero-in {
  width: min(1320px, 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: center;
}
.kicker { margin: 0 0 14px; color: var(--gold2); letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; }
.orn { color: var(--gold); }
.hero h1 { margin: 0; line-height: 0.95; }
.h1-kn {
  display: block;
  font: 400 clamp(64px, 9vw, 128px)/1.1 var(--kn);
  background: linear-gradient(180deg, #f8dc95 10%, #c99434 55%, #8a5a1c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 10px 30px rgba(214, 166, 64, 0.25));
}
.h1-en {
  display: block;
  font: 600 clamp(22px, 2.6vw, 34px)/1 var(--serif);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cream2);
  margin-top: 8px;
}
.hero-sub { font-size: clamp(17px, 1.5vw, 20px); max-width: 34em; color: #e9d8b5; margin: 22px 0 26px; }
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(246, 234, 208, 0.07);
  border: 1px solid rgba(240, 205, 122, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.08);
  transition: border-color 0.2s, background 0.2s;
}
.hero-search:focus-within { border-color: var(--gold2); background: rgba(246, 234, 208, 0.12); }
.hero-search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; }
.hero-search input::placeholder { color: rgba(246, 234, 208, 0.55); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 34px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 30px; justify-content: start; }
.stat { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.stat b { font: 600 34px/1 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; }
.stat i { font: normal 15px/1 var(--kn); color: var(--cream2); opacity: 0.75; }
.stat span { grid-column: 1 / -1; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 1.5px solid rgba(240, 205, 122, 0.5);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--gold2);
  animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- the palm leaf ---------- */

.leaf {
  position: relative;
  aspect-ratio: 1600 / 300;
  width: 100%;
  background: var(--tex) center / 100% 100% no-repeat;
  container-type: inline-size;
  user-select: none;
}
.leaf-text {
  position: absolute;
  inset: 13% 12.5% 13% 12.5%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}
.ll {
  --mk: transparent;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 0.6cqw;
  transition: background 0.2s, box-shadow 0.2s;
}
.ll::before {
  content: "";
  position: absolute;
  inset: 8% -1.2cqw;
  border-radius: 0.8cqw;
  background: var(--mk);
  opacity: 0.38;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.ll span {
  font-family: var(--kn);
  line-height: 1;
  white-space: nowrap;
  color: #24160b;
  text-shadow: 0 0.08cqw 0 rgba(255, 238, 200, 0.45), 0 -0.04cqw 0 rgba(60, 30, 5, 0.35);
  letter-spacing: 0.02em;
}
.ll-n {
  position: absolute;
  left: -3.6cqw;
  font: italic 1.1cqw/1 var(--body);
  color: rgba(70, 40, 15, 0.6);
}
.ll.hov { background: rgba(255, 230, 160, 0.28); }
.ll.sel { background: rgba(255, 220, 130, 0.35); box-shadow: 0 0 0 0.18cqw rgba(163, 38, 42, 0.75); }
.leaf.guides .ll { box-shadow: inset 0 -0.1cqw 0 rgba(120, 70, 20, 0.45); }
.leaf.guides .ll.sel { box-shadow: 0 0 0 0.18cqw rgba(163, 38, 42, 0.75); }
.leaf-num {
  position: absolute;
  left: 2.6cqw;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font: 1.7cqw/1 var(--kn);
  color: rgba(50, 28, 10, 0.55);
}
.leaf-mark { position: absolute; right: 3cqw; top: 18%; font: 1.5cqw/1 var(--kn); color: rgba(50, 28, 10, 0.5); }
.leaf-pseudo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- hero pothi (fans around its cord) ---------- */

.pothi-wrap {
  --rx: 22deg;
  --ry: -6deg;
  position: relative;
  perspective: 1600px;
  padding: 20px 0 0;
}
.pothi {
  position: relative;
  width: min(640px, 100%);
  margin-inline: auto;
  aspect-ratio: 1 / 0.82;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pl {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  transform-origin: 8.5% 50%;
  transform: translateY(-50%) translateY(calc(var(--k) * -2.2px)) translateZ(calc(var(--k) * 1.5px));
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--k) * 35ms), filter 0.3s;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}
.pl .leaf { pointer-events: none; }
.pothi-wrap.open .pl {
  transform: translateY(-50%) rotate(calc(var(--d) * 6.2deg)) translateZ(calc(var(--k) * 1.5px));
}
.pothi-wrap.open .pl.hot {
  transform: translateY(-50%) rotate(calc(var(--d) * 6.2deg)) translateX(3.5%) translateZ(30px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55)) brightness(1.06);
}
.pl.board {
  aspect-ratio: 1600 / 300;
  border-radius: 46% 46% 46% 46% / 50%;
  background:
    radial-gradient(circle at 8.5% 50%, #120a05 0 1.1%, transparent 1.3%),
    radial-gradient(circle at 91.5% 50%, #120a05 0 1.1%, transparent 1.3%),
    var(--grain),
    linear-gradient(180deg, #7a4a28, #4b2a15 55%, #2f1a0c);
  box-shadow: inset 0 2px 0 rgba(255, 200, 140, 0.25), inset 0 -4px 10px rgba(0, 0, 0, 0.5);
  border-radius: 999px / 50%;
}
.pothi-cord {
  position: absolute;
  left: calc(8.5% - 3px);
  top: 50%;
  width: 6px;
  height: 30%;
  border-radius: 3px;
  background: repeating-linear-gradient(160deg, #b02a2a 0 4px, #7b1717 4px 7px);
  transform: translateZ(30px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.pothi-cord::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -26px;
  width: 18px;
  height: 30px;
  margin-left: -9px;
  background: repeating-linear-gradient(90deg, #b02a2a 0 2px, #6d1212 2px 3px);
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  border-radius: 0 0 4px 4px;
}
.pothi-cap {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  min-height: 92px;
  margin-top: 10px;
}
.pc-kn { font: 26px/1.2 var(--kn); color: var(--gold2); }
.pc-en { font-size: 14px; opacity: 0.75; }
.pc-ln { font-style: italic; color: #ecdcbc; max-width: 36em; }
.pothi-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(240, 205, 122, 0.35);
  background: rgba(28, 18, 11, 0.5);
  color: var(--gold2);
}

/* ---------- sections ---------- */

.sec { position: relative; padding: 120px 0; isolation: isolate; }
.sec::before { content: ""; position: absolute; inset: 0; background: var(--noise); opacity: 0.22; mix-blend-mode: overlay; z-index: -1; pointer-events: none; }
.sec.dark { background: radial-gradient(1200px 600px at 50% 0%, #3a2214, transparent 70%), var(--rose); }
.sec.paper {
  color: var(--text);
  background:
    radial-gradient(1400px 700px at 50% -10%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(160, 110, 50, 0.18), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(160, 110, 50, 0.16), transparent 70%),
    var(--paper);
  color-scheme: light;
}
.sec.paper::before { opacity: 0.22; mix-blend-mode: multiply; }
.sec.paper a { color: var(--kumkum); }
.sec.wood { background: var(--grain), linear-gradient(180deg, #2b190e, #3a2214 40%, #2b190e); }
.sh { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.sh-n {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 0 12px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  font: 20px/1 var(--kn);
  color: var(--gold);
  box-shadow: 0 0 0 5px rgba(214, 166, 64, 0.1);
}
.paper .sh-n { color: var(--kumkum); border-color: var(--kumkum); box-shadow: 0 0 0 5px rgba(163, 38, 42, 0.08); }
.sh h2 { font: 600 clamp(36px, 4.6vw, 58px)/1.05 var(--serif); margin: 0 0 14px; letter-spacing: 0.01em; }
.sh h2 .kn { font-size: 0.8em; color: var(--gold2); margin-right: 8px; }
.sh p:last-child { margin: 0; font-size: 18px; opacity: 0.82; }
.sh::after {
  content: "❦";
  display: block;
  margin-top: 22px;
  color: var(--gold);
  font-size: 20px;
  background: linear-gradient(90deg, transparent, currentColor 30%, transparent 46%, transparent 54%, currentColor 70%, transparent) center / 260px 1px no-repeat;
}
.paper .sh::after { color: var(--kumkum); }
.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px dashed var(--gold);
  color: var(--gold2);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rv { opacity: 0; transform: translateY(26px); transition: opacity 0.9s, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }

/* ---------- rub ---------- */

.rub { max-width: 1060px; margin-inline: auto; }
.rub-leaf {
  padding: 26px;
  border-radius: 20px;
  background: radial-gradient(closest-side, rgba(255, 190, 100, 0.12), transparent), rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(214, 166, 64, 0.2);
}
#rubCanvas {
  display: block;
  width: 100%;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Ccircle cx='22' cy='22' r='18' fill='rgba(30,18,8,.25)' stroke='%23f0cd7a' stroke-width='1.5' stroke-dasharray='3 3'/%3E%3C/svg%3E") 22 22, crosshair;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
}
.rub-bar { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.rub-meter { --p: 0; flex: 1; height: 8px; border-radius: 4px; background: rgba(240, 205, 122, 0.12); overflow: hidden; }
.rub-meter i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, #4a2d14, #1b1108); box-shadow: 0 0 10px var(--gold); transition: width 0.15s; }
.rub-pct { font-size: 14px; opacity: 0.8; min-width: 80px; }
.rub-out { margin-top: 24px; padding: 22px 26px; border-left: 3px solid var(--gold); background: rgba(214, 166, 64, 0.07); border-radius: 0 12px 12px 0; animation: rise 0.6s; }
.rub-out p { margin: 6px 0; }
.rub-out .kn { font-size: 22px; color: var(--gold2); margin-right: 14px; }
.rub-out em { opacity: 0.85; }
.rub-done { font: 600 20px var(--serif); color: var(--gold2); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- making-of ---------- */

.mk { display: grid; grid-template-columns: 1.25fr 1fr; gap: 60px; }
.mk-sticky { position: sticky; top: 22vh; }
.mk-stage { position: relative; padding: 70px 10px; }
.mk-stage .leaf { transition: filter 0.9s, transform 0.9s; filter: drop-shadow(0 14px 20px rgba(60, 30, 5, 0.35)); }
.mk-stage .ll span { transition: color 0.9s, text-shadow 0.9s, opacity 0.9s; }
.mk-label { text-align: center; font-size: 18px; margin: 10px 0 0; }
.mk-label .kn { font-size: 24px; color: var(--kumkum); }
.mk-cut, .mk-stylus, .mk-cord, .mk-board, .mk-steam { position: absolute; opacity: 0; transition: opacity 0.7s, transform 0.9s; pointer-events: none; }
.mk-cut { inset: 62px 2px; border: 2px dashed rgba(163, 38, 42, 0.7); border-radius: 50% / 50%; }
.mk-stylus {
  width: 9px;
  height: 120px;
  left: 40%;
  top: -10px;
  background: linear-gradient(180deg, #8c8c8c, #3a3a3a 85%, #111);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%);
  transform: rotate(24deg);
  transform-origin: bottom;
}
.mk-cord {
  left: calc(10px + 8.5% - 3px);
  top: 40px;
  bottom: 40px;
  width: 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(160deg, #b02a2a 0 4px, #7b1717 4px 7px);
}
.mk-board {
  left: 10px;
  right: 10px;
  height: 30px;
  border-radius: 999px / 50%;
  background: var(--grain), linear-gradient(180deg, #7a4a28, #3a2010);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
.mk-board.t { top: 34px; transform: translateY(-40px); }
.mk-board.b { bottom: 34px; transform: translateY(40px); }
.mk-steam { left: 20%; right: 20%; top: 0; height: 70px; display: flex; justify-content: space-around; }
.mk-steam i { width: 18px; height: 60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.65), transparent); filter: blur(4px); animation: steam 2.4s infinite; }
.mk-steam i:nth-child(2) { animation-delay: 0.8s; }
.mk-steam i:nth-child(3) { animation-delay: 1.6s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(30px) scaleX(0.6); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px) scaleX(1.4); } }

.mk-stage[data-s="0"] .leaf { filter: hue-rotate(58deg) saturate(1.7) brightness(0.78); }
.mk-stage[data-s="1"] .leaf { filter: hue-rotate(38deg) saturate(1.3) brightness(0.85); }
.mk-stage[data-s="1"] .mk-steam { opacity: 1; }
.mk-stage[data-s="2"] .leaf { filter: hue-rotate(12deg) saturate(1.05) brightness(0.95); }
.mk-stage[data-s="3"] .leaf { filter: brightness(1.06) contrast(1.05); }
.mk-stage[data-s="3"] .mk-cut { opacity: 1; }
.mk-stage[data-s="4"] .mk-cut { opacity: 0; }
.mk-stage:is([data-s="0"], [data-s="1"], [data-s="2"], [data-s="3"], [data-s="4"]) .ll span { opacity: 0; }
.mk-stage:is([data-s="0"], [data-s="1"], [data-s="2"], [data-s="3"], [data-s="4"]) :is(.leaf-num, .leaf-mark) { opacity: 0; }
.mk-stage[data-s="4"] .leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8.5% 50%, transparent 1.4%, rgba(163, 38, 42, 0.9) 1.5% 1.9%, transparent 2%),
    radial-gradient(circle at 91.5% 50%, transparent 1.4%, rgba(163, 38, 42, 0.9) 1.5% 1.9%, transparent 2%);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.mk-stage[data-s="5"] .ll span { color: transparent; text-shadow: 0 0.1cqw 0 rgba(255, 240, 205, 0.8), 0 -0.06cqw 0 rgba(110, 70, 25, 0.45); }
.mk-stage[data-s="5"] .mk-stylus { opacity: 1; animation: scribe 3s ease-in-out infinite; }
@keyframes scribe { 0%, 100% { transform: translateX(-120px) rotate(24deg); } 50% { transform: translateX(160px) rotate(24deg); } }
.mk-stage[data-s="6"] .leaf { filter: drop-shadow(0 14px 20px rgba(60, 30, 5, 0.35)) contrast(1.05); }
.mk-stage[data-s="7"] .mk-cord { opacity: 1; }
.mk-stage[data-s="7"] .mk-board { opacity: 1; transform: none; }
.mk-steps { list-style: none; margin: 0; padding: 0 0 20vh; counter-reset: s; }
.mk-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  min-height: 46vh;
  align-content: center;
  opacity: 0.35;
  transition: opacity 0.5s;
}
.mk-step.on { opacity: 1; }
.mk-n {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 22px/1 var(--kn);
  border: 1.5px solid var(--kumkum);
  color: var(--kumkum);
  background: rgba(255, 255, 255, 0.35);
}
.mk-step.on .mk-n { background: var(--kumkum); color: var(--paper); }
.mk-step h3 { margin: 4px 0 6px; font: 600 28px/1.15 var(--serif); }
.mk-step h3 .kn { font-size: 26px; color: var(--kumkum); }
.mk-step h3 small { font-size: 0.7em; opacity: 0.7; font-weight: 500; }
.mk-step p { margin: 0; font-size: 18px; }

/* ---------- library ---------- */

.lib { display: grid; grid-template-columns: 290px 1fr; gap: 36px; align-items: start; }
.lib-side {
  position: sticky;
  top: 86px;
  padding: 20px;
  border-radius: var(--r);
  background: rgba(20, 12, 6, 0.45);
  border: 1px solid rgba(214, 166, 64, 0.2);
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.lib-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214, 166, 64, 0.35);
  background: rgba(246, 234, 208, 0.06);
}
.lib-q input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
.paper .lib-q { border-color: rgba(90, 56, 32, 0.35); background: rgba(255, 255, 255, 0.4); }
.fg { margin-top: 20px; }
.fg h4 { margin: 0 0 10px; font: 600 12px/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold2); opacity: 0.85; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  --tc: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(240, 205, 122, 0.25);
  background: rgba(240, 205, 122, 0.05);
  font-size: 13.5px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.chip small { opacity: 0.55; }
.chip:hover { border-color: var(--tc); transform: translateY(-1px); }
.chip.on { background: color-mix(in srgb, var(--tc) 35%, transparent); border-color: var(--tc); }
.lib-side .linkbtn { margin-top: 18px; }
.lib-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.lib-bar p { margin: 0; font-size: 15px; opacity: 0.85; }
.lib-bar b { font: 600 26px var(--serif); color: var(--gold2); }
.lib-ctl { display: flex; gap: 10px; }
.lib-ctl select, .atlas-ctl select {
  appearance: none;
  border: 1px solid rgba(214, 166, 64, 0.35);
  border-radius: 10px;
  padding: 8px 30px 8px 12px;
  background: rgba(246, 234, 208, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f0cd7a' stroke-width='1.4'/%3E%3C/svg%3E") right 10px center/10px no-repeat;
}
select option { background: var(--ink); color: var(--cream); }
.seg { display: inline-flex; border: 1px solid rgba(214, 166, 64, 0.35); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 8px 14px; }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.empty { text-align: center; padding: 60px 0; opacity: 0.7; font-style: italic; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 56px 0; }
.bundle { position: relative; padding: 0 18px; display: grid; grid-template-rows: auto 1fr; }
.bundle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--th) + 24px + 6px);
  height: 16px;
  background: linear-gradient(180deg, #8a5a32, #5a3820 40%, #2c180b);
  box-shadow: 0 10px 18px -6px rgba(0, 0, 0, 0.7);
  z-index: 0;
}
.b-obj {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: calc(var(--th) + 24px);
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.35s;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.45));
}
.b-obj:hover, .b-obj:focus-visible { transform: translateY(-10px) rotate(-1.2deg); filter: drop-shadow(0 22px 16px rgba(0, 0, 0, 0.55)); }
.b-board {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  border-radius: 999px / 50%;
  background: var(--grain), linear-gradient(180deg, #8a5630, #4b2a15 70%, #2a160a);
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.35);
}
.b-board.t { top: 0; }
.b-board.b { bottom: 0; }
.b-stack {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 12px;
  bottom: 12px;
  border-radius: 999px / 40%;
  background:
    linear-gradient(90deg, rgba(60, 30, 10, 0.55), transparent 9%, transparent 91%, rgba(60, 30, 10, 0.55)),
    repeating-linear-gradient(180deg, #e7cb92 0 2px, #c9a15e 2px 2.6px, #dcbb7c 2.6px 4px, #a87d42 4px 4.4px);
  transition: transform 0.35s;
}
.b-obj:hover .b-stack { transform: skewX(-4deg); }
.b-cord {
  position: absolute;
  left: 22%;
  top: -2px;
  bottom: -2px;
  width: 7px;
  background: repeating-linear-gradient(160deg, var(--cord) 0 4px, color-mix(in srgb, var(--cord) 60%, #000) 4px 7px);
  border-radius: 3px;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.4);
}
.b-cord::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  width: 19px;
  height: 11px;
  border-radius: 50%;
  background: var(--cord);
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.4);
  transform: translateY(-50%);
}
.b-slip {
  position: absolute;
  left: 36%;
  right: 8%;
  top: 50%;
  transform: translateY(-50%) rotate(-1deg);
  padding: 3px 8px;
  background: #f7ecd2;
  color: #3b2414;
  font-size: 14px;
  line-height: 1.3;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b-meta { padding-top: 32px; }
.b-meta h3 { margin: 0 0 2px; font: 600 21px/1.2 var(--serif); }
.b-meta p { margin: 0; font-size: 14px; opacity: 0.8; }
.b-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px !important; opacity: 1 !important; }
.st { font-size: 12.5px; }
.b-hit {
  display: grid;
  gap: 2px;
  text-align: left;
  margin-top: 10px;
  padding: 8px 12px;
  width: 100%;
  border: 1px solid rgba(214, 166, 64, 0.35);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: rgba(214, 166, 64, 0.08);
}
.b-hit .kn { font-size: 16px; color: var(--gold2); }
.b-hit small { font-style: italic; opacity: 0.8; }
.idx { width: 100%; border-collapse: collapse; font-size: 15px; }
.idx th { text-align: left; font: 600 12px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold2); padding: 10px; border-bottom: 1px solid rgba(214, 166, 64, 0.4); }
.idx td { padding: 12px 10px; border-bottom: 1px solid rgba(214, 166, 64, 0.12); vertical-align: top; }
.idx td .kn { font-size: 17px; }
.idx tbody tr { cursor: pointer; transition: background 0.2s; }
.idx tbody tr:hover, .idx tbody tr:focus { background: rgba(214, 166, 64, 0.1); outline: none; }

/* ---------- collections ---------- */

.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.coll {
  position: relative;
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 28px 26px 24px;
  border-radius: 6px;
  border: 1px solid rgba(90, 56, 32, 0.3);
  background:
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.15)),
    var(--paper2);
  box-shadow: 0 2px 0 rgba(90, 56, 32, 0.15), 0 18px 30px -24px rgba(60, 30, 5, 0.7);
  color: var(--text);
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.coll::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(163, 38, 42, 0.35);
  border-radius: 3px;
  pointer-events: none;
}
.coll:hover { transform: translateY(-5px) rotate(-0.4deg); box-shadow: 0 2px 0 rgba(90, 56, 32, 0.15), 0 30px 40px -24px rgba(60, 30, 5, 0.8); }
.coll-kn { font-size: 30px; line-height: 1.2; color: var(--kumkum); }
.coll-en { font: 600 22px/1.1 var(--serif); }
.coll-d { font-size: 15px; opacity: 0.8; }
.coll-ws { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.coll-ws i { font: normal 13px/1.5 var(--kn); padding: 1px 8px; border-radius: 4px; background: color-mix(in srgb, var(--tc) 16%, transparent); border-left: 3px solid var(--tc); }
.coll-n { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin-top: 4px; }

/* ---------- timeline ---------- */

.tl { position: relative; }
.tl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tl-year { margin: 0; }
.tl-year b { font: 600 42px/1 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; }
.tl-year > .kn { font-size: 22px; opacity: 0.7; margin: 0 8px; }
.tl-year small { font-size: 15px; opacity: 0.85; }
.tl-nav { display: flex; gap: 8px; }
.tl-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  user-select: none;
}
.tl-scroll.grab { cursor: grabbing; }
.tl-track {
  position: relative;
  background: linear-gradient(180deg, transparent calc(100% - 31px), rgba(214, 166, 64, 0.5) calc(100% - 31px), rgba(214, 166, 64, 0.5) calc(100% - 30px), transparent calc(100% - 30px));
}
.tl-era {
  position: absolute;
  height: 26px;
  padding: 3px 10px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(214, 166, 64, 0.1);
  border: 1px solid rgba(214, 166, 64, 0.3);
  transition: background 0.3s;
}
.tl-era b { font-weight: 400; color: var(--gold2); }
.tl-era span { opacity: 0.7; }
.tl-era.on { background: rgba(214, 166, 64, 0.28); }
.tl-tick { position: absolute; top: 0; border-left: 1px dashed rgba(214, 166, 64, 0.12); }
.tl-tick.maj { border-left: 1px solid rgba(214, 166, 64, 0.25); }
.tl-tick span { position: absolute; bottom: -2px; left: 6px; font: 600 15px var(--serif); color: var(--gold2); white-space: nowrap; }
.tl-tick i { font: normal 12px var(--kn); opacity: 0.6; margin-left: 5px; }
.tl-pin {
  --tc: var(--gold);
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  transform: translateX(-7px);
}
.tl-pin::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  height: var(--stem);
  border-left: 1px solid color-mix(in srgb, var(--tc) 60%, transparent);
}
.tl-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--tc); border: 2px solid var(--rose); box-shadow: 0 0 0 1.5px var(--tc); margin-top: 1px; transition: transform 0.2s; }
.tl-pin.done .tl-dot { box-shadow: 0 0 0 1.5px var(--tc), 0 0 14px var(--tc); }
.tl-lab { display: grid; padding: 4px 10px; border-radius: 8px; background: rgba(28, 18, 11, 0.75); border: 1px solid rgba(214, 166, 64, 0.18); transition: border-color 0.2s, background 0.2s; }
.tl-lab b { font-weight: 400; font-size: 15px; white-space: nowrap; }
.tl-lab small { font-size: 12px; opacity: 0.7; white-space: nowrap; }
.tl-pin:hover .tl-dot { transform: scale(1.35); }
.tl-pin:hover .tl-lab { border-color: var(--tc); background: rgba(50, 30, 15, 0.95); }
.tl-needle { position: absolute; left: 50%; top: 70px; bottom: 0; border-left: 1.5px solid var(--kumkum); pointer-events: none; opacity: 0.65; }
.tl-needle::before { content: ""; position: absolute; left: -6px; top: -6px; border: 6px solid transparent; border-top-color: var(--kumkum); }

/* ---------- map ---------- */

.mapbox { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.map-frame {
  position: relative;
  padding: 18px;
  border-radius: 4px;
  background: #efdcb2;
  border: 1px solid #a3814e;
  box-shadow: inset 0 0 0 6px #efdcb2, inset 0 0 0 7px #a3814e, inset 0 0 60px rgba(120, 70, 20, 0.35), var(--shadow);
}
#mapSvg { width: 100%; display: block; max-height: 78vh; }
.m-land { fill: #f3e3bd; stroke: #5a3d1e; stroke-width: 1.6; }
.m-hatch { stroke: none; }
.m-river { fill: none; stroke: #4a7a95; stroke-width: 2.2; stroke-linecap: round; opacity: 0.85; }
.m-rlabel { font: italic 10px var(--kn); fill: #2f5a73; }
.m-sea { font: italic 12px var(--serif); fill: #6b5232; letter-spacing: 0.2em; }
.m-rose circle { fill: none; stroke: #6b5232; }
.m-rose path { fill: #6b5232; }
.m-rose .m-rose2 { fill: #a3262a; opacity: 0.8; }
.m-rose text { font: 14px var(--kn); fill: #6b5232; text-anchor: middle; }
.m-cart rect { fill: #f7ecd2; stroke: #6b5232; }
.m-cart text { font: 17px var(--kn); fill: #a3262a; }
.m-pl { cursor: pointer; outline: none; }
.m-dot { fill: var(--kumkum); stroke: #f7ecd2; stroke-width: 1.5; transition: r 0.2s; }
.m-halo { fill: rgba(163, 38, 42, 0.08); stroke: rgba(163, 38, 42, 0.35); stroke-width: 1; transform-box: fill-box; transform-origin: center; }
.m-lab { font: 11.5px var(--kn); fill: #3b2414; paint-order: stroke; stroke: #f3e3bd; stroke-width: 3px; }
.m-pl:hover .m-lab, .m-pl:focus .m-lab, .m-pl.on .m-lab { fill: var(--kumkum); font-weight: 700; }
.m-pl.on .m-halo { animation: halo 1.8s infinite; fill: rgba(163, 38, 42, 0.18); }
.m-pl.on .m-dot { fill: var(--turmeric); stroke: var(--kumkum); }
@keyframes halo { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.map-note { position: absolute; right: 22px; bottom: 12px; margin: 0; font: italic 11px var(--serif); color: #6b5232; }
.map-panel { position: sticky; top: 100px; padding: 30px; border-radius: 6px; background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(90, 56, 32, 0.25); }
.mp-kn { font-size: 46px; line-height: 1.2; color: var(--kumkum); }
.map-panel h3 { margin: 0; font: 600 28px var(--serif); }
.mp-geo { margin: 2px 0 14px; font-size: 13px; letter-spacing: 0.1em; opacity: 0.6; }
.mp-ws { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.mp-ws button { display: grid; width: 100%; text-align: left; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(90, 56, 32, 0.25); background: rgba(255, 255, 255, 0.45); transition: transform 0.2s, border-color 0.2s; }
.mp-ws button:hover { transform: translateX(4px); border-color: var(--kumkum); }
.mp-ws b { font-weight: 400; font-size: 18px; }
.mp-ws small { opacity: 0.7; }

/* ---------- script atlas ---------- */

.atlas { max-width: 1060px; margin-inline: auto; }
.atlas-ctl { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.atlas-ctl select { flex: 1 1 260px; min-width: 0; }
.atlas-ctl input { flex: 1 1 260px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(214, 166, 64, 0.35); background: rgba(246, 234, 208, 0.06); outline: none; font-family: var(--kn); }
.atlas-out { border-top: 1px solid rgba(214, 166, 64, 0.3); }
.at-row { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; padding: 16px 4px; border-bottom: 1px solid rgba(214, 166, 64, 0.15); transition: background 0.2s; }
.at-row:hover { background: rgba(214, 166, 64, 0.06); }
.at-name { display: grid; }
.at-name b { font-weight: 400; font-size: 18px; color: var(--gold2); }
.at-name small { font-size: 12.5px; opacity: 0.6; }
.at-text { font-size: clamp(20px, 2.4vw, 30px); line-height: 1.4; }
.at-row:first-child .at-text { color: var(--gold2); }

/* ---------- OleAkshara ---------- */

.ocr-sec { background: radial-gradient(900px 500px at 50% 0%, rgba(61, 79, 154, 0.35), transparent 70%), linear-gradient(180deg, #171019, #1d140f); }
.ocr { max-width: 1100px; margin-inline: auto; }
.ocr-pipe { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0 0 26px; }
.ocr-pipe li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px dashed rgba(240, 205, 122, 0.3); font-size: 14px; opacity: 0.6; }
.ocr-pipe li.on { opacity: 1; border-style: solid; border-color: var(--gold); background: rgba(214, 166, 64, 0.08); }
.ocr-pipe b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(240, 205, 122, 0.2); font-size: 12px; }
.ocr-pipe small { color: var(--gold2); }
.ocr-box { padding: 22px; border-radius: 18px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(214, 166, 64, 0.25); transition: border-color 0.2s; }
.ocr-box.over { border-color: var(--gold2); background: rgba(214, 166, 64, 0.08); }
.ocr-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.file input { display: none; }
.tog { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tog input { accent-color: var(--gold); width: 16px; height: 16px; }
.ocr-n { margin-left: auto; font-size: 14px; }
.ocr-n b { font: 600 28px var(--serif); color: var(--gold2); }
.ocr-view { position: relative; border-radius: 10px; overflow: hidden; background: #0d0805; min-height: 120px; }
#ocrOv { display: block; width: 100%; height: auto; }
.ocr-scan { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(240, 205, 122, 0.25), transparent) 0 0 / 120px 100% no-repeat; opacity: 0; }
.ocr-box.has .ocr-scan { animation: scan 1.6s ease-out 1; }
@keyframes scan { 0% { opacity: 1; background-position: -120px 0; } 100% { opacity: 1; background-position: calc(100% + 120px) 0; } }
.ocr-crops { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ocr-crops li { display: grid; grid-template-columns: 44px minmax(0, 2.4fr) minmax(160px, 1fr); gap: 14px; align-items: center; animation: rise 0.5s backwards; }
.ocr-crops li:nth-child(2) { animation-delay: 0.1s; }
.ocr-crops li:nth-child(3) { animation-delay: 0.2s; }
.ocr-crops li:nth-child(4) { animation-delay: 0.3s; }
.ocr-crops li:nth-child(5) { animation-delay: 0.4s; }
.oc-n { font: 600 18px var(--serif); color: var(--gold2); }
.ocr-crops img { width: 100%; max-height: 54px; object-fit: cover; object-position: left; border-radius: 4px; }
.oc-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12.5px; opacity: 0.7; font-style: italic; }
.oc-wait i { width: 22px; height: 9px; border-radius: 4px; background: linear-gradient(90deg, rgba(240, 205, 122, 0.15), rgba(240, 205, 122, 0.4), rgba(240, 205, 122, 0.15)) 0 0 / 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- lexicon ---------- */

.lex-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: end; margin-bottom: 30px; }
.lex-today {
  display: grid;
  gap: 2px;
  padding: 28px 32px;
  border-radius: 6px;
  background: var(--wood);
  color: var(--cream);
  background: var(--grain), linear-gradient(135deg, #4b2a15, #2a160a);
  box-shadow: var(--shadow);
}
.lt-k { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold2); }
.lt-w { font-size: 54px; line-height: 1.25; color: var(--gold2); }
.lt-r { font-style: italic; opacity: 0.8; }
.lt-g { font: 600 24px var(--serif); }
.lt-o { opacity: 0.8; }
.lex-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.lex {
  display: grid;
  gap: 2px;
  padding: 18px 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(90, 56, 32, 0.2);
  transition: transform 0.25s, box-shadow 0.25s;
}
.lex:hover { transform: translateY(-3px); box-shadow: 0 14px 24px -16px rgba(60, 30, 5, 0.6); }
.lex b { font-weight: 400; font-size: 28px; color: var(--kumkum); line-height: 1.3; }
.lx-r { font-style: italic; font-size: 14px; opacity: 0.7; }
.lx-g { font: 600 18px var(--serif); }
.lx-o { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; opacity: 0.75; }
.lex.flash { animation: flash 1.8s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--turmeric); background: #fff6db; } }

/* ---------- about & footer ---------- */

.about { max-width: 900px; text-align: center; }
.orn-rule { color: var(--gold); font-size: 22px; letter-spacing: 0.4em; }
.about h2 { font: 600 clamp(34px, 4vw, 50px)/1.1 var(--serif); margin: 10px 0 26px; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; text-align: left; }
.about-cols p { margin: 0; }
.about-cols .kn { font-size: 18px; line-height: 1.8; }
.honest { margin-top: 30px; padding: 16px 20px; border: 1px dashed rgba(214, 166, 64, 0.4); border-radius: 10px; text-align: left; }
.ftr { padding: 36px 0; background: #120b06; border-top: 1px solid rgba(214, 166, 64, 0.2); }
.ftr-in { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; font-size: 14px; }

/* ---------- command palette ---------- */

.pal { position: fixed; inset: 0; z-index: 120; display: grid; justify-items: center; align-items: start; padding-top: 12vh; background: rgba(10, 6, 3, 0.55); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.pal.in { opacity: 1; }
.pal-box {
  width: min(700px, 100% - 32px);
  border-radius: 16px;
  background: linear-gradient(180deg, #2c1b10, #1d120a);
  border: 1px solid rgba(214, 166, 64, 0.45);
  box-shadow: 0 40px 90px -20px #000;
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.25s;
}
.pal.in .pal-box { transform: none; }
.pal-q { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(214, 166, 64, 0.25); }
.pal-q input { flex: 1; border: 0; background: none; outline: none; font-size: 19px; }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow: auto; }
.pg { padding: 12px 12px 6px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold2); opacity: 0.8; }
.pi { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pi > span:last-child { display: grid; min-width: 0; }
.pi b { font-weight: 400; font-size: 17px; }
.pi small { opacity: 0.65; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-i { flex: none; width: 26px; text-align: center; color: var(--gold2); font-size: 17px; }
.pi.on, .pi:hover { background: rgba(214, 166, 64, 0.16); }
.pempty { padding: 30px; text-align: center; opacity: 0.7; font-style: italic; }
.pal-foot { margin: 0; padding: 10px 18px; font-size: 12px; opacity: 0.55; border-top: 1px solid rgba(214, 166, 64, 0.15); }

/* ---------- reader ---------- */

.reader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(1200px 700px at 40% 45%, #3b2314, #150c06 70%);
  opacity: 0;
  transition: opacity 0.3s;
  outline: none;
}
.reader.in { opacity: 1; }
.reader::before { content: ""; position: absolute; inset: 0; background: var(--noise); opacity: 0.2; mix-blend-mode: overlay; pointer-events: none; }
.rd-head { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid rgba(214, 166, 64, 0.2); background: rgba(15, 9, 5, 0.6); }
.rd-title { flex: 1; min-width: 0; }
.rd-kn { font: 24px/1.2 var(--kn); color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-sub { font-size: 13.5px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-nav { display: flex; align-items: center; gap: 10px; }
.rd-pos { font-size: 14px; min-width: 110px; text-align: center; }
.rd-pos b { font: 600 20px var(--serif); color: var(--gold2); }
.kn-num { font-family: var(--kn); opacity: 0.6; margin-left: 4px; }
.rd-status { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; }
.rd-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.rd-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; }
.rd-stage.dragging { cursor: grabbing; }
.rd-zoom { position: absolute; left: 0; top: 0; transform-origin: 0 0; perspective: 1400px; will-change: transform; }
.rd-flip { transform-origin: 50% 50%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.7)); }
.rd-flip .ll { cursor: pointer; }
.rd-lamp {
  --lx: 50%;
  --ly: 50%;
  position: absolute;
  inset: 0 0 64px;
  pointer-events: none;
  background: radial-gradient(circle 190px at var(--lx) var(--ly), rgba(255, 190, 90, 0.14), rgba(255, 170, 60, 0.05) 55%, rgba(6, 3, 1, 0.88) 100%);
}
.rd-loupe {
  position: absolute;
  left: 0;
  top: 0;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(28, 18, 11, 0.7), 0 20px 40px rgba(0, 0, 0, 0.7), inset 0 0 30px rgba(0, 0, 0, 0.4);
  background: #24150d;
  z-index: 3;
}
.rd-loupe-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.rd-tools {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(20, 12, 6, 0.85);
  border: 1px solid rgba(214, 166, 64, 0.3);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  cursor: default;
  white-space: nowrap;
  z-index: 4;
}
.rd-tools button { border: 0; background: none; padding: 7px 11px; border-radius: 9px; font-size: 14px; min-width: 34px; transition: background 0.2s; }
.rd-tools button:hover { background: rgba(214, 166, 64, 0.15); }
.rd-tools button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.rd-tools .sep { width: 1px; height: 22px; background: rgba(214, 166, 64, 0.3); margin: 0 4px; }
.rd-con { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 0 8px; }
.rd-con input { width: 90px; accent-color: var(--gold); }
.rd-side { display: grid; grid-template-rows: auto 1fr; min-height: 0; border-left: 1px solid rgba(214, 166, 64, 0.2); background: rgba(15, 9, 5, 0.55); }
.rd-tabs { display: flex; border-bottom: 1px solid rgba(214, 166, 64, 0.2); }
.rd-tabs button { flex: 1; border: 0; background: none; padding: 13px 6px; font-size: 14px; opacity: 0.7; border-bottom: 2px solid transparent; }
.rd-tabs button[aria-selected="true"] { opacity: 1; border-bottom-color: var(--gold); color: var(--gold2); }
.rd-pane { overflow: auto; padding: 18px; }
.rp-ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rp-ctrl label { display: grid; gap: 4px; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold2); }
.rp-ctrl select { appearance: none; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--cream); padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(214, 166, 64, 0.3); background: rgba(246, 234, 208, 0.06); }
.rp-src { font-size: 12px; font-style: italic; opacity: 0.6; margin: 0 0 10px; }
.rp-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rl { --mk: transparent; border-radius: 10px; border: 1px solid transparent; border-left: 4px solid var(--mk); background: rgba(246, 234, 208, 0.04); transition: background 0.2s, border-color 0.2s; }
.rl.hov { background: rgba(214, 166, 64, 0.1); }
.rl.sel { border-color: rgba(214, 166, 64, 0.45); border-left-color: var(--mk); background: rgba(214, 166, 64, 0.12); }
.rl-b { display: grid; grid-template-columns: 26px 1fr; gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; }
.rl-n { font: 15px/1.6 var(--kn); color: var(--gold); opacity: 0.8; }
.rl-body { display: grid; gap: 3px; min-width: 0; }
.rl-o { font-size: 19px; line-height: 1.45; }
.rl-o.s-knda { font-size: 20px; }
.rl-r { font-size: 13px; font-style: italic; opacity: 0.6; }
.rl-t { font-size: 15px; color: #ecdcbc; }
.rl-note { font-size: 13px; color: var(--turmeric); }
.rl-tools { padding: 0 12px 12px 46px; display: grid; gap: 8px; animation: rise 0.25s; }
.rl-swatches { display: flex; gap: 8px; align-items: center; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); background: var(--c); transition: transform 0.15s; }
.sw:hover { transform: scale(1.15); }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--c); }
.sw.clear { background: none; font-size: 11px; display: grid; place-items: center; }
.rl-tools textarea, .rp-cite textarea { width: 100%; resize: vertical; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(214, 166, 64, 0.3); background: rgba(0, 0, 0, 0.25); font-size: 14px; outline: none; }
.rp-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-keys { margin-top: 20px; font-size: 12px; opacity: 0.5; }
.rp-pending { text-align: center; padding: 20px 10px; }
.rp-seal { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9443a, #7d1a17); color: #f7ddb0; font: 34px/1 var(--kn); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 -3px 6px rgba(0, 0, 0, 0.35); }
.rp-pending p { opacity: 0.85; }
.rp-skel { display: grid; gap: 10px; margin: 18px 0; }
.rp-skel i { height: 14px; border-radius: 7px; background: linear-gradient(90deg, rgba(240, 205, 122, 0.06), rgba(240, 205, 122, 0.2), rgba(240, 205, 122, 0.06)) 0 0 / 200% 100%; animation: shimmer 1.6s infinite linear; }
.rp-skel i:nth-child(odd) { width: 86%; }
.rp-summary { font-size: 16px; line-height: 1.6; }
.rp-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.rp-dl dt { color: var(--gold2); opacity: 0.85; font-size: 12.5px; letter-spacing: 0.06em; }
.rp-dl dd { margin: 0; }
.rp-dl .kn { font-size: 16px; }
.rp-empty { opacity: 0.7; font-style: italic; }
.rp-marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rp-marks button { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(214, 166, 64, 0.2); background: rgba(246, 234, 208, 0.04); }
.rp-marks button:hover { border-color: var(--gold); }
.rp-marks i { flex: none; width: 10px; border-radius: 3px; }
.rp-marks span { display: grid; gap: 2px; min-width: 0; }
.rp-marks b { font-weight: 400; font-size: 16px; }
.rp-marks small { opacity: 0.65; font-size: 12.5px; }
.rp-marks em { font-size: 13px; color: var(--turmeric); }
.rp-cite { display: grid; gap: 6px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold2); margin-bottom: 10px; }
.rp-cite textarea { text-transform: none; letter-spacing: 0; color: var(--cream); font-family: var(--body); }
.rd-strip { position: relative; display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; border-top: 1px solid rgba(214, 166, 64, 0.2); background: rgba(10, 6, 3, 0.7); scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.th { position: relative; flex: none; width: 116px; aspect-ratio: 360 / 68; border: 0; padding: 0; background: var(--tex) center / 100% 100% no-repeat; opacity: 0.55; transition: opacity 0.2s, transform 0.2s; }
.th span { position: absolute; inset: 0; display: grid; place-items: center; font: 13px var(--kn); color: #3b2414; }
.th.done::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #4f7a3a; }
.th:hover { opacity: 0.9; transform: translateY(-2px); }
.th.on { opacity: 1; filter: drop-shadow(0 0 4px var(--gold)); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .nav { display: none; }
  body.nav-open .nav {
    display: grid;
    position: fixed;
    top: 64px;
    right: 16px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(28, 18, 11, 0.96);
    border: 1px solid rgba(214, 166, 64, 0.3);
    box-shadow: var(--shadow);
  }
  .nav-toggle { display: block; }
  .hdr-tools { margin-left: auto; }
  .hero-in { grid-template-columns: 1fr; }
  .pothi-wrap { order: -1; max-width: 620px; margin-inline: auto; width: 100%; }
  .lib { grid-template-columns: 1fr; }
  .lib-side { position: static; max-height: none; }
  .mk { grid-template-columns: 1fr; gap: 0; }
  .mk-vis { position: sticky; top: 56px; z-index: 2; background: var(--paper); margin: 0 -24px; padding: 0 24px; box-shadow: 0 14px 18px -12px rgba(60, 30, 5, 0.35); }
  .mk-label { display: none; }
  .mk-sticky { position: static; }
  .mk-stage { padding: 46px 0; }
  .mk-step { min-height: 34vh; }
  .mapbox { grid-template-columns: 1fr; }
  .rd-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 42vh); }
  .rd-side { border-left: 0; border-top: 1px solid rgba(214, 166, 64, 0.2); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .hdr { padding: 10px 14px; gap: 10px; }
  .brand-en, .kbtn kbd { display: none; }
  .sec { padding: 84px 0; }
  .wrap { width: min(1220px, 100% - 28px); }
  .stats { grid-template-columns: repeat(2, auto); }
  .hero-search kbd { display: none; }
  .about-cols, .lex-top { grid-template-columns: 1fr; }
  .at-row { grid-template-columns: 1fr; gap: 4px; }
  .rd-head { flex-wrap: wrap; padding: 10px 12px; }
  .rd-nav { width: 100%; justify-content: space-between; }
  .rd-tools { max-width: calc(100% - 16px); overflow-x: auto; }
  .rd-con { display: none; }
  .ocr-crops li { grid-template-columns: 34px 1fr; }
  .oc-wait { grid-column: 2; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
