/* NikStudy 2: the look for every page. Loaded last, so it refines the older page styles.
   Ink and highlighter: cool paper, deep ink, one bright marker yellow, a red pen for marks.
   Each subject keeps its own colour (Maths indigo, Science teal, English violet). */

/* ---------- colour tokens ---------- */
:root{
  --paper:#f3f5f9; --card:#ffffff; --card-2:#f7f8fb; --ink:#0f1730; --muted:#566079; --line:#e6e9f1; --rule:#d5dae6; --field:#8a93a8;
  --accent:#3346d3; --accent-ink:#ffffff; --accent-soft:#eceffd; --accent-line:#b9c2f4;
  --hi:#ffe45c; --pen:#cf3b2c; --pen-soft:#fdebe8; --good:#127a4b; --good-soft:#e3f5ea; --warn:#8a5300; --warn-soft:#fff2da;
  --sci:#0d7f70; --sci-soft:#dff4f0; --eng:#6f45d6; --eng-soft:#f0eafd;
  --sheet:#ffffff;
  --shadow:0 1px 2px rgb(15 23 48 / .04),0 8px 24px -12px rgb(15 23 48 / .12);
  --shadow-lg:0 2px 4px rgb(15 23 48 / .05),0 24px 48px -20px rgb(15 23 48 / .25);
  --r:16px; --r-sm:10px;
  --sbw:252px;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --paper:#0a0f1d; --card:#121a2d; --card-2:#172038; --ink:#e9edf7; --muted:#a9b3c9; --line:#1f2942; --rule:#2c3856; --field:#6f7d9e;
  --accent:#8fa0ff; --accent-ink:#0a1026; --accent-soft:#1c2550; --accent-line:#44529a;
  --hi:#6b5a00; --pen:#ff8f82; --pen-soft:#3a1a1b; --good:#67d9a3; --good-soft:#0f2e20; --warn:#f3b85c; --warn-soft:#33250e;
  --sci:#5dd8c5; --sci-soft:#0d2e2a; --eng:#c2a5ff; --eng-soft:#261d45; --sheet:#172038;
  --shadow:0 1px 2px rgb(0 0 0 / .35),0 8px 24px -12px rgb(0 0 0 / .5);
  --shadow-lg:0 2px 4px rgb(0 0 0 / .4),0 24px 48px -20px rgb(0 0 0 / .7);
  color-scheme:dark;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --paper:#0a0f1d; --card:#121a2d; --card-2:#172038; --ink:#e9edf7; --muted:#a9b3c9; --line:#1f2942; --rule:#2c3856; --field:#6f7d9e;
    --accent:#8fa0ff; --accent-ink:#0a1026; --accent-soft:#1c2550; --accent-line:#44529a;
    --hi:#6b5a00; --pen:#ff8f82; --pen-soft:#3a1a1b; --good:#67d9a3; --good-soft:#0f2e20; --warn:#f3b85c; --warn-soft:#33250e;
    --sci:#5dd8c5; --sci-soft:#0d2e2a; --eng:#c2a5ff; --eng-soft:#261d45; --sheet:#172038;
    --shadow:0 1px 2px rgb(0 0 0 / .35),0 8px 24px -12px rgb(0 0 0 / .5);
    --shadow-lg:0 2px 4px rgb(0 0 0 / .4),0 24px 48px -20px rgb(0 0 0 / .7);
    color-scheme:dark;
  }
}
/* each subject page uses its own colour for buttons, tabs and highlights */
html.ec-sub-science{--accent:var(--sci);--accent-soft:var(--sci-soft)}
html.ec-sub-english{--accent:var(--eng);--accent-soft:var(--eng-soft)}
html.ec-sub-science,html.ec-sub-english{--accent-ink:#fff}
:root[data-theme="dark"].ec-sub-science,:root[data-theme="dark"].ec-sub-english{--accent-ink:#0a1026}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]).ec-sub-science,:root:not([data-theme="light"]).ec-sub-english{--accent-ink:#0a1026}}

/* ---------- base ---------- */
html{background:var(--paper)}
body{background:var(--paper);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
h1,h2,h3{letter-spacing:-.015em}
::selection{background:var(--hi);color:#111}
.card{border-radius:var(--r);border:1px solid var(--line);box-shadow:var(--shadow);background:var(--card)}
.card .card{box-shadow:none}
.btn{border-radius:var(--r-sm);min-height:44px;padding:10px 18px;font-weight:600;letter-spacing:.005em;transition:filter .15s,background-color .15s,border-color .15s,transform .05s}
.btn:active{transform:translateY(1px)}
.btn.sm{min-height:36px;padding:6px 13px}
.btn.quiet{border-color:var(--rule);background:var(--card);color:var(--ink)}
.btn.quiet:hover{border-color:var(--accent);filter:none;background:var(--accent-soft)}
input,select,textarea{border-radius:var(--r-sm)!important}
input:focus,select:focus,textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 4px var(--accent-soft)!important;outline:none}
.msg{border-radius:var(--r-sm)}
table th{font-weight:600;color:var(--muted)}

/* ---------- the shell: side menu (desktop) ---------- */
.ec-sb,.ec-mtop,.ec-tab,.ec-sheet{display:none}
html.ec-shell .ec-sb{display:flex;flex-direction:column;gap:6px;position:fixed;inset:0 auto 0 0;width:var(--sbw);z-index:900;background:var(--card);border-right:1px solid var(--line);padding:18px 14px 16px;overflow-y:auto;font-family:var(--f-body,"Lexend",system-ui,sans-serif)}
html.ec-shell body{padding-left:var(--sbw)}
.ec-logo{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink);padding:4px 8px 14px}
.ec-logo b{display:block;font-family:var(--f-display,"Bricolage Grotesque",system-ui);font-weight:800;font-size:1.12rem;letter-spacing:-.02em;line-height:1.1}
.ec-logo small{display:block;font-size:.78rem;color:var(--muted);line-height:1.3}
.ec-logo-mark{width:38px;height:38px;flex:none;border-radius:11px;display:grid;place-items:center;background:var(--ink);color:var(--paper);font-family:var(--f-display,"Bricolage Grotesque",system-ui);font-weight:800;font-size:1.15rem;letter-spacing:-.02em;position:relative;overflow:hidden}
.ec-logo-mark::after{content:'';position:absolute;left:5px;right:5px;bottom:9px;height:7px;background:var(--hi);opacity:.55;border-radius:2px;z-index:-1}
.ec-logo-mark{isolation:isolate}
.ec-grp{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.ec-grp-t{font-size:.78rem;color:var(--muted);padding:8px 12px 4px;font-weight:500}
.ec-nav{display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:12px;color:var(--ink);text-decoration:none;font-size:.98rem;font-weight:500;position:relative}
.ec-nav svg{width:21px;height:21px;flex:none;color:var(--muted)}
.ec-nav:hover{background:var(--card-2)}
.ec-nav.on{background:var(--accent-soft);color:var(--accent);font-weight:600}
.ec-nav.on svg{color:var(--accent)}
.ec-nav[data-k="maths"].on{background:color-mix(in srgb,#3346d3 12%,var(--card));color:var(--ink)} .ec-nav[data-k="maths"].on svg{color:#3346d3}
.ec-nav[data-k="science"].on{background:var(--sci-soft);color:var(--ink)} .ec-nav[data-k="science"].on svg{color:var(--sci)}
.ec-nav[data-k="english"].on{background:var(--eng-soft);color:var(--ink)} .ec-nav[data-k="english"].on svg{color:var(--eng)}
.ec-sb-sp{flex:1 1 auto;min-height:12px}
.ec-me{display:flex;align-items:center;gap:11px;padding:10px;border-radius:14px;border:1px solid var(--line);text-decoration:none;color:var(--ink);background:var(--card-2);margin-top:8px;position:relative}
.ec-me:hover{border-color:var(--accent)}
.ec-av{width:36px;height:36px;border-radius:50%;flex:none;display:grid;place-items:center;font-weight:700;background:var(--accent);color:var(--accent-ink);font-family:var(--f-display,"Bricolage Grotesque",system-ui)}
.ec-me-t{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.ec-me-t b{font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ec-me-t small{font-size:.78rem;color:var(--muted)}
.ec-nb{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--pen);color:#fff;font-size:.75rem;font-weight:700;margin-left:auto}
.ec-nb[hidden]{display:none}
.ec-sb-row{display:flex;gap:6px;margin-top:8px}
.ec-mini{flex:1;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:7px;font:inherit;font-size:.85rem;font-weight:500;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:10px;padding:8px 6px;cursor:pointer}
.ec-mini svg{width:17px;height:17px}
.ec-mini:hover{color:var(--ink);border-color:var(--rule);background:var(--card-2)}
.ec-nav .msg-badge,.ec-t .msg-badge,.ec-tile .msg-badge{margin-left:auto}

/* things the shell now does, so pages don't repeat them */
html.ec-shell #ecProfile,html.ec-shell .theme-btn,
html.ec-shell .top-tools a[href^="/feedback"],html.ec-shell .top-tools a[href^="/leaderboard"],html.ec-shell .top-tools a[href^="/chat"],html.ec-shell .top-tools a[href="/"],
html.ec-shell .top-tools #logoutBtn,html.ec-shell #whoBox a.navlink,html.ec-shell #whoBox #logout,
html.ec-shell .brand .mark,html.ec-shell .brand .brand-mark,html.ec-shell .hero .mark,html.ec-shell .hdr{display:none!important}

/* ---------- phones and small tablets: top bar + bottom tabs ---------- */
@media (max-width:1000px){
  html.ec-shell .ec-sb{display:none}
  html.ec-shell body{padding-left:0;padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
  html.ec-shell .ec-mtop{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top,0px));background:var(--card);border-bottom:1px solid var(--line)}
  .ec-mtop .ec-logo{padding:0}
  .ec-mtop .ec-logo-mark{width:32px;height:32px;border-radius:9px;font-size:.82rem}
  .ec-me-s{position:relative;text-decoration:none}
  .ec-me-s .ec-av{width:34px;height:34px}
  .ec-me-s .ec-nb{position:absolute;top:-4px;right:-6px;margin:0}
  html.ec-shell .ec-tab{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:950;background:color-mix(in srgb,var(--card) 92%,transparent);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px))}
  .ec-t{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;border-radius:12px;color:var(--muted);text-decoration:none;font:inherit;font-size:.72rem;font-weight:500;background:none;border:0;cursor:pointer;position:relative;min-height:52px;justify-content:center}
  .ec-t svg{width:23px;height:23px}
  .ec-t.on{color:var(--ink);font-weight:700}
  .ec-t.on svg{color:var(--accent)}
  .ec-t[data-k="maths"].on svg{color:#3346d3} .ec-t[data-k="science"].on svg{color:var(--sci)} .ec-t[data-k="english"].on svg{color:var(--eng)}
  .ec-t .ec-nb{position:absolute;top:2px;left:calc(50% + 6px);margin:0}
  .ec-t .msg-badge{position:absolute;top:0;left:calc(50% + 6px);margin:0}
  html.ec-shell .ec-sheet:not([hidden]){display:flex;position:fixed;inset:0;z-index:960;background:rgb(8 12 24 / .45);align-items:flex-end}
  .ec-sheet-in{width:100%;background:var(--card);border-radius:22px 22px 0 0;padding:10px 16px calc(18px + env(safe-area-inset-bottom,0px));box-shadow:var(--shadow-lg);display:flex;flex-direction:column;gap:12px;animation:ecUp .22s ease-out}
  @keyframes ecUp{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
  @media (prefers-reduced-motion:reduce){.ec-sheet-in{animation:none}}
  .ec-grab{width:42px;height:5px;border-radius:9px;background:var(--rule);align-self:center}
  .ec-sheet-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
  .ec-tile{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 6px;border-radius:14px;background:var(--card-2);border:1px solid var(--line);text-decoration:none;color:var(--ink);font-size:.85rem;font-weight:600;position:relative}
  .ec-tile svg{width:24px;height:24px;color:var(--accent)}
  .ec-tile.on{border-color:var(--accent)}
  .ec-tile .msg-badge{position:absolute;top:6px;right:6px;margin:0}
  /* keep the floating help button above the tab bar */
  html.ec-shell #ecHelpBtn{bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;width:44px;height:44px;min-height:44px;padding:0!important;justify-content:center;font-size:0!important;border-radius:50%!important}
  html.ec-shell #ecHelpBtn::before{content:'?';font-size:1.25rem;font-weight:800}
}

/* ---------- page headers: calmer and tighter ---------- */
html.ec-shell .top{background:transparent;border-bottom:0}
html.ec-shell header.top .top-in{padding-top:26px;padding-bottom:8px}
html.ec-shell .brand h1{font-size:clamp(1.8rem,1.2rem + 2.2vw,2.6rem);font-weight:800;letter-spacing:-.03em;margin-top:0}
html.ec-shell .brand p,html.ec-shell .brand .sub{color:var(--muted);font-size:1.02rem;margin-top:6px}
html.ec-shell .wrap{padding-top:26px}
html.ec-shell .top-tools{gap:8px}
html.ec-shell .acct{display:inline-flex;flex-direction:column;line-height:1.2}
/* section tabs inside Maths and Science: a calm segmented bar */
html.ec-shell nav.tabs{background:color-mix(in srgb,var(--paper) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
html.ec-shell nav.tabs .tabs-in{gap:4px;padding-top:10px;padding-bottom:10px}
html.ec-shell nav.tabs a{border-radius:999px;border-bottom:0;padding:9px 16px;font-size:.98rem}
html.ec-shell nav.tabs a.on,html.ec-shell nav.tabs a.on:hover{background:var(--ink);color:var(--paper);border-bottom:0}
html.ec-shell nav.tabs a:hover{background:var(--accent-soft)}
/* the small pill tabs used on Chat, Profile and Leaderboard */
html.ec-shell .tabs2{background:var(--card-2);border:1px solid var(--line);border-radius:999px;padding:4px;display:inline-flex;gap:4px;align-self:flex-start}
html.ec-shell .tabs2 button{border-radius:999px!important;border:0!important;padding:8px 16px}
html.ec-shell .tabs2 button.on{background:var(--ink)!important;color:var(--paper)!important}
/* footer sits inside the content column */
html.ec-shell .ec-foot{margin-top:40px;border-top:1px solid var(--line);padding-bottom:28px}
@media (max-width:1000px){html.ec-shell .ec-foot{padding-bottom:28px}}
/* the subject colour runs along the top of subject pages */
html.ec-sub-maths body::before,html.ec-sub-science body::before,html.ec-sub-english body::before{content:'';display:block;height:4px;background:var(--accent)}
html.ec-sub-maths body::before{background:#3346d3}

/* ---------- type: Geist throughout, one family with a clear scale ---------- */
:root{--f-display:"Geist","Inter",system-ui,sans-serif;--f-body:"Geist","Inter",system-ui,sans-serif;--f-mono:"Geist Mono",ui-monospace,Menlo,monospace}
body{font-family:var(--f-body);font-size:16.5px;line-height:1.6;font-feature-settings:"ss01","cv11"}
h1,h2,h3,h4{font-family:var(--f-display);font-weight:700;letter-spacing:-.025em;line-height:1.15}
html.ec-shell .brand h1,.homeh{font-weight:700;letter-spacing:-.035em}
.btn{font-family:var(--f-body)}
.small,.muted.small{font-size:.875rem}
.eyebrow{font-size:.8rem;letter-spacing:0;text-transform:none;font-weight:600;color:var(--muted)}
.mark,.brand-mark{font-family:var(--f-mono)}
code,kbd,.mono{font-family:var(--f-mono)}

/* ---------- surfaces: quieter cards, consistent radius and spacing ---------- */
.card{padding:24px}
@media (max-width:640px){.card{padding:18px}}
.card h2,.card h3{margin-bottom:2px}
.tablewrap table,table{border-collapse:separate;border-spacing:0}
html.ec-shell table th{font-size:.8rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--muted);border-bottom:1px solid var(--line);background:transparent}
html.ec-shell table td{border-bottom:1px solid var(--line)}
html.ec-shell table tr:last-child td{border-bottom:0}
html.ec-shell table tr.me td{background:var(--accent-soft)}
/* pill rows and chips */
.pill,.chip{border-radius:999px}
/* page width: content column reads at a comfortable measure */
html.ec-shell main.wrap{max-width:1080px}
/* stat numbers */
.stat .v,.stats .v,.tile b,.kv b{font-variant-numeric:tabular-nums;letter-spacing:-.02em}

/* the side menu replaces the old "Back to subjects" rows */
html.ec-shell .row:has(> #back){display:none}

/* ======================================================================
   NikStudy v3: aurora glass. A slow colour field behind everything, glass panels on top,
   subject gradients, 3D banners and tilt. Motion respects "reduce motion".
   ====================================================================== */
:root{--glass:rgb(255 255 255 / .72);--glass-line:rgb(15 23 48 / .08);--glow:0 0 0 1px rgb(51 70 211 / .18),0 10px 40px -12px rgb(51 70 211 / .45);
  --g-maths:linear-gradient(135deg,#4f5bff 0%,#7a3cff 100%);--g-science:linear-gradient(135deg,#00b894 0%,#0984e3 100%);--g-english:linear-gradient(135deg,#a855f7 0%,#ec4899 100%);
  --g-brand:linear-gradient(120deg,#4f5bff 0%,#a855f7 45%,#ec4899 75%,#f59e0b 100%)}
:root[data-theme="dark"]{--glass:rgb(18 24 44 / .62);--glass-line:rgb(255 255 255 / .08);--glow:0 0 0 1px rgb(143 160 255 / .25),0 12px 44px -10px rgb(110 90 255 / .55)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--glass:rgb(18 24 44 / .62);--glass-line:rgb(255 255 255 / .08);--glow:0 0 0 1px rgb(143 160 255 / .25),0 12px 44px -10px rgb(110 90 255 / .55)}}
:root[data-theme="dark"]{--paper:#070b18} @media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#070b18}}

/* the colour field */
.ec-aurora{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden;background:var(--paper)}
.ec-aurora i{position:absolute;width:60vmax;height:60vmax;border-radius:50%;filter:blur(90px);opacity:.38;animation:ecDrift 28s ease-in-out infinite alternate}
.ec-aurora i:nth-child(1){background:#5b5bff;left:-15vmax;top:-20vmax}
.ec-aurora i:nth-child(2){background:#c026d3;right:-20vmax;top:10vmax;animation-delay:-9s;opacity:.26}
.ec-aurora i:nth-child(3){background:#06b6d4;left:20vmax;bottom:-30vmax;animation-delay:-17s;opacity:.24}
:root:not([data-theme="dark"]) .ec-aurora i{opacity:.18}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .ec-aurora i{opacity:.38}}
.ec-aurora::after{content:'';position:absolute;inset:0;background-image:radial-gradient(rgb(127 140 190 / .14) 1px,transparent 1px);background-size:26px 26px;mask-image:linear-gradient(to bottom,#000,transparent 70%)}
html.ec-sub-maths .ec-aurora i:nth-child(1),html.ec-sub-maths .ec-aurora i:nth-child(3){background:#4f5bff}
html.ec-sub-science .ec-aurora i:nth-child(1),html.ec-sub-science .ec-aurora i:nth-child(3){background:#00b894} html.ec-sub-science .ec-aurora i:nth-child(2){background:#0984e3}
html.ec-sub-english .ec-aurora i:nth-child(1),html.ec-sub-english .ec-aurora i:nth-child(3){background:#a855f7} html.ec-sub-english .ec-aurora i:nth-child(2){background:#ec4899}
@keyframes ecDrift{to{transform:translate(8vmax,6vmax) scale(1.15)}}
html,body{background:transparent!important}
html.ec-sub-maths body::before,html.ec-sub-science body::before,html.ec-sub-english body::before{display:none}

/* glass panels */
.card,html.ec-shell .ec-sb,html.ec-shell .ec-mtop,.today:not(.welcome){background:var(--glass)!important;backdrop-filter:blur(18px) saturate(1.3);-webkit-backdrop-filter:blur(18px) saturate(1.3);border-color:var(--glass-line)!important}
.card{border-radius:20px;box-shadow:0 1px 0 rgb(255 255 255 / .06) inset,var(--shadow)}
html.ec-shell .ec-sb{border-right:1px solid var(--glass-line)}
html.ec-shell nav.tabs{background:transparent!important;border-bottom:0!important}
html.ec-shell nav.tabs .tabs-in{background:var(--glass);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid var(--glass-line);border-radius:999px;padding:6px!important;width:fit-content;max-width:calc(100% - 32px)}
html.ec-shell nav.tabs a.on,html.ec-shell nav.tabs a.on:hover{background:var(--accent)!important;color:var(--accent-ink)!important;box-shadow:var(--glow)}
html.ec-shell .tabs2 button.on{background:var(--accent)!important;color:var(--accent-ink)!important}

/* buttons: subject gradients with a soft glow */
.btn:not(.quiet):not(.danger):not(.ghost){background:var(--g-maths);border-color:transparent;color:#fff;box-shadow:0 6px 20px -8px rgb(79 91 255 / .7)}
html.ec-sub-science .btn:not(.quiet):not(.danger):not(.ghost),.btn.sci{background:var(--g-science)!important;box-shadow:0 6px 20px -8px rgb(0 184 148 / .7)}
html.ec-sub-english .btn:not(.quiet):not(.danger):not(.ghost),.btn.eng{background:var(--g-english)!important;box-shadow:0 6px 20px -8px rgb(236 72 153 / .6)}
.btn:not(.quiet):not(.danger):not(.ghost):hover{filter:brightness(1.1) saturate(1.1);transform:translateY(-1px)}
.btn.quiet{background:var(--glass)!important;backdrop-filter:blur(10px)}

/* sidebar: brand gradient on the active item */
.ec-logo-mark{background:var(--g-brand)!important;color:#fff!important;box-shadow:0 6px 18px -6px rgb(168 85 247 / .7)}
.ec-logo-mark::after{display:none}
.ec-nav.on{background:linear-gradient(90deg,var(--accent-soft),transparent)!important;color:var(--ink)!important}
.ec-nav.on::before{content:'';position:absolute;left:-14px;top:8px;bottom:8px;width:4px;border-radius:0 4px 4px 0;background:var(--g-brand)}
.ec-nav[data-k="maths"].on::before{background:var(--g-maths)} .ec-nav[data-k="science"].on::before{background:var(--g-science)} .ec-nav[data-k="english"].on::before{background:var(--g-english)}
.ec-av{background:var(--g-brand)!important;color:#fff!important}

/* ---------- 3D banners on subject pages ---------- */
.ec-banner{position:relative;overflow:hidden;border-radius:26px;margin:22px auto 6px;max-width:calc(1080px - 32px);min-height:220px;padding:30px 34px;color:#fff;display:flex;align-items:flex-end;isolation:isolate;box-shadow:0 30px 60px -30px rgb(20 20 60 / .6)}
.ec-banner.maths{background:radial-gradient(120% 140% at 0% 0%,#6d78ff 0%,#4338ca 45%,#1e1b4b 100%)}
.ec-banner.science{background:radial-gradient(120% 140% at 0% 0%,#22d3a6 0%,#0e7490 50%,#082f49 100%)}
.ec-banner.english{background:radial-gradient(120% 140% at 0% 0%,#d06cff 0%,#9d2fc7 45%,#3b0a45 100%)}
.ec-banner.play{background:radial-gradient(120% 140% at 0% 0%,#ff9a3c 0%,#e0326e 50%,#3a0d39 100%)}
.ec-banner canvas{position:absolute;right:0;top:0;width:62%;height:100%;z-index:-1}
.ec-banner::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgb(0 0 0 / .35),transparent 60%)}
.ec-banner .bt{max-width:min(560px,70%)}
.ec-banner small{display:inline-flex;align-items:center;gap:8px;font-weight:600;font-size:.82rem;padding:5px 12px;border-radius:999px;background:rgb(255 255 255 / .16);backdrop-filter:blur(8px);border:1px solid rgb(255 255 255 / .22)}
.ec-banner h1{color:#fff!important;font-size:clamp(2.1rem,1.3rem + 3vw,3.4rem)!important;font-weight:800!important;letter-spacing:-.04em!important;margin:12px 0 6px!important;line-height:1}
.ec-banner p{color:rgb(255 255 255 / .82)!important;font-size:1.05rem;margin:0}
html.ec-has-banner .brand h1,html.ec-has-banner .brand p,html.ec-has-banner .brand .sub{display:none!important}
html.ec-has-banner header.top .top-in{padding-top:6px!important;padding-bottom:0!important;justify-content:flex-end}
html.ec-has-banner .top{justify-content:flex-end}
@media (max-width:700px){.ec-banner{margin:14px 12px 4px;padding:22px;min-height:190px;border-radius:22px}.ec-banner canvas{width:100%;opacity:.32}.ec-banner .bt{max-width:100%}}

/* ---------- 3D tilt ---------- */
.ec-tilt{transform-style:preserve-3d;transition:transform .25s cubic-bezier(.2,.8,.2,1),box-shadow .25s;will-change:transform;position:relative}
.ec-tilt:hover{box-shadow:var(--glow)!important}
.ec-tilt .ec-glare{position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(400px circle at var(--gx,50%) var(--gy,50%),rgb(255 255 255 / .18),transparent 45%);opacity:0;transition:opacity .25s}
.ec-tilt:hover .ec-glare{opacity:1}

/* the page arrives once, gently */
@media (prefers-reduced-motion:no-preference){
  html.ec-shell main.wrap>*{animation:ecIn .55s cubic-bezier(.2,.8,.2,1) both}
  html.ec-shell main.wrap>*:nth-child(2){animation-delay:.05s} html.ec-shell main.wrap>*:nth-child(3){animation-delay:.1s} html.ec-shell main.wrap>*:nth-child(4){animation-delay:.15s} html.ec-shell main.wrap>*:nth-child(n+5){animation-delay:.2s}
  .ec-banner{animation:ecIn .6s cubic-bezier(.2,.8,.2,1) both}
}
@keyframes ecIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.ec-aurora i{animation:none}}
