/* PlayCourseAI design system v3 - studenty, warm, playful */

:root {
  /* Warm cream surface */
  --bg:          #FFF8EE;
  --bg-alt:      #FFFBF3;
  --surface:     #FFFFFF;
  --ink:         #1B1B32;
  --ink-2:       #2E2E4D;
  --muted:       #6B6B85;
  --dim:         #9696AE;
  --border:      #E8E4D8;
  --border-strong:#1B1B32;

  /* Brand colors */
  --violet:      #6B46FE;
  --violet-d:    #5431CC;   /* pressed / border */
  --violet-l:    #EEE8FF;
  --orange:      #FF8A00;
  --orange-d:    #D66A00;
  --orange-l:    #FFEAD1;
  --pink:        #FF5E87;
  --pink-d:      #CC3D66;
  --pink-l:      #FFE2EB;
  --green:       #22C55E;
  --green-d:     #15803D;
  --green-l:     #DCFCE7;
  --yellow:      #FFD93D;
  --yellow-d:    #C99E00;
  --yellow-l:    #FFF6CC;
  --sky:         #3BA3FF;
  --sky-d:       #1E7BCC;
  --sky-l:       #DCEEFF;

  --radius-sm:   12px;
  --radius:      20px;
  --radius-lg:   28px;
  --radius-xl:   36px;

  --shadow-sm:   0 2px 0 0 var(--border-strong);
  --shadow:      0 4px 0 0 var(--border-strong);
  --shadow-lg:   0 6px 0 0 var(--border-strong);
  --shadow-soft: 0 12px 30px -8px rgba(27, 27, 50, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.display { font-family: 'Fraunces', 'Lexend', serif; font-optical-sizing: auto; font-variation-settings: "SOFT" 50, "WONK" 0; letter-spacing: -0.02em; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, 2.75rem); }
h3 { font-size: 1.35rem; font-weight: 700; }

.muted { color: var(--muted); }
.dim   { color: var(--dim); }

/* ---------- page bg (subtle dotted texture + color blobs) ---------- */
.pcai-bg {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(27,27,50,.06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
}

/* ---------- nav ---------- */
.pcai-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 238, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--violet);
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  display: grid; place-items: center;
  color: white; font-weight: 800;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-style: italic;
}

/* ---------- buttons (Duolingo-style "pressable") ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: white;
  color: var(--ink);
  box-shadow: 0 4px 0 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn:hover { transform: translate(0, -1px); box-shadow: 0 5px 0 0 var(--ink); }
.btn:active { transform: translate(0, 3px); box-shadow: 0 1px 0 0 var(--ink); }

.btn-primary { background: var(--violet); color: white; }
.btn-primary:hover { background: #7956FF; }

.btn-orange { background: var(--orange); color: white; }
.btn-orange:hover { background: #FF9B1F; }

.btn-pink { background: var(--pink); color: white; }
.btn-pink:hover { background: #FF7BA0; }

.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #34D26D; }

.btn-ink { background: var(--ink); color: white; }
.btn-ink:hover { background: #2E2E4D; }

.btn-ghost { background: white; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-alt); }

.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 12px; box-shadow: 0 3px 0 0 var(--ink); }
.btn-sm:hover { box-shadow: 0 4px 0 0 var(--ink); }
.btn-sm:active { box-shadow: 0 1px 0 0 var(--ink); }

.btn-lg { padding: 18px 30px; font-size: 17px; border-radius: 18px; box-shadow: 0 5px 0 0 var(--ink); }
.btn-lg:hover { box-shadow: 0 6px 0 0 var(--ink); }
.btn-lg:active { box-shadow: 0 1px 0 0 var(--ink); }

.btn-xl { padding: 22px 36px; font-size: 19px; border-radius: 20px; box-shadow: 0 6px 0 0 var(--ink); }
.btn-xl:hover { box-shadow: 0 7px 0 0 var(--ink); }
.btn-xl:active { box-shadow: 0 1px 0 0 var(--ink); }

/* ---------- cards ---------- */
.card {
  background: white;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 0 var(--ink);
  padding: 28px;
}
.card-sm { border-radius: var(--radius); padding: 20px; box-shadow: 0 4px 0 0 var(--ink); }
.card-lg { border-radius: var(--radius-xl); padding: 40px; box-shadow: 0 8px 0 0 var(--ink); }

.card-tilt { transition: transform .25s ease; }
.card-tilt:hover { transform: rotate(-1.5deg) translateY(-4px); }

.soft-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, border-color .2s ease;
}
.soft-card:hover { transform: translateY(-3px); border-color: var(--ink); }

/* ---------- color tile cards (feature blocks) ---------- */
.tile {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 0 var(--ink);
  padding: 30px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 9px 0 0 var(--ink); }
.tile-violet { background: var(--violet-l); }
.tile-orange { background: var(--orange-l); }
.tile-pink   { background: var(--pink-l); }
.tile-green  { background: var(--green-l); }
.tile-yellow { background: var(--yellow-l); }
.tile-sky    { background: var(--sky-l); }

.tile-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: white;
  font-size: 28px;
  box-shadow: 0 3px 0 0 var(--ink);
  margin-bottom: 16px;
}

