/* ============================================================================
   English Skills by Grade.

   Same palette as before — lavender page, white cards, BolEnglish purple/pink.
   Everything added here is interaction: hover lift, expandable panels, filter
   chips, progress bars and scroll reveal. CSS transitions only, no library.
   Pairs with /assets/be-shell.css for brand tokens, topbar and footer.
   ========================================================================== */
body { font-family: 'Inter', system-ui, sans-serif; font-size: 1.0625rem; }
h1, h2, h3, h4 { font-family: 'Inter', system-ui, sans-serif; }

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

/* ---------------------------------------------------------------- hero ---- */
.es-hero { padding: 34px 0 18px; }
.es-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; }

.es-headrow { display: flex; align-items: flex-end; justify-content: space-between;
              gap: 16px; flex-wrap: wrap; margin: 12px 0 6px; }
.es-h1 { font-weight: 700; font-size: clamp(1.75rem, 5vw, 2.75rem); }

/* Jump to Grade */
.es-jump { display: inline-flex; align-items: center; gap: 8px; }
.es-jump-lbl { font-size: .8125rem; font-weight: 700; color: var(--muted);
               text-transform: uppercase; letter-spacing: .06em; }
.es-jump select { padding: 9px 12px; border-radius: 10px; min-height: 44px; cursor: pointer;
                  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
                  font-family: inherit; font-size: .875rem; font-weight: 600;
                  transition: border-color .2s var(--es-ease), box-shadow .2s var(--es-ease); }
.es-jump select:hover { border-color: var(--purple); }
.es-jump select:focus-visible { outline: none; border-color: var(--purple);
                                box-shadow: 0 0 0 4px rgba(124, 58, 237, .16); }

.es-lead { color: var(--muted); font-size: 1rem; max-width: 64ch; }
.es-stat { margin-top: 8px; color: var(--muted); font-size: .9375rem; }
.es-stat b { color: var(--purple); }

/* ------------------------------------------------------- search + clear ---- */
.es-searchwrap { position: relative; margin: 18px 0 14px; max-width: 480px; }
.es-searchwrap input { width: 100%; padding: 12px 42px 12px 16px; border-radius: 12px;
                       min-height: 48px; border: 1.5px solid var(--line); background: var(--card);
                       color: var(--ink); font-family: inherit; font-size: .9375rem;
                       transition: border-color .2s var(--es-ease), box-shadow .2s var(--es-ease); }
