/* ============================================================================
   Word Analysis — level tabs, topic cards, topic detail and the practice modal.
   BolEnglish palette; each level carries its own accent, used lightly.
   ========================================================================== */
body { font-family: 'Inter', system-ui, sans-serif; font-size: 1.0625rem; }
h1, h2, h3 { font-family: 'Inter', system-ui, sans-serif; }

:root { --wa-grad: linear-gradient(135deg, #7c3aed, #ec4899);
        --wa-ease: cubic-bezier(.4, 0, .2, 1); }
body.wa-lock { overflow: hidden; }

/* --------------------------------------------------------------- hero ---- */
.wa-hero { padding: 30px 0 14px; }
.wa-kicker { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .12em;
             text-transform: uppercase; color: var(--purple); background: #f3f0ff;
             border-radius: 999px; padding: 6px 14px; margin-bottom: 12px; }
.wa-h1 { font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
         font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.wa-h1 .gg { background: var(--wa-grad); -webkit-background-clip: text; background-clip: text;
             -webkit-text-fill-color: transparent; }
.wa-sub { color: var(--muted); font-size: 1.0625rem; max-width: 62ch; line-height: 1.6; }
.wa-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.wa-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 15px; border-radius: 999px;
           background: var(--card); border: 1px solid var(--line);
           font-size: .8125rem; font-weight: 600; color: var(--muted); }
.wa-stat b { font-size: .9375rem; font-weight: 800; color: var(--purple); }

/* ---------------------------------------------------------- level tabs --- */
.wa-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
           margin: 22px 0 16px; }
@media (max-width: 700px) { .wa-tabs { grid-template-columns: minmax(0, 1fr); } }
.wa-tab { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 16px;
          cursor: pointer; text-align: left; min-height: 68px;
          border: 2px solid var(--line); background: var(--card); color: var(--ink);
          font-family: inherit;
          transition: transform .2s var(--wa-ease), border-color .2s var(--wa-ease),
                      box-shadow .2s var(--wa-ease); }
.wa-tab:hover { transform: translateY(-2px); border-color: var(--c);
                box-shadow: 0 12px 26px -18px var(--c); }
.wa-tab:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.wa-tab.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--card));
                box-shadow: 0 12px 26px -20px var(--c); }
.wa-tab-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid;
             place-items: center; font-size: 1.25rem;
             background: color-mix(in srgb, var(--c) 13%, transparent); }
.wa-tab-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wa-tab-tx b { font-size: 1rem; font-weight: 700; }
.wa-tab.is-on .wa-tab-tx b { color: var(--c); }
.wa-tab-tx small { font-size: .75rem; color: var(--muted); }

/* the selected level's description */
.wa-lead { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: 14px;
           background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c);
           margin-bottom: 22px; font-size: .9375rem; color: var(--muted); line-height: 1.6; }
.wa-lead-ic { flex: none; font-size: 1.125rem; }
.wa-lead b { display: block; color: var(--c); font-size: 1rem; margin-bottom: 2px; }


/* the level's concept progression, e.g. Claim → Evidence → Conclusion */
.wa-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.wa-flow-step { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
                font-size: .75rem; font-weight: 700; color: var(--c);
                background: color-mix(in srgb, var(--c) 11%, transparent);
                border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); }
.wa-flow-step + .wa-flow-step::before { content: '→'; margin: 0 8px 0 -4px; opacity: .55;
                                        font-weight: 800; }

/* --------------------------------------------------------- topic cards --- */
.wa-grid { display: grid; gap: 16px; padding-bottom: 60px;
           grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 640px) { .wa-grid { grid-template-columns: minmax(0, 1fr); } }

.wa-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px;
           background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--c);
           box-shadow: 0 1px 2px rgba(16, 12, 40, .04);
           transition: transform .25s var(--wa-ease), box-shadow .25s var(--wa-ease),
                       border-color .25s var(--wa-ease); }
.wa-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 40%, var(--line));
                 box-shadow: 0 14px 30px -18px var(--c); }
.wa-card.is-open { transform: none; }
.wa-card.wa-pre { opacity: 0; transform: translateY(12px); }

.wa-cardtop { display: flex; align-items: center; gap: 10px; }
.wa-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
          font-size: 1.0625rem; background: color-mix(in srgb, var(--c) 12%, transparent); }
.wa-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.wa-desc { font-size: .8125rem; color: var(--muted); line-height: 1.55; flex: 1; }
.wa-counts { font-size: .6875rem; font-weight: 700; color: var(--muted);
             text-transform: uppercase; letter-spacing: .05em; }

.wa-prog { display: flex; align-items: center; gap: 9px; }
.wa-progbar { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wa-progbar span { display: block; height: 100%; border-radius: 999px; background: var(--c);
                   transition: width .6s var(--wa-ease); }
.wa-progtx { flex: none; font-size: .6875rem; font-weight: 800; color: var(--c); }

.wa-cardfoot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.wa-start { padding: 10px 18px; border-radius: 11px; border: 0; cursor: pointer; min-height: 44px;
            background: var(--wa-grad); color: #fff; font-family: inherit;
            font-size: .8125rem; font-weight: 700;
            transition: filter .18s var(--wa-ease), transform .18s var(--wa-ease); }
.wa-start:hover { filter: brightness(1.07); transform: translateY(-1px); }
.wa-start:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.wa-start.ghost { display: block; margin-top: 14px; background: color-mix(in srgb, var(--c) 12%, transparent);
                  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 26%, transparent); }
