/* A richer, more curious feel on top of site.css: living hero, things to tap and drag, soft light that follows the pointer.
   Everything here is decoration or progressive enhancement: with scripts off, or with "reduce motion" on, the page reads the same.
   Loaded after site.css on every public page; assets/js/rich.js drives the interactive parts. */

/* ---------- reading progress (a thin amber line at the very top) ---------- */
.kk-prog { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90; pointer-events: none; background: transparent; }
.kk-prog i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--amber-400), #ffdf8a, var(--leaf)); box-shadow: 0 0 10px rgba(246, 179, 33, .6); }

/* ---------- soft light that follows the pointer over cards ---------- */
.spot { --mx: -999px; --my: -999px; }
.spot:hover { background-image: radial-gradient(380px circle at var(--mx) var(--my), rgba(246, 179, 33, .13), transparent 62%); border-color: #f1d28a; }
.section-navy .why-item.spot:hover { background-image: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 255, 255, .09), transparent 62%); }

/* ---------- buttons: a slow shine over the amber ones ---------- */
.btn-amber { position: relative; overflow: hidden; isolation: isolate; }
.btn-amber::after { content: ''; position: absolute; inset: 0 auto 0 -70%; width: 50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); transition: none; z-index: -1; }
.btn-amber:hover::after { inset-inline-start: 130%; transition: inset-inline-start .7s ease; }

/* ---------- hero: a living backdrop ---------- */
.hero .orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero .orbs span { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; will-change: transform; }
.hero .orbs span:nth-child(1) { width: 380px; height: 380px; left: -90px; top: 20px; background: radial-gradient(circle, rgba(47, 102, 184, .8), transparent 70%); animation: kkdrift1 18s ease-in-out infinite alternate; }
.hero .orbs span:nth-child(2) { width: 300px; height: 300px; left: 42%; bottom: -120px; background: radial-gradient(circle, rgba(246, 179, 33, .4), transparent 70%); animation: kkdrift2 22s ease-in-out infinite alternate; }
.hero .orbs span:nth-child(3) { width: 240px; height: 240px; right: 6%; top: -60px; background: radial-gradient(circle, rgba(47, 168, 79, .32), transparent 70%); animation: kkdrift1 26s ease-in-out infinite alternate-reverse; }
.hero .orbs::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0, transparent 70%); mask-image: radial-gradient(ellipse at 70% 40%, #000 0, transparent 70%); }
@keyframes kkdrift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(70px, 50px) scale(1.18); } }
@keyframes kkdrift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-90px, -30px) scale(1.12); } }

/* the headline's key words glow */
.hero h1 .glow { background: linear-gradient(100deg, #ffe9a8, var(--amber-400) 55%, #ffd36b); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- "Curious? Ask Kalvi": a prompt that types itself ---------- */
.askbar { display: flex; align-items: center; gap: 12px; width: min(100%, 520px); margin-top: 26px; padding: 8px 8px 8px 16px; border-radius: 16px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; cursor: pointer; text-align: left; font: inherit; transition: background .2s, border-color .2s, transform .2s; }
.askbar:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); transform: translateY(-1px); }
.askbar .ic { color: var(--amber-300); flex: none; }
.askbar .ak { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-300); white-space: nowrap; }
.askbar .at { flex: 1; min-width: 0; font-size: 15.5px; color: rgba(255, 255, 255, .95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.askbar .at::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--amber-300); animation: kkblink 1s steps(1) infinite; }
.askbar .go { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(180deg, var(--amber-400), var(--amber-500)); color: #2a1a00; }
@keyframes kkblink { 50% { opacity: 0; } }

/* ---------- hotspots on the dashboard picture: tap to see what is behind it ---------- */
.shot-hot { position: relative; }
.hot { position: absolute; z-index: 3; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border: 0; border-radius: 50%; background: var(--amber-400); color: #2a1a00; font: 800 13px/1 var(--font); cursor: pointer; box-shadow: 0 4px 14px rgba(11, 29, 56, .4); }
.hot::before, .hot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--amber-400); animation: kkping 2.4s ease-out infinite; }
.hot::after { animation-delay: 1.2s; }
.hot[aria-expanded="true"]::before, .hot[aria-expanded="true"]::after { animation: none; opacity: 0; }
@keyframes kkping { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.hot-tip { position: absolute; z-index: 4; width: min(250px, 62%); padding: 14px 16px 14px; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; opacity: 0; transform: translateY(6px) scale(.97); pointer-events: none; transition: opacity .18s, transform .18s; }
.hot-tip.show { opacity: 1; transform: none; pointer-events: auto; }
.hot-tip b { display: block; font-size: 14.5px; color: var(--navy-900); margin-bottom: 3px; }
.hot-hint { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(11, 29, 56, .86); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 18px rgba(11, 29, 56, .35); }
.hot-hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber-400); animation: kkblink 1.4s steps(1) infinite; }

