/* ================================================================
   LEARN — Design system
   Editorial · cream paper · ink black · signal orange
   ================================================================ */

:root {
  --paper: #f6f2ea;
  --paper-2: #efe9de;
  --card: #ffffff;
  --ink: #131210;
  --ink-soft: #4a4640;
  --muted: #8c857a;
  --line: #e5ddcf;
  --line-strong: #d8cfbe;
  --orange: #f24d0d;
  --orange-soft: #fdeae1;
  --green: #1e7d4f;
  --green-soft: #e4f1e8;
  --red: #c8321e;
  --red-soft: #f9e6e2;
  --radius: 20px;
  --radius-sm: 12px;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  font-size: 15.5px;
  line-height: 1.5;
}
html { overflow-x: clip; }

::selection { background: var(--orange); color: #fff; }

/* ---------------- Icons ---------------- */
.ic {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.28em;
  flex-shrink: 0;
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 34px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 242, 234, 0.85);
  backdrop-filter: blur(14px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.logo .mark { height: 30px; width: auto; }
.logo em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  margin-right: 3px;
  letter-spacing: 0;
}
.logo .dot-o { color: var(--orange); font-weight: 800; }
.nav-links {
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(19, 18, 16, 0.04);
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 7px 15px;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip .val { font-weight: 800; color: var(--ink); }
.chip .ic { color: var(--orange); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(19, 18, 16, 0.22); }
.btn-orange {
  background: var(--orange);
  color: #fff;
}
.btn-orange:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(242, 77, 13, 0.32); }
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------------- Layout ---------------- */
.container { max-width: 1140px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.page { padding-top: 44px; padding-bottom: 100px; }
.page-head { margin-bottom: 36px; }
.page-head .kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
  margin-bottom: 10px;
}
.page-head h1 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.05;
}
.page-head h1 em {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
}
.page-head p { color: var(--muted); margin-top: 12px; font-size: 1.02rem; max-width: 560px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card.hoverable:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(19, 18, 16, 0.07);
}

/* Corner ticks (Calia-style) */
.ticked { position: relative; }
.ticked::before, .ticked::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--orange);
  border-style: solid;
  border-width: 0;
}
.ticked::before { top: -7px; left: 50%; margin-left: -7px; border-top-width: 2px; border-left-width: 2px; transform: rotate(45deg) scale(0.7); border-left-color: transparent; }
.ticked::after { bottom: -7px; left: 50%; margin-left: -7px; border-bottom-width: 2px; transform: scale(0.9); border-radius: 1px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Bento: one white container, internal hairlines */
.bento {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
}
.bento > div {
  padding: 40px 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.bento .b-visual {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  color: var(--orange);
}
.bento h3 { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em; }
.bento p { color: var(--muted); margin-top: 8px; font-size: 0.94rem; }

/* ---------------- Stats ---------------- */
.stat .label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stat .value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
}
.stat .value.orange { color: var(--orange); }
.stat .sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

/* ---------------- Progress ---------------- */
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}
.progress .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--orange);
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------- Level map ---------------- */
.level-block { margin-bottom: 44px; }
.level-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.level-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.6rem;
  color: var(--orange);
  line-height: 1;
}
.level-header h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.level-header .lvl-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.level-header .lvl-reward {
  margin-left: auto;
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}
.level-header .lvl-reward b { color: var(--ink); display: block; font-size: 1rem; }

