/* PyWorld Academy — site styles
   © 2026 Nika Tsitskishvili / PyWorld Academy. CC BY-NC 4.0 */

:root {
  --paper: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eaf0f7;
  --ink: #13233f;
  --ink-soft: #4a5b78;
  --line: #d5deea;
  --blue: #306998;
  --blue-strong: #24527a;
  --blue-tint: #e3edf7;
  --yellow: #ffd43b;
  --yellow-ink: #3b2f00;
  --green: #1e7f4f;
  --green-bright: #2ea86b;
  --green-tint: #e2f4ea;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --code-bg: #13233f;
  --code-ink: #e6edf7;
  --shadow: 0 1px 2px rgba(19, 35, 63, .06), 0 8px 24px -12px rgba(19, 35, 63, .18);

  --font: "Bricolage Grotesque", "Noto Sans Georgian", system-ui, sans-serif;
  --font-ka: "Noto Sans Georgian", "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --wrap: 1140px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1a30;
    --surface: #15253f;
    --surface-2: #1b2e4d;
    --ink: #e8eef7;
    --ink-soft: #a9b8cf;
    --line: #2a3f62;
    --blue: #6fa8e0;
    --blue-strong: #9cc4ec;
    --blue-tint: #1b3354;
    --green: #5fd49a;
    --green-bright: #4cd18a;
    --green-tint: #16392c;
    --danger: #ff8a80;
    --danger-tint: #3a1d22;
    --code-bg: #0a1426;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1a30;
  --surface: #15253f;
  --surface-2: #1b2e4d;
  --ink: #e8eef7;
  --ink-soft: #a9b8cf;
  --line: #2a3f62;
  --blue: #6fa8e0;
  --blue-strong: #9cc4ec;
  --blue-tint: #1b3354;
  --green: #5fd49a;
  --green-bright: #4cd18a;
  --green-tint: #16392c;
  --danger: #ff8a80;
  --danger-tint: #3a1d22;
  --code-bg: #0a1426;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[lang="ka"] body { font-family: var(--font-ka); font-size: 1rem; }
main { flex: 1; }

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--blue-strong); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 750; }
html[lang="ka"] h1, html[lang="ka"] h2, html[lang="ka"] h3 { letter-spacing: 0; font-weight: 700; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; letter-spacing: -.035em; }
html[lang="ka"] h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.2; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 36em; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section-head { max-width: 40em; margin-bottom: 36px; }
.section-head p { color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--yellow); color: var(--yellow-ink); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1;
  padding: .9em 1.35em; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0e1a30; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0e1a30; } }
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); }
.btn-yellow:hover { background: #ffcb05; color: var(--yellow-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-green { background: var(--green-bright); color: #06281a; }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-sm { padding: .6em 1em; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; color: var(--ink-soft); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; font-size: .98rem; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--blue-tint); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--blue); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-switch button { border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 700; font-size: .85rem; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.menu-btn { display: none; }

@media (max-width: 1020px) {
  .menu-btn { display: inline-grid; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .header-tools .portal-link { display: none; }
  .nav .portal-link-mobile { display: block; }
}
.nav .portal-link-mobile { display: none; }
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0 28px; color: var(--ink-soft); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { color: var(--ink); font-size: 1rem; margin-bottom: .7em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--blue); text-decoration: underline; }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Home hero ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { max-width: 11em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; padding: 0; list-style: none; color: var(--ink-soft); font-size: .95rem; }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 36px; } }