.wa-more { margin-left: auto; padding: 9px 14px; border-radius: 10px; cursor: pointer; min-height: 44px;
           border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
           font-family: inherit; font-size: .78125rem; font-weight: 700; transition: .18s; }
.wa-more:hover { border-color: var(--c); color: var(--c); }
.wa-more:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.wa-soon { font-size: .75rem; font-weight: 700; color: var(--muted);
           text-transform: uppercase; letter-spacing: .05em; }

/* -------------------------------------------------------- topic detail --- */
.wa-detail { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 12px; }
.wa-dlbl { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
           color: var(--muted); margin-bottom: 8px; }
.wa-exlist { list-style: none; display: grid; gap: 5px; }
.wa-exlist li { display: flex; align-items: center; gap: 9px; font-size: .84375rem; color: var(--ink); }
.wa-exdot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .6; }
.wa-lesson { display: block; margin-top: 12px; font-size: .8125rem; font-weight: 700;
             color: var(--c); text-decoration: none; }
.wa-lesson:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------ practice modal --- */
.wa-run { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: start center;
          padding: 6vh 16px 16px; }
.wa-run-back { position: fixed; inset: 0; background: rgba(24, 18, 46, .5);
               -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.wa-run-box { position: relative; width: 100%; max-width: 560px; border-radius: 20px; overflow: hidden;
              background: var(--card, #fff); border: 1px solid var(--line);
              box-shadow: 0 30px 70px -28px rgba(40, 20, 90, .65);
              animation: waPop .18s var(--wa-ease); }
@keyframes waPop { from { opacity: 0; transform: translateY(-8px); } }

.wa-run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
              padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.wa-run-kicker { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
                 color: var(--c); }
.wa-run-top h2 { font-size: 1.125rem; font-weight: 700; margin-top: 2px; }
.wa-run-x { flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 0;
            background: var(--bg-soft, #f3f0ff); color: var(--muted); font-size: 1.25rem; line-height: 1; }
.wa-run-x:hover { color: var(--purple); }
.wa-run-x:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.wa-run-bar { height: 4px; background: var(--line); }
.wa-run-bar > span { display: block; height: 100%; width: 0; background: var(--c);
                     transition: width .3s var(--wa-ease); }

.wa-run-body { padding: 18px 20px 22px; }
.wa-run-meta { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700;
               color: var(--muted); margin-bottom: 12px; }
.wa-run-q { font-size: 1.0625rem; font-weight: 600; line-height: 1.55; margin-bottom: 14px; }
.wa-run-opts { display: grid; gap: 8px; }
.wa-run-opt { padding: 12px 16px; border-radius: 12px; cursor: pointer; min-height: 48px; text-align: left;
              border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
              font-family: inherit; font-size: .9375rem; font-weight: 600; transition: .15s; }
.wa-run-opt:hover:not(:disabled) { border-color: var(--c); }
.wa-run-opt:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.wa-run-opt:disabled { cursor: default; }
.wa-run-opt.ok { border-color: #059669; background: rgba(5,150,105,.1); color: #059669; }
.wa-run-opt.no { border-color: #dc2626; background: rgba(220,38,38,.08); color: #dc2626; }
.wa-run-fb { margin-top: 13px; font-size: .875rem; line-height: 1.6; min-height: 1.2em; }
.wa-run-fb.good { color: #059669; }
.wa-run-fb.bad  { color: #dc2626; }
.wa-run-act { display: flex; justify-content: flex-end; margin-top: 14px; }
.wa-run-next { padding: 10px 22px; border-radius: 11px; border: 0; cursor: pointer; min-height: 44px;
               background: var(--wa-grad); color: #fff; font-family: inherit;
               font-size: .875rem; font-weight: 700; }
.wa-run-next:hover { filter: brightness(1.06); }

.wa-run-done { text-align: center; padding: 10px 0; }
.wa-run-emoji { font-size: 2.75rem; line-height: 1; }
.wa-run-score { font-size: 1.25rem; margin-top: 10px; }
.wa-run-score b { color: var(--c); }
.wa-run-msg { color: var(--muted); margin-top: 4px; font-size: .9375rem; }
.wa-run-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.wa-run-again, .wa-run-close { padding: 11px 20px; border-radius: 11px; cursor: pointer; min-height: 44px;
                               font-family: inherit; font-size: .875rem; font-weight: 700; }
.wa-run-again { border: 0; background: var(--wa-grad); color: #fff; }
.wa-run-close { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.wa-run-close:hover { border-color: var(--purple); color: var(--purple); }

/* ------------------------------------------------------ reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .wa-tab, .wa-card, .wa-start, .wa-more, .wa-progbar span, .wa-run-bar > span,
  .wa-run-opt, .wa-run-box { transition: none !important; animation: none !important; }
  .wa-card.wa-pre { opacity: 1; transform: none; }
  .wa-tab:hover, .wa-card:hover, .wa-start:hover { transform: none; }
}

@media print {
  .wa-tabs, .wa-start, .wa-more, .wa-run, .topbar, .site-footer { display: none !important; }
  .wa-card { break-inside: avoid; opacity: 1 !important; transform: none !important; box-shadow: none !important; }
  .wa-detail { display: block !important; }
}
