/* ===== KidStory Judge Deck — design system ===== */
:root {
  --primary: #6C63FF;
  --primary-2: #7C6FFF;
  --secondary: #FF6B9D;
  --accent: #FFD93D;
  --success: #36C18B;
  --danger: #FF5C7A;
  --dark: #1B1464;
  --dark-2: #2D1B69;
  --ink: #2D2D2D;
  --muted: #6b6b85;
  --paper: #ffffff;
  --bg: #0f0a2e;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .35);
  --font-head: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: #fff;
  background:
    radial-gradient(1200px 800px at 15% -10%, #2a1f6e 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 120%, #3a1a5e 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Deck stage ===== */
.deck {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 3.2vh 3vw 8vh;
}

.slide {
  --pad: clamp(28px, 4.2vw, 72px);
  position: absolute;
  width: min(1180px, 94vw);
  aspect-ratio: 16 / 9;
  max-height: 88vh;
  background: linear-gradient(160deg, #ffffff 0%, #fbfaff 100%);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px) scale(.985);
  transition: opacity .5s ease, transform .5s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.slide.is-active { opacity: 1; transform: none; pointer-events: auto; z-index: 2; }
.slide.is-prev { opacity: 0; transform: translateY(-22px) scale(.985); }

/* chrome on each content slide */
.slide__brand {
  position: absolute; top: 22px; left: 26px;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  color: var(--primary); z-index: 4;
}
.slide__brand img { width: 26px; height: 26px; border-radius: 7px; }
.slide__foot {
  position: absolute; bottom: 18px; right: 26px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .2px; z-index: 4;
}
.slide__tag {
  position: absolute; top: 20px; right: 24px; z-index: 4;
  font-family: var(--font-head); font-weight: 600; font-size: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(108, 99, 255, .12); color: var(--primary);
}

.slide__body {
  flex: 1; min-height: 0;
  padding: clamp(58px, 7vh, 92px) var(--pad) clamp(46px, 6vh, 70px);
  display: flex; flex-direction: column; justify-content: center;
}

/* ===== typography ===== */
.kicker {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(12px, 1.3vw, 15px); letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--secondary); margin-bottom: 14px;
}
h1.title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 60px); line-height: 1.04; color: var(--dark);
  letter-spacing: -.5px;
}
h2.title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(26px, 3.5vw, 46px); line-height: 1.08; color: var(--dark);
  letter-spacing: -.4px; margin-bottom: 6px;
}
.subtitle {
  font-size: clamp(15px, 1.7vw, 22px); color: var(--muted); font-weight: 600;
  margin-top: 16px; max-width: 46ch;
}
.grad { background: linear-gradient(90deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* bullets */
ul.bullets { list-style: none; margin-top: clamp(18px, 3vh, 34px); display: grid; gap: clamp(12px, 1.8vh, 20px); }
ul.bullets li {
  position: relative; padding-left: 38px;
  font-size: clamp(15px, 1.75vw, 22px); font-weight: 600; color: #38384a; line-height: 1.35;
}
ul.bullets li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 20px; height: 20px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 12px rgba(108, 99, 255, .35);
}
ul.bullets li b, ul.bullets li strong { color: var(--dark); }
ul.bullets li code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em;
  background: #efeefb; color: var(--primary); padding: 1px 7px; border-radius: 6px; font-weight: 700;
}

/* two-column layout (text + visual) */
.cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(22px, 3vw, 48px); align-items: center; height: 100%; }
.cols--wide-visual { grid-template-columns: .9fr 1.1fr; }
.cols .stack { display: flex; flex-direction: column; justify-content: center; }

