/* Ruang Belajar landing page. Palette and font match the game (Bandar Matematik). */
@font-face { font-family: Fredoka; font-weight: 400; font-display: swap; src: url(fonts/fredoka-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(fonts/fredoka-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(fonts/fredoka-latin-700-normal.woff2) format("woff2"); }

:root {
  --ink: #3b2e6e; --soft: #5f5489; --bg: #dff1fb; --card: #fffaf0; --tile: #f1ecff; --line: #ddd5f5;
  --go: #2fcb71; --go-d: #1e9c52; --btn: #7c5cf0; --btn-d: #5639c4; --sun: #ffc83d; --bad: #c8463d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 Fredoka, ui-rounded, "Segoe UI", system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--btn-d); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--btn); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: 600 17px/1.1 Fredoka, ui-rounded, system-ui, sans-serif; color: #fff; background: var(--go); border-radius: 16px; padding: 15px 24px;
  box-shadow: 0 4px 0 var(--go-d); transition: transform .08s, filter .15s, box-shadow .08s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--go-d); }
.btn.alt { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); padding: 13px 22px; }
.btn.white { background: #fff; color: var(--btn-d); box-shadow: 0 4px 0 rgba(0, 0, 0, .22); }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .7); box-shadow: none; padding: 13px 22px; }
.btn.sm { padding: 10px 16px; font-size: 15px; border-radius: 13px; box-shadow: 0 3px 0 var(--go-d); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: rgba(223, 241, 251, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.top.stuck { border-color: var(--line); box-shadow: 0 6px 18px rgba(59, 46, 110, .07); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 21px; }
.brand i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, #8d6ff5, var(--btn-d)); box-shadow: 0 3px 0 var(--btn-d); }
nav.main { margin-left: auto; display: flex; gap: 2px; align-items: center; }
nav.main a { padding: 8px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
nav.main a:hover { background: rgba(255, 255, 255, .75); }
.lang { display: flex; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; font: 600 14px Fredoka, system-ui, sans-serif; color: var(--soft); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--btn); color: #fff; }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-size: 22px; cursor: pointer; place-items: center; }
@media (max-width: 960px) {
  nav.main { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--card);
    padding: 10px 20px 16px; border-bottom: 2px solid var(--line); box-shadow: 0 14px 24px rgba(59, 46, 110, .1); }
  nav.main.open { display: flex; }
  nav.main a { padding: 13px 8px; font-size: 18px; }
  .burger { display: grid; }
  .top .wrap > .btn { display: none; }
  .lang { margin-left: auto; }
}

.brand { white-space: nowrap; }
@media (max-width: 480px) {
  .top .wrap { gap: 8px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand i { width: 34px; height: 34px; font-size: 21px; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 38px 0 96px; }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr .98fr; gap: 44px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 6px 15px; font-weight: 600; font-size: 14.5px; color: var(--btn-d); }
h1 { font-size: clamp(36px, 5.8vw, 62px); font-weight: 700; margin: 18px 0 16px; letter-spacing: -.01em; }
h1 mark { background: linear-gradient(transparent 60%, #ffd96a 60%); color: inherit; padding: 0 4px; border-radius: 6px; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--soft); max-width: 33em; margin-bottom: 26px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.pills li { background: rgba(255, 255, 255, .8); border: 2px solid #fff; border-radius: 999px; padding: 5px 13px; font-size: 14.5px; font-weight: 600; }
.shot { position: relative; padding: 0 0 18px; }
.frame { background: #fff; border: 3px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 9px 9px 0 var(--btn);
  transform: rotate(1.6deg); transition: transform .25s; }
.shot:hover .frame { transform: rotate(0); }
.frame .bar { display: flex; gap: 6px; padding: 9px 14px; background: var(--tile); border-bottom: 3px solid var(--ink); }
.frame .bar b { width: 11px; height: 11px; border-radius: 50%; background: #ff8a7a; }
.frame .bar b:nth-child(2) { background: #ffd166; }
.frame .bar b:nth-child(3) { background: #5fd68b; }
.frame img { width: 100%; }
.badge { position: absolute; z-index: 3; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 7px 14px; font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 0 var(--ink); animation: bob 4.5s ease-in-out infinite; white-space: nowrap; }
.badge.b1 { left: -14px; top: 14%; }
.badge.b2 { right: -10px; bottom: 7%; animation-delay: -2s; }
.sym { position: absolute; z-index: 1; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .18); animation: float 7s ease-in-out infinite; }
.sym.s1 { background: #e8a317; left: 3%; top: 12%; }
.sym.s2 { background: #e05d5d; left: 46%; top: 5%; animation-delay: -2s; width: 44px; height: 44px; font-size: 26px; }
.sym.s3 { background: var(--btn); right: 3%; top: 10%; animation-delay: -4s; }
.sym.s4 { background: var(--go); left: 40%; bottom: 14%; animation-delay: -1s; width: 46px; height: 46px; }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; z-index: 2; }
.wave path { fill: var(--card); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-16px) rotate(6deg); } }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 34px; }
  .badge.b1 { left: -6px; } .badge.b2 { right: -4px; }
  .sym.s2, .sym.s4 { display: none; }
}
@media (max-width: 640px) { .sym { display: none; } }

/* ---------- sections ---------- */
section { padding: 76px 0; scroll-margin-top: 68px; }
.paper { background: var(--card); }
.sec-head { text-align: center; max-width: 700px; margin: 0 auto 38px; }
.kicker { font-weight: 700; color: var(--btn-d); letter-spacing: .08em; text-transform: uppercase; font-size: 13.5px; }
.sec-head h2 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 700; margin: 8px 0 12px; }
.sec-head p { color: var(--soft); }

/* stats */
.stats { background: var(--card); padding: 8px 0 18px; }
.stats ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; list-style: none; padding: 0; margin: 0; }
.stats li { text-align: center; padding: 14px 8px; }
.stats .num { display: block; font-size: clamp(38px, 6vw, 56px); font-weight: 700; color: var(--btn-d); line-height: 1; }
.stats span.lab { display: block; margin-top: 6px; color: var(--soft); font-weight: 600; font-size: 15.5px; }
@media (max-width: 640px) { .stats ul { grid-template-columns: 1fr 1fr; } }

/* quiz */
#cuba { padding-top: 40px; }
.quiz { max-width: 760px; margin: 0 auto; background: #fff; border: 3px solid var(--ink); border-radius: 26px; padding: 22px; box-shadow: 9px 9px 0 var(--btn); position: relative; overflow: hidden; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.q-top .lab { font-weight: 700; }
.levels { display: flex; gap: 6px; flex-wrap: wrap; }
.levels button { width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line); background: var(--tile); font: 700 18px Fredoka, system-ui, sans-serif; color: var(--ink); cursor: pointer; transition: transform .08s; }
.levels button:hover { transform: translateY(-2px); border-color: var(--btn); }
.levels button[aria-pressed="true"] { background: var(--btn); border-color: var(--btn-d); color: #fff; box-shadow: 0 3px 0 var(--btn-d); }
@media (max-width: 560px) {
  .q-top { display: block; }
  .levels { margin-top: 8px; flex-wrap: nowrap; }
  .levels button { flex: 1; width: auto; min-width: 0; }
}
.q-owl { display: flex; gap: 12px; align-items: center; margin: 18px 0 6px; }
.owl { font-size: 36px; line-height: 1; background: var(--tile); border-radius: 18px; width: 60px; height: 60px; display: grid; place-items: center; flex: none; }
.bubble { background: var(--tile); border-radius: 16px; padding: 10px 15px; font-weight: 600; min-height: 46px; display: flex; align-items: center; }
.q-text { font-size: clamp(24px, 4.6vw, 36px); font-weight: 700; text-align: center; margin: 14px 0 18px; line-height: 1.3; min-height: 1.4em; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { font: 700 clamp(22px, 4vw, 30px) Fredoka, system-ui, sans-serif; padding: 16px 10px; border-radius: 18px; border: 3px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .08s, border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--btn); transform: translateY(-2px); }
.opt:disabled { cursor: default; }
.opt.ok { background: #d9f7e4; border-color: var(--go); box-shadow: 0 4px 0 var(--go-d); }
.opt.no { background: #ffe3df; border-color: var(--bad); box-shadow: 0 4px 0 #e5a39d; animation: shake .35s; }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.stars { display: flex; gap: 4px; font-size: 28px; line-height: 1; }
.stars span { filter: grayscale(1); opacity: .3; transition: transform .2s, opacity .2s, filter .2s; }
.stars span.on { filter: none; opacity: 1; transform: scale(1.18); }
.score { font-weight: 600; color: var(--soft); font-size: 15.5px; }
.note { text-align: center; color: var(--soft); font-size: 14.5px; margin-top: 16px; }
.confetto { position: absolute; top: -14px; width: 10px; height: 15px; border-radius: 3px; pointer-events: none; animation: fall 1.5s ease-in forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: .85; } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* not just a quiz */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
.split .frame { transform: rotate(-1.4deg); box-shadow: -9px 9px 0 var(--go); }
.split .shot:hover .frame { transform: rotate(0); }
.cap { text-align: center; color: var(--soft); font-size: 14.5px; margin-top: 18px; font-weight: 600; }
.split h2 { font-size: clamp(28px, 4.2vw, 40px); margin: 8px 0 12px; }
.split p.sub { color: var(--soft); }
.mini { list-style: none; padding: 0; margin: 24px 0 20px; display: grid; gap: 16px; }
.mini li { display: flex; gap: 14px; align-items: flex-start; }
.mini .n { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--btn); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; box-shadow: 0 3px 0 var(--btn-d); }
.mini strong { display: block; font-size: 18px; }
.mini span.d { color: var(--soft); }
.tip { background: #fff3c4; border: 2px solid #ffd96a; border-radius: 16px; padding: 12px 16px; font-weight: 600; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 34px; } .split .shot { order: 2; } }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 24px; }
.tab { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 10px 16px; font: 600 16px Fredoka, system-ui, sans-serif; color: var(--ink); cursor: pointer; transition: transform .08s, background .15s; }
.tab:hover { transform: translateY(-2px); border-color: var(--btn); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { background: #fff; border: 3px solid var(--ink); border-radius: 26px; padding: 28px; box-shadow: 9px 9px 0 var(--line); animation: pop .3s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.place { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: start; }
.place .big { width: 116px; height: 116px; border-radius: 30px; display: grid; place-items: center; font-size: 62px; background: var(--c, var(--tile)); box-shadow: 0 6px 0 rgba(0, 0, 0, .14); }
.place h3 { font-size: clamp(24px, 3.6vw, 32px); margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; padding: 0; list-style: none; }
.tags li { background: var(--tile); border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: 600; }
.place p { color: var(--soft); }
.example { margin-top: 16px; background: var(--card); border: 2px dashed var(--line); border-radius: 16px; padding: 12px 16px; }
.example b { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--btn-d); margin-bottom: 2px; }
@media (max-width: 640px) { .place { grid-template-columns: 1fr; } .place .big { width: 88px; height: 88px; font-size: 48px; } .panel { padding: 20px; } }

/* features */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.feat { background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 24px; transition: transform .15s, box-shadow .15s; }
.feat:hover { transform: translateY(-5px); box-shadow: 0 10px 0 var(--line); }
.feat .ic { width: 58px; height: 58px; border-radius: 18px; background: var(--tile); display: grid; place-items: center; font-size: 32px; margin-bottom: 14px; }
.feat h3 { font-size: 21px; margin-bottom: 6px; }
.feat p { color: var(--soft); }

/* audience */
.seg { display: flex; justify-content: center; margin-bottom: 24px; }
.seg .pill { display: inline-flex; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg .tab { border: 0; border-radius: 999px; padding: 10px 22px; }
.seg .tab:hover { transform: none; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; }
.checks .ic { flex: none; font-size: 28px; line-height: 1.1; }
@media (max-width: 720px) { .checks { grid-template-columns: 1fr; } }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 12px; }
.step { background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 34px 22px 24px; text-align: center; position: relative; }
.step .no { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--btn); color: #fff; font-weight: 700; display: grid; place-items: center; border: 3px solid var(--bg); }
.step .ic { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.step h3 { font-size: 21px; margin-bottom: 6px; }
.step p { color: var(--soft); }
.after { text-align: center; margin-top: 34px; }
.after p { color: var(--soft); font-weight: 600; margin-bottom: 16px; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 32px; } }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; }
details { background: #fff; border: 2px solid var(--line); border-radius: 18px; margin-bottom: 12px; transition: border-color .15s; }
details[open] { border-color: var(--btn); }
summary { cursor: pointer; list-style: none; padding: 17px 60px 17px 20px; font-weight: 600; font-size: 18px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; font-weight: 700; font-size: 20px; line-height: 1; }
details[open] summary::after { content: "\2013"; background: var(--btn); color: #fff; }
.ans { padding: 0 20px 18px; color: var(--soft); }

/* final call to action + footer */
.final { background: linear-gradient(135deg, #7c5cf0, #5639c4); color: #fff; text-align: center; padding: 80px 0; position: relative; overflow: hidden; }
.final h2 { font-size: clamp(28px, 4.6vw, 44px); margin-bottom: 12px; }
.final p { opacity: .92; max-width: 32em; margin: 0 auto 26px; font-size: 19px; }
.final .cta-row { justify-content: center; margin: 0; }
footer { background: var(--ink); color: #d9d3f2; padding: 34px 0 40px; font-size: 15px; }
footer .wrap { display: grid; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer a { color: #fff; }
footer small { opacity: .8; display: block; max-width: 52em; }

/* scroll reveal: only hidden when JavaScript is running */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .frame { transform: none; }
}