.es-searchwrap input:hover { border-color: #c4b5fd; }
.es-searchwrap input:focus { outline: none; border-color: var(--purple);
                             box-shadow: 0 0 0 4px rgba(124, 58, 237, .16); }
.es-searchwrap input::-webkit-search-cancel-button { display: none; }
.es-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
            width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 0;
            background: var(--bg-soft, #f3f0ff); color: var(--muted);
            font-size: 1.125rem; line-height: 1; display: grid; place-items: center;
            transition: background .18s var(--es-ease), color .18s var(--es-ease); }
.es-clear:hover { background: #ede9fe; color: var(--purple); }
.es-clear:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ----------------------------------------------------- popular skills ---- */
.es-popular { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.es-poplbl { font-size: .75rem; font-weight: 800; letter-spacing: .08em;
             text-transform: uppercase; color: var(--muted); }
.es-popchips { display: flex; gap: 7px; flex-wrap: wrap; }
.es-pop { padding: 6px 13px; border-radius: 999px; cursor: pointer; font-family: inherit;
          font-size: .8125rem; font-weight: 600; color: var(--purple);
          border: 1px solid #ddd6fe; background: #f8f6ff;
          transition: transform .18s var(--es-ease), background .18s var(--es-ease); }
.es-pop:hover { background: #ede9fe; transform: translateY(-1px); }
.es-pop:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ------------------------------------------------------------- filters ---- */
.es-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.es-chip { padding: 8px 15px; border-radius: 999px; cursor: pointer; min-height: 40px;
           border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
           font-family: inherit; font-size: .8125rem; font-weight: 600; white-space: nowrap;
           transition: transform .18s var(--es-ease), border-color .18s var(--es-ease),
                       box-shadow .18s var(--es-ease); }
.es-chip:hover { border-color: var(--purple); transform: translateY(-1px); }
.es-chip:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.es-chip.is-on { background: var(--es-grad); border-color: transparent; color: #fff;
                 box-shadow: 0 6px 16px -8px rgba(124, 58, 237, .75); }

.es-stages { margin-bottom: 4px; }
.es-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
            padding: 7px 14px; border-radius: 12px; cursor: pointer; min-height: 44px;
            border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
            font-family: inherit; text-align: left; white-space: nowrap;
            transition: transform .18s var(--es-ease), border-color .18s var(--es-ease); }
.es-stage b { font-size: .8125rem; font-weight: 700; }
.es-stage small { font-size: .6875rem; color: var(--muted); }
.es-stage:hover { border-color: var(--purple); transform: translateY(-1px); }
.es-stage:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.es-stage.is-on { border-color: var(--purple); background: #f8f6ff; }
.es-stage.is-on b { color: var(--purple); }

/* result count + empty state */
.es-count { min-height: 1.2em; margin: 6px 0 14px; font-size: .875rem;
            font-weight: 600; color: var(--muted); }
.es-empty { padding: 40px 0 70px; text-align: center; color: var(--muted); font-size: 1rem; }

/* ---------------------------------------------------------- grade grid ---- */
/* 3 columns desktop · 2 tablet · 1 mobile */
.es-grid { display: grid; gap: 18px; padding-bottom: 60px;
           grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .es-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .es-grid { grid-template-columns: minmax(0, 1fr); } }

.es-card { border-radius: 18px; background: var(--card); border: 1px solid var(--line);
           border-top: 5px solid var(--c); overflow: hidden; align-self: start;
           transition: transform .25s var(--es-ease), box-shadow .25s var(--es-ease),
                       border-color .25s var(--es-ease);
           box-shadow: 0 1px 2px rgba(16, 12, 40, .04); }
.es-card:hover { transform: translateY(-5px) scale(1.01); border-color: var(--c);
                 box-shadow: 0 18px 34px -20px var(--c), 0 0 0 1px var(--c) inset; }
.es-card.is-open { transform: none; box-shadow: 0 18px 34px -22px var(--c); }
.es-card.is-hit { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }

/* Scroll Animations — cards start here and are released by IntersectionObserver */
.es-card.es-pre { opacity: 0; transform: translateY(14px); }

/* jump-to-grade highlight */
@keyframes esFlash { 0%, 100% { box-shadow: 0 0 0 0 transparent; }
                     30%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent); } }
.es-card.is-flash { animation: esFlash 1.3s var(--es-ease); }

/* the whole card face is one button */
.es-cardbtn { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left;
              padding: 18px 18px 16px; cursor: pointer; border: 0; background: none;
              font-family: inherit; color: var(--ink); }
.es-cardbtn:focus-visible { outline: 2px solid var(--c); outline-offset: -4px; border-radius: 14px; }

.es-top { display: flex; align-items: center; gap: 10px; }
.es-badge { position: relative; flex: none; width: 30px; height: 30px; border-radius: 9px;
            display: grid; place-items: center; background: var(--c); color: #fff;
            font-weight: 800; font-size: .875rem; }
.es-badge:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.es-name { font-size: 1.25rem; font-weight: 700; color: var(--c); }

/* Grade tooltip */
.es-tip { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translate(-50%, 4px);
          display: flex; flex-direction: column; gap: 1px; padding: 8px 11px; border-radius: 10px;
          background: #1e1b2e; color: #fff; font-size: .75rem; font-weight: 500;
          line-height: 1.4; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 5;
          transition: opacity .18s var(--es-ease), transform .18s var(--es-ease); }
.es-tip b { font-weight: 700; }
.es-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
                 border: 5px solid transparent; border-top-color: #1e1b2e; }
.es-badge:hover .es-tip, .es-badge:focus-visible .es-tip { opacity: 1; transform: translate(-50%, 0); }

.es-blurb { font-size: .875rem; color: var(--muted); line-height: 1.55; }

/* ------------------------------------------------- interactive skill rows -- */
.es-strands { list-style: none; display: grid; gap: 2px; margin-top: 2px; }
.es-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px;
          font-size: .8125rem; transition: background .18s var(--es-ease); }
.es-row:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
.es-rowic { flex: none; transition: transform .18s var(--es-ease); }
.es-row:hover .es-rowic { transform: translateX(2px); }
.es-sname { flex: 1; color: var(--ink); transition: color .18s var(--es-ease), font-weight .18s; }
.es-row:hover .es-sname { color: var(--c); font-weight: 600; }
.es-scount { flex: none; min-width: 24px; text-align: center; padding: 1px 8px; border-radius: 999px;
             background: var(--bg-soft, #f3f0ff); color: var(--muted);
             font-size: .75rem; font-weight: 700; }
.es-row:hover .es-scount { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }

/* ------------------------------------------------------- ready progress ---- */
.es-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.es-footline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
               font-size: .8125rem; color: var(--muted); }
.es-footline b { color: var(--c); }
.es-pct { font-weight: 700; color: var(--c); font-size: .75rem; }
.es-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.es-barfill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c);
              transition: width .9s var(--es-ease); }

/* ------------------------------------------------------------- card CTA ---- */
.es-cta { display: flex; align-items: center; gap: 6px; margin-top: 2px;
          font-size: .8125rem; font-weight: 700; color: var(--c);
          opacity: 0; transform: translateY(-3px);
          transition: opacity .22s var(--es-ease), transform .22s var(--es-ease); }
