/* "The Story of Karnataka" — cinematic, always-dark chapter page. Loaded after style.css. */

body.story {
  --bg: #120606; --bg-alt: #1a0a08; --surface: #231110; --surface-2: #2d1613;
  --ink: #f7ebde; --ink-soft: #cdb3a1; --line: #43231d; --gold: #f4b400; --gold-2: #ffd766;
  --accent: #e8262d; --focus: #8ab4ff;
  --freedom: linear-gradient(135deg, #e8262d, #8a1217);
  --science: linear-gradient(135deg, #ffd24a, #f4b400);
  --culture: linear-gradient(135deg, #f4b400 0 50%, #d2232a 50% 100%);
  --sport:   linear-gradient(135deg, #b3151b, #5c0d10);
  color-scheme: dark; background: var(--bg); color: var(--ink);
}
.story h2 { color: var(--ink); }
.story .bar.solid { background: rgb(18 6 6 / .86); }

/* ─── reveal on scroll (class added by JS so no-JS shows everything) ─── */
.reveal { opacity: 0; transform: translateY(42px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ─── Opening ───────────────────────────────────────────────────────── */
.s-open { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.s-open-bg { position: absolute; inset: 0; z-index: -1; background: #1a0a08; }
.s-open-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%;
  animation: open-zoom 28s ease-in-out infinite alternate; will-change: transform; }
@keyframes open-zoom { from { transform: scale(1.02); } to { transform: scale(1.16) translate(-1.5%, -1%); } }
.s-open::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(180deg, rgb(18 6 6 / .55) 0%, rgb(18 6 6 / .05) 30%, rgb(18 6 6 / .5) 62%, var(--bg) 100%),
  radial-gradient(90% 60% at 10% 90%, rgb(18 6 6 / .7), transparent 70%); }
.s-open-inner { max-width: var(--wide); width: 100%; margin: 0 auto; padding: calc(var(--bar-h) + 48px) var(--gutter) clamp(72px, 12vh, 128px); }
.s-eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--gold-2); font-weight: 700; letter-spacing: .08em; font-size: .95rem; }
.s-eyebrow::before { content: ""; width: 42px; height: 2px; background: var(--gold); }
.s-title { margin: 0; font-size: clamp(3.4rem, 1rem + 11vw, 9.5rem); line-height: 1.02; font-weight: 800; letter-spacing: -.01em;
  text-shadow: 0 6px 40px rgb(0 0 0 / .45); }
.s-title span { display: block; }
.s-title em { font-style: normal; display: block; background: linear-gradient(100deg, #ffe58a 0%, var(--gold) 35%, #ffd24a 70%, var(--gold) 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: gold-flow 8s ease-in-out infinite alternate; }
:lang(kn) .s-title { line-height: 1.18; }
@keyframes gold-flow { to { background-position: 100% 0; } }
.s-lede { max-width: 34ch; margin: 20px 0 32px; font: 600 clamp(1.15rem, 1rem + .8vw, 1.5rem)/1.5 var(--font-head); color: #fbe6d2; }
.s-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.s-chapters a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px 8px 10px; border-radius: 999px; text-decoration: none; color: #fff;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .22); backdrop-filter: blur(10px); font-weight: 700; transition: background .2s, transform .2s; }
.s-chapters a:hover { background: rgb(255 255 255 / .18); transform: translateY(-2px); }
.s-chapters b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #2a1600; font: 800 .85rem/1 var(--font-head); }
.s-scroll { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgb(255 255 255 / .6); border-radius: 14px; }
.s-scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (max-width: 720px) { .s-scroll { display: none; } }

/* ─── Chapter heads ─────────────────────────────────────────────────── */
.s-chapter { position: relative; padding: clamp(80px, 12vw, 150px) var(--gutter); }
.s-head { position: relative; isolation: isolate; max-width: var(--wide); margin: 0 auto clamp(40px, 7vw, 88px); }
.s-num { position: absolute; top: -.42em; left: -.04em; margin: 0; z-index: -1; font: 800 clamp(7rem, 5rem + 12vw, 16rem)/1 var(--font-head);
  color: transparent; -webkit-text-stroke: 1.5px rgb(244 180 0 / .28); pointer-events: none; user-select: none; }
.s-head h2 { font-size: clamp(2.3rem, 1.4rem + 4vw, 4.6rem); line-height: 1.12; margin-bottom: .3em; }
.s-sub { max-width: 58ch; color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); margin: 0; }

/* ─── Timeline ──────────────────────────────────────────────────────── */
.tl { --p: 0; position: relative; list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: clamp(64px, 10vw, 140px); }
.tl::before, .tl::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.tl::before { background: rgb(255 255 255 / .1); }
.tl::after { background: linear-gradient(var(--gold), var(--accent)); transform-origin: top; transform: scaleY(var(--p)); box-shadow: 0 0 18px rgb(244 180 0 / .5); }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.tl-item::before { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; z-index: 1;
  background: var(--bg); border: 3px solid var(--gold); box-shadow: 0 0 0 6px rgb(244 180 0 / .12); transition: background .6s, box-shadow .6s; }
.tl-item.in::before { background: var(--gold); box-shadow: 0 0 0 8px rgb(244 180 0 / .18), 0 0 28px var(--gold); }
.tl-item:nth-child(even) .tl-media { order: 2; }
.tl-media { position: relative; margin: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .06); }
.tl-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: transform 2.4s cubic-bezier(.2,.7,.2,1); }
.tl-item.in .tl-media img { transform: scale(1.02); }
.tl-media.art { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #5a1a16, #1d0908 70%); }
.tl-media.art span { font: 800 clamp(5rem, 4rem + 6vw, 9rem)/1 var(--font-head); color: transparent; -webkit-text-stroke: 2px rgb(244 180 0 / .55); }
.tl-media figcaption { position: absolute; left: 12px; bottom: 10px; font-size: .72rem; color: rgb(255 255 255 / .75); text-shadow: 0 1px 4px #000; }
.tl-year { display: block; margin-bottom: 8px; font: 800 clamp(2.4rem, 1.6rem + 3vw, 4.2rem)/1.05 var(--font-head);
  background: linear-gradient(90deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-text h3 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin-bottom: .4em; }
.tl-text p { color: #e6d3c4; font-size: 1.08rem; }
.fact { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 18px; border-radius: 16px; background: rgb(244 180 0 / .09); border: 1px solid rgb(244 180 0 / .28); }
.fact b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #2a1600; font-size: 1.1rem; }
.fact p { margin: 0; font-size: 1rem; color: #fde9c4; }
.fact small { display: block; font-weight: 800; color: var(--gold-2); letter-spacing: .04em; }
@media (max-width: 820px) {
  .tl::before, .tl::after { left: 14px; }
  .tl-item { grid-template-columns: 1fr; gap: 20px; padding-left: 44px; }
  .tl-item::before { left: 14px; top: 8px; }
  .tl-item:nth-child(even) .tl-media { order: 0; }
}

/* ─── Heroes ────────────────────────────────────────────────────────── */
.s-heroes { background: radial-gradient(80% 50% at 50% 0%, #2a0f0c, transparent 70%); }
.tabs { max-width: var(--wide); margin: 0 auto 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.tab { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; transition: .2s; }
.tab:hover { border-color: var(--gold); }
.tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: #2a1600; }
.hero-grid { list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); align-items: start; }
.flip { perspective: 1400px; }
.flip button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; border-radius: 22px; }
.flip button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.flip-in { display: grid; height: 100%; transition: transform .8s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; }
.flip.on .flip-in { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; display: flex; flex-direction: column; padding: 26px 24px 22px; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid rgb(255 255 255 / .07); box-shadow: 0 20px 40px -24px rgb(0 0 0 / .8); }
.face.back { transform: rotateY(180deg); background: linear-gradient(180deg, #33190f, #221009); }
.flip:hover .face.front { border-color: rgb(244 180 0 / .45); }
.avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; overflow: hidden;
  font: 800 2rem/1 var(--font-head); color: #fff; background: var(--g, var(--freedom)); box-shadow: 0 10px 30px -8px rgb(0 0 0 / .6), inset 0 0 0 3px rgb(255 255 255 / .18); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); mix-blend-mode: luminosity; }
.grp { display: inline-block; align-self: flex-start; margin-bottom: 10px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; background: var(--g); }
.face h3 { font-size: 1.35rem; margin: 0 0 2px; }
.years { color: var(--gold-2); font-weight: 700; font-size: .92rem; margin: 0 0 10px; }
.line { color: var(--ink-soft); margin: 0 0 16px; }
.turn { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 700; font-size: .95rem; }
.turn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.back p { font-size: 1rem; color: #eddccd; margin: 0 0 12px; }
.back .fact { margin: auto 0 0; }
.g-freedom { --g: var(--freedom); } .g-science { --g: var(--science); } .g-culture { --g: var(--culture); } .g-sport { --g: var(--sport); }
.hero-grid li[hidden] { display: none; }

/* cards open in place instead of flipping: compact, even fronts; the story drops open below */
.flip-in { display: block; transform: none !important; }
.flip .face { backface-visibility: visible; -webkit-backface-visibility: visible; }
.flip .face.front { min-height: 250px; }
.flip .face.back { display: none; transform: none; margin-top: -22px; border-top: 0; border-radius: 0 0 22px 22px; padding-top: 4px; }
.flip .face.back h3 { display: none; }
.flip.on .face.front { border-radius: 22px 22px 0 0; border-bottom-color: transparent; min-height: 0; }
.flip.on .face.back { display: flex; animation: card-open .45s cubic-bezier(.2,.7,.2,1); }
.flip.on .face.front .turn { display: none; }
@keyframes card-open { from { opacity: 0; transform: translateY(-10px); } }

/* ─── Today ─────────────────────────────────────────────────────────── */
.s-today { background: linear-gradient(180deg, var(--bg), #3a0c0f 30%, #5c1116 60%, var(--bg)); overflow: hidden; }
.s-today::before { content: ""; position: absolute; inset: 0; background: url(/img/motifs/rangoli.svg) center/180px repeat; opacity: .05; pointer-events: none; }
.stat-grid { position: relative; list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.stat { padding: 28px 26px; border-radius: 22px; background: rgb(0 0 0 / .28); border: 1px solid rgb(244 180 0 / .22); backdrop-filter: blur(6px); }
.stat .num { display: block; font: 800 clamp(2.8rem, 2rem + 3vw, 4rem)/1 var(--font-head); color: var(--gold); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.stat .num.long { font-size: clamp(2.1rem, 1.6rem + 1.6vw, 2.8rem); white-space: nowrap; }
.stat h3 { font-size: 1.15rem; margin: 0 0 6px; }
.stat p { margin: 0; color: #e5cfbf; font-size: .98rem; }
.sym-title { position: relative; max-width: var(--wide); margin: clamp(56px, 8vw, 96px) auto 20px; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
.sym-grid { position: relative; list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.sym { padding: 20px; border-radius: 18px; background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .1); text-align: center; transition: transform .3s, background .3s; }
.sym:hover { transform: translateY(-4px); background: rgb(255 255 255 / .09); }
.sym .e { display: block; font-size: 2.6rem; line-height: 1.2; margin-bottom: 6px; }
.sym small { display: block; color: var(--gold-2); font-weight: 700; font-size: .82rem; letter-spacing: .03em; }
.sym b { display: block; font-size: 1.05rem; }

/* ─── Quiz ──────────────────────────────────────────────────────────── */
.quiz { position: relative; max-width: 760px; margin: 0 auto; padding: clamp(24px, 4vw, 44px); border-radius: 28px;
  background: linear-gradient(180deg, #2b1411, #1c0b09); border: 1px solid rgb(244 180 0 / .25); box-shadow: 0 40px 80px -30px rgb(0 0 0 / .8); }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--ink-soft); font-weight: 700; }
.q-score { color: var(--gold); }
.q-bar { height: 8px; border-radius: 4px; background: rgb(255 255 255 / .08); overflow: hidden; margin-bottom: 26px; }
.q-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .5s; }
.q-q { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin-bottom: 20px; }
.q-opts { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .q-opts { grid-template-columns: 1fr; } }
.q-opt { min-height: 60px; padding: 14px 18px; border-radius: 16px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 1.02rem; transition: .2s; }
.q-opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.q-opt:disabled { cursor: default; }
.q-opt.right { background: var(--gold); border-color: #ffe58a; color: #2a1600; }
.q-opt.wrong { background: #7a1418; border-color: #e8262d; color: #fff; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-explain { margin: 20px 0 0; padding: 14px 18px; border-radius: 14px; background: rgb(244 180 0 / .1); color: #fde9c4; }
.q-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.q-end { text-align: center; }
.q-big { font: 800 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--font-head); color: var(--gold); margin: 6px 0 10px; }
.q-end .btn { margin: 20px 6px 0; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ─── Close ─────────────────────────────────────────────────────────── */
.s-close { text-align: center; padding: clamp(80px, 12vw, 150px) var(--gutter) 60px; background: radial-gradient(60% 60% at 50% 40%, #3a1210, transparent 70%); }
.s-close-kn { margin: 0; font: 800 clamp(3rem, 2rem + 6vw, 7rem)/1.2 var(--font-head);
  background: linear-gradient(100deg, #ffe58a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.s-close-sub { max-width: 40ch; margin: 12px auto 28px; font-size: 1.2rem; color: var(--ink-soft); }
.credits { max-width: 900px; margin: 64px auto 0; text-align: left; color: var(--ink-soft); font-size: .88rem; }
.credits summary { cursor: pointer; font-weight: 700; color: var(--ink); text-align: center; }
.credits ul { margin: 16px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.credits a { color: var(--gold-2); word-break: break-word; }
.noscript { text-align: center; padding: 20px; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .tl-media img { transform: none; }
  .flip-in { transition: none; }
}

/* header "Home" button: always visible, also on phones */
.chip.home { text-decoration: none; padding: 0 14px 0 8px; }
.chip.home svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .chip.home { padding: 0 12px 0 6px; } }

/* ─── Review fixes ─────────────────────────────────────────────────── */
/* milestones without a photo: a giant outlined year instead of an empty-looking box */
.tl-media.art { background: none; box-shadow: none; aspect-ratio: auto; min-height: 180px; overflow: visible; }
.tl-media.art span { font-size: clamp(3rem, 2rem + 4vw, 5.6rem); line-height: 1.1; text-align: center; -webkit-text-stroke: 1.5px rgb(244 180 0 / .5); }
@media (max-width: 820px) { .tl-media.art { display: none; } }

/* portraits in natural colour, group colour as a ring */
.avatar img { filter: none; mix-blend-mode: normal; }
.avatar:has(img) { background: none; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .6), 0 0 0 3px var(--ring, var(--gold)); }
.g-freedom { --ring: #e8262d; } .g-science { --ring: #f4b400; } .g-culture { --ring: #f4b400; } .g-sport { --ring: #e8262d; }

/* phones: compact row cards (portrait left, text right) so the list isn't endless */
@media (max-width: 600px) {
  .hero-grid { gap: 12px; }
  .flip .face.front { min-height: 0; display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; padding: 16px; }
  .flip .face.front > * { grid-column: 2; }
  .flip .face.front .avatar { grid-column: 1; grid-row: 1 / span 5; width: 64px; height: 64px; margin: 0; font-size: 1.5rem; }
  .flip .face.front .grp { margin-bottom: 6px; justify-self: start; }
  .flip .face.front h3 { font-size: 1.15rem; }
  .flip .face.front .years { margin-bottom: 4px; }
  .flip .face.front .line { margin-bottom: 8px; font-size: .95rem; }
  .flip .face.back { padding: 4px 16px 16px; }
}

/* ─── 04 Taste of Karnataka ─────────────────────────────────────────── */
.s-food { background: radial-gradient(70% 50% at 30% 10%, #2e140d, transparent 70%); }
.food-grid { list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.dish { border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid rgb(255 255 255 / .07);
  box-shadow: 0 24px 50px -26px rgb(0 0 0 / .8); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.dish:hover { transform: translateY(-4px); }
.dish figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #2a1310; }
.dish img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.dish:hover img { transform: scale(1.06); }
.dish figure.noimg { display: grid; place-items: center; }
.dish figure.noimg span { font: 800 4rem/1 var(--font-head); color: transparent; -webkit-text-stroke: 1.5px rgb(244 180 0 / .5); }
.dish-body { padding: 18px 20px 20px; }
.dish-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--gold-2); font-weight: 700; font-size: .85rem; }
.veg { flex: none; width: 14px; height: 14px; border: 2px solid; border-radius: 3px; display: grid; place-items: center; }
.veg::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.veg.is-veg { color: #3ddc84; } .veg.is-nonveg { color: #e8262d; }
.dish h3 { font-size: 1.3rem; margin: 0 0 4px; }
.dish-line { margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.dish-text { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* ─── A thank-you to Karnataka ──────────────────────────────────────── */
.s-thanks { position: relative; padding: clamp(90px, 13vw, 170px) var(--gutter); text-align: center; overflow: hidden;
  background: radial-gradient(60% 70% at 50% 50%, #4a1414, var(--bg) 75%); }
.s-thanks::before { content: ""; position: absolute; inset: 0; background: url(/img/motifs/rangoli.svg) center/200px repeat; opacity: .05; }
.s-thanks-in { position: relative; max-width: 820px; margin: 0 auto; }
.s-thanks .s-eyebrow { justify-content: center; }
.s-thanks h2 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem); margin-bottom: .5em;
  background: linear-gradient(100deg, #ffe58a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.s-thanks-text { font: 600 clamp(1.2rem, 1rem + .9vw, 1.65rem)/1.7 var(--font-head); color: #fbe6d2; margin: 0 0 22px; }
.s-thanks-sign { color: var(--gold-2); font-weight: 700; font-size: 1.1rem; margin: 0; }

/* flag-colour groups: dark text on the yellow chips/initials */
.g-science .grp, .g-science .avatar { color: #2a1600; }
.g-culture .grp { text-shadow: 0 1px 2px rgb(0 0 0 / .6); }

/* ─── Map of Karnataka beside the timeline ──────────────────────────── */
.tl-wrap { position: relative; }
.tl-map svg { display: block; overflow: visible; }
.tl-map .ka { fill: rgb(244 180 0 / .06); stroke: rgb(244 180 0 / .6); stroke-width: 1.6; stroke-linejoin: round; transition: fill .8s; }
.tl-map svg.all .ka { fill: rgb(244 180 0 / .22); filter: drop-shadow(0 0 10px rgb(244 180 0 / .6)); }
.tl-map .dot { fill: rgb(255 255 255 / .28); transition: fill .5s, r .5s; }
.tl-map .ring { fill: none; stroke: var(--gold); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.tl-map .lbl { font: 700 13px var(--font-head); fill: #fff; opacity: 0; transition: opacity .4s; paint-order: stroke; stroke: rgb(18 6 6 / .85); stroke-width: 4px; }
.tl-map .pt.seen .dot { fill: rgb(244 180 0 / .6); }
.tl-map .pt.on .dot { fill: var(--gold); r: 7; }
.tl-map .pt.on .ring { animation: map-ping 1.8s ease-out infinite; }
.tl-map .pt.on .lbl { opacity: 1; }
.tl-map svg.all .dot { fill: var(--gold); }
@keyframes map-ping { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.6); } }
.tl-map-label { margin: 0; line-height: 1.3; }
.tl-map-label b { display: block; font: 800 1.25rem/1.25 var(--font-head); color: var(--gold); }
.tl-map-label span { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }

/* phones/tablets: a compact map strip that stays at the top during the history chapter */
@media (max-width: 1099px) {
  .tl-map { position: sticky; top: var(--bar-h); z-index: 6; display: flex; align-items: center; gap: 16px; height: 118px;
    margin: 0 calc(-1 * var(--gutter)) 36px; padding: 8px var(--gutter); background: rgb(18 6 6 / .88); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgb(244 180 0 / .25); }
  .tl-map svg { height: 100px; width: auto; flex: none; }
  .tl-map .lbl { display: none; }
}
/* computers: map sticks beside a single-column timeline */
@media (min-width: 1100px) {
  .tl-wrap { display: grid; grid-template-columns: minmax(340px, .95fr) 1.6fr; gap: clamp(40px, 5vw, 90px); max-width: var(--wide); margin: 0 auto; align-items: start; }
  .tl-map { position: sticky; top: calc(var(--bar-h) + 32px); }
  .tl-map svg { width: 100%; height: auto; max-height: calc(100vh - var(--bar-h) - 170px); }
  .tl-map-label { margin-top: 16px; }
  .tl-map-label b { font-size: 1.6rem; }
  .tl-wrap .tl { max-width: none; gap: clamp(56px, 7vw, 100px); }
  .tl-wrap .tl::before, .tl-wrap .tl::after { left: 14px; }
  .tl-wrap .tl-item { grid-template-columns: 1fr 1.1fr; gap: 36px; padding-left: 48px; }
  .tl-wrap .tl-item::before { left: 14px; top: 10px; }
  .tl-wrap .tl-item:nth-child(even) .tl-media { order: 0; }
  .tl-wrap .tl-item:has(.art) { grid-template-columns: 1fr; }
  .tl-wrap .tl-media.art { display: none; }
}

/* ─── 05 Learn Kannada: flip cards ──────────────────────────────────── */
.phrase-grid { list-style: none; margin: 0 auto; padding: 0; max-width: var(--wide); display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ph { position: relative; perspective: 1200px; }
.ph-card { all: unset; display: block; width: 100%; height: 200px; cursor: pointer; border-radius: 22px; }
.ph-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.ph-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; }
.ph.on .ph-in { transform: rotateY(180deg); }
.ph-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 22px; border-radius: 22px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid rgb(255 255 255 / .08); box-shadow: 0 24px 50px -26px rgb(0 0 0 / .8); }
.ph-front { background: linear-gradient(160deg, #3a1411, var(--surface)); border-top: 5px solid var(--gold); }
.ph-back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--gold), #e0a100); color: #2a1600; border-top: 5px solid var(--red, #d2232a); }
.ph-front b { font: 800 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.3 var(--font-head); color: var(--gold); }
.ph-front i { color: #e6cdb9; font-size: 1.05rem; }
.ph-front small { margin-top: auto; color: var(--ink-soft); font-size: .8rem; }
.ph-num { position: absolute; top: 14px; left: 20px; font: 800 .8rem var(--font-head); color: rgb(244 180 0 / .55); }
.ph-back b { font: 800 1.3rem/1.3 var(--font-head); }
.ph-back span { font-size: .98rem; line-height: 1.5; }
.ph-say { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgb(244 180 0 / .5);
  background: rgb(0 0 0 / .35); color: var(--gold); display: grid; place-items: center; }
.ph-say svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph.on .ph-say { color: #2a1600; background: rgb(255 255 255 / .35); border-color: rgb(0 0 0 / .2); }
@media (prefers-reduced-motion: reduce) { .ph-in { transition: none; } }
/* phrase cards: height follows the longest face; number bottom-right; 4 per row on computers */
.ph-card { height: auto; }
.ph-in { display: grid; height: auto; }
.ph-face { position: relative; inset: auto; grid-area: 1 / 1; min-height: 190px; padding: 26px 22px 34px; }
.ph-num { top: auto; bottom: 12px; left: auto; right: 18px; }
.ph-front b { padding-right: 34px; }
@media (min-width: 1100px) { .phrase-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 1099px) { .phrase-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Chapter bar (fixed under the header after the opening) ────────── */
.story { scroll-padding-top: calc(var(--bar-h) + 64px); }
html:has(body.story) { scroll-padding-top: calc(var(--bar-h) + 64px); }
.chap-nav { position: fixed; left: 0; right: 0; top: var(--bar-h); z-index: 45; display: flex; gap: 6px; padding: 8px var(--gutter);
  overflow-x: auto; scrollbar-width: none; background: rgb(18 6 6 / .9); backdrop-filter: blur(10px); border-bottom: 1px solid rgb(244 180 0 / .25);
  transform: translateY(-110%); opacity: 0; pointer-events: none; transition: transform .35s, opacity .35s; }
.chap-nav::-webkit-scrollbar { display: none; }
body.chap-on .chap-nav { transform: none; opacity: 1; pointer-events: auto; }
.chap-nav a { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px 0 6px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.chap-nav a b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(244 180 0 / .16); color: var(--gold); font: 800 .75rem/1 var(--font-head); }
.chap-nav a:hover { border-color: rgb(244 180 0 / .4); }
.chap-nav a.on { background: var(--gold); color: #2a1600; }
.chap-nav a.on b { background: #2a1600; color: var(--gold); }
@media (min-width: 1100px) { .chap-nav { justify-content: center; } }
/* the timeline map strip sits under the chapter bar */
@media (max-width: 1099px) { .tl-map { top: calc(var(--bar-h) + 52px); } }
@media (min-width: 1100px) { .tl-map { top: calc(var(--bar-h) + 84px); } }

/* ─── Previous / next at the end of each chapter ────────────────────── */
.chap-end { max-width: var(--wide); margin: clamp(48px, 7vw, 80px) auto 0; display: flex; justify-content: space-between; gap: 12px; }
.chap-end a { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 48%; padding: 12px 18px; border-radius: 16px; text-decoration: none;
  border: 1px solid rgb(244 180 0 / .3); background: rgb(0 0 0 / .2); transition: background .2s, transform .2s; }
.chap-end a:hover { background: rgb(244 180 0 / .1); transform: translateY(-2px); }
.chap-end a.next { margin-left: auto; text-align: right; }
.chap-end small { color: var(--ink-soft); font-weight: 600; font-size: .8rem; }
.chap-end b { color: var(--gold); font: 800 1rem/1.3 var(--font-head); }

/* opening: rotating "did you know" fact */
.s-fact { display: flex; align-items: center; gap: 10px; min-height: 2.4em; margin: -14px 0 26px; font: 700 clamp(1rem, .9rem + .6vw, 1.3rem)/1.4 var(--font-head); color: #fbe6d2; }
.s-fact::before { content: "✦"; color: var(--gold); flex: none; }
.s-fact span.swap { animation: fact-in .7s cubic-bezier(.2,.7,.2,1); }
@keyframes fact-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
.seo-static { max-width: var(--wide); margin: 0 auto; padding: 40px var(--gutter); }