/* Editor (signature element) */
.editor { background: var(--code-bg); border-radius: var(--r-lg); box-shadow: 0 30px 60px -30px rgba(19, 35, 63, .55); overflow: hidden; color: var(--code-ink); border: 1px solid rgba(255,255,255,.06); }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); font-family: var(--mono); font-size: .8rem; color: #93a4c0; }
.editor-bar .dots { display: flex; gap: 6px; }
.editor-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2c3e5f; display: block; }
.editor-bar .file { margin-right: auto; }
.run-btn { font-family: var(--font); font-weight: 700; font-size: .82rem; background: var(--yellow); color: var(--yellow-ink); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.run-btn svg { width: 12px; height: 12px; }
.editor-body { display: grid; grid-template-columns: 1.3fr 1fr; min-height: 310px; }
.i18n-wait body { visibility: hidden; }
.editor-code { margin: 0; padding: 18px 14px 18px 6px; font-size: .78rem; line-height: 1.75; overflow: auto; counter-reset: ln; }
.editor-code .ln { display: block; padding-left: 2.6em; position: relative; white-space: pre; }
.editor-code .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 1.8em; text-align: right; color: #4d6080; }
.editor-code .ln.active { background: rgba(255, 212, 59, .1); }
.tok-k { color: #ff9ecb; } .tok-f { color: #8fd3ff; } .tok-n { color: #ffd43b; } .tok-s { color: #9ee6a8; } .tok-c { color: #6c7f9f; font-style: italic; }
.editor-canvas { background: #0f1d36; border-left: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; position: relative; }
.editor-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.editor-out { font-family: var(--mono); font-size: .78rem; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.08); color: #9ee6a8; min-height: 2.6em; }
@media (max-width: 560px) { .editor-body { grid-template-columns: 1fr; } .editor-canvas { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); height: 260px; } }

/* ---------- Learning path ---------- */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 24px; right: 24px; top: 27px; height: 4px; background: repeating-linear-gradient(90deg, var(--blue) 0 14px, transparent 14px 22px); opacity: .5; }
.path-step { position: relative; padding: 0 18px 0 0; }
.path-dot { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); display: grid; place-items: center; font-size: 1.6rem; position: relative; z-index: 1; margin-bottom: 18px; }
.path-step.soon .path-dot { border-style: dashed; border-color: var(--line); }
.path-step h3 { margin-bottom: .3em; }
.path-step h3 a { color: var(--ink); text-decoration: none; }
.path-step h3 a:hover { color: var(--blue); text-decoration: underline; }
.path-meta { font-size: .9rem; color: var(--ink-soft); margin-bottom: .6em; }
.path-step p { font-size: .98rem; color: var(--ink-soft); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--green-tint); color: var(--green); }
.tag.soon { background: var(--surface-2); color: var(--ink-soft); }
@media (max-width: 900px) {
  .path { grid-template-columns: 1fr; gap: 28px; }
  .path::before { left: 27px; right: auto; top: 20px; bottom: 20px; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--blue) 0 14px, transparent 14px 22px); }
  .path-step { display: grid; grid-template-columns: 58px 1fr; gap: 0 18px; padding: 0; }
  .path-dot { margin: 0; grid-row: span 4; }
}

/* ---------- How classes work ---------- */
.how { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 48px; }
.how-item { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.how-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.how-icon svg { width: 24px; height: 24px; }
.how-item h3 { font-size: 1.15rem; margin-bottom: .25em; }
.how-item p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 720px) { .how-grid { grid-template-columns: 1fr; } }

