/* Gate and course hub only. The administrator and case pages keep their themes. */
@font-face{font-family:CaseChakra;src:url('/assets/chakra-petch-500-latin.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:CaseChakra;src:url('/assets/chakra-petch-600-latin.woff2') format('woff2');font-weight:600;font-display:swap}
@font-face{font-family:CaseChakra;src:url('/assets/chakra-petch-700-latin.woff2') format('woff2');font-weight:700;font-display:swap}
@font-face{font-family:CaseManrope;src:url('/assets/manrope-400.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:CaseManrope;src:url('/assets/manrope-700.ttf') format('truetype');font-weight:700;font-display:swap}
@font-face{font-family:CaseMono;src:url('/assets/plex-mono-400.ttf') format('truetype');font-weight:400;font-display:swap}

body:is([data-access-page="gate"],[data-access-page="hub"]){
  --portal-mint:#22e584;
  --portal-teal:#2cd9a2;
  --portal-glint:linear-gradient(105deg,transparent 36%,rgba(255,255,255,.56) 50%,transparent 64%);
  --portal-brand-grad:linear-gradient(145deg,#33fe94 0%,#3dfaa0 52%,#22e6f0 83%,#4c82ff 92%,#9655ff 100%);
  --portal-grad:linear-gradient(145deg,#33fe94 0%,#58fdaa 54%,#22e6f0 86%,#729eff 95%,#9c82ff 100%);
  --portal-font:CaseManrope,Manrope,system-ui,sans-serif;
  --portal-display:CaseChakra,'Chakra Petch',system-ui,sans-serif;
  --portal-mono:CaseMono,Mono,monospace;
  --portal-max:1160px;
  --portal-line:#c2d7cf28;
  --portal-card:linear-gradient(135deg,#1c1f24db,#111317d6);
  --portal-shadow:inset 0 1px #ffffff1f,0 18px 48px #00000038;
  --bg:#0c0e11;
  --text:#eef7f3;
  --muted:#bac8c8;
  --accent:var(--portal-mint);
  --border:var(--portal-line);
  display:flex;
  flex-direction:column;
  min-height:100dvh;
  margin:0;
  position:relative;
  isolation:isolate;
  color:var(--text);
  background:var(--bg);
  font:400 16px/1.75 var(--portal-font);
  -webkit-font-smoothing:antialiased;
}
body:is([data-access-page="gate"],[data-access-page="hub"])::before{
  content:'';
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(180deg,#10151a55 0%,#10151a9c 40%,#10151ae8 100%),url('/assets/mountain.webp') center top/cover no-repeat;
  filter:grayscale(.5);
}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(h1,h2,h3,p){margin:0}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(h1,h2,h3){color:var(--text);font-family:var(--portal-display);font-weight:600;letter-spacing:-.035em;text-wrap:balance}
body:is([data-access-page="gate"],[data-access-page="hub"]) h1{font-size:clamp(2.5rem,5.3vw,4.35rem);line-height:1.08}
body:is([data-access-page="gate"],[data-access-page="hub"]) h2{font-size:1.65rem;line-height:1.25}
body:is([data-access-page="gate"],[data-access-page="hub"]) p{color:var(--muted)}
body:is([data-access-page="gate"],[data-access-page="hub"]) a{color:var(--portal-mint);text-underline-offset:.24em}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(button,input){font-family:var(--portal-font)}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(a,button,input):focus-visible{outline:2px solid var(--portal-mint);outline-offset:5px}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(.topbar,.portal-main,.portal-footer){width:min(var(--portal-max),calc(100% - 64px));max-width:none;margin-inline:auto}
body:is([data-access-page="gate"],[data-access-page="hub"]) .accent-text{color:#33fe94;background-image:var(--portal-glint),var(--portal-brand-grad);background-size:260% 100%,135% 100%;background-repeat:no-repeat;background-position:145% 0,0% 50%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:portal-breathe-glint 4.5s ease-in-out infinite}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-skip{position:fixed;top:12px;left:16px;z-index:100;transform:translateY(calc(-100% - 24px));padding:11px 17px;border-radius:7px;background:var(--portal-mint);color:#062116;font-size:.85rem;font-weight:700;text-decoration:none}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-skip:focus{transform:none}

body:is([data-access-page="gate"],[data-access-page="hub"]) .topbar{padding:28px 0 24px;gap:24px;border-bottom:1px solid var(--portal-line)}
body:is([data-access-page="gate"],[data-access-page="hub"]) .brand{gap:12px;color:var(--text);font:500 .875rem/1.4 var(--portal-display);letter-spacing:.04em;text-decoration:none}
body:is([data-access-page="gate"],[data-access-page="hub"]) .brand-point{color:#33fe94;background-image:var(--portal-glint),var(--portal-brand-grad);background-size:260% 100%,135% 100%;background-repeat:no-repeat;background-position:145% 0,0% 50%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:portal-breathe-glint 4.5s ease-in-out infinite}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-brand-logo{display:block;flex:none;width:64px;height:auto;object-fit:contain}
body:is([data-access-page="gate"],[data-access-page="hub"]) .brand small{display:block;margin-top:4px;font:400 .7rem/1.5 var(--portal-font);letter-spacing:0;color:#b6c6c5}
body:is([data-access-page="gate"],[data-access-page="hub"]) .local-badge{flex:none;padding:5px 11px;border:1px solid #c5d6c336;border-radius:6px;background:#c1e4d506;color:#c0d4ca;font:400 .65rem/1.5 var(--portal-mono);letter-spacing:.03em}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-main{flex:1;margin-block:0;padding:64px 0 70px}
body:is([data-access-page="gate"],[data-access-page="hub"]) .eyebrow{color:var(--portal-mint);font:400 .69rem/1.6 var(--portal-mono);letter-spacing:.13em;text-transform:uppercase}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-intro h1{margin:18px 0 24px;max-width:17ch}
body:is([data-access-page="gate"],[data-access-page="hub"]) .lead{max-width:60ch;font-size:clamp(1rem,1.5vw,1.15rem);line-height:1.85;color:#cfdbd8}
body:is([data-access-page="gate"],[data-access-page="hub"]) .lead strong{font-weight:700;color:#e1f0e6}
body:is([data-access-page="gate"],[data-access-page="hub"]) .lead+.lead{margin-top:15px}
body:is([data-access-page="gate"],[data-access-page="hub"]) .panel{min-width:0;margin:0;padding:30px;border:1px solid var(--portal-line);border-radius:18px;background:var(--portal-card);box-shadow:var(--portal-shadow);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(button,.button){min-height:46px;padding:12px 20px;gap:9px;border:1px solid transparent;border-radius:11px;background:var(--portal-grad);background-size:145% 100%;color:#062116;font:700 .84rem/1.45 var(--portal-font);text-decoration:none;cursor:pointer;animation:portal-neon-flow 4.5s ease-in-out infinite;box-shadow:0 7px 26px #33fe9436;transition:box-shadow .2s,filter .2s,border-color .2s,transform .2s}
body:is([data-access-page="gate"],[data-access-page="hub"]) :is(button,.button):hover:not(:disabled){filter:brightness(1.06);box-shadow:0 0 22px #33fe9488,0 8px 36px #33fe9455;transform:translateY(-2px)}
body:is([data-access-page="gate"],[data-access-page="hub"]) button:disabled{cursor:wait;opacity:.65}
body:is([data-access-page="gate"],[data-access-page="hub"]) .hint{font-size:.79rem;line-height:1.8;color:#adbfba}
body:is([data-access-page="gate"],[data-access-page="hub"]) .muted{font-size:.84rem;line-height:1.75;color:#b6c7c0}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-links{display:flex;align-items:center;flex-wrap:wrap;gap:12px 26px;margin-top:24px;padding-top:23px;border-top:1px solid var(--portal-line);font-size:.79rem}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-links a{text-decoration:none}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-links a:hover{text-decoration:underline}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-links .subtle-link{display:inline;margin:0;text-align:left}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-footer{margin-top:auto;padding:24px 0 30px;border-top:1px solid var(--portal-line);font-size:.73rem;line-height:1.8;color:#a7bcb4}
body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-footer p{max-width:85ch;color:inherit}

body[data-access-page="gate"] .portal-gate{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);align-items:center;gap:70px;padding-block:clamp(48px,8vh,88px)}
body[data-access-page="gate"] .portal-intro{min-width:0;padding-bottom:12px}
body[data-access-page="gate"] .portal-intro .lead{max-width:46ch}
body[data-access-page="gate"] .portal-steps{list-style:none;padding:0;margin:32px 0 0;display:grid;gap:18px;counter-reset:portal-step;max-width:430px}
body[data-access-page="gate"] .portal-steps li{position:relative;min-height:34px;padding-left:45px;counter-increment:portal-step;font-size:.82rem;line-height:1.75;color:#b9cbc2}
body[data-access-page="gate"] .portal-steps li>span{position:absolute;left:0;top:0;display:grid;place-items:center;width:29px;height:29px;margin:0;border:1px solid #49f2ba40;border-radius:7px;background:#49f2ba0a;color:var(--portal-teal);font:400 .66rem/1 var(--portal-mono)}
body[data-access-page="gate"] .portal-steps strong{display:block;color:#d9e8df;font-size:.84rem;font-weight:700}
body[data-access-page="gate"] .portal-steps li>div p{display:block;margin-top:3px;font-size:.78rem;color:#afc2b8}
body[data-access-page="gate"] .entry-panel{padding:33px;border-color:#bbd9c83b;border-radius:20px}
body[data-access-page="gate"] .entry-panel>.eyebrow{margin-bottom:10px}
body[data-access-page="gate"] .entry-panel>h2{margin:0 0 27px;font-size:1.8rem}
body[data-access-page="gate"] .selected-course{margin:-8px 0 24px;padding:12px 14px;border-left:2px solid #4dfd9a77;border-radius:0 6px 6px 0;background:#4dfd9a0a;color:#b5ccc0;font-size:.76rem;line-height:1.7}
body[data-access-page="gate"] .selected-course strong{display:block;margin-top:3px;color:#d8f1e0;font-size:.85rem;font-weight:700}
body[data-access-page="gate"] #redeem label{margin-bottom:10px;color:#d9e7df;font-size:.85rem;font-weight:700}
body[data-access-page="gate"] #code{display:block;width:100%;min-height:54px;padding:13px 15px;border:1px solid #92b0a65e;border-radius:8px;background:#101c20c4;color:#eef7f3;font:400 .88rem/1.5 var(--portal-mono);letter-spacing:.02em;caret-color:var(--portal-mint);transition:border-color .2s,background .2s}
body[data-access-page="gate"] #code::placeholder{color:#809c92;opacity:1}
body[data-access-page="gate"] #code:hover{border-color:#b0cbbc8a}
body[data-access-page="gate"] #code:focus{border-color:#4dfd9aa6;background:#10221fd9}
body[data-access-page="gate"] #code-help{margin:14px 0 23px;font-size:.77rem}
body[data-access-page="gate"] #redeem>button{width:100%;min-height:48px}
body[data-access-page="gate"] #message{min-height:1.7em;margin:13px 0 0;color:#e8ce9e;font-size:.79rem;line-height:1.7;overflow-wrap:anywhere}
body[data-access-page="gate"] .entry-panel .portal-links{font-size:.73rem;gap:10px 20px;margin-top:19px;padding-top:19px}

body[data-access-page="hub"] .portal-hub{padding-top:56px}
body[data-access-page="hub"] .portal-intro{max-width:920px}
body[data-access-page="hub"] .portal-intro h1{max-width:21ch;margin-bottom:19px}
body[data-access-page="hub"] .portal-intro .lead{max-width:66ch}
body[data-access-page="hub"] .portal-deadline{max-width:100%;margin:27px 0 0;padding:13px 16px;border:1px solid #4dfd9a30;border-radius:8px;background:#4dfd9a0a;color:#c2d7ca;font-size:.81rem;line-height:1.8;font-variant-numeric:tabular-nums}
body[data-access-page="hub"] .portal-deadline:empty{display:none}
body[data-access-page="hub"] #hub-message{min-height:1.7em;margin:11px 0 20px;color:#e8ce9e;font-size:.8rem;line-height:1.7;overflow-wrap:anywhere}
body[data-access-page="hub"] .course-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;counter-reset:portal-course;align-items:stretch}
body[data-access-page="hub"] .portal-intro+.course-grid{margin-top:32px}
body[data-access-page="hub"] .course-grid .panel{display:flex;position:relative;flex-direction:column;align-items:flex-start;gap:0;min-height:295px;margin:0;padding:29px 31px 30px;counter-increment:portal-course;transition:border-color .2s,box-shadow .2s}
body[data-access-page="hub"] .course-grid .panel::before{content:'CASO ' counter(portal-course,decimal-leading-zero);display:block;align-self:flex-start;margin-bottom:18px;color:var(--portal-teal);font:400 .66rem/1.5 var(--portal-mono);letter-spacing:.13em}
body[data-access-page="hub"] .course-grid h2{min-height:2.5em;max-width:25ch;margin:0 0 12px;font-size:clamp(1.45rem,2.4vw,1.95rem);line-height:1.25}
body[data-access-page="hub"] .course-grid .muted{margin:0 0 11px;color:#b4c7bd;font-size:.82rem}
body[data-access-page="hub"] .course-grid .hint{margin:3px 0 12px;padding-left:10px;border-left:2px solid #4dfd9a77;color:#c7dfcf;font-size:.73rem}
body[data-access-page="hub"] .course-grid .course-time{margin:4px 0 23px;font:400 .76rem/1.8 var(--portal-mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em;color:#73feae}
body[data-access-page="hub"] .course-grid :is(button,a.button){align-self:flex-start;min-width:183px;margin-top:auto;padding:11px 18px;min-height:44px;font-size:.79rem}
body[data-access-page="hub"] .course-grid .panel:focus-within{border-color:#4dfd9a87;box-shadow:inset 0 1px #afffd33c,0 18px 48px #00000026,0 0 26px #4dfd9a14}
body[data-access-page="hub"] .course-grid .panel:not(:has(button,a.button)){background:linear-gradient(135deg,#202728b8,#151d20c4)}
body[data-access-page="hub"] .course-grid .panel:not(:has(button,a.button))::before{color:#9aaea5}
body[data-access-page="hub"] .course-grid .panel:not(:has(button,a.button))>.muted:last-child{margin:7px 0 0;padding-top:13px;border-top:1px solid var(--portal-line);color:#c5c7bc}
body[data-access-page="hub"] .course-grid+.hint{max-width:86ch;margin-top:23px;font-size:.79rem}
body[data-access-page="hub"] .portal-session-note{margin-top:23px;padding:15px 18px;border-left:2px solid #9bcdb84a;border-radius:0 8px 8px 0;background:#d9eee205}
body[data-access-page="hub"] .portal-session-note .hint{max-width:92ch;margin:0;font-size:.79rem;color:#b6c9be}
body[data-access-page="hub"] .portal-links{margin-top:27px}

/* Entry animation never hides content and does not replay when hub cards refresh. */
@keyframes portal-enter{from{opacity:.75;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes portal-neon-flow{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
@keyframes portal-breathe-glint{0%{background-position:145% 0,0% 50%}50%{background-position:-45% 0,100% 50%}100%{background-position:-45% 0,0% 50%}}
@media(prefers-reduced-motion:no-preference){
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-main{animation:portal-enter .5s cubic-bezier(.22,1,.3,1) both}
}
@media(hover:hover) and (pointer:fine){
  body[data-access-page="hub"] .course-grid .panel:has(button,a.button):hover{border-color:#4dfd9a5c;box-shadow:inset 0 1px #afffd330,0 18px 48px #00000030,0 0 24px #4dfd9a14}
}
@media(min-width:1500px){body:is([data-access-page="gate"],[data-access-page="hub"]){--portal-max:1240px}}
@media(max-width:1000px){
  body[data-access-page="gate"] .portal-gate{gap:35px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  body[data-access-page="gate"] .portal-intro h1{font-size:clamp(2.5rem,5vw,3.6rem)}
  body[data-access-page="gate"] .entry-panel{padding:27px}
  body[data-access-page="hub"] .course-grid .panel{padding:27px}
}
@media(max-width:760px){
  body:is([data-access-page="gate"],[data-access-page="hub"]) :is(.topbar,.portal-main,.portal-footer){width:calc(100% - 40px)}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .topbar{padding:23px 0;gap:16px}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .brand{font-size:.82rem;gap:11px}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .brand small{font-size:.65rem}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-brand-logo{width:60px}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-main{padding:43px 0 50px}
  body[data-access-page="gate"] .portal-gate{grid-template-columns:1fr;gap:31px;align-items:start;max-width:600px}
  body[data-access-page="gate"] .portal-intro{padding-bottom:0}
  body[data-access-page="gate"] .portal-intro h1{max-width:20ch;font-size:clamp(2.4rem,7vw,3.5rem)}
  body[data-access-page="gate"] .portal-intro .lead{max-width:53ch}
  body[data-access-page="gate"] .portal-steps{display:none}
  body[data-access-page="gate"] .entry-panel{padding:28px}
  body[data-access-page="hub"] .portal-intro h1{font-size:clamp(2.35rem,6.4vw,3.5rem)}
  body[data-access-page="hub"] .course-grid{gap:16px}
  body[data-access-page="hub"] .course-grid .panel{padding:24px;min-height:295px}
  body[data-access-page="hub"] .course-grid h2{font-size:1.5rem}
  body[data-access-page="hub"] .course-grid .course-time{font-size:.71rem}
}
@media(max-width:600px){
  body[data-access-page="hub"] .course-grid{grid-template-columns:1fr;gap:17px}
  body[data-access-page="hub"] .course-grid .panel{min-height:265px;padding:27px}
  body[data-access-page="hub"] .course-grid h2{min-height:0;max-width:25ch;font-size:1.75rem}
  body[data-access-page="hub"] .course-grid .panel::before{margin-bottom:16px}
  body[data-access-page="hub"] .course-grid .course-time{font-size:.76rem}
  body[data-access-page="hub"] .portal-deadline{margin-top:24px;font-size:.77rem}
}
@media(max-width:440px){
  body:is([data-access-page="gate"],[data-access-page="hub"]) :is(.topbar,.portal-main,.portal-footer){width:calc(100% - 32px)}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .topbar{align-items:flex-start;gap:12px;padding:20px 0}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .brand{gap:10px;font-size:.78rem}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-brand-logo{width:54px;margin-top:2px}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .brand small{max-width:22ch;font-size:.6rem;line-height:1.6}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .local-badge{max-width:90px;padding:4px 7px;font-size:.57rem;white-space:normal;text-align:center}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-main{padding-top:34px}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .lead{font-size:.98rem}
  body:is([data-access-page="gate"],[data-access-page="hub"]) .portal-footer{font-size:.7rem;padding:22px 0 27px}
  body[data-access-page="gate"] .portal-intro h1{font-size:clamp(2.2rem,9vw,2.8rem)}
  body[data-access-page="gate"] .entry-panel{padding:24px 21px;border-radius:16px}
  body[data-access-page="gate"] .entry-panel>h2{font-size:1.65rem;margin-bottom:23px}
  body[data-access-page="gate"] #code{font-size:.82rem;padding-inline:12px}
  body[data-access-page="gate"] .entry-panel .portal-links{gap:13px 20px;font-size:.74rem}
  body[data-access-page="hub"] .portal-intro h1{font-size:clamp(2.15rem,8vw,2.8rem)}
  body[data-access-page="hub"] .course-grid .panel{padding:24px;border-radius:15px}
  body[data-access-page="hub"] .course-grid h2{font-size:1.6rem}
  body[data-access-page="hub"] .course-grid :is(button,a.button){width:100%;min-width:0}
}
@media(prefers-reduced-motion:reduce){
  body:is([data-access-page="gate"],[data-access-page="hub"]) :is(.portal-main,.accent-text,button,.button){animation:none;transform:none;opacity:1}
  body:is([data-access-page="gate"],[data-access-page="hub"]) :is(button,a.button,input,.course-grid .panel){transition:none}
}
@media(forced-colors:active){
  body:is([data-access-page="gate"],[data-access-page="hub"]) .accent-text{background:none;color:CanvasText;-webkit-text-fill-color:CanvasText}
}