.es-card:hover .es-cta, .es-cardbtn:focus-visible .es-cta, .es-card.is-open .es-cta { opacity: 1; transform: none; }
.es-arrow { transition: transform .22s var(--es-ease); }
.es-card:hover .es-arrow { transform: translateX(3px); }
.es-card.is-open .es-arrow { transform: rotate(90deg); }
/* touch devices have no hover — keep the CTA visible there */
@media (hover: none) { .es-cta { opacity: 1; transform: none; } }

/* ------------------------------------------------- expandable grade panel -- */
.es-panel { overflow: hidden; height: 0; transition: height .3s var(--es-ease); }
.es-panel-in { padding: 2px 18px 18px; border-top: 1px dashed var(--line); margin-top: 2px; }
.es-group { margin-top: 14px; }
.es-group h4 { display: flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 800;
               letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: 6px; }
.es-group ul { list-style: none; display: grid; gap: 4px; }
.es-skill { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px;
            text-decoration: none; color: var(--ink); font-size: .875rem; font-weight: 600;
            min-height: 44px; background: transparent;
            transition: background .18s var(--es-ease), transform .18s var(--es-ease); }
a.es-skill:hover { background: color-mix(in srgb, var(--c) 9%, transparent); transform: translateX(3px); }
a.es-skill:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; }
.es-tick { flex: none; width: 17px; height: 17px; border-radius: 50%; display: grid;
           place-items: center; font-size: .625rem; font-weight: 800;
           background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.es-skname { flex: 1; }
.es-go { flex: none; color: var(--c); opacity: 0; transition: opacity .18s var(--es-ease),
                                                             transform .18s var(--es-ease); }
a.es-skill:hover .es-go { opacity: 1; transform: translateX(2px); }
.es-skill.is-soon { color: var(--muted); font-weight: 500; }
.es-skill.is-soon .es-tick { background: var(--line); color: var(--muted); }
.es-soon { flex: none; font-size: .6875rem; font-weight: 700; color: var(--muted);
           text-transform: uppercase; letter-spacing: .05em; }

.es-startbtn { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
               padding: 11px 20px; border-radius: 12px; min-height: 44px;
               background: var(--es-grad); color: #fff; text-decoration: none;
               font-size: .875rem; font-weight: 700;
               transition: filter .18s var(--es-ease), transform .18s var(--es-ease); }
.es-startbtn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.es-startbtn:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.es-startbtn span { transition: transform .18s var(--es-ease); }
.es-startbtn:hover span { transform: translateX(3px); }

/* ------------------------------------------------------------- mobile ----- */
@media (max-width: 720px) {
  .es-headrow { flex-direction: column; align-items: stretch; }
  .es-jump { justify-content: space-between; }
  .es-jump select { flex: 1; }
  /* filters stay on one line and scroll sideways rather than stacking */
  .es-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
                scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .es-filters::-webkit-scrollbar { display: none; }
  .es-chip, .es-stage { flex: 0 0 auto; }
  .es-cardbtn { padding: 16px 15px 14px; }
  .es-panel-in { padding: 2px 15px 16px; }
}

/* ---------------------------------------------------- reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  .es-card, .es-cta, .es-arrow, .es-row, .es-rowic, .es-skill, .es-go,
  .es-chip, .es-stage, .es-pop, .es-barfill, .es-panel, .es-startbtn,
  .es-tip, .es-clear, .es-jump select, .es-searchwrap input { transition: none !important; }
  .es-card.es-pre { opacity: 1; transform: none; }
  .es-card:hover { transform: none; }
  .es-card.is-flash { animation: none; outline: 3px solid var(--c); outline-offset: 2px; }
  a.es-skill:hover, .es-startbtn:hover, .es-chip:hover, .es-stage:hover, .es-pop:hover { transform: none; }
}

/* ------------------------------------------------------------- print ------ */
@media print {
  .es-searchwrap, .es-popular, .es-filters, .es-jump, .es-count, .es-cta,
  .topbar, .site-footer { display: none !important; }
  .es-card { break-inside: avoid; opacity: 1 !important; transform: none !important;
             box-shadow: none !important; }
  .es-panel { height: auto !important; }
}

/* ------------------------------------------------------------- view tabs --
   Shared with english-topics.css so both views carry the same switcher. */
.et-views { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
            background: #f0ecfb; margin: 12px 0 4px; }
.et-view { padding: 8px 18px; border-radius: 999px; text-decoration: none; min-height: 40px;
           display: inline-flex; align-items: center; font-size: .875rem; font-weight: 700;
           color: var(--muted); transition: background .2s var(--es-ease), color .2s var(--es-ease); }
.et-view:hover { color: var(--purple); }
.et-view.is-on { background: var(--card); color: var(--purple);
                 box-shadow: 0 2px 8px -3px rgba(80, 40, 160, .35); }
.et-view:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .et-view { transition: none; } }
@media print { .et-views { display: none !important; } }
