/* ═══════════════════════════════════════
   WoGL — World of GL
   wogl.io | worldofgl.com | mundogl.com
   hello@wogl.io | hola@mundogl.com

   Proprietary. All rights reserved.
   ═══════════════════════════════════════ */

/* The Toolkit in the new design's chassis (academy-site/home.css: tokens, the house bar, the lava, the footer).
   A library: its name and count, a bar that stays (the two libraries, the search, the order and the families) over
   a grid whose first card is the work of the day, and a work opened whole over the page. */

html.tk-locked { overflow: hidden; }
html.wogl-embed .nav, html.wogl-embed .foot { display: none !important; }
body { background: var(--ink); color: var(--text); font-family: var(--sans); }
main.tk { position: relative; z-index: 1; }

/* ── The library ─────────────────────────────────────────────────────────────────────────────────── */
.tk-lib { position: relative; padding: clamp(112px, 12vw, 148px) 0 var(--section-y); }
.tk-top h1 { font: 400 clamp(40px, 4.4vw, 60px)/1 var(--sans); letter-spacing: -.035em; color: var(--cream); }

/* The bar that stays under the house bar while the grid scrolls: the two libraries, the search, the order, a work at
   random, and the families under them. */
.tk-bar { position: sticky; top: 80px; z-index: 20; margin-top: 28px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(13, 10, 8, .94); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.tk-libs { display: inline-flex; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.tk-libs button { height: 40px; padding: 0 16px; border: 0; border-radius: 6px; background: none; cursor: pointer; font: 500 14px/1 var(--sans); color: var(--muted); transition: background .25s, color .25s; }
.tk-libs button[aria-selected="true"] { background: rgba(243, 220, 182, .12); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(232, 200, 154, .35); }
.tk-libs button:not([aria-selected="true"]):hover { color: var(--cream); }
.tk-search { position: relative; display: flex; align-items: center; height: 48px; padding: 0 12px 0 44px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); transition: border-color .25s; }
.tk-search:focus-within { border-color: var(--gold); }
.tk-search svg { position: absolute; left: 16px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.tk-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 15px/1 var(--sans); color: var(--cream); }
.tk-search input::placeholder { color: var(--quiet); }
.tk-search kbd { flex: none; padding: 4px 8px; border-radius: 5px; border: 1px solid var(--line); font: 500 11px/1 var(--mono); color: var(--quiet); }
.tk-sort { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 14px; border-radius: 8px; border: 1px solid var(--line); font: 400 13px/1 var(--sans); color: var(--quiet); }
.tk-sort select { height: 100%; padding: 0 22px 0 0; border: 0; outline: 0; background: none; font: 500 13px/1 var(--sans); color: var(--cream); cursor: pointer; appearance: none; -webkit-appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e8c89a' stroke-width='1.4'/%3E%3C/svg%3E") right 6px center / 10px no-repeat; }
.tk-sort select option { background: #110d0a; color: var(--cream); }
.tk-sort:focus-within { border-color: var(--gold); }
.tk-random { height: 48px; }
.tk-fams { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.tk-fams::-webkit-scrollbar { display: none; }
.tk-fam { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); font: 400 14px/1 var(--sans); color: var(--muted); transition: border-color .25s, color .25s, background .25s; }
.tk-fam small { font: 500 10px/1 var(--mono); letter-spacing: .06em; color: var(--quiet); }
.tk-fam:hover { color: var(--cream); border-color: var(--line-2); }
.tk-fam[aria-pressed="true"] { color: var(--gold); border-color: rgba(232, 200, 154, .7); background: rgba(232, 200, 154, .08); }
.tk-fam[aria-pressed="true"] small { color: var(--gold); }
/* soft chips with no edge, as Practice's: the one chosen in cream with ink letters */
.tk-fam { border-color: transparent; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.tk-fam:hover { border-color: transparent; background: rgba(255, 255, 255, .09); }
.tk-fam[aria-pressed="true"] { border-color: transparent; background: #f4ece1; color: #120d09; }
.tk-fam[aria-pressed="true"] small { color: rgba(18, 13, 9, .6); }
@media (max-width: 1000px) { .tk-bar { grid-template-columns: auto minmax(0, 1fr) auto; } .tk-random { display: none; } }
@media (max-width: 760px) {
  .tk-bar { position: static; grid-template-columns: minmax(0, 1fr) auto; }
  .tk-libs, .tk-search { grid-column: 1 / -1; }
  .tk-libs { width: 100%; } .tk-libs button { flex: 1; }
  .tk-search kbd { display: none; }
  .tk-random { display: inline-flex; }
}

.tk-count { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s7) 0 var(--s4); }
.tk-count h3 { font: 400 22px/1.2 var(--sans); color: var(--cream); }
.tk-count span { font: 400 22px/1.2 var(--sans); color: var(--quiet); }

/* ── The cards ─────────────────────────────────────────────────────────────────────────────────── */
/* Flat panels in three columns: the art framed inside, the work's line under its name, its elements and number at the foot. */
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 620px) { .tk-grid { grid-template-columns: 1fr; } }
.pcard { position: relative; display: flex; flex-direction: column; text-align: left; padding: 8px; cursor: pointer; font-family: inherit; color: inherit; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #110e0d; transition: border-color .35s, box-shadow .45s var(--ease); }
.pcard:hover, .pcard:focus-visible { border-color: rgba(232, 200, 154, .45); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); outline: none; }
.pcard-art { position: relative; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background-size: cover; background-position: center; }
.pcard-hovergl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pcard-live { position: absolute; z-index: 2; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #6fbf8a; box-shadow: 0 0 10px rgba(111, 191, 138, .9); opacity: 0; transition: opacity .3s; }
.pcard.playing .pcard-live { opacity: 1; }
.pcard-body { padding: 14px 8px 6px; display: grid; gap: 8px; }
.pcard-name { font: 500 17px/1.2 var(--sans); color: var(--cream); }
.pcard-tag { font: 400 13.5px/1.45 var(--sans); color: var(--muted); }
.pcard-tag::first-letter { text-transform: uppercase; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pcard-bucket { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pcard-id { font: 500 10px/1 var(--mono); letter-spacing: .08em; color: var(--quiet); }
.pcard-today { position: absolute; z-index: 2; top: 10px; left: 10px; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px;
  background: rgba(8, 6, 4, .62); font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pcard-today i { width: 6px; height: 6px; border-radius: 50%; background: #6fbf8a; box-shadow: 0 0 8px rgba(111, 191, 138, .8); }
.pcard.whammy { border-color: rgba(214, 84, 160, .35); }
.pcard.intro { animation: tk-in .7s var(--ease) both; }
@keyframes tk-in { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.tk-empty { margin-top: var(--s5); padding: var(--s8) var(--s6); border-radius: 26px; border: 1px dashed var(--line-2); text-align: center; color: var(--muted); }
.tk-empty .btn { margin-top: var(--s5); }

/* ── A work, opened whole ────────────────────────────────────────────────────────────────────────── */
.tk-view { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: clamp(16px, 2vw, 28px);
  padding: clamp(14px, 2vw, 28px); background: rgba(5, 4, 3, .9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
.tk-view.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.tk-stage { position: relative; min-height: 0; border-radius: 28px; overflow: hidden; border: 1px solid var(--line-2); background: #050403;
  transform: scale(.97); transition: transform .6s var(--ease); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.tk-view.open .tk-stage { transform: none; }
.tk-stage canvas { width: 100%; height: 100%; display: block; }
.tk-stage-badge { position: absolute; left: 16px; bottom: 16px; height: 30px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
  background: rgba(8, 6, 4, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.tk-stage-badge[hidden] { display: none; }
.tk-round { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; border: 1px solid var(--line-2);
  background: rgba(10, 8, 6, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--cream); font: 400 16px/1 var(--sans); transition: border-color .25s, color .25s, opacity .25s; }
.tk-round:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.tk-round:disabled { opacity: .3; cursor: default; }
.tk-stage .tk-round { position: absolute; right: 16px; bottom: 16px; }
.tk-panel { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: clamp(8px, 1vw, 16px) 6px clamp(8px, 1vw, 16px) 0; scrollbar-width: thin;
  transform: translateY(12px); transition: transform .6s var(--ease); }
.tk-view.open .tk-panel { transform: none; }
.tk-panel-top { display: flex; align-items: center; gap: 8px; }
.tk-crumb { margin-right: auto; font: 500 11px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.tk-crumb span { color: var(--quiet); }
.tk-panel h2 { margin-top: var(--s6); font: 400 clamp(40px, 4.6vw, 68px)/1 var(--sans); letter-spacing: -.035em; color: var(--cream); }
.tk-tagline { margin-top: var(--s4); font: 400 12px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s5); }
.tk-chips .chip { height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font: 400 12px/1 var(--mono); color: var(--muted); transition: border-color .25s, color .25s; }
.tk-chips .chip:hover { border-color: var(--gold); color: var(--gold); }
.tk-desc { margin-top: var(--s5); font-size: 16px; line-height: 1.7; color: var(--muted); }
.tk-desc b, .tk-desc strong { color: var(--cream); font-weight: 500; }
.tk-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
/* The code in the lessons' own format (academy-site/clase.css · .ed): the frame with its head, JetBrains Mono at
   13.5 px on 1.75, the sand text and the same highlight colors. */
.tk-code { display: none; margin-top: var(--s5); border-radius: 24px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.tk-code.open { display: block; }
.tk-code pre { max-height: 46vh; overflow: auto; margin: 0; padding: var(--card-pad); scrollbar-width: thin; }
.tk-code pre, .tk-code code { font: 400 13.5px/1.75 var(--mono); color: #c7b8a5; tab-size: 2; white-space: pre; }
.tk-code i { font-style: normal; }
.tk-code .kw { color: var(--gold); } .tk-code .fn { color: var(--cream); } .tk-code .bi { color: #a99780; }
.tk-code .nu { color: #e9b98a; } .tk-code .cm { font-style: italic; color: rgba(239, 230, 216, .35); }
@media (max-width: 760px) { .tk-code pre, .tk-code code { font-size: 12px; } }
@media (max-width: 900px) {
  .tk-view { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); overflow-y: auto; }
  .tk-stage { aspect-ratio: 1 / 1; max-height: 56svh; width: 100%; }
  .tk-panel { overflow: visible; padding: 0 2px var(--s6); }
  .tk-panel h2 { margin-top: var(--s4); }
}
@media (prefers-reduced-motion: reduce) {
  .pcard, .tk-view, .tk-stage, .tk-panel { transition: none; }
  .pcard.intro { animation: none; }
}