.lesson-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}
.lesson-card .l-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.15rem;
}
.lesson-card .l-info { flex: 1; min-width: 0; }
.lesson-card .l-info h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.lesson-card .l-info p { color: var(--muted); font-size: 0.84rem; margin-top: 3px; }
.lesson-card .l-status {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.9rem;
}
.lesson-card.done .l-icon { background: var(--green-soft); border-color: transparent; color: var(--green); }
.lesson-card.done .l-status { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-card.locked { opacity: 0.45; cursor: not-allowed; }

/* ---------------- Lesson page ---------------- */
.lesson-progress-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.lesson-progress-wrap .progress { flex: 1; }
.lesson-progress-wrap span { color: var(--muted); font-size: 0.84rem; font-weight: 600; white-space: nowrap; }

.lcard {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 52px 44px;
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.lcard .big-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 1.6rem;
}
.lcard h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.lcard > p { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.7; }
.lcard .example {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: left;
}
.lcard .example b { color: var(--orange); font-weight: 800; }
.lesson-nav { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------------- Quiz ---------------- */
.quiz-card { max-width: 680px; margin: 0 auto; padding: 44px 40px; animation: cardIn 0.4s; }
.quiz-card .q-count {
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.quiz-card h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; margin: 14px 0 28px; line-height: 1.4; }
.q-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.q-option:hover:not(:disabled) { border-color: var(--ink); }
.q-option .k {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  color: var(--muted);
}
.q-option.correct { border-color: var(--green); background: var(--green-soft); }
.q-option.correct .k { background: var(--green); border-color: var(--green); color: #fff; }
.q-option.wrong { border-color: var(--red); background: var(--red-soft); }
.q-option.wrong .k { background: var(--red); border-color: var(--red); color: #fff; }
.q-option:disabled { cursor: default; }
.q-explain {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 8px;
  animation: cardIn 0.3s;
}
.quiz-footer { display: flex; justify-content: flex-end; margin-top: 24px; }

/* ---------------- Reward modal ---------------- */
.reward-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(19, 18, 16, 0.45);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reward-box {
  text-align: center;
  padding: 56px 64px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(19, 18, 16, 0.28);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  max-width: 90vw;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.reward-box .r-coin {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  animation: coinFloat 2.2s ease-in-out infinite;
}
.reward-box .r-coin .ic { width: 40px; height: 40px; }
@keyframes coinFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.reward-box h2 { margin: 22px 0 4px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.reward-box .r-amount {
  font-family: var(--serif);
  font-style: italic;
  font-size: 3rem;
  color: var(--orange);
  margin: 6px 0 10px;
  line-height: 1;
}
.reward-box p { color: var(--muted); font-size: 0.93rem; margin-bottom: 26px; max-width: 340px; margin-left: auto; margin-right: auto; }
.confetti {
  position: absolute;
  top: -14px;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  animation: confFall linear forwards;
  pointer-events: none;
}
@keyframes confFall {
  to { transform: translateY(640px) rotate(660deg); opacity: 0; }
}

/* ---------------- Tables ---------------- */
.table-card { padding: 8px 8px 4px; overflow: hidden; }
.table-card h3 { padding: 18px 20px 10px; font-size: 1.05rem; font-weight: 800; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 0.93rem; font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr.me td { background: var(--orange-soft); }
.table .rank {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
  width: 64px;
}
.table tr:nth-child(-n+3) .rank { color: var(--orange); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.neutral { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }

/* ---------------- Badges ---------------- */
.badge-tile { text-align: center; padding: 26px 16px; }
.badge-tile .b-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 1.2rem;
}
.badge-tile h4 { font-size: 0.92rem; font-weight: 800; }
.badge-tile p { color: var(--muted); font-size: 0.78rem; margin-top: 5px; line-height: 1.45; }
.badge-tile.locked { opacity: 0.4; }
.badge-tile.locked .b-icon { background: var(--paper); color: var(--muted); }
.badge-tile.earned { border-color: var(--orange); }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); font-weight: 500; }

/* ---------------- Landing ---------------- */
.hero {
  text-align: center;
  padding: 90px 24px 64px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 34px;
}
.hero .eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
}
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 900px;
  margin: 0 auto;
}
.hero h1 .serif {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}
.hero h1 .accent { color: var(--orange); }
.hero .sub {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 580px;
  margin: 26px auto 40px;
  line-height: 1.65;
}
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 72px auto 0;
  max-width: 780px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-stats .hs {
  flex: 1;
  text-align: center;
  padding: 26px 12px;
  border-right: 1px solid var(--line);
}
.hero-stats .hs:last-child { border-right: none; }
.hero-stats .hs b {
  font-size: 1.75rem;
  display: block;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-stats .hs b em { font-family: var(--serif); font-weight: 400; color: var(--orange); }
.hero-stats .hs span { color: var(--muted); font-size: 0.8rem; font-weight: 600; }

.section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
  margin-bottom: 12px;
}
.section-head h2 { font-size: 2.3rem; letter-spacing: -0.03em; font-weight: 800; line-height: 1.1; }
.section-head h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; }
.section-head p { color: var(--muted); margin-top: 14px; max-width: 540px; margin-left: auto; margin-right: auto; }

.faq-item { margin-bottom: 10px; overflow: hidden; }
.faq-item summary {
  cursor: pointer;
  padding: 22px 26px;
  font-weight: 800;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--orange);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.2s;
  line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 26px 22px; color: var(--muted); line-height: 1.65; font-size: 0.94rem; }

.cta-banner {
  text-align: center;
  padding: 76px 40px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.cta-banner h2 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.cta-banner h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--orange); }
