/* MAKERS Learn. Brand system from the MAKERS Hub site: a dark plum "studio at night" ground,
   paper-white work sheets slid in between, and the pointer as the recurring device.
   Base colours come from Admin > Settings (see layout.js); everything else is derived here. */
:root {
  --plum: color-mix(in srgb, var(--ink) 85%, #8a6f9e);
  --plum-2: color-mix(in srgb, var(--ink) 74%, #8a6f9e);
  --fg: #F4EEF9;
  --fg-d: #F4EEF9;
  --muted-d: #B9ABC9;
  --line-d: rgba(244, 238, 249, .14);
  --paper-fg: color-mix(in srgb, var(--ink) 80%, #6b5a78);
  --muted: #6A5C78;
  --line: rgba(45, 33, 51, .14);
  --card: #fff;
  --ok: #1F9D63;
  --danger: #D7264F;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;
  --r-sm: 10px; --r: 18px; --r-lg: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --gutter: 20px;
  --pointer: polygon(10% 0, 100% 72%, 45% 76%, 0 100%);
  --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 80 100'%3E%3Cpath d='M10 6 L72 70 L34 73 L8 96 Z' fill='%23A12EE8' stroke='%23ffffff' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, auto;
  --cur-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 80 100'%3E%3Cpath d='M10 6 L72 70 L34 73 L8 96 Z' fill='%23E81BF0' stroke='%23ffffff' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, pointer;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--paper-fg); font: 400 17px/1.6 var(--font-body); overflow-x: hidden; cursor: var(--cur); }
a, button, label, select, summary, [data-flip] { cursor: var(--cur-hand); }
input, textarea { cursor: text; }
::selection { background: var(--accent); color: #fff; }
img, svg, video, canvas, iframe { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, .h3 { font-family: var(--font-head); font-stretch: 125%; line-height: 1.04; letter-spacing: -.01em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-weight: 900; font-size: clamp(2.2rem, 5.2vw, 4.2rem); }
h2 { font-weight: 850; font-size: clamp(1.5rem, 3vw, 2.4rem); margin-top: 1.3em; }
h3, .h3 { font-weight: 800; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.15; }
.h3 { display: block; }
p { margin: 0 0 1em; }
code { font: .86em/1 var(--font-mono); background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--paper-fg); padding: .2em .4em; border-radius: 5px; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--card); padding: 8px 12px; }
.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.5; color: var(--muted); max-width: 60ch; }
.eyebrow { font: 600 .74rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--primary); display: inline-flex; gap: .6em; align-items: center; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 10px; height: 12px; background: currentColor; clip-path: var(--pointer); }
.big-num { font: 900 clamp(2rem, 4vw, 3rem)/1 var(--font-head); font-stretch: 125%; color: var(--primary); margin: 0 0 .3em; }
main { min-height: 60vh; padding-bottom: 72px; }
main.bare { padding: 0; }
.sec { padding-block: clamp(56px, 8vw, 112px); }
.sec-head { max-width: 820px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head h2 { margin-top: 0; }

/* Dark world */
.dark { background: var(--ink); color: var(--fg); }
.dark .lede, .dark .muted { color: var(--muted-d); }
.dark .eyebrow { color: var(--accent); }
.dark a:not(.btn) { color: var(--fg); }
.paper { background: var(--paper); color: var(--paper-fg); }

/* Logo */
.lg { display: inline-flex; align-items: center; gap: .04em; font: 800 21px/1 var(--font-head); font-stretch: 125%; padding: .36em .66em; border: 2px solid currentColor; border-radius: .62em; letter-spacing: .01em; color: var(--fg); }
.lg svg { width: .86em; height: 1.08em; margin: 0 .02em; transform: translateY(.14em); overflow: visible; transition: transform .5s var(--spring); }
.lg svg path { fill: var(--primary); stroke: var(--primary); stroke-width: 9; stroke-linejoin: round; }
.lg .dot { width: .3em; height: .3em; border-radius: 50%; background: var(--accent); margin-left: .14em; align-self: flex-end; margin-bottom: .02em; }
a:hover .lg svg { transform: translate(.08em, .04em) rotate(-10deg); }
.lg.big { font-size: clamp(26px, 4vw, 44px); color: var(--paper-fg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 12px 22px; border: 0; border-radius: 99px; background: var(--primary); color: #fff; font: 700 .98rem/1.1 var(--font-body); text-decoration: none; position: relative; transition: background .25s, transform .25s var(--ease), box-shadow .25s; will-change: transform; }
.btn:hover { background: var(--accent); box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn:active { transform: scale(.97); }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--paper-fg); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--paper-fg); background: transparent; }
.dark .btn.ghost { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-d); }
.dark .btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
.btn.sm { min-height: 38px; padding: 8px 15px; font-size: .88rem; }
.btn.lg { min-height: 54px; padding: 15px 26px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; }
.btn.danger { background: var(--danger); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; text-decoration: underline; }
.danger-text { color: var(--danger) !important; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; color: var(--paper-fg); transition: all .2s; }
.icon-btn:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.icon-btn[disabled] { opacity: .3; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4em 0; }
.links { display: flex; gap: 20px; flex-wrap: wrap; }
.inline { display: inline; }
.more { margin-top: 28px; }

/* Bars */
.sitebar { background: var(--hi); color: var(--ink); text-align: center; padding: 9px var(--gutter); font-weight: 700; font-size: .9rem; }
.sitebar a { color: inherit; }
.sitebar.bottom { position: sticky; bottom: 0; z-index: 20; }
.sitebar.warn { background: var(--accent); color: #fff; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-d); color: var(--fg); }
.head-row { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); flex: none; }
.brand-sub { font: 600 .74rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 14px; border-radius: 99px; color: var(--muted-d); transition: color .2s, background .2s; }
.main-nav a:hover { color: var(--fg); background: var(--line-d); }
.main-nav a[aria-current] { color: var(--fg); background: var(--plum-2); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.head-actions .btn.ghost { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-d); }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .head-row { gap: 10px; }
  .brand-sub { display: none; }
  .site-head .lg { font-size: 16px; }
  .head-actions { gap: 6px; }
  .nav-toggle { display: grid; gap: 5px; place-content: center; order: 3; width: 44px; height: 44px; background: none; border: 1px solid var(--line-d); border-radius: 12px; }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--fg); transition: transform .3s var(--ease); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .main-nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--ink); padding: 14px var(--gutter) 22px; border-bottom: 1px solid var(--line-d); transform: translateY(-130%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s; z-index: -1; }
  .main-nav.open { transform: none; visibility: visible; transition: transform .4s var(--ease); }
  .main-nav a { font-size: 1.15rem; padding: 12px 14px; }
  .head-actions .btn { padding: 7px 12px; min-height: 36px; }
}
.bell { position: relative; color: var(--fg); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; transition: background .2s; }
.bell:hover { background: var(--line-d); }
.bell .badge { position: absolute; top: 3px; right: 1px; background: var(--accent); color: #fff; font: 800 11px/18px var(--font-body); min-width: 18px; padding: 0 4px; border-radius: 9px; text-align: center; animation: pop .5s var(--spring); }
@keyframes pop { from { transform: scale(0); } }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); background: var(--plum); border: 1px solid var(--line-d); border-radius: 16px; padding: 8px; min-width: 230px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7); display: grid; animation: drop .25s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.menu-panel a, .menu-panel .linklike { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--fg); text-align: left; width: 100%; }
.menu-panel a:hover, .menu-panel .linklike:hover { background: var(--plum-2); }
.menu-name { padding: 8px 12px 12px; border-bottom: 1px solid var(--line-d); margin-bottom: 6px; font-weight: 700; }
.menu-name small { font-weight: 400; color: var(--muted-d); }

.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; font: 900 .9rem/1 var(--font-head); font-stretch: 125%; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: .78rem; box-shadow: 0 0 0 2px var(--ink), 0 0 0 3.5px var(--accent); }
.avatar.lg { width: 66px; height: 66px; font-size: 1.3rem; }
.avatar.xl { width: 104px; height: 104px; font-size: 2.1rem; }