/* ===== visual frames / screenshot placeholders ===== */
.shot {
  width: 100%; border-radius: 16px; overflow: hidden;
  background: #f1f0fb; border: 1px solid #e6e4f5;
  box-shadow: 0 18px 40px rgba(27, 20, 100, .14);
  display: grid; place-items: center; aspect-ratio: 16 / 10;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot--ph { position: relative; }
.shot--ph .ph {
  text-align: center; color: #8a87b0; padding: 18px; font-weight: 700; font-size: 13.5px;
}
.shot--ph .ph .ic { font-size: 30px; display: block; margin-bottom: 8px; opacity: .7; }
.shot--ph::after {
  content: ""; position: absolute; inset: 9px; border: 2px dashed #cfcbe8; border-radius: 11px; pointer-events: none;
}
.shot--tall { aspect-ratio: 4 / 5; }
.shot--full { aspect-ratio: auto; height: 100%; }
/* portrait diagram: contain (never crop), fit the slide height */
.shot--portrait { aspect-ratio: auto; height: 100%; max-height: 100%; background: #fff; }
.shot--portrait img { object-fit: contain; }

/* landscape diagram: full width, contain (never crop), fit available height */
.shot--landscape { aspect-ratio: auto; width: 100%; height: 100%; max-height: 100%; background: #fff; padding: 10px; }
.shot--landscape img { width: 100%; height: 100%; object-fit: contain; }

/* fit slide: top-aligned, content + image fit inside the slide (no overflow) */
.slide--fit .slide__body { justify-content: flex-start; padding: clamp(44px, 5vh, 60px) clamp(24px, 3vw, 48px) clamp(30px, 3.5vh, 44px); overflow: hidden; }
.slide--fit .kicker { margin-bottom: 8px; }
.fitstage { flex: 1 1 auto; min-height: 0; margin-top: clamp(12px, 1.8vh, 18px); display: flex; justify-content: center; align-items: stretch; }
.fitstage .shot { width: 100%; height: 100%; aspect-ratio: auto; background: #fff; padding: 8px; }
.fitstage .shot img { width: 100%; height: 100%; object-fit: contain; }

/* two stacked screenshots that split the column height (both fully visible) */
.twoshot { height: 100%; min-height: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.twoshot__item { min-height: 0; display: flex; flex-direction: column; }
.twoshot__item .shot { flex: 1; min-height: 0; width: 100%; height: auto; aspect-ratio: auto; background: #fff; padding: 6px; }
.twoshot__item .shot img { width: 100%; height: 100%; object-fit: contain; }
.twoshot__item .caption { margin-top: 5px; flex: 0 0 auto; }
.ba--compact { flex: 0 0 auto; margin-top: clamp(10px, 1.6vh, 16px); height: auto !important; align-content: start; align-items: start; }
.ba--compact .ba__card { padding: clamp(11px, 1.5vh, 16px); }
.ba--compact .ba__card p { font-size: clamp(11.5px, 1.2vw, 14px); line-height: 1.3; }
.ba--compact .ba__card .mono { font-size: .8em; padding: 5px 8px; margin-top: 6px; }
.ba--compact .ba__badge { margin-bottom: 7px; font-size: 11px; padding: 4px 11px; }

/* diagram slide: minimal top, give the image the most room */
.slide--diagram .slide__body { padding: clamp(40px, 5vh, 56px) clamp(22px, 2.6vw, 40px) clamp(34px, 4vh, 48px); }
.diaghead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.chips--inline { margin: 0; gap: 7px; justify-content: flex-end; }
.chips--inline .chip { padding: 6px 12px; font-size: clamp(11px, 1.05vw, 13px); }
.diagstage { flex: 1; min-height: 0; margin-top: clamp(8px, 1.4vh, 14px); display: flex; }
.diagstage .shot { height: 100%; }

/* clickable screenshot wrapper (opens full diagram in new tab) */
.shotlink { position: relative; display: block; height: 100%; text-decoration: none; border-radius: 16px; transition: transform .18s; }
.shotlink:hover { transform: translateY(-3px); }
.shotlink:hover .shot { box-shadow: 0 22px 50px rgba(108, 99, 255, .28); border-color: var(--primary); }
.shotlink__hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(27, 20, 100, .9); color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap;
}
.shotlink:hover .shotlink__hint { opacity: 1; }

/* prominent text link */
.biglink {
  display: inline-flex; align-items: center; gap: 14px; margin-top: clamp(18px, 2.6vh, 30px);
  background: linear-gradient(135deg, rgba(108, 99, 255, .1), rgba(255, 107, 157, .1));
  border: 1.5px solid rgba(108, 99, 255, .25); border-radius: 16px; padding: 14px 20px;
  text-decoration: none; color: var(--dark); font-size: clamp(14px, 1.5vw, 18px); transition: border-color .2s, transform .15s; max-width: max-content;
}
.biglink:hover { border-color: var(--primary); transform: translateY(-2px); }
.biglink__ic { font-size: 26px; }
.biglink__url { color: var(--primary); font-weight: 700; font-size: .82em; }

.caption { margin-top: 10px; font-size: 12.5px; color: var(--muted); font-weight: 700; text-align: center; }

/* ===== stat callouts ===== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 28px); margin-top: clamp(20px, 3vh, 34px); }
.stat {
  background: #fff; border: 1px solid #ececf7; border-radius: 18px; padding: clamp(16px, 2.4vh, 26px);
  box-shadow: 0 12px 28px rgba(27, 20, 100, .08); text-align: center;
}
.stat .num { font-family: var(--font-head); font-weight: 700; font-size: clamp(30px, 4.4vw, 56px); line-height: 1; }
.stat .num.p { color: var(--primary); } .stat .num.s { color: var(--secondary); } .stat .num.a { color: #E0A800; }
.stat .lbl { margin-top: 8px; font-size: clamp(12px, 1.3vw, 15px); font-weight: 700; color: var(--muted); }
.stat .src { display: inline-block; margin-top: 6px; font-size: 10.5px; color: #8f8caf; font-weight: 700; text-decoration: none; transition: color .15s; }
a.src:hover { color: var(--primary); text-decoration: underline; }

/* ===== agent grid ===== */
.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.3vw, 16px); margin-top: clamp(14px, 2vh, 24px); }
.acard {
  border-radius: 15px; padding: clamp(12px, 1.7vh, 17px) clamp(13px, 1.4vw, 17px); background: #fff;
  border: 1px solid #ececf7; box-shadow: 0 8px 20px rgba(27, 20, 100, .06);
  border-left: 5px solid var(--primary); display: flex; flex-direction: column; gap: 4px;
}
.acard .an { font-family: var(--font-head); font-weight: 700; font-size: clamp(14px, 1.45vw, 18px); color: var(--dark); display: flex; align-items: center; gap: 7px; }
.acard .ar { font-size: clamp(11.5px, 1.15vw, 13.5px); color: var(--muted); font-weight: 600; line-height: 1.25; }
.acard.t-safety { border-left-color: var(--danger); } .acard.t-safety .an { color: #c0285a; }
.acard.t-gen { border-left-color: var(--primary); }
.acard.t-quiz { border-left-color: #E0A800; } .acard.t-quiz .an { color: #9a7400; }
.acard.t-rag { border-left-color: #9b59d0; } .acard.t-rag .an { color: #7b3fb0; }

/* ===== before / after ===== */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.2vw, 30px); margin-top: clamp(16px, 2.4vh, 28px); height: 100%; align-content: center; }
.ba__card { border-radius: 16px; padding: clamp(16px, 2.2vh, 24px); display: flex; flex-direction: column; }
.ba__before { background: linear-gradient(160deg, #fff1f4, #fff); border: 1.5px solid #ffd4de; }
.ba__after { background: linear-gradient(160deg, #eefaf4, #fff); border: 1.5px solid #c4ecd9; }
.ba__badge { align-self: flex-start; font-family: var(--font-head); font-weight: 700; font-size: 12.5px; letter-spacing: 1.5px; padding: 5px 13px; border-radius: 999px; margin-bottom: 12px; }
.ba__before .ba__badge { background: var(--danger); color: #fff; }
.ba__after .ba__badge { background: var(--success); color: #fff; }
.ba__card p { font-size: clamp(13.5px, 1.45vw, 17px); font-weight: 600; color: #44445a; line-height: 1.4; }
.ba__card p + p { margin-top: 8px; }
.ba__card .mono { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 7px 10px; display: inline-block; margin-top: 8px; color: #555; }

/* loop diagram (slide 9) */
.loop { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 18px); flex-wrap: wrap; margin-top: clamp(18px, 3vh, 34px); }
.loop .node { background: #fff; border: 1px solid #ececf7; border-radius: 14px; padding: 14px 20px; font-family: var(--font-head); font-weight: 700; font-size: clamp(13px, 1.4vw, 17px); color: var(--dark); box-shadow: 0 10px 24px rgba(27, 20, 100, .08); }
.loop .arr { color: var(--secondary); font-size: 22px; font-weight: 800; }

/* pricing table (slide 15) */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.tier { border-radius: 16px; padding: 18px 20px; border: 1px solid #ececf7; background: #fff; }
.tier.pro { border: 2px solid var(--accent); background: linear-gradient(160deg, #fffbe9, #fff); }
.tier .tname { font-family: var(--font-head); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.tier.pro .tname { color: #b58900; }
.tier .tprice { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 3vw, 38px); color: var(--dark); margin: 4px 0 8px; }
.tier ul { list-style: none; display: grid; gap: 6px; }
.tier ul li { font-size: 13.5px; font-weight: 600; color: #555; padding-left: 20px; position: relative; }
.tier ul li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }

/* chips row (links / languages) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(16px, 2.6vh, 30px); }
.chip { background: #fff; border: 1px solid #ececf7; border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: clamp(12.5px, 1.3vw, 15px); color: var(--dark); box-shadow: 0 6px 16px rgba(27, 20, 100, .06); }
.chip b { color: var(--primary); }
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(16px, 2.4vh, 28px); }
.flag { font-size: clamp(22px, 2.6vw, 34px); }
.flag.hi { filter: drop-shadow(0 0 0 transparent); position: relative; }
.flag.hi::after { content: ""; position: absolute; inset: -5px -3px; border: 2px solid var(--accent); border-radius: 8px; }

/* checklist (slide 17) */
.checks { display: grid; gap: clamp(11px, 1.7vh, 18px); margin-top: clamp(16px, 2.4vh, 28px); }
.checks li { list-style: none; display: flex; gap: 14px; align-items: flex-start; font-size: clamp(14px, 1.6vw, 20px); font-weight: 600; color: #38384a; }
.checks li .ck { flex: none; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--success), #2aa877); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; box-shadow: 0 6px 14px rgba(54, 193, 139, .35); }

/* ===== HERO / cover slides (dark, full-bleed) ===== */
.slide.cover { color: #fff; background: linear-gradient(150deg, var(--dark) 0%, var(--dark-2) 55%, #4a2c8a 100%); }
.slide.cover .slide__body { justify-content: center; align-items: flex-start; }
.slide.cover .bgimg { position: absolute; inset: 0; z-index: 0; }
.slide.cover .bgimg img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.slide.cover .bgimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(15, 10, 46, .82) 0%, rgba(27, 20, 100, .55) 55%, rgba(27, 20, 100, .3) 100%); }
.slide.cover .slide__body { position: relative; z-index: 2; }
.slide.cover h1.title, .slide.cover h2.title { color: #fff; }
.slide.cover .subtitle { color: rgba(255, 255, 255, .82); }
.slide.cover .kicker { color: var(--accent); }
.slide.cover ul.bullets li { color: rgba(255, 255, 255, .92); }
.slide.cover ul.bullets li b { color: #fff; }
.slide.cover .slide__foot { color: rgba(255, 255, 255, .7); }
.cover-logo { width: clamp(70px, 9vw, 110px); height: auto; margin-bottom: 20px; border-radius: 20px; box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
.linklist { display: grid; gap: 10px; margin-top: clamp(16px, 2.4vh, 26px); }
.linklist a { color: #fff; text-decoration: none; font-weight: 700; font-size: clamp(14px, 1.6vw, 20px); display: flex; align-items: center; gap: 12px; }
.linklist a .lk { color: var(--accent); font-weight: 800; min-width: 130px; }
.linklist a:hover .url { text-decoration: underline; text-decoration-color: var(--accent); }

/* ===== controls ===== */
.controls {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 50;
  background: rgba(20, 16, 50, .55); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; padding: 7px 9px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
.ctrl {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; line-height: 1;
  display: grid; place-items: center; transition: background .2s, transform .15s;
}
.ctrl--wide { font-size: 16px; }
.ctrl:hover { background: var(--primary); transform: translateY(-1px); }
.ctrl:active { transform: scale(.92); }
.counter { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: #fff; padding: 0 6px; min-width: 56px; text-align: center; }
.counter__sep { opacity: .45; margin: 0 3px; }

/* progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: rgba(255, 255, 255, .08); z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent)); transition: width .45s cubic-bezier(.4, 0, .2, 1); }

/* hint */
.hint { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 55; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); background: rgba(20, 16, 50, .5); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .12); padding: 7px 16px; border-radius: 999px; transition: opacity .5s; }
.hint kbd { background: rgba(255, 255, 255, .15); border-radius: 5px; padding: 1px 7px; font-family: var(--font-head); font-size: 12px; margin: 0 1px; }
.hint.hide { opacity: 0; pointer-events: none; }

/* ===== overview grid ===== */
.overview { position: fixed; inset: 0; z-index: 80; background: rgba(10, 7, 28, .92); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s; overflow-y: auto; padding: 70px 5vw 40px; }
.overview.show { opacity: 1; pointer-events: auto; }
.overview__head { position: fixed; top: 22px; left: 5vw; right: 5vw; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #fff; }
.overview__close { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; cursor: pointer; }
.overview__close:hover { background: var(--secondary); }
.overview__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; max-width: 1300px; margin: 0 auto; }
.ovcard { aspect-ratio: 16 / 9; border-radius: 12px; background: linear-gradient(160deg, #fff, #f7f6ff); color: var(--ink); cursor: pointer; overflow: hidden; position: relative; border: 2px solid transparent; transition: transform .15s, border-color .15s; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.ovcard:hover { transform: translateY(-3px); border-color: var(--accent); }
.ovcard.cur { border-color: var(--secondary); }
.ovcard .ovn { position: absolute; top: 8px; left: 10px; font-family: var(--font-head); font-weight: 700; font-size: 12px; color: var(--primary); background: #fff; border-radius: 6px; padding: 1px 7px; }
.ovcard .ovt { position: absolute; inset: auto 12px 12px 12px; font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--dark); line-height: 1.2; }
.ovcard.dark { background: linear-gradient(150deg, var(--dark), #4a2c8a); }
.ovcard.dark .ovt { color: #fff; } .ovcard.dark .ovn { color: var(--dark); }

/* responsive */
@media (max-width: 720px) {
  .cols, .cols--wide-visual { grid-template-columns: 1fr; gap: 16px; }
  .cols .shot { display: none; } /* hide screenshots on tiny screens, keep text */
  .agrid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .ba, .price { grid-template-columns: 1fr; }
  .hint { display: none; }
}
@media print {
  body { overflow: visible; background: #fff; }
  .controls, .progress, .hint, .overview { display: none !important; }
  .deck { position: static; display: block; padding: 0; }
  .slide { position: relative; opacity: 1 !important; transform: none !important; page-break-after: always; box-shadow: none; width: 100%; max-height: none; margin: 0 0 12px; border: 1px solid #ddd; }
}