/* ---------- a strip of everything it can run, drifting past ---------- */
.marq { background: #fff; border-bottom: 1px solid var(--line); padding: 16px 0; overflow: hidden; position: relative; }
.marq::before, .marq::after { content: ''; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none; }
.marq::before { left: 0; background: linear-gradient(90deg, #fff, transparent); } .marq::after { right: 0; background: linear-gradient(270deg, #fff, transparent); }
.marq-track { display: flex; width: max-content; gap: 12px; animation: kkmarq 60s linear infinite; }
.marq:hover .marq-track { animation-play-state: paused; }
.marq a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); color: var(--navy-800); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.marq a:hover { background: var(--navy-700); color: #fff; border-color: var(--navy-700); transform: translateY(-2px); }
.marq a .ic { color: var(--amber-600); } .marq a:hover .ic { color: var(--amber-300); }
@keyframes kkmarq { to { transform: translateX(-50%); } }

/* ---------- "Who are you?": the same school through four pairs of eyes ---------- */
.who { margin-bottom: 44px; }
.who-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 28px; }
.who-tabs button { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--navy-800); font: 700 15px/1 var(--font); cursor: pointer; transition: all .2s; }
.who-tabs button:hover { border-color: var(--navy-500); transform: translateY(-1px); }
.who-tabs button[aria-selected="true"] { background: linear-gradient(180deg, var(--navy-600), var(--navy-800)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(27, 74, 138, .3); }
.who-tabs .ic { color: var(--amber-600); } .who-tabs button[aria-selected="true"] .ic { color: var(--amber-300); }
.who-panel { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center; animation: kkfade .45s ease both; }
.who-panel[hidden] { display: none; }
.who-panel h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 8px; }
.who-panel .who-lead { color: var(--muted); font-size: 16.5px; margin-bottom: 18px; }
.who-panel .ticks li { margin-bottom: 9px; }
.who-panel .btn { margin-top: 18px; }
.who-panel .browser { box-shadow: var(--shadow-lg); border-color: var(--line); }
@keyframes kkfade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- "What happens when...": cards that turn over ---------- */
.flipgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flip { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; perspective: 1200px; }
.flip-in { display: grid; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2, .8, .2, 1); }
.flip[aria-pressed="true"] .flip-in { transform: rotateY(180deg); }
.flip-f, .flip-b { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; padding: 26px 24px; min-height: 230px; display: flex; flex-direction: column; border: 1px solid var(--line); }
.flip-f { background: #fff; box-shadow: 0 1px 2px rgba(18, 47, 86, .05); transition: box-shadow .25s, border-color .25s; }
.flip:hover .flip-f { box-shadow: var(--shadow); border-color: #f1d28a; }
.flip-f small { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-600); margin: 14px 0 6px; }
.flip-f h3 { font-size: 21px; }
.flip-f .tap { margin-top: auto; padding-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--navy-600); }
.flip-f .tap i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff3d6; color: var(--amber-600); animation: kkpulse 2.2s ease-in-out infinite; }
@keyframes kkpulse { 50% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(246, 179, 33, .18); } }
.flip-b { transform: rotateY(180deg); background: linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #fff; border-color: transparent; box-shadow: var(--shadow-lg); justify-content: center; }
.flip-b b { color: var(--amber-300); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.flip-b p { font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, .94); }

/* ---------- a day in the school: each step lights up as you reach it ---------- */
.day li { transition: transform .25s ease, box-shadow .25s ease, opacity .6s ease, border-color .5s, background .5s; }
.day li .dt { transition: background .5s, color .5s; }
.day li.lit { border-color: #f1d28a; background-image: linear-gradient(180deg, #fffaf0, #fff 60%); }
.day li.lit .dt { background: var(--amber-400); color: #2a1a00; }

/* ---------- "What would it cost your school?": drag to find out ---------- */
.peek { max-width: 820px; margin: 0 auto 40px; padding: 28px 30px 26px; border-radius: 22px; background: linear-gradient(160deg, var(--navy-950), var(--navy-800)); color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.peek::before { content: ''; position: absolute; right: -80px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(246, 179, 33, .28), transparent 65%); pointer-events: none; }
.peek-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 18px; position: relative; }
.peek-head b { font-size: 20px; } .peek-head span { color: rgba(255, 255, 255, .7); font-size: 14px; }
.peek-row { display: flex; align-items: center; gap: 18px; position: relative; }
.peek-row output { min-width: 128px; text-align: right; font-size: 28px; font-weight: 800; color: var(--amber-300); letter-spacing: -.02em; white-space: nowrap; }
.peek-row output small { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .7); margin-left: 4px; letter-spacing: 0; }
.peek input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 99px; outline: none; cursor: pointer; background: linear-gradient(90deg, var(--amber-400) var(--fill, 20%), rgba(255, 255, 255, .22) var(--fill, 20%)); }
.peek input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 5px solid var(--amber-400); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); transition: transform .15s; }
.peek input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 5px solid var(--amber-400); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.peek input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.peek-out { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; position: relative; }
.peek-out > div { padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.peek-out small { display: block; color: rgba(255, 255, 255, .72); font-size: 12.5px; line-height: 1.4; min-height: 36px; }
.peek-out b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.peek-out em { font-style: normal; color: rgba(255, 255, 255, .7); font-size: 13px; }
.peek-out i { display: block; margin-top: 4px; font-style: normal; color: var(--amber-300); font-size: 13px; font-weight: 700; }
.peek-foot { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; position: relative; font-size: 13px; color: rgba(255, 255, 255, .7); }

/* ---------- back to the top ---------- */
.kk-top { position: fixed; left: 18px; bottom: 22px; z-index: 60; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--navy-800); color: #fff; box-shadow: 0 8px 22px rgba(11, 29, 56, .35); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, background .2s; }
.kk-top.on { opacity: 1; transform: none; pointer-events: auto; }
.kk-top:hover { background: var(--navy-600); }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .who-panel { grid-template-columns: 1fr; gap: 24px; }
  .flipgrid { grid-template-columns: repeat(2, 1fr); }
  .hot-hint { display: none; }
}
@media (max-width: 640px) {
  .flipgrid { grid-template-columns: 1fr; }
  .peek { padding: 22px 18px; border-radius: 18px; }
  .peek-out { grid-template-columns: 1fr; }
  .peek-out small { min-height: 0; }
  .peek-row output { font-size: 22px; min-width: 104px; }
  .askbar .ak { display: none; }
  .askbar .at { font-size: 14.5px; }
  .hot { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; }

}

/* ---------- people who prefer no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero .orbs span, .marq-track, .hot::before, .hot::after, .flip-f .tap i, .hot-hint i, .askbar .at::after { animation: none !important; }
  .marq-track { flex-wrap: wrap; width: auto; justify-content: center; } .marq-track [aria-hidden="true"] { display: none; }
  .flip-in { transition: none; } .who-panel { animation: none; }
  .btn-amber::after { display: none; }
}
@media print { .kk-prog, .kk-top, .hero .orbs, .hot, .hot-hint, .askbar, .marq { display: none !important; } }

/* a band that stuck out a few pixels on narrow phones */
.cta-band { overflow: hidden; }
@media (max-width: 640px) { .kk-top { width: 38px; height: 38px; left: 10px; bottom: 14px; } }