/* Toasts */
.toasts { position: fixed; z-index: 70; right: 16px; top: 82px; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { margin: 0; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 18px; border-radius: 16px; background: var(--plum); color: var(--fg); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .6); border-left: 4px solid var(--primary); animation: slide .5s var(--spring) both; font-weight: 500; }
.toast.success, .toast.xp { border-left-color: var(--hi); }
.toast.celebrate { border-left-color: var(--hi); background: var(--primary); }
.toast.error { border-left-color: var(--danger); }
.toast.out { animation: slideout .35s var(--ease) forwards; }
.toast-x { margin-left: auto; background: none; border: 0; color: var(--muted-d); font-size: 1.3rem; line-height: 1; padding: 0 4px; }
@keyframes slide { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes slideout { to { opacity: 0; transform: translateX(40px); } }
.flash { padding: 12px 14px; border-radius: 12px; border-left: 4px solid var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); margin: 0 0 10px; color: var(--paper-fg); }
.flash.success { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, #fff); }
.flash.error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, #fff); }
.warn-text { color: var(--danger); font-weight: 600; }
.tag { display: inline-block; font: 600 .7rem/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; border: 1px solid currentColor; color: var(--primary); vertical-align: .12em; }
.tag.ok { color: var(--ok); }
.tag.bad { color: var(--danger); }
.status { font: 600 .74rem/1.3 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 7px; vertical-align: .05em; }
.s-paid::before, .s-published::before, .s-active::before { background: var(--ok); }
.s-pending::before, .s-awaiting_review::before, .s-requested::before { background: #F2B632; }
.s-failed::before, .s-rejected::before, .s-suspended::before { background: var(--danger); }

/* Page wipe between pages */
.wipe { position: fixed; inset: 0; z-index: 90; pointer-events: none; background: var(--primary); transform: scaleY(0); transform-origin: bottom; display: grid; place-items: center; }
.wipe .lg { font-size: clamp(28px, 6vw, 60px); color: #fff; opacity: 0; }
.wipe .lg svg path { fill: var(--ink); stroke: var(--ink); }
.wipe.in { animation: wipein .42s var(--ease) forwards; }
.wipe.in .lg { animation: fadein .3s .15s forwards; }
.wipe.outro { transform: scaleY(1); transform-origin: top; animation: wipeout .5s var(--ease) forwards; }
.wipe.outro .lg { opacity: 1; animation: fadeout .2s forwards; }
@keyframes wipein { to { transform: scaleY(1); } }
@keyframes wipeout { to { transform: scaleY(0); } }
@keyframes fadein { to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }

/* Reveal on scroll (only hidden once JS has marked the page) */
.js .rv { opacity: 0; transform: translateY(26px); }
.js .rv.on { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 7vw, 92px) clamp(56px, 8vw, 100px); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line-d) 1px, transparent 1px), linear-gradient(90deg, var(--line-d) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(70% 60% at 20% 30%, #000, transparent); -webkit-mask-image: radial-gradient(70% 60% at 20% 30%, #000, transparent); opacity: .6; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; position: relative; }
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(2.7rem, 7vw, 6.2rem); line-height: .98; margin-bottom: .35em; }
.hero h1 .line { display: block; }
.hero h1 .outline { color: transparent; -webkit-text-stroke: 2px var(--fg); }
.hero h1 .outline b { color: var(--primary); -webkit-text-stroke: 0; font-weight: 900; }
.typed { font: 400 .95rem var(--font-mono); color: var(--muted-d); min-height: 1.6em; }
.typed .caret { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: -.18em; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px 36px; padding-top: 18px; margin: 8px 0 0; border-top: 1px solid var(--line-d); }
.hero-meta div { display: flex; flex-direction: column-reverse; }
.hero-meta dd { margin: 0; font: 900 1.9rem/1.1 var(--font-head); font-stretch: 125%; font-variant-numeric: tabular-nums; }
.hero-meta dt { font-size: .82rem; color: var(--muted-d); }
.hero-art { position: relative; aspect-ratio: 1; width: 100%; border-radius: var(--r-lg); background: radial-gradient(120% 90% at 30% 20%, var(--plum-2), var(--ink) 70%); border: 1px solid var(--line-d); overflow: hidden; }
.hero-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.hero-art .chip { position: absolute; right: 16px; top: 16px; font: 600 .7rem var(--font-mono); background: var(--hi); color: var(--ink); padding: 6px 11px; border-radius: 99px; letter-spacing: .06em; border: 0; }
.hero-art .hint { position: absolute; left: 18px; bottom: 16px; font: 400 .7rem var(--font-mono); color: var(--muted-d); letter-spacing: .08em; text-transform: uppercase; }
.ticket { position: absolute; display: grid; gap: 4px; width: min(250px, 58%); padding: 16px 18px; border-radius: 18px; background: var(--primary); color: #fff !important; text-decoration: none; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .8); animation: float 6s ease-in-out infinite; transition: background .3s, scale .4s var(--spring); }
.ticket:hover { background: var(--accent); scale: 1.05; }
.ticket.t0 { left: 8%; bottom: 14%; rotate: -4deg; }
.ticket.t1 { right: 7%; top: 18%; rotate: 3deg; background: var(--plum); border: 1px solid var(--line-d); animation-delay: -3s; }
.ticket strong { font: 800 1.02rem/1.15 var(--font-head); font-stretch: 115%; }
.t-kind { font: 600 .66rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.t-price { font: 900 1.2rem var(--font-head); font-stretch: 125%; color: var(--hi); }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 520px; } }

/* Marquee */
.marquee { overflow: hidden; background: var(--plum); color: var(--fg); padding-block: 18px; border-block: 1px solid var(--line-d); }
.marquee .track { display: flex; gap: 44px; width: max-content; animation: mq 40s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { font: 800 clamp(1.25rem, 2.6vw, 2rem)/1.2 var(--font-head); font-stretch: 125%; white-space: nowrap; display: inline-flex; align-items: center; gap: 44px; }
.marquee span:nth-child(3n+2) { color: transparent; -webkit-text-stroke: 1.3px var(--fg); }
.marquee span::after { content: ""; width: 16px; height: 20px; background: var(--accent); clip-path: var(--pointer); }
@keyframes mq { to { transform: translateX(-50%); } }

/* Filter chips */
.filter-chips, .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.fchip, .chip { border: 1.5px solid var(--line); background: var(--card); color: var(--paper-fg); border-radius: 99px; padding: 9px 16px; font: 600 .9rem var(--font-body); text-decoration: none; transition: all .3s var(--ease); display: inline-block; }
.fchip:hover, .chip:hover { border-color: var(--primary); transform: translateY(-2px) rotate(-1.5deg); }
.fchip[aria-pressed="true"] { background: var(--paper-fg); border-color: var(--paper-fg); color: var(--fg); }
.chip span { color: var(--muted); margin-left: 4px; }

/* Course cards */
.grid.cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); }
.course-card { background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; position: relative; transition: transform .5s var(--ease), box-shadow .5s; }
.course-card:hover { box-shadow: 0 30px 50px -30px color-mix(in srgb, var(--ink) 70%, transparent); }
.course-card.hide { display: none; }
.course-card.pop { animation: popin .5s var(--spring) both; }
@keyframes popin { from { opacity: 0; transform: scale(.9); } }
.course-card .cover { position: relative; aspect-ratio: 4 / 3; display: block; overflow: hidden; }
.course-card .cover .adire { width: 100%; height: 100%; transition: transform .8s var(--ease); }
.course-card:hover .cover .adire { transform: scale(1.06) rotate(-1deg); }
.glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .28), transparent 50%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.course-card:hover .glare { opacity: 1; }
.cc-badge { position: absolute; left: 12px; top: 12px; font: 600 .66rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--fg); padding: 5px 10px; border-radius: 99px; }
.cc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.cc-body h3 { margin-bottom: .35em; }
.cc-body h3 a { color: var(--paper-fg); text-decoration: none; }
.cc-body h3 a::after { content: ""; position: absolute; inset: 0; }
.cc-meta { font: 600 .7rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: .6em; }
.cc-teach { font-size: .9rem; color: var(--muted); margin-bottom: .8em; }
.cc-foot { margin: auto 0 0; display: flex; justify-content: space-between; align-items: center; }
.cc-price { font: 900 1.3rem/1 var(--font-head); font-stretch: 125%; }
.cc-price.free { color: var(--ok); }
.cc-go { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--paper-fg); transition: all .35s var(--spring); }
.course-card:hover .cc-go { background: var(--primary); color: #fff; transform: rotate(-35deg); }
.adire { width: 100%; height: 100%; }

/* Journey */
.journey { display: grid; gap: 22px; }
.journey .track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; padding-top: 36px; }
.lvl { all: unset; box-sizing: border-box; display: grid; gap: 6px; padding: 18px 16px 20px; border-radius: 16px; background: var(--plum); border: 1.5px solid transparent; position: relative; transition: all .4s var(--ease); margin-bottom: calc(var(--k) * 26px); cursor: var(--cur-hand); }
.lvl .n { font: 400 .72rem var(--font-mono); color: var(--muted-d); }
.lvl b { font: 850 1.08rem/1.1 var(--font-head); font-stretch: 125%; }
.lvl:hover { border-color: var(--primary); }
.lvl[aria-pressed="true"] { background: var(--primary); }
.lvl[aria-pressed="true"] .n { color: #fff; }
.lvl:focus-visible { outline: 2px solid var(--accent); }
.climber { position: absolute; top: -32px; left: 16px; width: 22px; height: 28px; background: var(--accent); clip-path: var(--pointer); opacity: 0; transition: opacity .3s; }
.lvl[aria-pressed="true"] .climber { opacity: 1; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.jprog { height: 8px; border-radius: 8px; background: var(--line-d); overflow: hidden; }
.jprog i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s var(--ease); }
.jtext { color: var(--muted-d); min-height: 3.2em; font-size: 1.1rem; max-width: 62ch; }
.jtext.swap { animation: rise .45s var(--ease); }
@media (max-width: 760px) { .journey .track { grid-template-columns: 1fr; padding-top: 0; } .lvl { margin-bottom: 0; margin-left: calc(var(--k) * 14px); } .climber { top: 50%; left: auto; right: 16px; margin-top: -14px; } }

/* Flip cards */
.tests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; perspective: 1200px; }
.tcard { all: unset; box-sizing: border-box; position: relative; min-height: 250px; display: block; cursor: var(--cur-hand); }
.tcard .in { position: absolute; inset: 0; transition: transform .7s var(--ease); transform-style: preserve-3d; }
.tcard:hover .in, .tcard[aria-pressed="true"] .in { transform: rotateY(180deg); }
.tcard .f, .tcard .b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r); padding: 22px; display: grid; align-content: space-between; }
.tcard .f { background: var(--card); border: 1px solid var(--line); color: var(--paper-fg); }
.tcard .f .n { display: block; font: 400 .75rem var(--font-mono); color: var(--primary); }
.tcard .f small { color: var(--muted); }
.tcard .b { background: var(--ink); color: var(--fg); transform: rotateY(180deg); font: 700 1.12rem/1.25 var(--font-head); font-stretch: 110%; }
.tcard .b .tag { color: var(--accent); width: max-content; }
.tcard .b a { color: var(--hi); font: 600 .9rem var(--font-body); }
.tcard:focus-visible .f { outline: 2px solid var(--primary); }
@media (max-width: 900px) { .tests { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .tests { grid-template-columns: 1fr; } }

/* CTA band */
.ask { position: relative; overflow: hidden; background: var(--plum); border-radius: 32px; padding: clamp(32px, 6vw, 80px); }
.ask h2 { font-size: clamp(2rem, 5.4vw, 4.4rem); margin: 0 0 .4em; max-width: 16ch; }
.ask::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, var(--accent) 0 2px, transparent 3px) 0 0/14px 14px; opacity: .5; pointer-events: none; }
.sign { position: absolute; right: clamp(16px, 4vw, 60px); top: clamp(16px, 3vw, 40px); background: #C8894F; color: #2b1608; font: 600 1.6rem var(--font-hand); padding: 10px 18px; border-radius: 6px; transform-origin: 50% -30px; animation: swing 4s ease-in-out infinite; box-shadow: 0 8px 0 #8a5528; z-index: 1; }
@keyframes swing { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(-3deg); } }
@media (max-width: 640px) { .sign { position: static; display: inline-block; margin-bottom: 18px; animation: none; transform: rotate(-2deg); } }

