:root {
  --ink: #102a43;
  --ink-soft: #486581;
  --paper: #f8fafc;
  --white: #ffffff;
  --line: #d9e2ec;
  --yellow: #f9c74f;
  --yellow-soft: #fff4cf;
  --coral: #f47c64;
  --coral-soft: #fff0ec;
  --blue: #2d7dd2;
  --blue-soft: #eaf3ff;
  --mint: #3bb273;
  --mint-soft: #e7f8ee;
  --purple: #7564d8;
  --purple-soft: #f0edff;
  --shadow: 0 18px 50px rgba(16, 42, 67, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  min-width: 320px;
}

button, a { font: inherit; }
button { cursor: pointer; }

.topline { height: 7px; background: linear-gradient(90deg, var(--coral), var(--yellow), var(--mint), var(--blue), var(--purple)); }

.site-header {
  height: 82px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; color: var(--ink); background: var(--yellow); font-size: 21px; transform: rotate(-8deg); }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-family: Fraunces, Georgia, serif; font-size: 19px; }
.brand small { color: var(--ink-soft); font-size: 11px; margin-top: 4px; letter-spacing: .04em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 100%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }

.share-rail { position: fixed; right: 16px; top: 50%; z-index: 30; display: grid; gap: 8px; transform: translateY(-50%); }
.share-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.22); background: rgba(16,42,67,.92); color: white; line-height: 1; font-size: 11px; font-weight: 900; text-decoration: none; box-shadow: 0 12px 28px rgba(16,42,67,.2); cursor: pointer; padding: 0; }
.share-button .icon { display: block; width: 20px; height: 20px; fill: currentColor; }
.share-button:hover, .share-button:focus-visible { background: var(--purple); outline: none; }
.share-button[data-share="whatsapp"] { background: #25d366; }
.share-button[data-share="facebook"] { background: #1877f2; }
.share-button[data-share="telegram"] { background: #229ed9; }
.share-button[data-share="instagram"] { background: radial-gradient(circle at 30% 110%, #fdf497 0 18%, #fd5949 42%, #d6249f 68%, #285aeb 100%); }
.share-button[data-share="copy"] { background: var(--ink); }
.share-button[data-share="whatsapp"]:hover, .share-button[data-share="facebook"]:hover, .share-button[data-share="telegram"]:hover, .share-button[data-share="instagram"]:hover, .share-button[data-share="copy"]:hover, .share-button[data-share="whatsapp"]:focus-visible, .share-button[data-share="facebook"]:focus-visible, .share-button[data-share="telegram"]:focus-visible, .share-button[data-share="instagram"]:focus-visible, .share-button[data-share="copy"]:focus-visible { filter: brightness(.9); }
.share-toast { position: fixed; right: 72px; bottom: 20px; z-index: 40; max-width: 280px; padding: 11px 14px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.share-toast.is-visible { opacity: 1; transform: translateY(0); }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; color: var(--blue); margin: 0 0 14px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; letter-spacing: -.025em; }
h1 { font-size: clamp(39px, 6vw, 72px); line-height: .98; max-width: 720px; margin-bottom: 22px; }
h2 { font-size: clamp(29px, 4vw, 42px); line-height: 1.04; margin-bottom: 11px; }
h3 { font-size: 23px; line-height: 1.08; margin-bottom: 9px; }
.lede { color: var(--ink-soft); font-size: 17px; line-height: 1.65; max-width: 650px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(310px, .78fr); gap: 42px; align-items: center; margin-bottom: 54px; }
.hero-copy { padding: 16px 0; }
.hero-copy h1 span { color: var(--coral); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.primary-btn, .ghost-btn, .back-btn, .next-btn { border: 0; border-radius: 13px; padding: 13px 18px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-btn { background: var(--ink); color: #fff; box-shadow: 0 8px 18px rgba(16, 42, 67, .18); }
.primary-btn:hover, .next-btn:hover, .ghost-btn:hover, .back-btn:hover { transform: translateY(-2px); }
.ghost-btn, .back-btn { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.back-btn { padding: 9px 13px; font-size: 13px; }
.next-btn { background: var(--coral); color: white; }
.text-link { color: var(--blue); font-weight: 700; text-decoration: none; }

.hero-visual { min-height: 300px; border-radius: 30px; padding: 24px; background: var(--ink); color: white; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero-visual::before, .hero-visual::after { content: ""; position: absolute; border-radius: 50%; opacity: .75; }
.hero-visual::before { width: 170px; height: 170px; right: -50px; top: -50px; background: var(--yellow); }
.hero-visual::after { width: 120px; height: 120px; left: -35px; bottom: -48px; background: var(--coral); }
.brain-card { height: 100%; min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; position: relative; z-index: 1; }
.brain-card-top { display: flex; justify-content: space-between; align-items: center; color: #cdd8e4; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.brain-icon { font-size: 62px; line-height: 1; margin: 21px 0 9px; display: block; }
.brain-card h2 { max-width: 260px; font-size: 33px; margin-bottom: 10px; color: white; }
.mini-sequence { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-sequence span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; background: rgba(255,255,255,.11); font-weight: 700; }
.mini-sequence span:last-child { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading p { color: var(--ink-soft); margin-bottom: 3px; text-align: right; }
.blocks-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.block-card { min-height: 190px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); display: flex; flex-direction: column; justify-content: space-between; text-align: left; color: var(--ink); position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.block-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #b8c7d7; }
.block-card:focus-visible, .choice:focus-visible, .primary-btn:focus-visible, .ghost-btn:focus-visible, .back-btn:focus-visible, .next-btn:focus-visible, .memory-toggle:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.block-number { color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.block-card h3 { margin: 21px 0 7px; font-size: 24px; }
.block-card p { color: var(--ink-soft); font-size: 13px; line-height: 1.45; margin-bottom: 0; }
.block-card small { color: var(--ink-soft); font-size: 11px; margin-top: 18px; }
.block-card::after { content: ""; position: absolute; width: 86px; height: 86px; border-radius: 30px; right: -29px; bottom: -34px; transform: rotate(25deg); opacity: .48; }
.block-card:nth-child(1)::after { background: var(--yellow); }
.block-card:nth-child(2)::after { background: var(--mint); }
.block-card:nth-child(3)::after { background: var(--blue); }
.block-card:nth-child(4)::after { background: var(--coral); }

.promo-strip { margin-top: 57px; }
.promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.promo-card { min-height: 215px; padding: 19px; background: var(--white); border-radius: 21px; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-start; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.promo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.promo-card::after { content: ""; position: absolute; width: 115px; height: 115px; border-radius: 40px; right: -38px; bottom: -51px; transform: rotate(22deg); opacity: .34; }
.promo-card.herbal { border-top: 4px solid #5aa66e; background: linear-gradient(150deg, #fff 0%, #f3fbf4 100%); }
.promo-card.herbal::after { background: #a8d9ae; }
.promo-card.herbal.second { border-top-color: #88a844; background: linear-gradient(150deg, #fff 0%, #f8fbe9 100%); }
.promo-card.herbal.second::after { background: #d2dd8c; }
.promo-card.author { border-top: 4px solid var(--purple); background: linear-gradient(150deg, #fff 0%, #f4f0ff 100%); }
.promo-card.author::after { background: #b9adf3; }
.promo-card.books { border-top: 4px solid var(--yellow); background: linear-gradient(150deg, #fff 0%, #fff9df 100%); }
.promo-card.books::after { background: #f6d36c; }
.promo-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.78); box-shadow: 0 4px 12px rgba(16,42,67,.07); font-size: 18px; margin-bottom: 16px; position: relative; z-index: 1; }
.promo-label { color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; position: relative; z-index: 1; }
.promo-card strong { font-family: Fraunces, Georgia, serif; font-size: 18px; line-height: 1.12; margin: 9px 0 7px; max-width: 210px; position: relative; z-index: 1; }
.promo-copy { color: var(--ink-soft); font-size: 12px; line-height: 1.42; max-width: 230px; position: relative; z-index: 1; }
.promo-cta { color: var(--blue); font-size: 12px; font-weight: 700; margin-top: auto; padding-top: 16px; position: relative; z-index: 1; }
.promo-cta b { font-size: 16px; margin-left: 3px; }
.promo-domain { color: #829ab1; font-size: 10px; margin-top: 5px; position: relative; z-index: 1; }
.promo-disclaimer { color: var(--ink-soft); font-size: 11px; margin-top: 13px; }

.session-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.session-top .eyebrow { margin-bottom: 7px; }
.session-top h2 { margin-bottom: 0; }
.progress-wrap { min-width: 260px; }
.progress-label { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 12px; margin-bottom: 8px; }
.progress-bar { height: 9px; background: #e7edf3; border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), var(--yellow)); transition: width .35s ease; }
.exercise-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.exercise-card, .side-card, .result-card { background: var(--white); border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
.exercise-card { padding: clamp(24px, 4vw, 42px); min-height: 540px; }
.exercise-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 23px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 5px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; }
.badge.soft { background: var(--purple-soft); color: var(--purple); }
.exercise-card h1 { font-size: clamp(31px, 4vw, 47px); max-width: 680px; margin-bottom: 13px; }
.exercise-prompt { color: var(--ink-soft); font-size: 16px; line-height: 1.55; max-width: 720px; margin-bottom: 26px; }
.visual-stage { border-radius: 18px; background: #f4f7fa; border: 1px solid #e2eaf1; padding: 24px; margin: 20px 0 24px; }
.visual-label { text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); font-size: 10px; font-weight: 700; margin-bottom: 14px; }
.token-row, .sequence-row, .letter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.token, .sequence-token, .letter-token { min-width: 48px; height: 48px; padding: 0 13px; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 700; font-size: 18px; box-shadow: 0 4px 10px rgba(16,42,67,.04); }
.sequence-token.missing { background: var(--yellow-soft); border: 2px dashed var(--yellow); color: #ad7a00; }
.sequence-arrow { color: #9fb3c8; font-weight: 700; }
.grid-visual { display: grid; grid-template-columns: repeat(3, minmax(48px, 76px)); gap: 9px; width: fit-content; }
.grid-cell { aspect-ratio: 1; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; font-size: 24px; font-weight: 700; }
.grid-cell.missing { background: var(--yellow-soft); border: 2px dashed var(--yellow); color: #ad7a00; }
.equation { font-size: clamp(31px, 5vw, 52px); font-family: Fraunces, Georgia, serif; letter-spacing: .02em; text-align: center; padding: 14px; }
.rule-box { border-radius: 14px; background: var(--ink); color: white; padding: 15px 17px; line-height: 1.45; font-size: 14px; margin-bottom: 17px; }
.story-box { background: var(--yellow-soft); border-left: 5px solid var(--yellow); padding: 17px 19px; border-radius: 13px; line-height: 1.6; color: #715300; }
.spatial-row { display: flex; align-items: center; justify-content: center; gap: 17px; font-size: 39px; }
.spatial-row .rotate { color: var(--coral); font-size: 25px; }
.memory-stage { text-align: center; }
.memory-stage .token-row { justify-content: center; }
.memory-toggle { background: var(--ink); border: 0; color: white; padding: 10px 14px; border-radius: 11px; font-weight: 700; margin-top: 18px; }
.memory-hidden { min-height: 48px; display: grid; place-items: center; color: var(--ink-soft); border: 1px dashed #9fb3c8; border-radius: 14px; font-size: 13px; }
.choices-label { color: var(--ink-soft); font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice { min-height: 58px; text-align: left; padding: 13px 15px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.choice:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-2px); }
.choice:disabled { cursor: default; opacity: .86; }
.choice.correct { border: 2px solid var(--mint); background: var(--mint-soft); color: #17683c; }
.choice.wrong { border: 2px solid var(--coral); background: var(--coral-soft); color: #9e3d2d; }
.choice-letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #edf2f7; color: var(--ink-soft); font-size: 11px; margin-right: 9px; }
.feedback { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 15px 17px; border-radius: 15px; line-height: 1.48; font-size: 14px; }
.feedback strong { display: block; margin-bottom: 3px; }
.feedback.good { background: var(--mint-soft); color: #17683c; }
.feedback.bad { background: var(--coral-soft); color: #9e3d2d; }
.feedback-icon { font-size: 22px; line-height: 1; }
.exercise-footer { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 26px; }
.exercise-footer small { color: var(--ink-soft); line-height: 1.4; }
.side-column { display: grid; gap: 15px; }
.side-card { padding: 20px; box-shadow: none; }
.side-card h3 { font-size: 21px; }
.side-card p { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.skill-list { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.skill-list li { display: flex; gap: 9px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.skill-list span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); }
.tiny-score { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.tiny-score:last-child { border-bottom: 0; }
.tiny-score strong { color: var(--ink); }

.result-wrap { max-width: 850px; margin: 0 auto; }
.result-card { padding: clamp(25px, 5vw, 55px); text-align: center; }
.result-orb { width: 92px; height: 92px; border-radius: 30px; margin: 0 auto 22px; display: grid; place-items: center; font-size: 44px; background: var(--yellow-soft); transform: rotate(-7deg); }
.result-card h1 { font-size: clamp(35px, 5vw, 58px); margin: 0 auto 12px; }
.result-copy { max-width: 600px; margin: 0 auto; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.score-big { font-family: Fraunces, Georgia, serif; font-size: 68px; line-height: 1; margin: 30px 0 6px; color: var(--coral); }
.score-caption { color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.result-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 30px auto; text-align: left; max-width: 540px; }
.breakdown-item { background: #f5f8fb; border-radius: 14px; padding: 13px 15px; display: flex; justify-content: space-between; gap: 9px; font-size: 13px; color: var(--ink-soft); }
.breakdown-item strong { color: var(--ink); }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.site-footer { border-top: 1px solid var(--line); padding: 23px clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; gap: 20px; color: var(--ink-soft); font-size: 12px; background: white; }
.site-footer strong { color: var(--ink); margin-right: 12px; }
.footer-note { text-align: right; }

.empty-state { padding: 60px 20px; text-align: center; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 250px; }
  .blocks-grid, .promo-grid { grid-template-columns: repeat(2, 1fr); }
  .exercise-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-header { height: 72px; }
  .header-meta { font-size: 11px; }
  .header-meta .status-dot { width: 6px; height: 6px; }
  .shell { width: min(100% - 28px, 1180px); padding-top: 34px; }
  .hero { gap: 25px; margin-bottom: 40px; }
  .hero-visual { min-height: 235px; padding: 19px; }
  .brain-card { min-height: 195px; }
  .brain-icon { font-size: 47px; }
  .brain-card h2 { font-size: 28px; }
  .section-heading, .session-top { display: block; }
  .section-heading p { text-align: left; margin-top: 7px; }
  .blocks-grid, .promo-grid, .side-column { grid-template-columns: 1fr; }
  .block-card { min-height: 152px; }
  .promo-strip { margin-top: 39px; }
  .session-top .progress-wrap { margin-top: 18px; min-width: 0; }
  .exercise-card { padding: 23px 18px; min-height: 0; }
  .visual-stage { padding: 17px; }
  .choices { grid-template-columns: 1fr; }
  .exercise-footer { align-items: stretch; flex-direction: column; }
  .exercise-footer button { width: 100%; }
  .site-footer { display: block; }
  .site-footer > div { margin-bottom: 10px; }
  .footer-note { text-align: left; }
  .result-breakdown { grid-template-columns: 1fr; }
  .share-rail { inset: auto auto 12px 50%; grid-template-columns: repeat(5, 1fr); transform: translateX(-50%); width: min(330px, calc(100vw - 28px)); }
  .share-button { width: auto; height: 40px; }
  .share-toast { right: 50%; bottom: 64px; transform: translate(50%, 8px); }
  .share-toast.is-visible { transform: translate(50%, 0); }
}
