/* Typy-Type (typy-type.html) and its card on the Library page. Every class starts with tt- (library.css is shared). */
.tt-page .nx-crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.tt-page .nx-crumbs a, .tt-page .nx-side-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.tt-page .nx-crumbs a:hover, .tt-page .nx-side-link:hover { text-decoration: underline; }

.tt-hero { background: var(--yellow); border-bottom: var(--edge); padding: 44px 0 40px; }
.tt-hero h1 { font-size: clamp(40px, 6vw, 68px); }
.tt-hero-lead { font-size: 19px; line-height: 1.6; color: var(--navy); max-width: 680px; margin: 16px 0 18px; }
.tt-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tt-facts li { background: #fff; border: 1.5px solid var(--navy); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; color: var(--navy); }

.tt-main { padding-top: 32px; }
.tt-decks { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-deck, .tt-level { font: 600 15px/1.2 Geist, Inter, sans-serif; padding: 10px 15px; border-radius: 999px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); cursor: pointer; }
.tt-deck:hover, .tt-level:hover { background: #f0f0f8; }
.tt-deck[aria-pressed="true"], .tt-level[aria-pressed="true"] { background: var(--navy); color: #fff; }
.tt-level { font-size: 14px; padding: 8px 12px; }
.tt-lead { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 760px; margin: 16px 0 24px; }

.tt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.tt-play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.tt-title { font: 700 22px/1.25 Geist, Inter, sans-serif; color: var(--navy); margin: 0; }
.tt-levels { display: flex; flex-wrap: wrap; gap: 6px; }

/* The line being typed. The textarea lies over it (invisible), so a tap anywhere opens the phone's keyboard. */
.tt-stage { position: relative; background: var(--paper); border: var(--edge); border-radius: 20px; box-shadow: 6px 6px 0 var(--navy); padding: 26px 26px 40px; cursor: text; }
.tt-stage.is-focus { box-shadow: 6px 6px 0 var(--navy), 0 0 0 4px #fedb71; }
.tt-text { font: 500 clamp(22px, 2.6vw, 30px)/1.7 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #8b8ba3; overflow-wrap: anywhere; }
.tt-word { white-space: nowrap; }
.tt-ch { position: relative; border-radius: 3px; }
.tt-ch.is-ok { color: #11663f; }
.tt-ch.is-bad { color: #b3261e; background: #fde3e1; text-decoration: underline wavy #b3261e; text-underline-offset: 4px; }
.tt-ch.is-space.is-bad { background: #f6b9b4; }
.tt-ch.is-hidden { color: transparent; border-bottom: 2px solid #b9b9cc; }
.tt-ch.is-caret::before { content: ""; position: absolute; left: -1px; top: 12%; bottom: 12%; width: 2px; background: var(--navy); animation: tt-blink 1s steps(1) infinite; }
.tt-stage:not(.is-focus) .tt-ch.is-caret::before { animation: none; opacity: 0.35; }
@keyframes tt-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tt-ch.is-caret::before { animation: none; } }
.tt-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; resize: none; font-size: 16px; cursor: text; caret-color: transparent; }
.tt-tap { position: absolute; left: 26px; bottom: 12px; margin: 0; font-size: 13px; color: var(--muted); pointer-events: none; }
.tt-stage.is-focus .tt-tap, .tt-stage.is-done .tt-tap { visibility: hidden; }
.tt-input:focus-visible { outline: none; }

.tt-live { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; color: var(--muted); margin: 14px 0 0; }
.tt-live strong { color: var(--navy); }

/* The result goes under the line, never over it */
.tt-result { margin-top: 18px; background: var(--mint); border: var(--edge); border-radius: 18px; padding: 18px 20px; }
.tt-result-head { font: 700 20px/1.3 Geist, Inter, sans-serif; color: var(--navy); margin: 0 0 4px; }
.tt-result-stats { margin: 0 0 12px; color: var(--navy); }
.tt-note { margin: 0 0 16px; padding: 12px 14px; background: #fff; border-radius: 12px; line-height: 1.55; }
.tt-note span { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tt-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tt-hint { font-size: 13px; color: var(--muted); }

.tt-side-title { font: 700 18px/1.3 Geist, Inter, sans-serif; color: var(--navy); margin: 0 0 10px; }
.tt-count { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.tt-lines { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 6px; }
.tt-line { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: 600 15px/1.3 Geist, Inter, sans-serif; color: var(--navy); background: #fff; border: 1.5px solid #d6d6e4; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.tt-line:hover { border-color: var(--navy); }
.tt-line[aria-pressed="true"] { border: 2px solid var(--navy); background: #fffbea; }
.tt-dots { display: inline-flex; gap: 4px; flex: none; }
.tt-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--navy); }
.tt-dot.is-on { background: #11663f; border-color: #11663f; }
.tt-box { background: var(--paper); border: var(--edge); border-radius: 16px; padding: 16px; }
.tt-box h3 { font: 700 16px/1.3 Geist, Inter, sans-serif; color: var(--navy); margin: 0 0 6px; }
.tt-box p { margin: 0 0 10px; line-height: 1.5; }

.tt-how { background: var(--mint); border-top: var(--edge); }
.tt-steps { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tt-steps li { background: #fff; border: var(--edge); border-radius: 16px; padding: 16px; line-height: 1.5; }
.tt-steps strong { display: block; color: var(--navy); font-size: 17px; margin-bottom: 4px; }
.tt-why { max-width: 760px; line-height: 1.6; margin: 0 0 12px; }
.tt-credit { font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.tt-credit a { color: var(--navy); }

@media (max-width: 900px) {
  .tt-grid { grid-template-columns: 1fr; }
  .tt-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .tt-stage { padding: 18px 16px 36px; }
  .tt-tap { left: 16px; }
  .tt-steps { grid-template-columns: 1fr; }
}

/* ---------- The Typy-Type card at the top of the Library page ---------- */
.tt-card-wrap { padding: 28px 0 8px; }
.tt-card { display: flex; align-items: center; gap: 18px; background: #fff; border: var(--edge); border-radius: 22px; box-shadow: 6px 6px 0 var(--navy); padding: 18px 22px; }
.tt-card-icon { flex: none; width: 58px; height: 58px; border-radius: 16px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; box-shadow: 3px 3px 0 #fedb71; }
.tt-card-text { flex: 1; min-width: 0; }
.tt-card-text h2 { font: 700 22px/1.2 'Orbitron Variablefont Wght', Orbitron, sans-serif; color: var(--navy); margin: 0 0 4px; }
.tt-card-text p { margin: 0; line-height: 1.5; color: var(--ink); }
.tt-card-tag { display: inline-block; font: 600 12px/1 Geist, Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; background: var(--mint); color: var(--navy); border: 1.5px solid var(--navy); border-radius: 999px; padding: 5px 9px; margin-left: 8px; vertical-align: 3px; }
@media (max-width: 640px) {
  .tt-card { flex-wrap: wrap; padding: 16px; }
  .tt-card .nx-btn { width: 100%; justify-content: center; }
}