.band { padding-top: 32px; }
.band-head, .row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.page-head { padding-top: 40px; padding-bottom: 8px; }
.page-head h1 { margin-bottom: .2em; }
.teachers { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Catalogue */
.catalog { display: grid; gap: 28px; }
@media (min-width: 980px) { .catalog { grid-template-columns: 260px 1fr; align-items: start; } .filters { position: sticky; top: 88px; } }
.filters { display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
@media (min-width: 560px) and (max-width: 979px) { .filters { grid-template-columns: repeat(3, 1fr); align-items: end; } }

/* Forms */
.field { display: grid; gap: 6px; }
.lbl { font-weight: 600; font-size: .9rem; }
.hint { color: var(--muted); font-size: .84rem; }
input, select, textarea { width: 100%; font: 500 1rem var(--font-body); color: var(--paper-fg); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; min-height: 46px; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); flex: none; margin: 2px 0 0; padding: 0; }
input[type=color] { width: 52px; padding: 3px; }
input[type=file] { padding: 9px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.stack { display: grid; gap: 16px; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; }
.inline-form .field, .inline-form > input { flex: 1 1 200px; }
.inline-form.grow { flex: 1; margin: 0; }
.row3 { display: grid; gap: 16px; }
@media (min-width: 720px) { .row3 { grid-template-columns: repeat(3, 1fr); } }
.color-pair { display: flex; gap: 8px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font: 800 1.15rem/1.2 var(--font-head); font-stretch: 115%; padding: 0; margin-bottom: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 1.2rem; margin-top: 1.2em; }
.panel h2:first-child { margin-top: 0; }
.two-col { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col.wide-left { grid-template-columns: 1.7fr 1fr; } }
.plain { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.devices li { display: grid; }

/* Auth */
.auth { display: grid; place-items: center; padding-top: 48px; }
.auth-card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; right: -10px; top: -10px; width: 70px; height: 88px; background: var(--primary); clip-path: var(--pointer); opacity: .14; transform: rotate(-12deg); }

/* Course page */
.course-hero { position: relative; }
.course-hero::before { overflow: hidden; }
.course-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, var(--line-d) 1.5px, transparent 2px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(90deg, #000, transparent 60%); pointer-events: none; }
.course-hero-grid { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 44px; position: relative; }
@media (min-width: 920px) { .course-hero-grid { grid-template-columns: 1fr 370px; } .buy { margin-bottom: -170px; } }
.crumb { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1em; }
.crumb a { color: var(--accent) !important; text-decoration: none; }
.byline { color: var(--muted-d); }
.course-hero h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.buy { background: var(--card); color: var(--paper-fg); border-radius: 22px; padding: 0 22px 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); position: relative; z-index: 3; align-self: start; overflow: hidden; }
.buy a:not(.btn) { color: var(--primary) !important; }
.buy-cover { margin: 0 -22px 18px; aspect-ratio: 16 / 9; overflow: hidden; }
.buy .price { font: 900 2.4rem/1 var(--font-head); font-stretch: 125%; margin-bottom: .4em; }
.buy .muted { color: var(--muted) !important; }
.owned { font-weight: 700; color: var(--ok); }
.facts { list-style: none; padding: 0; margin: 18px 0 0; }
.facts li { padding: 9px 0 9px 26px; border-top: 1px solid var(--line); font-size: .92rem; position: relative; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 11px; height: 14px; background: var(--primary); clip-path: var(--pointer); }
.course-body { padding-top: 44px; }
.prose-col { max-width: 760px; }
@media (min-width: 920px) { .prose-col { max-width: calc(100% - 410px); } }
.ticks { list-style: none; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .ticks { grid-template-columns: 1fr 1fr; } }
.ticks li { padding: 14px 14px 14px 46px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 16px; top: 17px; width: 16px; height: 20px; background: var(--accent); clip-path: var(--pointer); }
.outline details { border: 1px solid var(--line); background: var(--card); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.outline summary { padding: 14px 18px; font-weight: 700; display: flex; gap: 12px; list-style: none; align-items: center; }
.outline summary::-webkit-details-marker { display: none; }
.outline summary::after { content: "+"; font: 400 1.3rem/1 var(--font-mono); color: var(--accent); transition: transform .3s var(--ease); }
.outline details[open] summary::after { transform: rotate(45deg); }
.outline summary .muted { font-weight: 400; font-size: .86rem; margin-left: auto; }
.outline ul { list-style: none; margin: 0; padding: 0 18px 10px; }
.lesson-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lesson-row .muted { font-size: .84rem; margin-left: auto; }
.lesson-row .muted ~ .muted { margin-left: 14px; min-width: 48px; text-align: right; }
.kind { width: 22px; height: 22px; flex: none; border-radius: 7px; background: color-mix(in srgb, var(--primary) 12%, #fff); position: relative; }
.k-video .kind::after { content: ""; position: absolute; left: 8px; top: 6px; border: 5px solid transparent; border-left: 7px solid var(--primary); border-right: 0; }
.k-text .kind::after { content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 8px; border-top: 2px solid var(--primary); border-bottom: 2px solid var(--primary); }
.k-pdf .kind::after { content: ""; position: absolute; inset: 4px 6px; border: 2px solid var(--primary); border-radius: 2px; }
.k-live .kind::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--accent); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
.k-quiz .kind::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 900 12px/1 var(--font-head); color: var(--primary); }
.teacher-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.teacher-row h3 { margin: 0; }
.teacher-head { display: flex; gap: 22px; align-items: center; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.35rem; }
.prose blockquote { margin: 1em 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 12px 12px 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }

/* Checkout */
.checkout { display: grid; gap: 28px; padding-top: 36px; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1fr 1fr; align-items: start; } }
.co-cover { aspect-ratio: 21 / 9; border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.sums { margin: 0 0 16px; }
.sums div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sums dd { margin: 0; font-weight: 700; }
.sums .total { font: 900 1.4rem/1.2 var(--font-head); font-stretch: 115%; border-bottom: 3px solid var(--primary); }
.methods { display: grid; gap: 10px; margin-bottom: 18px; }
.method { display: flex; gap: 12px; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: all .25s var(--ease); }
.method:hover { border-color: var(--primary); }
.method:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, #fff); }
.method span { display: grid; }
.method small { color: var(--muted); }
.method.dev { border-style: dashed; }
.bank { white-space: pre-wrap; font: 500 .98rem/1.6 var(--font-mono); background: color-mix(in srgb, var(--primary) 7%, #fff); padding: 16px; border-radius: 12px; margin: 0 0 1em; }
.bank.sm { font-size: .8rem; padding: 6px 8px; margin: 0; }

/* Dashboard */
.dash-hero { padding: 40px 0 0; position: relative; overflow: hidden; margin-bottom: 28px; }
.dash-hero-grid { display: grid; gap: 20px; align-items: center; }
@media (min-width: 980px) { .dash-hero-grid { grid-template-columns: 1.3fr auto auto; } }
.dash-hero h1 { margin-bottom: .2em; }
.level-card, .streak-card { background: var(--plum); border: 1px solid var(--line-d); border-radius: 22px; padding: 18px 22px; display: flex; gap: 18px; align-items: center; }
.level-card p { margin: 0; }
.lv-name { font: 900 1.2rem/1.1 var(--font-head); font-stretch: 125%; color: var(--hi); margin-bottom: 4px !important; }
.xp { font-size: .9rem; color: var(--muted-d); }
.xp b { font: 900 1.6rem var(--font-head); font-stretch: 125%; color: var(--fg); }
.streak-card { display: grid; gap: 8px; justify-items: start; }
.streak-card p { margin: 0; color: var(--muted-d); }
.streak-card b { font: 900 1.6rem var(--font-head); font-stretch: 125%; color: var(--fg); margin-right: 4px; }
.flame svg { width: 30px; height: 30px; fill: var(--accent); animation: flicker 1.6s ease-in-out infinite; transform-origin: bottom; }
@keyframes flicker { 50% { transform: scale(1.12, .94) rotate(-3deg); } }
.week { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.week li { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 .66rem var(--font-mono); background: var(--plum-2); color: var(--muted-d); }
.week li.on { background: var(--accent); color: #fff; }
.week li.today { box-shadow: 0 0 0 2px var(--hi); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-top: 22px; padding-bottom: 22px; margin-top: 26px; border-top: 1px solid var(--line-d); }
.mini-stats p { margin: 0; color: var(--muted-d); }
.mini-stats b { font: 900 1.3rem var(--font-head); font-stretch: 125%; color: var(--fg); margin-right: 6px; }
.dash { display: grid; gap: 28px; }
.dash h2:first-child { margin-top: 0; }
@media (min-width: 980px) { .dash { grid-template-columns: 1.6fr 1fr; } }
.continue { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.continue li { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px 12px 12px; transition: transform .4s var(--ease), box-shadow .4s; }
.continue li:hover { box-shadow: 0 24px 40px -28px color-mix(in srgb, var(--ink) 60%, transparent); }
.mini-cover { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.continue h3 { margin-bottom: 4px; }
.continue h3 a { color: var(--paper-fg); text-decoration: none; }
.continue .muted { margin: 0 0 10px; }
@media (max-width: 520px) { .continue li { grid-template-columns: 64px 1fr; } .continue li .ring { display: none; } }
.xp-rules { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.xp-rules li { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; }
.xp-rules b { color: var(--primary); font-family: var(--font-head); font-stretch: 125%; }
.done-list li { display: flex; gap: 10px; align-items: center; }
.tick { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); position: relative; flex: none; }
.tick::after { content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.live-list li { display: flex; gap: 12px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; animation: livepulse 1.6s infinite; }
.notice { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; position: relative; }
.notice .pin { position: absolute; right: 0; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .2); }
.notice h3 { margin: 0 20px 4px 0; font-size: 1rem; }
.notes { list-style: none; padding: 0; display: grid; gap: 8px; }
.notes li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; background: var(--card); border-radius: 14px; border: 1px solid var(--line); }
.notes li.unread { border-left: 4px solid var(--accent); }
.notes p { margin: 4px 0 0; }
.empty { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--r); padding: 32px; text-align: center; }
.empty h3 { margin-bottom: .3em; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width 1s var(--ease); }
.dark .progress { background: var(--line-d); }

/* Progress ring */
.ring { position: relative; width: var(--s); height: var(--s); display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.ring .rt { stroke: var(--line); }
.dark .ring .rt, .level-card .ring .rt, .result .ring .rt { stroke: var(--line-d); }
.ring .rv-c { stroke: var(--primary); animation: ringin 1.4s var(--ease) both .2s; }
.level-card .ring .rv-c, .result.ok .ring .rv-c { stroke: var(--hi); }
.result.bad .ring .rv-c { stroke: var(--accent); }
@keyframes ringin { from { stroke-dasharray: 0 100; } }
.ring-in { font: 900 .9rem/1 var(--font-head); font-stretch: 125%; display: grid; text-align: center; gap: 3px; }
.ring-in b { font-size: calc(var(--s) * .26); line-height: 1; }
.ring-in small { font: 400 .6rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; opacity: .7; }

/* Player */
.player-layout { display: grid; }
@media (min-width: 980px) { .player-layout { grid-template-columns: 330px 1fr; min-height: calc(100vh - 69px); } }
.outline-side { background: var(--ink); color: var(--fg); padding: 20px; }
@media (min-width: 980px) { .outline-side { position: sticky; top: 69px; height: calc(100vh - 69px); overflow-y: auto; scrollbar-width: thin; } }
@media (max-width: 979px) { .outline-side { order: 2; } }
.outline-side .back { font: 800 1.05rem/1.2 var(--font-head); font-stretch: 115%; display: block; margin-bottom: 14px; text-decoration: none; color: var(--fg); }
.outline-side .muted { color: var(--muted-d); }
.outline-side .progress { background: var(--line-d); }
.os-sec h2 { font: 600 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-d); margin: 20px 0 6px; }
.os-sec ol { list-style: none; padding: 0; margin: 0; }
.os-sec a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--fg) !important; font-size: .9rem; transition: background .2s; }
.os-sec a > span:nth-child(2) { display: grid; }
.os-sec a:hover { background: var(--plum); }
.os-sec .kind { background: var(--plum-2); }
.os-sec li.current a { background: var(--primary); }
.os-sec li.current .kind { background: rgba(255, 255, 255, .25); }
.os-sec .k-video .kind::after { border-left-color: var(--fg); }
.os-sec .k-text .kind::after, .os-sec .k-pdf .kind::after { border-color: var(--fg); }
.os-sec .k-quiz .kind::after { color: var(--fg); }
.os-sec li.done .kind { background: var(--ok); }
.os-sec li.done .kind::after { content: ""; position: absolute; inset: auto; left: 8px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; border-radius: 0; transform: rotate(45deg); background: none; animation: none; box-shadow: none; }
.os-sec li.locked a { opacity: .5; }
.os-sec small { color: var(--muted-d); font-size: .78rem; }
.lesson { padding: 28px var(--gutter) 56px; max-width: 1000px; width: 100%; }
.lesson h1 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.player { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .8); }
.player iframe, .player video { width: 100%; height: 100%; border: 0; }
.player.live { aspect-ratio: 4 / 3; }
@media (min-width: 720px) { .player.live { aspect-ratio: 16 / 10; } }
.watermark { position: absolute; left: 8%; top: 12%; pointer-events: none; color: #fff; opacity: .3; font: 600 13px/1 var(--font-mono); text-shadow: 0 1px 2px #000; transition: left 2s, top 2s; user-select: none; }
.lesson-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 30px; }
.kbd-hint { font: 400 .74rem var(--font-mono); color: var(--muted); width: 100%; text-align: center; margin: 4px 0 0; }
.kbd-hint kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: #fff; }
.locked-box { background: var(--card); border: 1.5px dashed var(--primary); border-radius: var(--r); padding: 28px; }
.live-card { background: var(--ink); color: var(--fg); border-radius: var(--r); padding: 24px; margin-bottom: 24px; position: relative; overflow: hidden; }
.live-card .btn.ghost { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-d); }
.live-card .muted { color: var(--muted-d); }
.live-card::before { content: "LIVE"; position: absolute; right: 18px; top: 18px; font: 600 .7rem var(--font-mono); letter-spacing: .12em; background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 99px; animation: livepulse 1.6s infinite; }
.live-card.s-ended::before { content: "ENDED"; background: var(--plum-2); animation: none; }
.countdown { font: 900 clamp(1.4rem, 3vw, 2.2rem)/1.1 var(--font-head); font-stretch: 125%; color: var(--hi); }
.pdfviewer { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.pdf-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); font: 400 .8rem var(--font-mono); }
.pdf-stage { position: relative; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); padding: 14px; display: grid; justify-items: center; }
.pdf-stage canvas { background: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--ink) 18%, transparent); width: 100%; height: auto; max-width: 860px; border-radius: 4px; }
.pdf-stage .watermark { color: var(--ink); text-shadow: none; opacity: .16; }

