/* STEMIA Academy: institutional colours, typography and visual hierarchy. */
:root {
  --ink:#1f2933; --muted:#52606b; --bg:#f7f9f8; --panel:#fff;
  --green:#2e8b6f; --green-dark:#246e58; --green-soft:#eaf3ef;
  --mint:var(--green); --gold:#8a5b10; --danger:#b52e42; --line:#dbe3df;
  --shadow:0 16px 48px #1f29330b; --slate:#1f2933; --accent-text:#2e8b6f; color-scheme:light;
}
:root[data-theme="dark"] {
  --ink:#edf5f1; --muted:#b7c6c1; --bg:#17212b; --panel:#1f2933;
  --green-dark:#9dd5c2; --green-soft:#263d37; --line:#40514e;
  --accent-text:#9dd5c2; --danger:#ffacb7; --gold:#e9c980;
  --shadow:0 16px 48px #0002; color-scheme:dark;
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--ink); font:400 14px/1.6 "Merriweather Sans","Segoe UI",sans-serif; }
button,input,select { font:inherit; }
button,a,input,select { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--green); outline-offset:4px; }
button:disabled { cursor:wait; opacity:.65; }
.hidden { display:none!important; }
.topbar { min-height:90px; padding:14px clamp(20px,5vw,80px); display:flex; align-items:center; justify-content:space-between; gap:20px; background:var(--slate); color:white; }
.brand { display:flex; align-items:center; gap:24px; text-decoration:none; color:white; }
.brand-logo { position:relative; display:block; width:162px; height:56px; overflow:hidden; flex-shrink:0; }
.brand-logo img { position:absolute; width:200px; max-width:none; height:auto; left:-19px; top:-33px; }
.header-actions { display:flex; align-items:center; gap:16px; }
.theme-toggle { color:white; background:transparent; border-color:#ffffff60!important; white-space:nowrap; }
.theme-toggle:hover { background:#ffffff15; }
.theme-toggle svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.theme-sun,:root[data-theme="dark"] .theme-moon { display:none; }
:root[data-theme="dark"] .theme-sun { display:block; }
.brand-divider { height:32px; width:1px; background:#ffffff35; }
.brand-product { font-size:13px; font-weight:600; letter-spacing:.02em; }
.brand-product>span { display:block; color:#c4ccd1; font-size:10px; font-weight:300; margin-top:2px; }
.user-nav { display:flex; align-items:center; gap:20px; font-size:12px; }
.topbar .ghost { color:white; border-color:#ffffff60; }
.topbar .ghost:hover { background:#ffffff15; }
.auth-layout { max-width:1320px; padding:68px 48px 30px; margin:auto; display:grid; grid-template-columns:minmax(0,1.2fr) minmax(350px,.9fr); align-items:center; gap:48px 86px; }
.eyebrow { display:inline-flex; align-items:center; gap:10px; color:var(--green-dark); font-size:10px; font-weight:700; letter-spacing:.14em; line-height:1.6; }
.eyebrow-square { display:inline-block; width:8px; height:8px; background:var(--green); }
h1,.auth-card h2,.section-heading h2 { font-family:"Merriweather",Georgia,serif; font-weight:400; }
.hero h1 { margin:24px 0; font-size:clamp(38px,4.1vw,58px); line-height:1.24; letter-spacing:-.045em; }
.hero h1 em { color:var(--accent-text); font-style:normal; }
.hero { position:relative; }
.brand-details { position:absolute; top:-54px; right:8px; width:112px; height:45px; opacity:.75; }
.detail-square { position:absolute; width:16px; height:16px; background:var(--green); transition:transform .35s ease; }
.detail-square:nth-child(1) { top:6px; left:3px; }
.detail-square:nth-child(2) { top:20px; left:24px; width:10px; height:10px; background:transparent; border:1px solid var(--accent-text); }
.detail-square:nth-child(3) { top:5px; left:39px; width:8px; height:8px; }
.detail-dots { position:absolute; right:0; top:4px; width:39px; height:39px; background:radial-gradient(circle,var(--accent-text) 1.5px,transparent 2px) 0 0 / 13px 13px; transition:transform .35s ease; }
@media(hover:hover) and (pointer:fine) {
  .brand-details:hover .detail-square:nth-child(1) { transform:translate(-3px,-3px) rotate(12deg); }
  .brand-details:hover .detail-square:nth-child(2) { transform:translate(3px,3px) rotate(-15deg); }
  .brand-details:hover .detail-square:nth-child(3) { transform:translate(2px,-2px); }
  .brand-details:hover .detail-dots { transform:translateX(4px); }
}
.hero>p { max-width:500px; font-size:15px; font-weight:300; line-height:1.9; color:var(--muted); }
.learning-steps { list-style:none; margin:38px 0 0; padding:24px 0 0; border-top:1px solid var(--line); display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.learning-steps li { display:grid; gap:8px; }
.learning-steps span { color:var(--green); font-size:10px; letter-spacing:.08em; }
.learning-steps strong { font-size:11px; font-weight:600; line-height:1.5; }
.auth-card { background:white; padding:36px; border:1px solid var(--line); border-top:3px solid var(--green); border-radius:3px 3px 14px 14px; box-shadow:var(--shadow); }
.auth-card>.eyebrow { font-size:9px; letter-spacing:.1em; }
.auth-card h2 { font-size:27px; letter-spacing:-.035em; line-height:1.35; margin:14px 0 8px; }
.auth-intro { color:var(--muted); margin:0 0 25px; font-size:12px; font-weight:300; }
.tabs { display:grid; grid-template-columns:1fr 1fr; padding:4px; border-radius:6px; background:#eef2f0; margin-bottom:27px; }
.tab { padding:10px 6px; color:var(--muted); border:0; border-radius:4px; background:transparent; font-size:12px; }
.tab.active { background:white; color:var(--green-dark); font-weight:700; box-shadow:0 1px 4px #1f293315; }
.form-stack { display:grid; gap:19px; }
.form-stack label { display:grid; gap:7px; font-size:11px; font-weight:600; }
input,select { width:100%; min-width:0; background:#fff; color:var(--ink); border:1px solid #b6c4bc; padding:12px 13px; border-radius:5px; }
input::placeholder { color:#6f7b83; font-weight:300; }
.form-stack input { font-size:13px; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:44px; padding:11px 17px; border:1px solid transparent; border-radius:5px; font-size:12px; font-weight:600; transition:background .16s,border-color .16s; }
.primary { background:var(--green); color:white; }
.primary:hover { background:#246e58; }
.form-stack .primary { justify-content:space-between; margin-top:4px; }
.secondary { background:var(--slate); color:white; }
.secondary:hover { background:#36434e; }
.ghost { background:transparent; border-color:#a9b8af; color:var(--ink); }
.ghost:hover { background:var(--green-soft); }
.wide { width:100%; }
.error { font-size:12px; color:var(--danger); margin:14px 0 0; }
.error:empty { display:none; }
.auth-note { display:flex; align-items:center; gap:13px; border-top:1px solid var(--line); margin-top:27px; padding-top:21px; }
.auth-note>span { color:var(--green); font-size:25px; }
.auth-note p { margin:0; color:var(--ink); font-size:11px; line-height:1.8; }
.auth-note strong { font-size:10px; font-weight:300; color:var(--muted); }
.course-strip { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:24px; border-top:1px solid var(--line); padding:25px 0 8px; }
.course-strip>div { display:grid; gap:6px; }
.course-strip .eyebrow { font-size:8px; }
.course-strip strong { font-size:12px; font-weight:600; }
.course-strip p { font-size:12px; color:var(--muted); font-weight:300; }
.course-label { color:var(--green-dark); background:var(--green-soft); border-radius:4px; padding:8px 12px; font-size:10px; white-space:nowrap; }
.app-shell { max-width:1520px; margin:auto; display:grid; grid-template-columns:235px minmax(0,1fr); gap:40px; padding:38px clamp(20px,4vw,60px); }
.side-panel { height:fit-content; position:sticky; top:24px; background:var(--ink); color:white; border-radius:10px; padding:25px; display:flex; flex-direction:column; gap:12px; }
.side-panel .eyebrow { color:#a0d1c1; }
.side-panel .ghost { border-color:#73818b; color:white; }
.side-panel .ghost:hover { background:#36434e; }
.side-panel .secondary { background:var(--green); }
.score-ring { --score:0deg; width:148px; height:148px; margin:28px auto; display:grid; place-content:center; text-align:center; border-radius:50%; background:radial-gradient(circle closest-side,var(--ink) 84%,transparent 86%),conic-gradient(#7fb7a6 var(--score),#44525d 0); }
.score-ring strong { font-size:30px; font-weight:400; }
.score-ring span,.mini-stats span { display:block; color:#c4ccd1; font-size:10px; }
.mini-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
.mini-stats>div { padding:11px 5px; text-align:center; border:1px solid #ffffff26; border-radius:5px; }
.mini-stats strong { font-size:23px; font-weight:400; }
.content { min-width:0; }
.course-breadcrumb { display:flex; gap:12px; font-size:11px; color:var(--muted); margin-bottom:25px; }
.course-breadcrumb strong { color:var(--green-dark); font-weight:600; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:28px; }
.section-heading h2 { font-size:clamp(25px,2.7vw,36px); line-height:1.3; letter-spacing:-.035em; margin:12px 0 0; }
.difficulty { display:grid; gap:7px; min-width:145px; font-size:10px; color:var(--muted); }
.difficulty select { font-size:12px; padding:10px; }
.topic-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.topic-card { position:relative; min-height:206px; padding:23px 23px 38px; background:white; color:var(--ink); border:1px solid var(--line); border-radius:7px; text-align:left; transition:border-color .18s,box-shadow .18s; }
.topic-card:hover { border-color:var(--green); box-shadow:var(--shadow); }
.topic-number { color:var(--green-dark); font-size:10px; font-weight:700; letter-spacing:.04em; }
.topic-card h3 { font-size:16px; line-height:1.4; margin:22px 0 10px; }
.topic-card p { color:var(--muted); font-size:11px; line-height:1.7; font-weight:300; margin:0; }
.topic-arrow { position:absolute; right:23px; bottom:13px; font-size:19px; color:var(--green); }
.back-button { border:0; padding:0; background:transparent; color:var(--green-dark); margin-bottom:20px; font-size:12px; }
.exercise-card { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:white; }
.exercise-meta { display:flex; justify-content:space-between; gap:16px; padding:17px 24px; border-bottom:1px solid var(--line); color:var(--green-dark); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.exercise-layout { display:grid; grid-template-columns:1.2fr 1fr; }
.diagram { display:grid; place-items:center; padding:30px; }
.problem { min-width:0; padding:32px; display:flex; flex-direction:column; justify-content:center; }
.problem h2 { margin:15px 0 26px; font-size:21px; font-weight:600; line-height:1.6; }
.answer-form { display:grid; gap:18px; }
.answer-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.answer-actions .button { flex:1 1 210px; }
.explanation-steps { margin:14px 0 0; padding-left:22px; display:grid; gap:13px; }
.explanation-steps li::marker { color:var(--green); font-weight:800; }
.explanation-steps strong { color:var(--ink); font-size:13px; }
.explanation-steps p { margin:4px 0 0; line-height:1.65; }
.sim-engineering-input { display:grid; grid-template-columns:minmax(110px,1fr) minmax(120px,.7fr) auto; gap:8px; align-items:center; margin-top:7px; }
.sim-engineering-input input,.sim-engineering-input select { min-width:0; }
.sim-engineering-input strong { min-width:28px; color:var(--green); font-size:15px; }
@media (max-width:540px) { .sim-engineering-input { grid-template-columns:1fr 1fr; } .sim-engineering-input strong { grid-column:1/-1; } }
.answer-input { display:flex; align-items:center; border:1px solid #b6c4bc; border-radius:5px; overflow:hidden; background:white; }
.answer-input input { border:0; border-radius:0; font-size:18px; flex:1; }
.answer-input:focus-within { outline:2px solid var(--green); outline-offset:2px; }
.answer-input input:focus-visible { outline:none; }
.answer-input>span { padding:0 16px; color:var(--green-dark); font-size:13px; font-weight:700; }
.feedback { margin:20px 0; padding:18px; border-radius:6px; font-size:12px; line-height:1.8; }
.feedback.correct { border:1px solid #8fbdaa; background:#edf6f2; }
.feedback.incorrect { border:1px solid #ddaab1; background:#fff5f5; }
.feedback.demonstration { border:1px solid #9ab8c4; background:#f0f6f8; }
.answer-field input[readonly] { cursor:not-allowed; background:color-mix(in srgb,var(--surface) 78%,var(--green) 22%); border-style:dashed; }
.toast { position:fixed; bottom:24px; left:50%; transform:translate(-50%,150px); background:var(--ink); color:white; max-width:calc(100vw - 32px); width:max-content; padding:14px 20px; border-radius:6px; box-shadow:var(--shadow); transition:transform .2s; z-index:10; }
.toast { visibility:hidden; opacity:0; }
.toast.show { transform:translate(-50%,0); visibility:visible; opacity:1; }
@media(max-width:1150px) {
  .auth-layout { gap:40px; padding:50px 32px 26px; }
  .auth-card { padding:28px; } .hero h1 { font-size:44px; }
  .app-shell { grid-template-columns:210px minmax(0,1fr); gap:25px; }
  .topic-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .section-heading { align-items:start; flex-direction:column; }
}
@media(max-width:800px) {
  .topbar { padding:12px 24px; } .brand { gap:15px; }
  .auth-layout { max-width:650px; grid-template-columns:1fr; gap:36px; padding-top:40px; }
  .hero h1 { font-size:46px; }
  .course-strip { flex-wrap:wrap; gap:12px; } .course-strip p { order:3; width:100%; margin:0; }
  .app-shell { grid-template-columns:1fr; }
  .side-panel { position:static; display:grid; grid-template-columns:1fr 1fr; }
  .side-panel>div:first-child { grid-column:1/-1; } .score-ring { width:110px; height:110px; margin:18px auto; }
  .mini-stats { margin-bottom:0; } .user-nav #welcome { display:none; }
}
@media(max-width:480px) {
  .topbar { padding:12px 18px; min-height:78px; } .brand { gap:10px; }
  .brand-logo { width:120px; height:43px; } .brand-logo img { width:148px; left:-14px; top:-24px; }
  .brand-product { font-size:10px; } .brand-product>span { display:none; } .brand-divider { height:25px; }
  body.signed-in .brand-product,body.signed-in .brand-divider { display:none; }
  .auth-layout { padding:32px 20px 22px; } .hero .eyebrow { font-size:8px; letter-spacing:.12em; }
  .hero h1 { font-size:36px; margin:20px 0; } .hero>p { font-size:14px; }
  .hero .learning-steps { display:none; }
  .learning-steps { gap:10px; } .learning-steps strong { font-size:10px; }
  .auth-card { padding:26px 22px; } .auth-card h2 { font-size:25px; }
  .app-shell { padding:26px 16px; } .topic-grid { grid-template-columns:1fr; }
  .topic-card { min-height:175px; } .exercise-meta { padding:14px 18px; font-size:9px; }
  .problem { padding:25px 20px; } .course-label { font-size:9px; }
}
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { transition:none!important; scroll-behavior:auto!important; } }

/* Surface overrides keep every exercise, input and feedback legible in dark mode. */
:root[data-theme="dark"] .auth-card,:root[data-theme="dark"] .tab.active,
:root[data-theme="dark"] input,:root[data-theme="dark"] select,
:root[data-theme="dark"] .topic-card,:root[data-theme="dark"] .exercise-card,
:root[data-theme="dark"] .answer-input { background:var(--panel); }
:root[data-theme="dark"] .tabs { background:#17212b; }
:root[data-theme="dark"] input,:root[data-theme="dark"] select,
:root[data-theme="dark"] .answer-input { border-color:#687d74; }
:root[data-theme="dark"] input::placeholder { color:#a6b7af; }
:root[data-theme="dark"] .side-panel,:root[data-theme="dark"] .toast { background:var(--slate); }
:root[data-theme="dark"] .score-ring { background:radial-gradient(circle closest-side,var(--slate) 84%,transparent 86%),conic-gradient(#7fb7a6 var(--score),#44525d 0); }
:root[data-theme="dark"] .feedback.correct { background:#1b3830; border-color:#528d76; }
:root[data-theme="dark"] .feedback.incorrect { background:#402a31; border-color:#b66c78; }
:root[data-theme="dark"] .feedback.demonstration { background:#213640; border-color:#618a9b; }
:root[data-theme="dark"] .learning-steps span,:root[data-theme="dark"] .topic-arrow,
:root[data-theme="dark"] .auth-note>span { color:var(--accent-text); }
@media(max-width:1050px) { #theme-label { display:none; } .theme-toggle { width:44px; padding:10px; } .user-nav #welcome { display:none; } }
@media(max-width:800px) { .brand-details { position:relative; top:auto; right:auto; margin:0 0 18px auto; height:38px; } }
@media(max-width:480px) {
  .header-actions { gap:8px; } .topbar { gap:10px; }
  body.signed-in .topbar .button { padding:8px; font-size:10px; }
  .brand-details { transform:scale(.85); transform-origin:right center; margin-bottom:8px; }
}
/* Distributed squares complement the curved point clouds behind the page. */
.brand-details { width:84px; height:64px; opacity:.85; }
.hero>.brand-details { position:relative; top:auto; right:auto; margin:0 0 28px auto; transform:none; }
.detail-square:nth-child(1) { width:28px; height:28px; top:8px; left:4px; }
.detail-square:nth-child(2) { width:20px; height:20px; top:38px; left:29px; }
.detail-square:nth-child(3) { width:13px; height:13px; top:12px; left:59px; }
.detail-dots { top:4px; width:91px; height:65px; }
.brand-details--card { position:relative; top:auto; right:auto; width:68px; height:45px; margin:0 0 20px auto; transform:none; }
.brand-details--card .detail-dots { width:65px; height:39px; }
.brand-details--card .detail-square:nth-child(1) { width:20px; height:20px; }
.brand-details--card .detail-square:nth-child(2) { width:13px; height:13px; top:29px; left:23px; }
.brand-details--card .detail-square:nth-child(3) { left:45px; width:9px; height:9px; }
.course-strip { position:relative; padding-top:34px; }
.course-strip:before { content:""; position:absolute; top:-6px; left:0; width:11px; height:11px; background:var(--green); box-shadow:18px 0 0 var(--green-soft),36px 0 0 var(--green); }
.workspace-brand-row,.practice-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; }
.workspace-brand-row .course-breadcrumb,.practice-toolbar .back-button { margin-bottom:0; }
.brand-details--workspace,.brand-details--practice { position:relative; top:auto; right:auto; margin:0; flex-shrink:0; transform:none; }
.sidebar-dots { position:absolute; top:24px; right:17px; width:52px; height:39px; opacity:.45; background:radial-gradient(circle,#a0d1c1 1.5px,transparent 2px) 0 0 / 13px 13px; transition:transform .35s; }
.topic-number { display:inline-block; max-width:calc(100% - 60px); }
.topic-card:after { content:""; position:absolute; right:22px; top:24px; width:17px; height:17px; border:1px solid var(--accent-text); box-shadow:-22px 10px 0 -2px var(--green); opacity:.7; transition:transform .35s,opacity .35s; }
.topic-card:nth-child(3n+2):after { width:44px; height:33px; border:0; box-shadow:none; background:radial-gradient(circle,var(--accent-text) 1.4px,transparent 1.9px) 0 0 / 11px 11px; }
.topic-card:nth-child(3n):after { width:14px; height:14px; background:var(--green); border:0; box-shadow:-23px 9px 0 -3px var(--green),-9px 23px 0 -4px var(--accent-text); }
@media(hover:hover) and (pointer:fine) {
  .topic-card:hover:after { transform:translateY(-3px) rotate(6deg); opacity:1; }
  .topic-card:nth-child(3n+2):hover:after { transform:translateX(4px); }
  .side-panel:hover .sidebar-dots { transform:translateY(3px); }
}
@media(max-width:800px) {
  .side-panel { position:relative; top:auto; }
  .hero>.brand-details { margin-bottom:20px; }
}
@media(max-width:480px) {
  .brand-details--card { height:42px; margin-bottom:16px; }
  .workspace-brand-row { align-items:flex-start; flex-direction:column-reverse; gap:12px; }
  .brand-details--workspace { align-self:flex-end; }
  .practice-toolbar { gap:10px; }
  .brand-details--practice { width:130px; height:52px; }
  .brand-details--practice .detail-dots { width:52px; height:39px; }
  .brand-details--practice .detail-square:nth-child(1) { width:20px; height:20px; }
  .brand-details--practice .detail-square:nth-child(2) { width:12px; height:12px; top:30px; left:20px; }
  .brand-details--practice .detail-square:nth-child(3) { width:8px; height:8px; left:44px; }
}
@media(prefers-reduced-motion:reduce) {
  .brand-details .detail-square,.brand-details .detail-dots,.topic-card:after,.sidebar-dots { transform:none!important; }
}
.topbar { position:relative; z-index:2; }
main { position:relative; z-index:1; }
.brand-atmosphere { position:fixed; inset:90px 0 0; overflow:hidden; pointer-events:none; z-index:0; }
.cloud-wave { position:absolute; background:url("/academy-assets/assets/brand-dot-wave.svg") center/contain no-repeat; opacity:.27; transition:transform .9s ease-out; }
.cloud-wave--right { width:480px; height:900px; right:-160px; top:-65px; transform:translate(var(--cloud-x,0px),var(--cloud-y,0px)); }
.cloud-wave--left { width:370px; height:680px; left:-165px; top:230px; transform:translate(calc(var(--cloud-x,0px) * -1),calc(var(--cloud-y,0px) * -1)) scaleX(-1) rotate(8deg); }
:root[data-theme="dark"] .cloud-wave { opacity:.5; }
.brand-details .detail-dots { display:none; }
.sidebar-dots { width:13px; height:13px; right:22px; background:transparent; border:1px solid #a0d1c1; box-shadow:-18px 12px 0 -3px #2e8b6f; }
.topic-card:nth-child(3n+2):after { background:transparent; border:1px solid var(--accent-text); width:22px; height:22px; box-shadow:-17px 13px 0 -5px var(--green); }
@media(max-width:800px) {
  .cloud-wave--right { width:360px; height:650px; right:-195px; top:0; }
  .cloud-wave--left { width:300px; height:580px; left:-210px; top:350px; }
}
@media(prefers-reduced-motion:reduce) {
  .cloud-wave { transition:none; }
  .cloud-wave--right { transform:none; }
  .cloud-wave--left { transform:scaleX(-1) rotate(8deg); }
}

/* Premium responsive pass: one rhythm for navigation, content and motion. */
:root { --header-height:88px; --page-gutter:clamp(18px,4vw,56px); --ease-premium:cubic-bezier(.22,1,.36,1); }
html { scroll-behavior:smooth; scrollbar-gutter:stable; }
body { overflow-x:hidden; }
.topbar {
  position:sticky; top:0; z-index:40; min-height:var(--header-height); padding:12px var(--page-gutter);
  box-shadow:0 1px 0 #ffffff14,0 10px 34px #11192312;
}
.brand { min-width:0; gap:clamp(12px,2vw,24px); }
.brand-logo { width:clamp(128px,12vw,162px); }
.header-actions,.user-nav { min-width:0; }
.user-nav { gap:clamp(7px,1.2vw,16px); }
.topbar .button { white-space:nowrap; }
.button { transition:transform .24s var(--ease-premium),background-color .2s ease,border-color .2s ease,box-shadow .24s ease,opacity .2s ease; }
@media(hover:hover) and (pointer:fine) {
  .button:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 8px 22px #17212b18; }
  .button:active:not(:disabled) { transform:translateY(0) scale(.98); }
}
main { min-width:0; transition:padding-right .42s var(--ease-premium); }
.workspace-enter { animation:workspace-reveal .46s var(--ease-premium) both; }
.workspace-enter .catalog-card,.workspace-enter .topic-card,.workspace-enter .student-card { animation:card-reveal .48s var(--ease-premium) both; }
.workspace-enter .catalog-card:nth-child(2),.workspace-enter .topic-card:nth-child(2),.workspace-enter .student-card:nth-child(2){animation-delay:45ms}
.workspace-enter .catalog-card:nth-child(3),.workspace-enter .topic-card:nth-child(3),.workspace-enter .student-card:nth-child(3){animation-delay:90ms}
.workspace-enter .catalog-card:nth-child(n+4),.workspace-enter .topic-card:nth-child(n+4),.workspace-enter .student-card:nth-child(n+4){animation-delay:120ms}
@keyframes workspace-reveal { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes card-reveal { from{opacity:0;transform:translateY(14px) scale(.985)} to{opacity:1;transform:none} }
.auth-card,.exercise-card,.side-panel { transition:transform .35s var(--ease-premium),box-shadow .35s ease,border-color .25s ease; }
dialog[open] { animation:dialog-in .32s var(--ease-premium) both; }
dialog[open]::backdrop { animation:backdrop-in .25s ease both; }
@keyframes dialog-in { from{opacity:0;transform:translateY(18px) scale(.98)} to{opacity:1;transform:none} }
@keyframes backdrop-in { from{opacity:0} to{opacity:1} }
@media(max-width:1180px) {
  .user-nav #welcome { display:none; }
  .topbar { padding-inline:22px; }
  .brand-product>span { display:none; }
}
@media(max-width:760px) {
  :root { --header-height:76px; }
  .topbar { gap:10px; padding:10px 14px; }
  .brand-logo { width:112px; height:42px; }
  .brand-logo img { width:142px; left:-14px; top:-23px; }
  .brand-divider,.brand-product { display:none; }
  .header-actions { margin-left:auto; gap:7px; }
  .user-nav { gap:6px; }
  .topbar .button { min-height:40px; padding:8px 10px; }
  #theme-label { display:none; }
  .theme-toggle { width:40px; }
  .exercise-layout { grid-template-columns:1fr; }
  .diagram { min-width:0; padding:20px 14px; overflow:auto; }
  .problem { padding:26px 20px; }
}
@media(max-width:520px) {
  .user-nav #home-courses { display:none; }
  .topbar .button { font-size:10px; }
  .brand-logo { width:100px; }
}
@media(max-width:390px) {
  .brand-logo { width:82px; }
  .topbar { gap:6px; padding-inline:6px; }
  .header-actions,.user-nav { gap:4px; }
  .theme-toggle { width:36px; }
  .topbar .button { min-height:36px; padding-inline:6px; font-size:9px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .workspace-enter,.workspace-enter .catalog-card,.workspace-enter .topic-card,.workspace-enter .student-card,dialog[open],dialog[open]::backdrop { animation:none!important; }
}