.cta-banner p { color: rgba(246, 242, 234, 0.6); margin-bottom: 30px; }
.cta-banner .btn-orange { font-size: 1rem; padding: 15px 32px; }

footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.84rem;
}
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------- Auth ---------------- */
.auth-wrap {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card { width: 100%; max-width: 430px; padding: 46px 42px; }
.auth-card h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.auth-card h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; }
.auth-card > p { color: var(--muted); font-size: 0.94rem; margin: 10px 0 30px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 26px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 14px 40px rgba(19, 18, 16, 0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Avatar ---------------- */
.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
  text-decoration: none;
}

/* ---------------- Meme portraits ---------------- */
.portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.p-frame {
  background: #ede3d5; /* matches the Chill Guy sheet background — no white gaps */
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  transition: transform 0.25s, box-shadow 0.25s;
}
.p-frame svg { width: 100%; height: auto; display: block; }
.portrait .p-frame { width: 200px; }
.portrait figcaption {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.portrait .p-no {
  font-family: var(--serif);
  font-style: italic;
  color: var(--orange);
  font-size: 0.95rem;
}
.portrait figcaption b { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.01em; }
.portrait .p-sub { color: var(--muted); font-size: 0.76rem; font-weight: 600; }

/* hero gallery */
.gallery {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 34px;
  margin-top: 66px;
  flex-wrap: wrap;
}
.gallery .portrait:nth-child(1) { transform: rotate(-2.5deg) translateY(10px); }
.gallery .portrait:nth-child(2) { z-index: 1; }
.gallery .portrait:nth-child(2) .p-frame { width: 236px; }
.gallery .portrait:nth-child(3) { transform: rotate(2.5deg) translateY(10px); }
.gallery .portrait:hover .p-frame {
  transform: translateY(-6px);
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--line), 0 22px 40px rgba(19, 18, 16, 0.12);
}

/* small variants */
.p-frame.mini {
  width: 132px;
  margin: 0 auto;
  border-radius: 16px;
}
.p-frame.badge {
  width: 76px;
  border-radius: 13px;
  align-self: center;
}

/* ---------------- Real meme art (image + SVG fallback) ---------------- */
.meme-art { position: relative; display: block; }
.meme-art .meme-img { display: none; width: 100%; height: auto; }
.meme-art .meme-fb { display: block; color: var(--ink); }
.meme-art .meme-fb svg { width: 100%; height: auto; display: block; }
body.has-doge .meme-art .meme-img { display: block; }
body.has-doge .meme-art .meme-fb { display: none; }

.chill-art { position: relative; display: block; width: 100%; }
.chill-art .chill-img {
  display: none;
  width: 100%;
  padding-top: 100%;
  background-image: url("assets/chill-guy.png");
  background-size: 300% 300%;
  background-position: var(--cx) var(--cy);
  background-repeat: no-repeat;
}
.chill-art .meme-fb { display: block; color: var(--ink); }
.chill-art .meme-fb svg { width: 100%; height: auto; display: block; }
body.has-chill .chill-art .chill-img { display: block; }
body.has-chill .chill-art .meme-fb { display: none; }

.p-frame .chill-art, .p-frame .meme-art { width: 100%; display: block; }

/* neutral fallback while an art file is missing */
.art-fb {
  display: block;
  width: 100%;
  padding-top: 100%;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 42%, rgba(242, 77, 13, 0.14), transparent 60%),
    var(--paper-2);
  border: 1px dashed var(--line-strong);
}