/* Quiz */
.quiz h1 { margin-bottom: .3em; }
.questions { padding-left: 0; list-style: none; display: grid; gap: 22px; counter-reset: q; }
.q { counter-increment: q; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.q fieldset legend { font: 700 1.12rem/1.4 var(--font-body); margin-bottom: 14px; }
.q fieldset legend::before { content: counter(q) "."; color: var(--primary); font-family: var(--font-head); font-stretch: 125%; margin-right: 8px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: #fff; transition: all .25s var(--ease); }
.opt:hover { border-color: var(--primary); transform: translateX(4px); }
.opt:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); }
.opt:has(input:checked) span { font-weight: 600; }
.opt .key { margin-left: auto; font: 400 .72rem var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.quiz-form.stepped .q { display: none; }
.quiz-form.stepped .q.cur { display: block; animation: qin .45s var(--ease); }
.quiz-form.stepped .q.cur.back { animation-name: qback; }
@keyframes qin { from { opacity: 0; transform: translateX(30px); } }
@keyframes qback { from { opacity: 0; transform: translateX(-30px); } }
.quiz-form.stepped > .btn.lg { display: none; }
.qnav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.qcount { font: 600 .8rem var(--font-mono); color: var(--muted); }
.qbar { display: flex; gap: 6px; margin-bottom: 18px; }
.qbar i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); transition: background .3s; }
.qbar i.ans { background: var(--primary); }
.qbar i.cur { background: var(--accent); }
.timer { position: sticky; top: 80px; z-index: 5; background: var(--ink); color: var(--fg); display: inline-block; padding: 8px 16px; border-radius: 99px; font: 600 .9rem var(--font-mono); }
.timer.low { background: var(--danger); animation: livepulse 1s infinite; }
.result { border-radius: var(--r-lg); padding: 26px; margin: 22px 0; background: var(--ink); color: var(--fg); display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.result h1, .result h2 { margin: 0 0 .3em; }
.result p:last-child { margin-bottom: 0; }
.result.ok { background: linear-gradient(135deg, var(--ink), var(--plum-2)); }
.result.bad { background: var(--plum); }
.result a:not(.btn) { color: var(--hi); }
.review .q { border-left: 5px solid var(--ok); }
.review .q.wrong { border-left-color: var(--danger); }
.review ul { padding-left: 1.2em; }
.quiz-intro .facts { margin-bottom: 18px; }

/* Teaching & admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; }
.tabs a { padding: 11px 15px; text-decoration: none; color: var(--paper-fg); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; transition: border-color .2s; }
.tabs a:hover { border-color: var(--line); }
.tabs a[aria-current] { border-color: var(--primary); color: var(--primary); }
.tabs a:last-child { margin-left: auto; font-weight: 400; color: var(--primary); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: transform .3s var(--ease); }
.stat:hover { transform: translateY(-3px); }
.stat span { font: 600 .7rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat strong { font: 900 clamp(1.5rem, 2.4vw, 2rem)/1 var(--font-head); font-stretch: 125%; color: var(--paper-fg); }
.stat:first-child { background: var(--primary); border-color: var(--primary); }
.stat:first-child span, .stat:first-child strong { color: #fff; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .7rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, #fff); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.neg { color: var(--danger); }
tr.off td { opacity: .45; }
.w-progress { min-width: 150px; }
.w-progress .progress { display: inline-block; width: 84px; vertical-align: middle; }
.builder .sec { padding: 16px; }
.builder .sec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; max-width: none; }
.builder .sec-head input { font-weight: 700; }
.lesson-list { list-style: none; padding: 0; margin: 0 0 12px; }
.lesson-list li { display: flex; gap: 10px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lesson-list .muted { font-size: .84rem; }
.li-actions { margin-left: auto; display: flex; gap: 6px; }
.add-lesson { margin: 0; }
.add-lesson select { flex: 0 1 170px; }
.answers { display: grid; gap: 8px; }
.ans { display: flex; gap: 10px; align-items: center; }
.qbank { list-style: none; padding: 0; display: grid; gap: 6px; }
.qbank li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.danger summary { color: var(--danger); font-weight: 700; margin-top: 12px; }
.danger-zone { margin-top: 12px; }
.admin { display: grid; gap: 26px; padding-top: 28px; }
@media (min-width: 980px) { .admin { grid-template-columns: 210px 1fr; align-items: start; } .admin-nav { position: sticky; top: 90px; } }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; background: var(--ink); padding: 8px; border-radius: var(--r); }
@media (min-width: 980px) { .admin-nav { flex-direction: column; } }
.admin-nav a { padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--muted-d); font-weight: 600; white-space: nowrap; transition: all .2s; }
.admin-nav a:hover { color: var(--fg); background: var(--plum); }
.admin-nav a[aria-current] { background: var(--primary); color: #fff; }
.admin-main { min-width: 0; }
.todo { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.todo a { background: var(--hi); color: var(--ink); padding: 10px 16px; border-radius: 99px; font-weight: 700; text-decoration: none; animation: pop .5s var(--spring); }
.chart { margin: 0 0 20px; }
.chart figcaption { font-weight: 700; margin-bottom: 10px; }
.chart svg rect { fill: var(--primary); transform-origin: bottom; transform-box: fill-box; animation: barup .9s var(--ease) both; }
.chart svg rect:hover { fill: var(--accent); }
@keyframes barup { from { transform: scaleY(0); } }
.chart svg .axis { stroke: var(--line); }
.chart svg text { font: 11px var(--font-mono); fill: var(--muted); }
.settings fieldset .row3 + .row3, .settings fieldset .row3 + .field, .settings fieldset .field + .row3 { margin-top: 14px; }

/* Certificate */
.cert-page { padding: 28px var(--gutter); background: var(--ink); min-height: 100vh; }
.cert-actions { display: flex; justify-content: space-between; max-width: 1000px; margin: 0 auto 18px; }
.cert-actions .btn.ghost { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--line-d); }
.certificate { max-width: 1000px; margin: 0 auto; background: #fff; color: var(--paper-fg); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); aspect-ratio: 1.414; display: flex; flex-direction: column; position: relative; overflow: hidden; border-radius: 6px; }
.certificate::before { content: ""; position: absolute; right: -4%; bottom: -8%; width: 34%; aspect-ratio: .8; background: var(--primary); clip-path: var(--pointer); opacity: .08; }
.cert-band { height: 3.2%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.cert-band.b { background: var(--ink); }
.cert-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3% 8%; position: relative; }
.cert-org { color: var(--muted); margin-top: .8em; font: 600 clamp(.6rem, 1.2vw, .8rem) var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.cert-small { margin: .4em 0; color: var(--muted); }
.cert-name { font-size: clamp(1.7rem, 5.4vw, 3.8rem); margin: .1em 0 .2em; padding: 0 .1em .05em; background: linear-gradient(transparent 80%, color-mix(in srgb, var(--accent) 35%, transparent) 80%); }
.cert-course { font-size: clamp(1.1rem, 3vw, 2rem); color: var(--primary); margin: .2em 0 .8em; }
.cert-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; width: 100%; margin-top: auto; font-size: clamp(.6rem, 1.4vw, .9rem); }
.cert-foot div { display: grid; border-top: 1.5px solid var(--paper-fg); padding-top: 6px; }
.cert-foot span { color: var(--muted); font-family: var(--font-mono); font-size: .85em; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  .no-print, .site-head, .site-foot, .sitebar, .consent, .toasts, .wipe, .confetti { display: none !important; }
  .cert-page { padding: 0; background: #fff; }
  .certificate { box-shadow: none; max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Holding page, errors, footer */
.holding { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; position: relative; overflow: hidden; }
.holding canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.holding-in { position: relative; display: grid; gap: 6px; justify-items: center; }
.holding .lg.big { color: var(--fg); }
.holding h1 { font-size: clamp(2.4rem, 7vw, 5.6rem); max-width: 14ch; margin: .4em auto .2em; }
.holding .lede { margin: 0 auto 1em; }
.error-page { padding-top: 72px; }
.site-foot { background: var(--ink); color: var(--muted-d); padding: 56px 0 40px; border-top: 1px solid var(--line-d); }
.site-foot a { color: var(--fg); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .muted { color: var(--muted-d); }
.foot-logo { margin-bottom: 14px; }
.foot-row { display: grid; gap: 28px; }
@media (min-width: 720px) { .foot-row { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot nav { display: grid; gap: 9px; align-content: start; }
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 560px; margin: 0 auto; background: var(--plum); color: var(--fg); border: 1px solid var(--line-d); border-radius: 18px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .5); animation: slide .6s var(--spring) .8s both; }
.consent p { margin: 0; font-size: .9rem; }
.consent a { color: var(--hi); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }

/* Confetti & XP burst */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; width: 100vw; height: 100vh; }
.xp-burst { position: fixed; z-index: 96; pointer-events: none; font: 900 1.6rem var(--font-head); font-stretch: 125%; color: var(--hi); -webkit-text-stroke: 1px var(--ink); animation: burst 1.4s var(--ease) forwards; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -20px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -110px) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; transform: none; }
}

/* ===================== Phase 2: projects, critique, showcase, studio ===================== */
.k-project .kind::after { content: ""; position: absolute; inset: 5px; border-radius: 3px; background: linear-gradient(135deg, var(--primary) 50%, var(--accent) 50%); }

/* Brief */
.brief { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.brief-head { background: var(--ink); color: var(--fg); padding: 18px 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.brief-head .eyebrow { color: var(--accent); margin: 0; }
.brief-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-due { font: 600 .72rem var(--font-mono); padding: 5px 10px; border-radius: 99px; background: var(--plum-2); color: var(--fg); }
.chip-due.late { background: var(--danger); }
.brief .prose { padding: 20px 22px 6px; }

/* Submit with drag and drop */
.submit-form h2 { margin-top: 0; }
.drop { position: relative; display: grid; gap: 12px; border: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent); border-radius: var(--r); padding: 26px; text-align: center; background: color-mix(in srgb, var(--primary) 4%, #fff); transition: all .25s var(--ease); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: var(--cur-hand); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); transform: scale(1.01); }
.drop-in b { display: block; font: 800 1.1rem var(--font-head); font-stretch: 115%; color: var(--paper-fg); }
.drop-in { color: var(--muted); font-size: .9rem; }
.previews { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.previews:empty { display: none; }
.previews figure { margin: 0; width: 88px; display: grid; gap: 4px; animation: popin .4s var(--spring) both; }
.previews img, .previews .pv-pdf { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--ink); color: var(--fg); display: grid; place-items: center; font: 700 .8rem var(--font-mono); }
.previews figcaption { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.previews .bad { outline: 2px solid var(--danger); border-radius: 10px; }

/* Submissions and critique */
.subs { display: grid; gap: 16px; }
.sub { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; border-left: 5px solid #F2B632; }
.sub.s-approved { border-left-color: var(--ok); }
.sub.s-revise { border-left-color: var(--danger); }
.sub header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.thumb { display: block; width: 110px; height: 110px; border-radius: 12px; overflow: hidden; background: var(--ink); transition: transform .3s var(--spring); }
.thumb:hover { transform: scale(1.04) rotate(-1deg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.pdf { display: grid; place-content: center; text-align: center; color: var(--fg); text-decoration: none; padding: 8px; }
.thumb.pdf span { font: 900 1.2rem var(--font-head); color: var(--hi); }
.thumb.pdf small { font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 94px; }
.gallery { display: grid; gap: 14px; margin-bottom: 22px; }
.gallery .thumb { width: 100%; height: auto; background: transparent; border-radius: var(--r); box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--ink) 70%, transparent); }
.gallery .thumb img { height: auto; object-fit: contain; background: #fff; }
.gallery .thumb.pdf { background: var(--ink); min-height: 160px; }
.gallery .thumb:hover { transform: none; }
.crit { background: color-mix(in srgb, var(--primary) 6%, #fff); border-radius: 14px; padding: 14px 16px; margin: 10px 0; position: relative; }
.crit::before { content: ""; position: absolute; left: 16px; top: -8px; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); }
.crit-label { font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--primary); display: block; margin-bottom: 6px; }
.crit-label b { color: var(--paper-fg); font-family: var(--font-head); font-stretch: 125%; font-size: 1rem; margin-left: 6px; }
.publish { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

/* Review queue */
.review-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.review-card { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--paper-fg); transition: transform .4s var(--ease), box-shadow .4s; }
.review-card:hover { box-shadow: 0 26px 46px -28px color-mix(in srgb, var(--ink) 70%, transparent); }
.rc-art { aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink); }
.rc-art img { width: 100%; height: 100%; object-fit: cover; }
.rc-body { padding: 14px 16px; display: grid; gap: 2px; }
.rc-body small { color: var(--muted); }
.review-layout { display: grid; gap: 26px; }
@media (min-width: 980px) { .review-layout { grid-template-columns: 1fr 380px; align-items: start; } .review-layout aside { position: sticky; top: 88px; } }
.decision { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dec { display: flex; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; transition: all .2s; }
.dec span { display: grid; }
.dec small { color: var(--muted); font-size: .78rem; }
.dec.ok:has(input:checked) { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, #fff); }
.dec.rev:has(input:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, #fff); }
input[type=range] { padding: 0; min-height: 0; height: 28px; accent-color: var(--primary); border: 0; box-shadow: none; }
output { font: 900 1.2rem var(--font-head); font-stretch: 125%; color: var(--primary); }

/* Showcase */
.showcase-hero, .studio-hero { padding: 48px 0 28px; margin-bottom: 32px; }
.showcase-hero h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
.showcase-hero .fchip, .studio-hero .fchip { background: transparent; color: var(--fg); border-color: var(--line-d); }
.showcase-hero .fchip[aria-pressed="true"], .studio-hero .fchip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); }
.masonry { columns: 3 280px; column-gap: 18px; }
.piece { break-inside: avoid; margin: 0 0 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; animation: popin .6s var(--spring) both; }
.piece-art { display: block; overflow: hidden; background: var(--ink); }
.piece-art img { width: 100%; height: auto; transition: transform .8s var(--ease); }
.piece-art .adire { aspect-ratio: 4 / 3; }
.piece:hover .piece-art img { transform: scale(1.04); }
.piece-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.piece-meta > div { display: grid; min-width: 0; }
.piece-meta a { color: var(--paper-fg); text-decoration: none; }
.piece-meta .by { font-size: .85rem; color: var(--muted); }
.feat { position: absolute; left: 12px; top: 12px; background: var(--hi); color: var(--ink); font: 600 .68rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; }
.piece.featured { border-color: var(--hi); box-shadow: 0 0 0 2px var(--hi); }
.heart { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; color: var(--paper-fg); border-radius: 99px; padding: 6px 12px; font: 700 .85rem var(--font-body); text-decoration: none; transition: all .25s var(--spring); }
.heart svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; transition: transform .3s var(--spring); }
.heart:hover svg { transform: scale(1.2); }
.heart[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.heart[aria-pressed="true"] svg { fill: #fff; stroke: #fff; }
.heart.pop svg { animation: heartpop .5s var(--spring); }
@keyframes heartpop { 30% { transform: scale(1.6); } }
.heart.lg { padding: 10px 18px; font-size: 1rem; }
.heart.lg svg { width: 24px; height: 24px; }
.piece-byline { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.piece-byline .like-big, .piece-byline > .heart { margin-left: auto; }

/* Portfolio */
.portfolio-hero { padding: 48px 0; margin-bottom: 28px; }
.pf-grid { display: grid; gap: 22px; align-items: center; grid-template-columns: auto 1fr auto; }
@media (max-width: 720px) { .pf-grid { grid-template-columns: auto 1fr; } .pf-grid .ring { display: none; } }
.pf-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted-d); margin: 0; }
.pf-stats b { font: 900 1.2rem var(--font-head); font-stretch: 125%; color: var(--fg); margin-right: 4px; }
.pf-stats .lv { color: var(--hi); font-weight: 700; }
.portfolio-hero .ring .rt { stroke: var(--line-d); }
.portfolio-hero .ring .rv-c { stroke: var(--hi); }

/* Studio */
.threads { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.thread { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: transform .25s var(--ease), border-color .25s; }
.thread:hover { transform: translateX(4px); border-color: var(--primary); }
.thread > div { display: grid; min-width: 0; }
.thread a { color: var(--paper-fg); text-decoration: none; }
.thread.pinned { border-color: var(--hi); }
.thread .avatar.sm { box-shadow: none; }
.t-count { min-width: 38px; height: 30px; border-radius: 99px; background: var(--paper); display: inline-flex; gap: 4px; align-items: center; justify-content: center; font: 700 .85rem var(--font-mono); padding: 0 10px; }
.t-count.ok { background: var(--ok); color: #fff; }
.t-count svg { width: 14px; height: 14px; }
.lesson-studio { margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--line); }
.ask-box summary { list-style: none; display: inline-flex; }
.ask-box summary::-webkit-details-marker { display: none; }
.ask-box[open] summary { margin-bottom: 14px; }
.post { display: grid; grid-template-columns: auto 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 12px; }
.post.op { border-color: var(--primary); }
.post.answer { border: 2px solid var(--ok); }
.post-by { margin: 0 0 6px; }
.answer-flag { font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin: 0 0 6px; }
.studio-link { display: grid; margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; background: var(--plum); color: var(--fg) !important; text-decoration: none; border: 1px solid var(--line-d); transition: border-color .2s; }
.studio-link:hover { border-color: var(--accent); }
.studio-link span { font-weight: 700; }
.studio-link small { color: var(--muted-d); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 85; background: color-mix(in srgb, var(--ink) 92%, transparent); display: grid; place-items: center; padding: 24px; animation: fadein .25s forwards; opacity: 0; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: popin .35s var(--spring); }
.lightbox button { position: absolute; top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-d); background: var(--plum); color: var(--fg); font-size: 1.4rem; }
.thread-page h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
@media (max-width: 640px) { .showcase-hero .filter-chips, .studio-hero .filter-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); scrollbar-width: none; } .fchip { white-space: nowrap; } }

/* ===================== Phase 3: pass, points, instalments, referrals, bookings, chat ===================== */
.points-toggle, .pass-promo { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); text-decoration: none; color: var(--paper-fg); margin-top: 12px; transition: all .25s var(--ease); }
.points-toggle span:last-child, .pass-promo span:last-child { display: grid; }
.points-toggle small, .pass-promo small { color: var(--muted); }
.points-toggle:hover, .pass-promo:hover { border-color: var(--primary); transform: translateY(-2px); }
.sw { width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .25s; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.points-toggle.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, #fff); }
.points-toggle.on .sw { background: var(--primary); }
.points-toggle.on .sw::after { transform: translateX(18px); }
.pass-promo { background: var(--ink); color: var(--fg); border-color: var(--ink); }
.pass-promo small { color: var(--muted-d); }
.burst { width: 34px; height: 34px; flex: none; background: var(--hi); clip-path: polygon(50% 0, 61% 32%, 95% 20%, 72% 48%, 100% 70%, 64% 68%, 58% 100%, 45% 72%, 12% 92%, 30% 60%, 0 42%, 34% 36%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pass-mini { display: block; text-align: center; margin-top: 10px; font-size: .88rem; }
.plan-hint { text-align: center; margin: -6px 0 10px; }

.pass-hero { padding: 56px 0 48px; overflow: hidden; }
.pass-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .pass-grid { grid-template-columns: 1.2fr .8fr; } }
.pass-hero h1 { font-size: clamp(2.6rem, 6.6vw, 5.4rem); }
.pass-active { background: var(--plum); border: 1px solid var(--line-d); border-radius: 14px; padding: 12px 16px; display: inline-block; }
.pass-card { aspect-ratio: 1.586; border-radius: 22px; padding: 24px; display: grid; align-content: space-between; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, var(--accent), transparent 55%), linear-gradient(135deg, var(--primary), var(--plum)); box-shadow: 0 40px 70px -30px color-mix(in srgb, var(--primary) 70%, transparent); transition: transform .5s var(--ease); }
.pass-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .5) 0 1.5px, transparent 2px) 0 0/12px 12px; opacity: .5; }
.pass-card .lg { color: #fff; border-color: #fff; font-size: 18px; width: max-content; }
.pass-card .lg svg path { fill: #fff; stroke: #fff; }
.pass-word { font: 900 clamp(2.4rem, 6vw, 3.6rem)/1 var(--font-head); font-stretch: 125%; letter-spacing: .08em; }
.pass-name { font: 600 .9rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.pass-plans { padding-top: 36px; }
.plan-pick { display: grid; gap: 14px; max-width: 640px; grid-template-columns: 1fr 1fr; }
.plan-pick > :not(.plan-opt) { grid-column: 1 / -1; }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; }
.plan-opt > span { display: grid; gap: 4px; padding: 20px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); transition: all .25s var(--spring); }
.plan-opt b { font: 600 .74rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.plan-opt strong { font: 900 2rem/1 var(--font-head); font-stretch: 125%; }
.plan-opt small { color: var(--muted); }
.plan-opt.best small { color: var(--ok); font-weight: 700; }
.plan-opt input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, #fff); transform: scale(1.02); }
.plan-opt input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.pass-list { list-style: none; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.pass-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.pass-list span { color: var(--muted); text-decoration: line-through; }

.plans-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.plan-card h2 { margin-top: 0; font-size: 1.2rem; }
.plan-dots { display: flex; gap: 8px; margin: 10px 0 14px; }
.plan-dots span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem var(--font-mono); background: var(--paper); border: 1.5px dashed var(--line); }
.plan-dots span.paid { background: var(--primary); color: #fff; border: 0; }

.ref-hero { padding: 48px 0 40px; margin-bottom: 28px; }
.ref-hero h1 { font-size: clamp(2.2rem, 5.4vw, 4.2rem); }
.ref-link { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; margin-top: 20px; }
.ref-link input { flex: 1 1 280px; background: var(--plum); color: var(--fg); border-color: var(--line-d); font-family: var(--font-mono); font-size: .9rem; }

.booking { display: grid; gap: 24px; }
@media (min-width: 980px) { .booking { grid-template-columns: 1fr 340px; align-items: start; } .book-side { position: sticky; top: 88px; } }
.days { display: grid; gap: 14px; }
.day legend { font: 600 .74rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; }
.slot > span { display: grid; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); transition: all .2s var(--spring); }
.slot b { font: 800 1.05rem var(--font-head); font-stretch: 115%; }
.slot small { color: var(--muted); font-size: .76rem; }
.slot:hover > span { border-color: var(--primary); }
.slot input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.04); }
.slot input:checked + span small { color: rgba(255, 255, 255, .85); }
.slot input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.chat { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding-top: 24px; min-height: calc(100vh - 200px); }
.chat-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-head > div { display: grid; }
.chat-head .btn { margin-left: auto; }
.msgs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 60vh; scroll-behavior: smooth; }
.msg { max-width: 78%; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 10px 14px; animation: popin .35s var(--spring); }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { display: block; font: 400 .68rem var(--font-mono); color: var(--muted); margin-top: 4px; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 18px 18px 4px 18px; }
.msg.me time { color: rgba(255, 255, 255, .75); }
.msg-empty { text-align: center; padding: 20px; }
.chat-form { display: flex; gap: 8px; align-items: end; position: sticky; bottom: 0; background: var(--paper); padding: 10px 0; }
.chat-form textarea { min-height: 48px; }

.google { gap: 10px; background: #fff !important; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lang-switch { display: inline-flex; gap: 4px; }
.lang-switch a, .lang-switch button { font: 600 .72rem var(--font-mono); letter-spacing: .08em; padding: 5px 9px; border-radius: 99px; text-decoration: none; color: var(--muted-d); border: 1px solid var(--line-d); background: none; }
.lang-switch [aria-current] { background: var(--fg); color: var(--ink); }

/* ---------- Phase 4: billing, phone login, workshops, teams, analytics ---------- */
.menu-label { font: 600 .62rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d); padding: 10px 12px 2px; border-top: 1px solid var(--line-d); margin-top: 4px; }
.tag.hot { color: var(--accent); }
.check.autopay { background: color-mix(in srgb, var(--primary) 7%, var(--card)); border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0; }
.check.autopay span { display: grid; gap: 2px; } .check.autopay small { color: var(--muted); font-size: .82rem; }
.check.autopay[hidden] { display: none; }
.billing-list li { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.billing-list li:last-child { border-bottom: 0; }
.billing-list .inline-form { margin: 0; align-items: center; }
.billing-list select, .panel .inline-form select { width: auto; min-width: 0; }
.saved-card { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.saved-card > div { flex: 1; }
.chip-card { width: 46px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, var(--primary), var(--accent)); position: relative; flex: none; box-shadow: 0 6px 14px -8px var(--primary); }
.chip-card::after { content: ""; position: absolute; left: 8px; top: 10px; width: 11px; height: 9px; border-radius: 2px; background: var(--hi); }
.btn.sm { padding: 7px 12px; font-size: .85rem; }

/* Phone login */
.phone-btn svg, .google svg { flex: none; }
.btn.block.ghost.phone-btn { margin-top: 10px; }
input.otp { font: 700 1.8rem/1 var(--font-mono); letter-spacing: .45em; text-align: center; padding: 14px 10px 14px calc(10px + .45em); }
.confirm-phone { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--hi) 35%, var(--card)); border-radius: var(--r-sm); padding: 12px 14px; margin: 16px 0; }
.confirm-phone p { margin: 0; }

/* Workshops */
.ws-hero, .org-hero { padding: 56px 0 46px; }
.ws-list { display: grid; gap: 16px; padding: 28px 0 40px; }
@media (min-width: 900px) { .ws-list { grid-template-columns: 1fr 1fr; } }
.ws-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; text-decoration: none; color: inherit; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.ws-card:hover { box-shadow: 0 24px 40px -28px color-mix(in srgb, var(--primary) 70%, transparent); }
.ws-card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.ws-body p { margin: 0 0 8px; }
.ws-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-price { font: 800 1.05rem var(--font-head); font-stretch: 125%; white-space: nowrap; }
.ws-price.big { font-size: 1.8rem; margin: 0 0 10px; }
.date-chip { display: grid; place-items: center; width: 64px; padding: 8px 0 6px; border-radius: 14px; background: var(--ink); color: var(--fg); line-height: 1; position: relative; overflow: hidden; }
.date-chip::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.date-chip b { font: 900 1.6rem var(--font-head); font-stretch: 125%; margin-top: 4px; }
.date-chip span { font: 600 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--hi); margin-top: 3px; }
.date-chip small { font: .62rem var(--font-mono); color: var(--muted-d); margin-top: 3px; text-transform: uppercase; }
.seat-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.seat-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.ws-detail { padding-top: 30px; }
.ws-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.ws-head h1 { margin: 0 0 4px; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.ws-box { position: sticky; top: 90px; }
.teacher-line { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; margin: 22px 0; }
.plain-ol { padding-left: 1.2em; } .plain-ol li { padding: 4px 0; }
.grid-3 { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Teams */
.org-points { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 22px; }
.org-points li { padding-left: 24px; position: relative; color: var(--muted-d); }
.org-points li::before { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 13px; background: var(--hi); clip-path: var(--pointer); }
.org-points b { color: var(--fg); }
.org-head { padding: 40px 0 26px; }
.org-head h1 { margin-bottom: 8px; }
.stat-row.on-dark .stat { background: var(--plum); border-color: var(--line-d); }
.stat-row.on-dark .stat span { color: var(--muted-d); } .stat-row.on-dark .stat strong { color: var(--fg); }
.org-grid { padding-top: 26px; }
.pick-people { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-height: 260px; overflow: auto; }
.pick-people legend { font: 600 .74rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 6px; }
.ref-link.light input { background: var(--paper); color: var(--paper-fg); border-color: var(--line); }
.people li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.people li > div { flex: 1; }
.person-menu { position: relative; }
.person-menu summary { list-style: none; cursor: pointer; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.person-menu summary::-webkit-details-marker { display: none; }
.person-menu > div { position: absolute; right: 0; top: 100%; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; box-shadow: 0 16px 30px -18px rgba(0,0,0,.4); white-space: nowrap; display: grid; gap: 6px; }
.seat-total { font: 700 1.1rem var(--font-head); font-stretch: 110%; min-height: 1.4em; margin: 0; }
.seat-total small { font: .8rem var(--font-body); color: var(--ok); display: block; }
.report td { min-width: 110px; }
.org-mine li { display: grid; gap: 6px; }

/* Analytics: thin single-hue marks, recessive grid, values in text ink */
.analytics { padding-bottom: 40px; }
.an-fig { margin: 0 0 20px; }
.an-fig figcaption h2 { margin: 0; }
.an-weeks { width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.an-weeks .bar { fill: var(--primary); }
.an-weeks .an-col:hover .bar, .an-weeks .an-col:focus .bar { fill: var(--accent); }
.an-weeks .hit { fill: transparent; }
.an-weeks .an-col { outline: none; }
.an-axis { stroke: var(--line); stroke-width: 1; } .an-grid { stroke: var(--line); stroke-dasharray: 2 4; }
.an-tick { font: 10px var(--font-mono); fill: var(--muted); }
.an-src li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; }
.an-src b { font-variant-numeric: tabular-nums; }
.an-mini { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.an-mini i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.an-callout { background: color-mix(in srgb, var(--hi) 40%, var(--card)); border-radius: var(--r-sm); padding: 12px 14px; }
.funnel td, .items td { vertical-align: middle; }
.bar-col { width: 36%; min-width: 160px; }
.hbar { display: inline-block; vertical-align: middle; width: calc(100% - 52px); height: 8px; background: color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 99px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .9s var(--ease) both; }
.hbar.low i { background: var(--danger); }
.hbar-val { display: inline-block; width: 46px; text-align: right; font: 600 .82rem var(--font-mono); font-variant-numeric: tabular-nums; color: var(--paper-fg); }
.funnel tr.worst td { background: color-mix(in srgb, var(--hi) 22%, transparent); }
.stat small { color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .seat-bar span, .hbar i { animation: none; } }

/* Mobile fit: grid children may shrink, wide tables scroll inside their panel */
.two-col > *, .stack > *, .plan-pick > * { min-width: 0; }
@media (max-width: 719px) {
  .panel table { display: block; overflow-x: auto; }
  .plan-opt strong { font-size: clamp(1.3rem, 6.4vw, 2rem); }
  .plan-opt > span { padding: 16px; }
}
@media (max-width: 420px) {
  .head-row { gap: 8px; }
  .head-actions { gap: 4px; }
  .head-actions .btn.sm { padding: 6px 9px; font-size: .8rem; }
  .lang-switch a { padding: 4px 6px; }
}
.ws-tags .tag, .tag { white-space: nowrap; }
@media (max-width: 420px) { .nav-toggle { width: 40px; height: 40px; } }
.ws-card { grid-template-columns: auto minmax(0, 1fr) auto; min-width: 0; }
@media (max-width: 480px) { .ws-card { gap: 12px; padding: 14px; } .ws-tags .tag { white-space: normal; } }
