/* Berbar Math — the student portal's glass layer.
   student.html loads this after app.css. It is the desk's look (see desk.css)
   with the costly parts left out: one blurred surface (the top bar), no
   pointer light, no staggered arrival. Type keeps app.css's sizes. */

:root{
  --code:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  /* one family for Latin and Arabic; figures sit in it too, in tabular form */
  --sans:"Readex Pro","Segoe UI",system-ui,sans-serif;
  --display:var(--sans);
  --mono:var(--sans);

  --rail:264px;
  --gap:14px;            /* the air between the floating chrome and the screen edge */
  --gutter:28px;         /* the page's side margin */

  /* the canvas */
  --ground:#0A0614; --ground-rgb:10 6 20;
  --solid:#171028;       /* for the few surfaces that must stay opaque */
  --grid-line:rgba(190,150,255,.06);
  --aurora:
    radial-gradient(58vw 56vh at 92% -12%,rgba(144,86,255,.56),transparent 66%),
    radial-gradient(48vw 60vh at -12% 38%,rgba(70,100,255,.32),transparent 70%),
    radial-gradient(58vw 54vh at 52% 116%,rgba(214,70,200,.30),transparent 70%),
    radial-gradient(30vw 34vh at 100% 78%,rgba(120,84,255,.20),transparent 70%),
    radial-gradient(34vw 34vh at 30% -14%,rgba(53,208,165,.08),transparent 70%);

  /* panes */
  --panel:rgba(255,255,255,.052);
  --panel-2:rgba(255,255,255,.078);
  --raise:rgba(255,255,255,.15);
  --line:rgba(255,255,255,.13);
  --line-soft:rgba(255,255,255,.085);
  --edge:rgba(255,255,255,.14);     /* the rim of a pane */
  --hi:rgba(255,255,255,.13);       /* light caught along its top edge */
  --sheen:linear-gradient(140deg,rgba(255,255,255,.075),rgba(255,255,255,0) 40%);
  --hover:rgba(255,255,255,.065);
  --btn:rgba(255,255,255,.085); --btn-hover:rgba(255,255,255,.155); --btn-line:rgba(255,255,255,.14);
  --input:rgba(6,3,14,.40); --placeholder:#7B6B9A;
  --chip:rgba(255,255,255,.085); --track:rgba(255,255,255,.10); --out:rgba(0,0,0,.20);
  --well:inset 0 1px 2px rgba(0,0,0,.35);

  /* chrome */
  --mat:rgba(24,16,44,.50);
  --mat-heavy:rgba(27,19,50,.78);
  --pop:rgba(37,26,64,.82); --pop-line:rgba(255,255,255,.17);
  --pop-solid:rgba(34,24,60,.97);
  --blur:blur(26px) saturate(175%);
  --blur-heavy:blur(40px) saturate(185%);
  --scrim-rgb:6 3 14; --scrim-a:.56;

  --ink:#F6F1FF; --ink-2:#C6B9E2; --ink-3:#9585B6;
  --violet-wash:rgba(166,107,255,.17);
  --glow:rgba(166,107,255,.55);
  --cta:linear-gradient(180deg,#B98CFF 0%,#9358F6 48%,#7A3EE2 100%);
  --cta-shadow:inset 0 1px 0 rgba(255,255,255,.42),inset 0 -1px 0 rgba(30,10,80,.35),
    0 12px 28px -12px rgba(146,88,255,.95),0 2px 6px -2px rgba(60,20,150,.6);

  --e1:inset 0 1px 0 var(--hi),0 18px 40px -26px rgba(0,0,0,.78),0 2px 6px -3px rgba(0,0,0,.35);
  --e2:inset 0 1px 0 rgba(255,255,255,.17),0 28px 64px -30px rgba(0,0,0,.88),0 4px 14px -6px rgba(0,0,0,.45);
  --e3:inset 0 1px 0 rgba(255,255,255,.2),0 44px 100px -34px rgba(0,0,0,.95),0 10px 30px -12px rgba(0,0,0,.6);
  --shadow:var(--e3);
}
:root[data-theme="light"]{
  --ground:#E7DFFA; --ground-rgb:231 223 250;
  --solid:#FBF9FF;
  --grid-line:rgba(110,70,210,.075);
  --aurora:
    radial-gradient(58vw 56vh at 92% -12%,rgba(150,100,255,.66),transparent 66%),
    radial-gradient(48vw 60vh at -12% 38%,rgba(104,160,255,.48),transparent 70%),
    radial-gradient(58vw 54vh at 52% 116%,rgba(255,138,220,.46),transparent 70%),
    radial-gradient(30vw 34vh at 100% 78%,rgba(170,130,255,.34),transparent 70%),
    radial-gradient(34vw 34vh at 30% -14%,rgba(110,225,195,.20),transparent 70%);

  --panel:rgba(255,255,255,.46);
  --panel-2:rgba(255,255,255,.66);
  --raise:rgba(255,255,255,.97);
  --line:rgba(88,60,160,.19);
  --line-soft:rgba(88,60,160,.115);
  --edge:rgba(255,255,255,.86);
  --hi:rgba(255,255,255,.95);
  --sheen:linear-gradient(140deg,rgba(255,255,255,.72),rgba(255,255,255,0) 46%);
  --hover:rgba(122,63,228,.07);
  --btn:rgba(255,255,255,.64); --btn-hover:rgba(255,255,255,.98); --btn-line:rgba(88,60,160,.17);
  --input:rgba(255,255,255,.72); --placeholder:#9F93BA;
  --chip:rgba(122,63,228,.085); --track:rgba(88,60,160,.13); --out:rgba(88,60,160,.055);
  --well:inset 0 1px 2px rgba(72,44,150,.10);

  --mat:rgba(255,255,255,.42);
  --mat-heavy:rgba(255,255,255,.80);
  --pop:rgba(255,255,255,.86); --pop-line:rgba(255,255,255,.95);
  --pop-solid:rgba(255,255,255,.98);
  --scrim-rgb:62 46 112; --scrim-a:.26;

  --ink:#1B142E; --ink-2:#4A3F63; --ink-3:#6C6088;
  --violet-wash:rgba(122,63,228,.11);
  --glow:rgba(140,90,255,.42);
  --cta:linear-gradient(180deg,#9F6FFF 0%,#7D43EA 50%,#6A31D4 100%);
  --cta-shadow:inset 0 1px 0 rgba(255,255,255,.45),inset 0 -1px 0 rgba(40,10,110,.3),
    0 12px 26px -12px rgba(110,56,230,.85),0 2px 6px -2px rgba(70,30,170,.35);

  --e1:inset 0 1px 0 var(--hi),0 18px 40px -28px rgba(72,44,150,.45),0 1px 3px rgba(72,44,150,.07);
  --e2:inset 0 1px 0 #fff,0 28px 60px -32px rgba(72,44,150,.52),0 3px 10px -4px rgba(72,44,150,.12);
  --e3:inset 0 1px 0 #fff,0 44px 100px -36px rgba(60,36,130,.56),0 10px 28px -12px rgba(60,36,130,.24);
}


/* ---------------- the canvas ---------------- */
body,:root[data-theme="light"] body{background:var(--ground)}
body::before,body::after{content:"";position:fixed;inset:0;pointer-events:none}
body::before{z-index:-2;background:var(--aurora)}
/* graph paper, as in the logo, where the light is strongest */
body::after{z-index:-1;
  background-image:linear-gradient(var(--grid-line) 1px,transparent 1px),
    linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);
  background-size:32px 32px;
  -webkit-mask-image:radial-gradient(74vw 78vh at 88% 0%,#000,transparent 72%);
  mask-image:radial-gradient(74vw 78vh at 88% 0%,#000,transparent 72%)}
::-webkit-scrollbar-thumb{background:var(--track);border:3px solid transparent;
  background-clip:padding-box}
::selection{background:rgba(146,88,255,.55);color:#fff}


/* ---------------- type: app.css's sizes, the new face ---------------- */
.num,.stat .val,.tblock .hh,.gradepill,.day .dn,.ev b,.hr-lbl,.bub .t,.tip b,.notif .t{
  font-variant-numeric:tabular-nums}
.code,.linkbox code{font-family:var(--code)}

/* ---------------- the shell ----------------
   Speed first: only the top bar is real frosted glass. Everything else is a
   translucent pane over the fixed light, which costs nothing to scroll. */
.stopbar{top:calc(var(--gap) + env(safe-area-inset-top));
  margin:calc(var(--gap) + env(safe-area-inset-top)) var(--gap) 0;
  padding:9px 14px;min-height:58px;border:1px solid var(--edge);border-radius:22px;
  background:var(--sheen),var(--mat);box-shadow:var(--e1);
  -webkit-backdrop-filter:blur(18px) saturate(160%);backdrop-filter:blur(18px) saturate(160%)}
.rail{gap:2px;background:var(--sheen),var(--mat);border:1px solid var(--edge);box-shadow:var(--e2);
  -webkit-backdrop-filter:none;backdrop-filter:none;scrollbar-width:none}
.rail::-webkit-scrollbar{width:0;height:0}
@media(min-width:1001px){
  .portal-shell{grid-template-columns:calc(var(--rail) + var(--gap)) minmax(0,1fr)}
  .portal-shell .rail{top:calc(var(--gap) * 2 + 60px);height:calc(100vh - var(--gap) * 3 - 60px);
    margin-inline-start:var(--gap);margin-top:var(--gap);border-radius:26px;padding:16px 12px 12px}
}
@media(max-width:1000px){
  /* the drawer is solid enough to read without blurring the page behind it */
  .rail{background:var(--pop-solid);border-radius:0 28px 28px 0}
  [dir="rtl"] .rail{border-radius:28px 0 0 28px}
}
.brand svg,.brand .mark{filter:drop-shadow(0 8px 14px rgba(140,84,255,.5))}
.navitem{border-radius:13px;border:1px solid transparent}
.navitem:hover{background:var(--hover)}
.navitem.on{font-weight:500;color:var(--ink);border-color:rgba(196,160,255,.30);
  background:linear-gradient(135deg,rgba(166,107,255,.36),rgba(166,107,255,.12));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 12px 26px -16px var(--glow)}
.navitem.on svg{opacity:1;color:#D7BFFF}
.navitem.on::before{display:none}
:root[data-theme="light"] .navitem.on{color:var(--violet);border-color:#fff;
  background:linear-gradient(135deg,#fff,rgba(255,255,255,.72));
  box-shadow:inset 0 1px 0 #fff,0 12px 24px -16px rgba(90,50,200,.6),0 1px 2px rgba(72,44,150,.08)}
:root[data-theme="light"] .navitem.on svg{color:var(--violet)}
.navitem .badge{box-shadow:0 4px 10px -4px var(--rose)}
.iconbtn .count{border:0;box-shadow:0 4px 10px -3px var(--rose)}

/* ---------------- panes ---------------- */
.card,.stat,.cal,.msg-shell,.reccard,.pastcard,.next-card,.gate-card{
  background:var(--sheen),var(--panel);border:1px solid var(--edge);box-shadow:var(--e1)}
:root[data-theme="light"] .card,:root[data-theme="light"] .stat,
:root[data-theme="light"] .pastcard{box-shadow:var(--e1)}
.card,.cal,.msg-shell,.reccard,.pastcard{border-radius:22px}
.stat{border-radius:22px}
.stat .lbl > svg{box-sizing:content-box;width:15px;height:15px;padding:7px;border-radius:11px;
  background:var(--violet-wash);color:var(--violet);box-shadow:inset 0 1px 0 var(--hi)}
.hero,:root[data-theme="light"] .hero{border-radius:28px;border:1px solid var(--edge);
  box-shadow:var(--e2);background:
    radial-gradient(560px 290px at 96% -36%,rgba(166,107,255,.42),transparent 70%),
    radial-gradient(440px 250px at -6% 132%,rgba(96,130,255,.18),transparent 70%),
    var(--sheen),var(--panel-2)}
:root[data-theme="light"] .hero{background:
    radial-gradient(560px 290px at 96% -36%,rgba(150,100,255,.32),transparent 70%),
    radial-gradient(440px 250px at -6% 132%,rgba(120,172,255,.24),transparent 70%),
    var(--sheen),var(--panel-2)}
.next-card{border-radius:24px;box-shadow:var(--e2)}
.tblock,:root[data-theme="light"] .tblock{border-radius:18px;background:var(--panel-2);
  border:1px solid var(--line);box-shadow:inset 0 1px 0 var(--hi)}
.tblock.live{border-color:var(--rose)}
/* a pane you can open rises to meet the pointer; phones never run this */
@media(hover:hover){
  .reccard,.pastcard,button.card,.card[data-act],.card[data-go]{
    transition:transform .25s var(--ease),box-shadow .25s var(--ease)}
  .reccard:hover,.pastcard:hover,button.card:hover,.card[data-act]:hover,.card[data-go]:hover{
    transform:translateY(-3px);box-shadow:var(--e2)}
}

/* ---------------- controls ---------------- */
.btn{border-radius:12px;box-shadow:inset 0 1px 0 var(--hi)}
.btn.sm{border-radius:10px}
.btn.ghost{box-shadow:none}
.btn.primary{background:var(--cta);border-color:rgba(255,255,255,.2);color:#fff;
  box-shadow:var(--cta-shadow)}
.iconbtn{border-radius:12px;box-shadow:inset 0 1px 0 var(--hi)}
.rolepill{box-shadow:inset 0 1px 0 var(--hi)}
input[type=text],input[type=email],input[type=tel],input[type=date],input[type=time],
input[type=number],input[type=url],input[type=password],input[type=datetime-local],
input[type=search],select,textarea{background-color:var(--input);border-color:var(--line);
  border-radius:12px;box-shadow:var(--well)}
input:focus,select:focus,textarea:focus{border-color:var(--violet-dim);
  box-shadow:var(--well),0 0 0 4px var(--violet-wash)}
.seg{background:var(--input);border:1px solid var(--line-soft);box-shadow:var(--well);
  padding:3px;border-radius:13px}
.seg button{border-radius:10px}
.seg button.on{background:var(--raise);color:var(--ink);
  box-shadow:inset 0 1px 0 var(--hi),0 6px 12px -8px rgba(0,0,0,.55)}
.av{position:relative;border-radius:50%;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 6px 12px -6px rgba(0,0,0,.5)}
.av.lg,.av.sm{border-radius:50%}
.avwrap .dot-on{border-color:var(--solid)}
.bar{background:var(--track)}
.empty .ico{border-radius:50%;background:var(--violet-wash)}
.ressec{background:var(--chip);border-bottom-color:var(--line-soft)}
.lrow .av[style*="#2A1C45"]{background:var(--chip) !important}
.fab{background:var(--pop-solid);border:1px solid var(--edge);box-shadow:var(--e2)}

/* ---------------- layers above the page: solid enough to need no blur ---------------- */
.scrim{background:rgb(var(--scrim-rgb) / calc(var(--scrim-a) + .14));
  -webkit-backdrop-filter:none;backdrop-filter:none}
.modal{background:var(--pop-solid);border:1px solid var(--edge);border-radius:28px;box-shadow:var(--e3)}
.modal.marksheet{background:var(--solid);border-radius:0;border:0}
.popover,.ctxmenu,.toast,.tip{background:var(--pop-solid);border-color:var(--pop-line);
  box-shadow:var(--e3)}
.popover{border-radius:22px}
.toast{border-radius:16px}
.examlive{background:var(--solid)}
.pq-sticky{background:var(--pop-solid);-webkit-backdrop-filter:none;backdrop-filter:none}

/* ---------------- calendar, messages, signing in ---------------- */
.cal{border-radius:24px}
.calhead{background:none;border-bottom:1px solid var(--line-soft)}
.day.today{background:linear-gradient(180deg,var(--violet-wash),transparent 78%)}
.ev.cancelled{background:var(--chip);border-inline-start-color:var(--ink-3)}
.msg-shell{border-radius:24px}
.bub{border-radius:18px}
.bub.me{background:var(--cta);box-shadow:inset 0 1px 0 rgba(255,255,255,.34)}
.bub.them{background:var(--btn);border:1px solid var(--btn-line)}
.gate{background:none}
.gate-card{border-radius:28px;box-shadow:var(--e3)}

/* ---------------- phone ---------------- */
@media(max-width:1000px){
  :root{--gap:10px}
}
@media(max-width:620px){
  :root{--gap:8px}
  .stopbar{padding:7px 10px;min-height:52px;border-radius:20px}
  .card,.cal,.msg-shell,.reccard,.pastcard,.stat{border-radius:20px}
  .hero,:root[data-theme="light"] .hero{border-radius:24px}
  .modal{border-radius:24px}
}

/* ---------------- the top bar's own buttons: bare icons, like the menu ---------------- */
.stopbar .iconbtn{background:transparent;border-color:transparent;box-shadow:none;color:var(--ink-2)}
.stopbar .iconbtn:hover{background:var(--btn);border-color:var(--btn-line);color:var(--ink)}
.stopbar .iconbtn:active{transform:scale(.92)}

/* ---------------- the bar at the foot (phone and iPad) ----------------
   One bead of glass, solid enough to need no blur. The lit pill is a single
   element slid with a transform, so moving between tabs costs one frame of
   compositing and nothing else. */
.tabbar{display:none}
@media(max-width:1000px){
  .tabbar{display:flex;position:fixed;z-index:70;left:50%;transform:translateX(-50%);
    bottom:max(10px,calc(env(safe-area-inset-bottom) - 8px));
    width:min(460px,calc(100vw - 20px));gap:0;padding:6px;border-radius:32px;
    background:var(--sheen),var(--pop-solid);border:1px solid var(--edge);box-shadow:var(--e2)}
  .tabbar .tabpill{position:absolute;top:6px;bottom:6px;left:0;border-radius:26px;
    background:var(--btn);border:1px solid var(--btn-line);
    box-shadow:inset 0 1px 0 var(--hi),0 8px 18px -12px var(--glow);
    transition:transform .38s cubic-bezier(.32,.72,0,1),width .38s cubic-bezier(.32,.72,0,1)}
  .tab{position:relative;z-index:1;flex:1 1 0;min-width:0;min-height:52px;display:flex;
    flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;
    border:0;background:none;border-radius:26px;color:var(--ink-3);font:inherit;font-size:10.5px;
    font-weight:500;line-height:1.1;cursor:pointer;-webkit-tap-highlight-color:transparent;
    transition:color .2s ease,transform .1s ease-out}
  .tab .tabi{position:relative;display:grid;place-items:center;width:44px;height:26px}
  .tab svg{width:21px;height:21px;transition:transform .3s cubic-bezier(.32,.72,0,1)}
  .tab.on{color:var(--violet)}
  .tab.on svg{transform:translateY(-1px) scale(1.08)}
  .tab:active{transform:scale(.94)}
  .tab .tabl{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tab .count{position:absolute;top:-4px;inset-inline-end:0;min-width:16px;height:16px;padding:0 4px;
    border-radius:20px;background:var(--rose);color:#fff;font-size:10px;font-weight:700;
    font-style:normal;display:grid;place-items:center;line-height:1}
  .portal-page{padding-bottom:calc(104px + env(safe-area-inset-bottom))}
  .portal-page.msgpage{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  /* the floating support button sat on the cards above the bar: on a phone
     and an iPad support is in the menu (three lines) and in Settings */
  .fab{display:none !important}
  .toasts{bottom:calc(92px + env(safe-area-inset-bottom))}
  #portal.landing .tabbar{display:none}
}
@media(min-width:621px) and (max-width:1000px){
  .tabbar{width:auto;bottom:calc(16px + env(safe-area-inset-bottom))}
  .tab{flex:none;width:92px}
}

/* ---------------- moving between pages ----------------
   The new page slides in from the side of the tab you went to, and settles.
   Transform and opacity only. */
@keyframes infwd{from{opacity:0;transform:translateX(28px)}to{opacity:1;transform:none}}
@keyframes inback{from{opacity:0;transform:translateX(-28px)}to{opacity:1;transform:none}}
.portal-page.enter[data-dir="fwd"]{animation:infwd .32s cubic-bezier(.32,.72,0,1) both}
.portal-page.enter[data-dir="back"]{animation:inback .32s cubic-bezier(.32,.72,0,1) both}
[dir="rtl"] .portal-page.enter[data-dir="fwd"]{animation-name:inback}
[dir="rtl"] .portal-page.enter[data-dir="back"]{animation-name:infwd}
@media(prefers-reduced-motion:reduce){
  .portal-page.enter[data-dir]{animation:none}
  .tabbar .tabpill,.tab svg{transition:none}
}


/* ---------------- an open drawer owns the screen ---------------- */
.railcover{display:none}
@media(max-width:1000px){
  .railcover.on{display:block;position:fixed;inset:0;z-index:79;touch-action:none;
    background:rgb(var(--scrim-rgb) / var(--scrim-a));animation:fade .2s ease}
  html.railopen,html.railopen body{overflow:hidden;overscroll-behavior:none}
  .rail{overscroll-behavior:contain}
  .rail.open,[dir="rtl"] .rail.open{box-shadow:var(--e3)}
}

/* an odd last number tile takes the whole row instead of sitting alone at half width */
@media(max-width:620px){.stats > .stat:last-child:nth-child(odd){grid-column:1 / -1}}

/* the avatar and name are the way into Settings */
.stopbar .brandbadge{border:0;background:none;padding:4px 6px;margin:-4px -6px;border-radius:14px;
  color:inherit;font:inherit;cursor:pointer;text-align:inherit;-webkit-tap-highlight-color:transparent}
.stopbar .brandbadge:hover{background:var(--hover)}
.stopbar .brandbadge:active{transform:scale(.97)}

/* ---------------- what people ask their device for ---------------- */
@media(prefers-reduced-transparency:reduce){
  :root{--panel:#150E26;--panel-2:#1B1332;--mat:#150E26;--input:#0E0919;--aurora:none}
  :root[data-theme="light"]{--panel:#fff;--panel-2:#fff;--mat:#fff;--input:#fff;--aurora:none}
  .stopbar{-webkit-backdrop-filter:none;backdrop-filter:none}
}
@media(prefers-contrast:more){
  :root{--edge:var(--ink-3);--line:var(--ink-3);--line-soft:var(--ink-3)}
  .stopbar{background:var(--solid)}
}