/* ---------------- How-you-earn cards ---------------- */
.earn-ic {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
  margin-bottom: 16px;
}
.earn-ic svg { width: 24px; height: 24px; }
#earn .card h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
#earn .card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-top: 8px; }

/* ---------------- Create-account box ---------------- */
.join-card {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  padding: 50px 44px;
}
.join-card h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.join-card h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; }
.join-card > p { color: var(--muted); margin: 12px auto 26px; max-width: 400px; }
#join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}
#join-form input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}
#join-form input:focus { border-color: var(--ink); }
#join-form input::placeholder { color: var(--muted); font-weight: 500; }
#join-form .btn { width: 100%; padding: 14px 26px; margin-top: 2px; }

/* ---------------- Lesson sketches ---------------- */
.lsketch {
  margin-top: 24px;
  padding: 18px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.lsketch svg { width: 100%; max-width: 230px; height: auto; display: block; margin: 0 auto; }
.join-or {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 16px 0;
}

/* ---------------- Animated background ---------------- */
#bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-blobs .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.85;
}
.bg-blobs .b1 { width: 520px; height: 520px; background: rgba(242, 77, 13, 0.16); top: -130px; left: -90px; animation: blobDrift 22s ease-in-out infinite; }
.bg-blobs .b2 { width: 560px; height: 560px; background: rgba(30, 125, 79, 0.13); bottom: -170px; right: -130px; animation: blobDrift 28s ease-in-out infinite reverse; }
.bg-blobs .b3 { width: 420px; height: 420px; background: rgba(242, 77, 13, 0.12); top: 42%; left: 52%; animation: blobDrift 34s ease-in-out infinite; }
@keyframes blobDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -50px) scale(1.18); }
}
/* content sits above the animated background */
.topbar { z-index: 50; }
main, footer, .marquee { position: relative; z-index: 1; }