/* ---------- chip / pill ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  border: 2px solid var(--ink);
  background: white;
  border-radius: 999px;
  box-shadow: 0 2px 0 0 var(--ink);
}
.chip-violet { background: var(--violet); color: white; }
.chip-orange { background: var(--orange); color: white; }
.chip-pink   { background: var(--pink);   color: white; }
.chip-green  { background: var(--green);  color: white; }
.chip-yellow { background: var(--yellow); color: var(--ink); }
.chip-sky    { background: var(--sky);    color: white; }

.chip-soft {
  border-color: var(--border);
  box-shadow: none;
  background: var(--bg-alt);
  color: var(--muted);
  font-weight: 600;
}

/* ---------- input ---------- */
.input {
  width: 100%;
  padding: 16px 20px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 4px 0 0 var(--ink);
  outline: none;
  transition: transform .05s, box-shadow .05s;
}
.input:focus { transform: translateY(-1px); box-shadow: 0 5px 0 0 var(--ink); background: white; }
.input::placeholder { color: var(--dim); font-weight: 500; }

/* ---------- big ingest composer ---------- */
.composer {
  display: flex; align-items: center; gap: 10px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 6px 0 0 var(--ink);
}
.composer .input { border: 0; box-shadow: none; padding: 10px 16px; font-size: 16px; }
.composer .input:focus { transform: none; box-shadow: none; }

/* ---------- exam grid cards ---------- */
.exam-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 4px 0 0 var(--ink);
  transition: transform .18s;
  cursor: pointer;
}
.exam-card:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 6px 0 0 var(--ink); }
.exam-card .emoji { font-size: 32px; display: block; }
.exam-card .name { font-weight: 800; font-size: 17px; margin-top: 8px; }
.exam-card .desc { font-size: 12px; color: var(--ink); opacity: .65; margin-top: 2px; font-weight: 500; }

/* ---------- tabs / segmented ---------- */
.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 8px;
  padding: 6px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 0 var(--ink);
}
.tab {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700; font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: inherit;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--bg-alt); }
.tab.active { background: var(--violet); color: white; }

/* ---------- progress ---------- */
.progress {
  width: 100%; height: 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: white;
  overflow: hidden;
  position: relative;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-right: 2px solid var(--ink);
  transition: width .4s ease;
}
.progress-indeterminate::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--violet), var(--pink), transparent);
  animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide { 0% { left: -40%; } 100% { left: 100%; } }

/* ---------- spinner ---------- */
.spin {
  width: 16px; height: 16px;
  border: 2.5px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- mock question UI ---------- */
.q {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 0 0 var(--ink);
  margin-bottom: 14px;
}
.q-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all .12s;
  font-weight: 500;
}
.q-opt:hover { border-color: var(--ink); transform: translateY(-1px); }
.q-opt.selected { background: var(--violet-l); border-color: var(--violet); }
.q-opt.correct  { background: var(--green-l);  border-color: var(--green); }
.q-opt.wrong    { background: var(--pink-l);   border-color: var(--pink); }
.q-letter {
  width: 30px; height: 30px; border-radius: 10px;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  background: white;
  flex-shrink: 0;
}
.q-opt.selected .q-letter { background: var(--violet); color: white; }
.q-opt.correct  .q-letter { background: var(--green); color: white; }
.q-opt.wrong    .q-letter { background: var(--pink);  color: white; }

/* ---------- prose ---------- */
.prose h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 10px; }
.prose p { color: var(--ink-2); margin: .4rem 0; }
.prose ul { padding-left: 1.2rem; }
.prose code {
  background: var(--violet-l);
  color: var(--violet-d);
  padding: 2px 8px; border-radius: 6px; font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: .5rem 0; font-size: 14px; background: var(--bg-alt); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.prose th { text-align: left; padding: 12px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 2px solid var(--border); font-weight: 800; }
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--ink-2); }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- stats ---------- */
.stat {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 0 0 var(--ink);
}
.stat-value { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; font-weight: 700; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- decorations (wavy underline, squiggle) ---------- */
.highlight-orange {
  background: linear-gradient(180deg, transparent 55%, rgba(255,138,0,.4) 55%);
  padding: 0 4px;
}
.highlight-violet {
  background: linear-gradient(180deg, transparent 60%, rgba(107,70,254,.25) 60%);
  padding: 0 4px;
}
.highlight-green {
  background: linear-gradient(180deg, transparent 60%, rgba(34,197,94,.3) 60%);
  padding: 0 4px;
}

.underline-wavy {
  position: relative;
}
.underline-wavy::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -8px;
  height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'><path d='M0 5 Q15 0 30 5 T60 5 T90 5 T120 5' fill='none' stroke='%236B46FE' stroke-width='3' stroke-linecap='round'/></svg>");
  background-repeat: repeat-x;
  background-size: 120px 10px;
}

/* ---------- floating notes (hero decoration) ---------- */
.float-note {
  position: absolute;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 5px 0 0 var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.float-note.tilt-l { transform: rotate(-6deg); }
.float-note.tilt-r { transform: rotate(5deg); }
.float-note.tilt-ll { transform: rotate(-10deg); }
.float { animation: bob 5s ease-in-out infinite; }
.float.delay-1 { animation-delay: -2s; }
.float.delay-2 { animation-delay: -4s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-8px) rotate(var(--r, 0deg)); }
}

/* ---------- details (FAQ) ---------- */
details.faq { padding: 0; list-style: none; }
details.faq summary {
  list-style: none; cursor: pointer;
  padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 700;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: ""; width: 30px; height: 30px;
  border: 2px solid var(--ink);
  background: var(--bg-alt);
  border-radius: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1B32' stroke-width='3' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .2s;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq[open] summary { padding-bottom: 8px; }
details.faq > p { padding: 0 26px 24px; color: var(--muted); line-height: 1.65; }

/* ---------- divider ---------- */
.div-dashed { border: 0; border-top: 2px dashed var(--border); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 999px; border: 2px solid var(--bg); }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .hide-m { display: none; }
  .card, .tile, .stat { padding: 20px; }
  h1 { font-size: 2.5rem; }
}

/* ---------- section header helpers ---------- */
.eyebrow { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--violet); }