/* ---------- Showcase (portfolio) ---------- */
.showcase { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.shot { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); text-decoration: none; color: #fff; grid-column: span 4; aspect-ratio: 4 / 3; display: block; }
.shot.wide { grid-column: span 8; aspect-ratio: auto; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.shot:hover img { transform: scale(1.04); }
.shot-cap { position: absolute; inset: auto 0 0 0; padding: 40px 18px 16px; background: linear-gradient(transparent, rgba(10, 20, 38, .9)); }
.shot-cap strong { display: block; font-size: 1.15rem; }
.shot-cap span { font-size: .88rem; opacity: .85; }
@media (max-width: 900px) { .shot, .shot.wide { grid-column: span 6; aspect-ratio: 4 / 3; } }
@media (max-width: 560px) { .shot, .shot.wide { grid-column: span 12; } }

/* ---------- Portfolio page ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: inherit; font-weight: 600; font-size: .92rem; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.project-img { aspect-ratio: 16 / 10; background: var(--surface-2); }
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.project-body .by { font-size: .9rem; color: var(--ink-soft); margin-bottom: .6em; }
.project-body p { color: var(--ink-soft); font-size: .98rem; flex: 1; }
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Courses page ---------- */
.age-finder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 34px; }
.age-finder label { font-weight: 700; }
.age-finder input[type="range"] { flex: 1; min-width: 180px; accent-color: var(--blue); }
.age-finder output { font-weight: 800; font-size: 1.3rem; min-width: 2ch; color: var(--blue); }
.age-finder .hint { flex-basis: 100%; margin: 0; color: var(--ink-soft); font-size: .95rem; }
.course-list { display: grid; gap: 22px; }
.course-row { display: grid; grid-template-columns: 76px 1fr 260px; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; transition: opacity .2s, border-color .2s; }
.course-row.match { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.course-row.dim { opacity: .5; }
.course-emoji { width: 76px; height: 76px; border-radius: 20px; background: var(--blue-tint); display: grid; place-items: center; font-size: 2.2rem; }
.course-row h2 { font-size: 1.6rem; margin-bottom: .2em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-soft); font-size: .93rem; margin-bottom: .9em; padding: 0; list-style: none; }
.phases { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 6px; counter-reset: ph; }
.phases li { counter-increment: ph; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: .97rem; }
.phases li::before { content: counter(ph); width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: .82rem; color: var(--blue); }
.phases strong { color: var(--ink); }
.phases span { color: var(--ink-soft); }
.course-side { display: flex; flex-direction: column; gap: 10px; justify-content: space-between; border-left: 1px dashed var(--line); padding-left: 24px; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills span { font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
@media (max-width: 900px) {
  .course-row { grid-template-columns: 1fr; }
  .course-side { border-left: 0; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 16px; }
}

/* ---------- Course detail ---------- */
.course-hero { padding: 52px 0 30px; }
.course-hero .crumbs { font-size: .92rem; margin-bottom: 18px; }
.course-hero .crumbs a { color: var(--ink-soft); }
.course-layout { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: start; }
.course-main section { margin-bottom: 44px; }
.outcomes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.outcomes li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.outcomes li::before { content: ""; width: 20px; height: 20px; margin-top: 4px; border-radius: 6px; background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%232ea86b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.modules { list-style: none; padding: 0; margin: 0; counter-reset: m; border-left: 3px solid var(--line); }
.modules > li { counter-increment: m; position: relative; padding: 0 0 22px 30px; }
.modules > li::before { content: counter(m); position: absolute; left: -16px; top: -2px; width: 29px; height: 29px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.modules h3 { font-size: 1.12rem; margin-bottom: .3em; }
.modules ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.aside { position: sticky; top: 88px; display: grid; gap: 18px; }
.ticket { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 26px; position: relative; overflow: hidden; }
.ticket::after { content: ""; position: absolute; left: -12px; right: -12px; top: 128px; border-top: 2px dashed rgba(255,255,255,.25); }
.ticket .price { font-size: 2.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ticket .price small { font-size: 1rem; font-weight: 500; opacity: .75; letter-spacing: 0; }
.ticket .price-label { opacity: .75; font-size: .95rem; margin-bottom: 6px; }
.ticket dl { margin: 48px 0 20px; display: grid; gap: 10px; font-size: .95rem; }
.ticket dt { opacity: .7; font-size: .85rem; }
.ticket dd { margin: 0; font-weight: 600; }
.ticket .btn { width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.instructor { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; }
.instructor img { width: 52px; height: 52px; border-radius: 50%; }
.instructor p { margin: 0; }
@media (max-width: 960px) { .course-layout { grid-template-columns: 1fr; } .aside { position: static; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field textarea { resize: vertical; min-height: 90px; }
.field input, .field select, .field textarea { font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.check { display: flex; gap: 10px; align-items: center; font-size: .95rem; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-note { font-size: .88rem; color: var(--ink-soft); margin: 0; }
.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: .95rem; }
.alert-error { background: var(--danger-tint); color: var(--danger); }
.alert-ok { background: var(--green-tint); color: var(--green); }

.contact-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.contact-row a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.contact-row a:hover { border-color: var(--blue); color: var(--blue); }
.aside .contact-row a:last-child { grid-column: 1 / -1; }
.contact-row svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 900px) { .contact-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .contact-row { grid-template-columns: 1fr; } }

/* Pricing band on home */
.band { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.band h2 { color: var(--paper); }
.band p { opacity: .8; margin: 0; max-width: 34em; }
.band .price { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.band .price small { font-size: 1rem; font-weight: 500; opacity: .75; letter-spacing: 0; }
@media (max-width: 720px) { .band { grid-template-columns: 1fr; padding: 28px; } }

/* ---------- Turtle workspace ---------- */
.ide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.ide-toolbar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ide-toolbar select { font: inherit; font-size: .95rem; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 240px; }
.ide-toolbar .spacer { flex: 1; }
.ide-status { font-size: .9rem; color: var(--ink-soft); }
.code-pane { background: var(--code-bg); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; min-height: 520px; }
.pane-label { font-size: .82rem; font-weight: 700; padding: 10px 14px; color: #93a4c0; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-wrap { flex: 1; display: grid; grid-template-columns: 44px 1fr; overflow: auto; }
.gutter { margin: 0; padding: 14px 8px 14px 0; text-align: right; color: #4d6080; font: .9rem/1.6 var(--mono); user-select: none; white-space: pre; }
.code-input { border: 0; outline: none; resize: none; background: transparent; color: var(--code-ink); font: .9rem/1.6 var(--mono); padding: 14px 14px 14px 8px; tab-size: 4; white-space: pre; overflow: hidden; min-height: 100%; caret-color: var(--yellow); }
.code-wrap:focus-within { box-shadow: inset 0 0 0 2px var(--yellow); }
.run-pane { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }
.stage { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stage .pane-label { color: var(--ink-soft); border-bottom-color: var(--line); background: var(--surface); }
#turtle-stage { display: grid; place-items: center; min-height: 380px; outline: none; }
#turtle-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--yellow); }
#turtle-stage canvas { max-width: 100%; height: auto !important; }
.console { background: var(--code-bg); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; min-height: 140px; }
.console-out { margin: 0; padding: 12px 14px; font: .85rem/1.55 var(--mono); color: var(--code-ink); white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 220px; flex: 1; }
.console-out .err { color: #ff9e9e; }
.console-out .sys { color: #93a4c0; font-style: italic; }
.console-in { display: flex; border-top: 1px solid rgba(255,255,255,.1); }
.console-in input { flex: 1; border: 0; background: rgba(255,255,255,.05); color: var(--code-ink); font: .9rem var(--mono); padding: 10px 14px; outline: none; }
.console-in input:focus { box-shadow: inset 0 0 0 2px var(--yellow); }
.console-big { min-height: 520px; }
.console-big .console-out { max-height: none; }
.ide-hint { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-soft); margin: 0; }
.cheats { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cheats h3 { font-size: 1rem; margin-bottom: .5em; }
.cheats code { display: inline-block; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; margin: 0 4px 6px 0; font-size: .84rem; }
@media (max-width: 960px) { .ide { grid-template-columns: 1fr; } .code-pane { min-height: 340px; } .cheats { grid-template-columns: 1fr; } }

/* ---------- Portal ---------- */
.portal-login { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 40px 0; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow); }
.login-card .logo { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 16px; }
.login-card h1 { font-size: 1.9rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; padding: 6px 8px; }

.dash { padding: 36px 0 20px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.dash-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .15em; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.dash-col { display: grid; gap: 24px; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }

.live { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center; position: relative; overflow: hidden; }
.live h2 { color: var(--paper); font-size: 1.5rem; margin-bottom: .2em; }
.live p { margin: 0; opacity: .85; }
.live .countdown { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.live-actions { display: flex; flex-direction: column; gap: 10px; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); margin-bottom: 12px; }
.live-badge i { width: 9px; height: 9px; border-radius: 50%; background: #93a4c0; }
.live.is-live .live-badge { background: rgba(46,168,107,.2); color: #8ff0bb; }
.live.is-live .live-badge i { background: #4cd18a; box-shadow: 0 0 0 0 rgba(76,209,138,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(76,209,138,0); } 100% { box-shadow: 0 0 0 0 rgba(76,209,138,0); } }
.live .btn-ghost { color: var(--paper); border-color: rgba(255,255,255,.25); }
.live .btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.schedule-line { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; }
.schedule-line span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
@media (max-width: 640px) { .live { grid-template-columns: 1fr; } .live-actions { flex-direction: row; flex-wrap: wrap; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.panel h2 { font-size: 1.3rem; margin-bottom: .8em; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel h2 small { font-size: .9rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: -4px 0 18px; }
.progress span { display: block; height: 100%; background: var(--green-bright); border-radius: inherit; transition: width .3s; }

.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.lesson { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); align-items: start; }
.lesson:first-child { border-top: 0; padding-top: 4px; }
.lesson-num { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); font-weight: 800; display: grid; place-items: center; }
.lesson.done .lesson-num { background: var(--green-tint); color: var(--green); }
.lesson h3 { font-size: 1.05rem; margin: 0 0 .2em; }
.lesson .date { font-size: .86rem; color: var(--ink-soft); }
.lesson-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lesson-links a { font-size: .86rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.lesson-links a:hover { background: var(--blue-tint); color: var(--blue); }
.lesson .check { font-size: .85rem; white-space: nowrap; }
@media (max-width: 560px) { .lesson { grid-template-columns: 40px 1fr; } .lesson .check { grid-column: 2; } }

.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-list a { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.res-list a:hover { background: var(--surface-2); border-color: var(--line); }
.res-list .ri { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.1rem; }
.res-list strong { display: block; font-size: .98rem; line-height: 1.3; }
.res-list small { color: var(--ink-soft); font-size: .84rem; }
.res-group + .res-group { margin-top: 18px; }
.res-group h3 { font-size: .95rem; color: var(--ink-soft); font-weight: 700; margin-bottom: .5em; letter-spacing: 0; }

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notes li { padding: 12px 14px; border-radius: var(--r-sm); background: var(--yellow); color: var(--yellow-ink); }
.notes li time { display: block; font-size: .8rem; font-weight: 700; opacity: .75; }
.empty { color: var(--ink-soft); font-size: .95rem; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 404 */
.notfound { text-align: center; padding: 100px 0; }
.notfound pre { display: inline-block; text-align: left; background: var(--code-bg); color: var(--code-ink); padding: 18px 22px; border-radius: var(--r-md); font-size: .9rem; margin-bottom: 26px; }