/* ---------------- Hero Professor Doge stage ---------------- */
.hero-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  margin-top: 48px;
  min-height: 240px;
}
/* no empty gap until the real Professor Doge image is added */
body:not(.has-doge) .hero-stage { display: none; }
.doge-stage { width: 300px; max-width: 64vw; }
.doge-stage .meme-art { filter: drop-shadow(0 26px 28px rgba(19, 18, 16, 0.14)); }
.float { animation: floatY 5s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.float-accent { width: 118px; align-self: flex-end; }
.float-accent .chill-art, .float-accent .meme-art { width: 100%; display: block; }
.acc-left { transform: rotate(-4deg); animation: floatY 6.2s ease-in-out infinite; margin-right: -6px; margin-bottom: 6px; }
.acc-right { transform: rotate(4deg); animation: floatY 5.4s ease-in-out infinite 0.7s; margin-left: -6px; margin-bottom: 6px; }

/* ---------------- Marquee ---------------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding: 14px 0;
  margin-top: 8px;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  will-change: transform;
}
.marquee-track span { font-family: var(--serif); font-style: italic; font-size: 1.35rem; }
.marquee-track .dot { color: var(--orange); font-style: normal; font-size: 0.85rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------- Live price ticker ---------------- */
.hero-price { max-width: 720px; margin: 42px auto 0; }
.ticker {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 18px 24px;
}
.tk-id { display: flex; align-items: center; gap: 12px; }
.tk-coin { width: 44px; height: 40px; display: grid; place-items: center; }
.tk-coin svg { height: 40px; width: auto; }
.tk-name b { font-size: 1.05rem; letter-spacing: -0.01em; display: block; }
.tk-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; }
.tk-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: livepulse 1.6s ease-in-out infinite; }
/* pre-launch (no fake numbers) */
.ticker-soon { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.tk-live.soon { color: var(--orange); }
.tk-live.soon i { background: var(--orange); animation: none; }
.tk-soon { flex: 1; min-width: 220px; color: var(--muted); font-size: 0.94rem; font-weight: 600; line-height: 1.5; }
.ca-addr.soon { color: var(--muted); font-style: italic; font-family: var(--sans); font-size: 0.86rem; font-weight: 600; }
@keyframes livepulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(30, 125, 79, 0.45); } 50% { opacity: 0.55; box-shadow: 0 0 0 5px rgba(30, 125, 79, 0); } }
.tk-price { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.tk-val { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tk-val.flash-up { animation: flashUp 0.6s ease; }
.tk-val.flash-down { animation: flashDown 0.6s ease; }
@keyframes flashUp { 0% { color: var(--green); } 100% { color: var(--ink); } }
@keyframes flashDown { 0% { color: var(--red); } 100% { color: var(--ink); } }
.tk-chg { font-size: 0.85rem; font-weight: 800; }
.tk-chg.up { color: var(--green); }
.tk-chg.down { color: var(--red); }
.tk-chg.zero { color: var(--muted); }
.tk-spark { width: 100%; max-width: 220px; min-width: 140px; height: 52px; justify-self: center; }
.tk-stats { display: flex; gap: 24px; }
.tk-stats > div { display: flex; flex-direction: column; gap: 2px; }
.tk-stats span { color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.tk-stats b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* ---------------- Contract address bar ---------------- */
.ca-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px 10px 18px;
}
.ca-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  flex-shrink: 0;
}
.ca-addr {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ca-copy:hover { border-color: var(--ink); }
.ca-copy .ic { color: var(--orange); }
.ca-buy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ca-buy:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(242, 77, 13, 0.32); }

/* ---------------- Reward buddy / inline buddy ---------------- */
.reward-buddy { position: absolute; top: 12px; right: 12px; width: 62px; transform: rotate(5deg); pointer-events: none; opacity: 0.96; z-index: 2; }
.reward-buddy .chill-art, .reward-buddy .meme-art { width: 100%; display: block; }
.buddy-inline { width: 96px; flex-shrink: 0; }
.buddy-inline .chill-art, .buddy-inline .meme-art { width: 100%; display: block; }

/* ---------------- Scroll reveal ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float, .marquee-track, .acc-left, .acc-right { animation: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .ticker { grid-template-columns: 1fr auto; gap: 14px 18px; }
  .tk-spark { grid-column: 1 / -1; max-width: 100%; min-width: 0; justify-self: stretch; order: 3; }
  .tk-stats { grid-column: 1 / -1; justify-content: space-between; order: 4; border-top: 1px solid var(--line); padding-top: 12px; }
}
@media (max-width: 760px) {
  .marquee-track span { font-size: 1.15rem; }
}
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .mobile-nav {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 12px 34px rgba(19, 18, 16, 0.14);
    z-index: 60;
  }
  .mobile-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .mobile-nav a.active { background: var(--ink); color: var(--paper); }
  .mobile-nav a .mi { display: grid; place-items: center; }
  .mobile-nav a span.lbl { display: none; }
  .mobile-nav a.active span.lbl { display: inline; }
  .page { padding-bottom: 130px; }
}
@media (min-width: 961px) { .mobile-nav { display: none; } }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; }
  .lcard, .quiz-card { padding: 32px 24px; }
  .topbar { padding: 14px 20px; }
  .user-chip .chip.hide-sm { display: none; }
  .reward-box { padding: 42px 30px; }
  .bento > div { border-right: none !important; }
  .page-head h1 { font-size: 2rem; }
  .hero-stats { flex-wrap: wrap; }
  .hero-stats .hs { flex: 1 1 40%; border-bottom: 1px solid var(--line); }
}
