/* ============================================================================
   Tech Skills — the Software Engineering hub and its twelve module pages.
   Same tokens and rhythm as word-analysis.css so the two hubs read as family.
   ========================================================================== */
body { font-family: 'Inter', system-ui, sans-serif; font-size: 1.0625rem; }
h1, h2, h3 { font-family: 'Inter', system-ui, sans-serif; }

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

/* --------------------------------------------------------------- hero ---- */
.ts-hero { padding: 30px 0 14px; }
.ts-kicker { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .12em;
             text-transform: uppercase; color: var(--ts-c); background: #eaf0ff;
             border-radius: 999px; padding: 6px 14px; margin-bottom: 12px; }
.ts-h1 { font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
         font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin-bottom: 8px; }
.ts-h1 .gg { background: var(--ts-grad); -webkit-background-clip: text; background-clip: text;
             -webkit-text-fill-color: transparent; }
.ts-sub { color: var(--muted); font-size: 1.0625rem; max-width: 66ch; line-height: 1.6; }
.ts-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ts-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); }
.ts-stat b { font-size: .9375rem; font-weight: 800; color: var(--ts-c); }

/* the "Menu → Submenu → Topic → Meaning → Explanation → Example" path */
.ts-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.ts-path span { padding: 4px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700;
                color: var(--ts-c); background: color-mix(in srgb, var(--ts-c) 10%, transparent);
                border: 1px solid color-mix(in srgb, var(--ts-c) 22%, transparent); }
.ts-path span + span::before { content: '→'; margin: 0 8px 0 -4px; opacity: .55; font-weight: 800; }

/* ------------------------------------------------------ section heads ---- */
.ts-sec { margin: 26px 0 12px; display: flex; align-items: baseline; justify-content: space-between;
          gap: 12px; flex-wrap: wrap; }
.ts-sec h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.ts-sec p { color: var(--muted); font-size: .875rem; }

/* ---------------------------------------------------------- module grid -- */
.ts-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
@media (max-width: 640px) { .ts-grid { grid-template-columns: minmax(0, 1fr); } }
.ts-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(--ts-c);
           color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 12, 40, .04);
           transition: transform .25s var(--ts-ease), box-shadow .25s var(--ts-ease); }
.ts-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px var(--ts-c); }
.ts-card.ts-pre { opacity: 0; transform: translateY(12px); }
.ts-cardtop { display: flex; align-items: center; gap: 10px; }
.ts-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
          font-size: .8125rem; font-weight: 800; color: var(--ts-c);
          background: color-mix(in srgb, var(--ts-c) 12%, transparent); }
.ts-ico { font-size: 1.25rem; }
.ts-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.ts-learn { font-size: .8125rem; color: var(--muted); line-height: 1.55; flex: 1; }
.ts-counts { font-size: .6875rem; font-weight: 700; color: var(--muted);
             text-transform: uppercase; letter-spacing: .05em; }
.ts-prog { display: flex; align-items: center; gap: 9px; }
.ts-progbar { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ts-progbar span { display: block; height: 100%; border-radius: 999px; background: var(--ts-c);
                   transition: width .6s var(--ts-ease); }
.ts-progtx { flex: none; font-size: .6875rem; font-weight: 800; color: var(--ts-c); }
.ts-cardfoot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ts-btn { padding: 10px 18px; border-radius: 11px; border: 0; cursor: pointer; min-height: 44px;
          background: var(--ts-grad); color: #fff; font-family: inherit; font-size: .8125rem; font-weight: 700;
          text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
          transition: filter .18s, transform .18s; }
.ts-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.ts-btn:focus-visible { outline: 2px solid var(--ts-c); outline-offset: 3px; }
.ts-btn.ghost { background: color-mix(in srgb, var(--ts-c) 11%, transparent); color: var(--ts-c);
                border: 1px solid color-mix(in srgb, var(--ts-c) 26%, transparent); }
.ts-btn.ghost:hover { filter: none; background: color-mix(in srgb, var(--ts-c) 16%, transparent); }

/* -------------------------------------------------- learning method ------ */
.ts-method { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ts-step { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.ts-step b { display: block; font-size: .6875rem; font-weight: 800; letter-spacing: .08em;
             text-transform: uppercase; color: var(--ts-c); margin-bottom: 4px; }
.ts-step span { font-size: .9375rem; font-weight: 600; line-height: 1.45; }
.ts-method-note { margin-top: 10px; color: var(--muted); font-size: .875rem; }

/* ------------------------------------------------------- checklist ------- */
.ts-check { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ts-check label { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px;
                  background: var(--card); border: 1px solid var(--line); cursor: pointer;
                  font-size: .9375rem; line-height: 1.5; transition: border-color .18s, background .18s; }
.ts-check label:hover { border-color: var(--ts-c); }
.ts-check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ts-c); cursor: pointer; }
.ts-check label.is-on { background: color-mix(in srgb, #059669 8%, var(--card)); border-color: #059669;
                        color: var(--muted); }
.ts-check label.is-on span { text-decoration: line-through; text-decoration-color: rgba(5,150,105,.5); }
.ts-checkbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .875rem;
               font-weight: 700; color: var(--muted); }
.ts-checkbar .ts-progbar { max-width: 260px; }
.ts-reset { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--ts-c);
            font-family: inherit; font-size: .8125rem; font-weight: 700; }

/* ======================================================= module page ===== */
.ts-modhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ts-crumb { font-size: .8125rem; color: var(--muted); }
.ts-crumb a { color: var(--ts-c); text-decoration: none; font-weight: 700; }
.ts-crumb a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ts-goal { margin-top: 12px; padding: 12px 16px; border-radius: 12px; border-left: 4px solid var(--ts-c);
           background: var(--card); border-top: 1px solid var(--line); border-right: 1px solid var(--line);
           border-bottom: 1px solid var(--line); font-size: .9375rem; color: var(--muted); line-height: 1.6; }
.ts-goal b { color: var(--ts-c); }

.ts-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }
.ts-modes { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card);
            border: 1px solid var(--line); }
.ts-mode { padding: 8px 15px; border-radius: 999px; border: 0; cursor: pointer; min-height: 38px;
           background: transparent; color: var(--muted); font-family: inherit; font-size: .8125rem; font-weight: 700; }
.ts-mode.is-on { background: var(--ts-grad); color: #fff; }
.ts-mode:focus-visible { outline: 2px solid var(--ts-c); outline-offset: 2px; }
.ts-tools .ts-btn { margin-left: auto; }
@media (max-width: 560px) { .ts-tools .ts-btn { margin-left: 0; width: 100%; justify-content: center; } }

.ts-sechead { margin: 18px 0 8px; font-size: .75rem; font-weight: 800; letter-spacing: .1em;
              text-transform: uppercase; color: var(--muted); }

/* topic accordion */
.ts-topics { display: grid; gap: 10px; }
.ts-topic { border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden;
            transition: border-color .18s, box-shadow .18s; }
.ts-topic.is-open { border-color: color-mix(in srgb, var(--ts-c) 40%, var(--line));
                    box-shadow: 0 12px 26px -20px var(--ts-c); }
.ts-topic.is-done { border-left: 4px solid #059669; }
.ts-tbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left;
           background: none; border: 0; cursor: pointer; font-family: inherit; color: var(--ink); min-height: 52px; }
.ts-tbtn:focus-visible { outline: 2px solid var(--ts-c); outline-offset: -2px; }
.ts-tnum { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
           font-size: .75rem; font-weight: 800; color: var(--ts-c);
           background: color-mix(in srgb, var(--ts-c) 12%, transparent); }
.ts-topic.is-done .ts-tnum { color: #059669; background: rgba(5,150,105,.12); }
.ts-tname { flex: 1; font-size: 1rem; font-weight: 700; }
.ts-tmeaning { display: none; }
.ts-chev { flex: none; color: var(--muted); transition: transform .2s var(--ts-ease); }
.ts-topic.is-open .ts-chev { transform: rotate(180deg); }
.ts-tbody { display: none; padding: 0 16px 16px 56px; }
.ts-topic.is-open .ts-tbody { display: block; }
@media (max-width: 560px) { .ts-tbody { padding-left: 16px; } }
.ts-block { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; padding: 10px 0;
            border-top: 1px dashed var(--line); font-size: .9375rem; line-height: 1.6; }
.ts-block:first-child { border-top: 0; padding-top: 0; }
.ts-block b { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
              color: var(--ts-c); padding-top: 3px; }
.ts-block.ex b { color: #059669; }
.ts-block.ex span { background: rgba(5,150,105,.06); border-radius: 8px; padding: 8px 12px; }
@media (max-width: 560px) { .ts-block { grid-template-columns: minmax(0, 1fr); gap: 3px; } }
.ts-tfoot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ts-small { padding: 8px 14px; border-radius: 10px; cursor: pointer; min-height: 40px;
            border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
            font-family: inherit; font-size: .78125rem; font-weight: 700; transition: .18s; }
.ts-small:hover { border-color: var(--ts-c); color: var(--ts-c); }
.ts-small.is-on { border-color: #059669; color: #059669; background: rgba(5,150,105,.08); }

/* ---------------------------------------------------------- flashcards --- */
.ts-flash { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ts-fcard { perspective: 1200px; min-height: 190px; cursor: pointer; }
.ts-fcard:focus-visible { outline: 2px solid var(--ts-c); outline-offset: 3px; border-radius: 16px; }
.ts-finner { position: relative; width: 100%; height: 100%; min-height: 190px;
             transition: transform .45s var(--ts-ease); transform-style: preserve-3d; }
.ts-fcard.is-flipped .ts-finner { transform: rotateY(180deg); }
.ts-fface { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
            gap: 8px; padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
            -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.ts-fface.front { text-align: center; border-top: 3px solid var(--ts-c); }
.ts-fface.front b { font-size: 1.125rem; font-weight: 700; }
.ts-fface.front small { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em;
                        text-transform: uppercase; }
.ts-fface.back { transform: rotateY(180deg); background: color-mix(in srgb, var(--ts-c) 6%, var(--card)); }
.ts-fface.back b { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
                   color: var(--ts-c); }
.ts-fface.back p { font-size: .9375rem; line-height: 1.5; }

/* --------------------------------------------------------- quiz modal ---- */
.ts-run { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: start center;
          padding: 6vh 16px 16px; }
.ts-run-back { position: fixed; inset: 0; background: rgba(24, 18, 46, .5);
               -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ts-run-box { position: relative; width: 100%; max-width: 600px; border-radius: 20px; overflow: hidden;
              background: var(--card, #fff); border: 1px solid var(--line);
              box-shadow: 0 30px 70px -28px rgba(20, 30, 90, .65); animation: tsPop .18s var(--ts-ease); }
@keyframes tsPop { from { opacity: 0; transform: translateY(-8px); } }
.ts-run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
              padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.ts-run-kicker { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ts-c); }
.ts-run-top h2 { font-size: 1.125rem; font-weight: 700; margin-top: 2px; }
.ts-run-x { flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 0;
            background: var(--bg-soft, #eef1ff); color: var(--muted); font-size: 1.25rem; line-height: 1; }
.ts-run-bar { height: 4px; background: var(--line); }
.ts-run-bar > span { display: block; height: 100%; width: 0; background: var(--ts-c); transition: width .3s var(--ts-ease); }
.ts-run-body { padding: 18px 20px 22px; }
.ts-run-meta { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700;
               color: var(--muted); margin-bottom: 12px; }
.ts-run-lbl { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
              color: var(--ts-c); margin-bottom: 4px; }
.ts-run-q { font-size: 1.0625rem; font-weight: 600; line-height: 1.55; margin-bottom: 14px;
            padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ts-c) 6%, var(--card)); }
.ts-run-ask { font-size: .9375rem; font-weight: 700; margin-bottom: 10px; }
.ts-run-opts { display: grid; gap: 8px; }
.ts-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; }
.ts-run-opt:hover:not(:disabled) { border-color: var(--ts-c); }
.ts-run-opt:disabled { cursor: default; }
.ts-run-opt.ok { border-color: #059669; background: rgba(5,150,105,.1); color: #059669; }
.ts-run-opt.no { border-color: #dc2626; background: rgba(220,38,38,.08); color: #dc2626; }
.ts-run-fb { margin-top: 13px; font-size: .875rem; line-height: 1.6; min-height: 1.2em; }
.ts-run-fb.good { color: #059669; }
.ts-run-fb.bad  { color: #dc2626; }
.ts-run-act { display: flex; justify-content: flex-end; margin-top: 14px; }
.ts-run-done { text-align: center; padding: 10px 0; }
.ts-run-emoji { font-size: 2.75rem; line-height: 1; }
.ts-run-score { font-size: 1.25rem; margin-top: 10px; }
.ts-run-score b { color: var(--ts-c); }
.ts-run-msg { color: var(--muted); margin-top: 4px; font-size: .9375rem; }
.ts-run-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* prev / next */
.ts-pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 60px; flex-wrap: wrap; }
.ts-pager a { flex: 1; min-width: 200px; padding: 14px 16px; border-radius: 14px; background: var(--card);
              border: 1px solid var(--line); color: inherit; text-decoration: none; transition: .18s; }
.ts-pager a:hover { border-color: var(--ts-c); transform: translateY(-2px); }
.ts-pager small { display: block; font-size: .6875rem; font-weight: 800; letter-spacing: .08em;
                  text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.ts-pager b { font-size: .9375rem; }
.ts-pager a.next { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .ts-card, .ts-btn, .ts-progbar span, .ts-finner, .ts-chev, .ts-run-box, .ts-pager a { transition: none !important; animation: none !important; }
  .ts-card.ts-pre { opacity: 1; transform: none; }
}
@media print { .ts-tools, .ts-run, .ts-btn, .ts-small, .topbar, .site-footer { display: none !important; }
               .ts-tbody { display: block !important; } .ts-card { opacity: 1 !important; transform: none !important; } }
