/* Public event windows share the Research palette, with individual branch art. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-grotesque.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --paper: #f3f6fc;
  --line: #dbe3f0;
  --muted: #475a73;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
}
body { background: linear-gradient(180deg, #f9fbff, var(--paper) 55%); }
h1, h2, h3 { font-family: var(--display); }
.site-head { background: #08162cf2; backdrop-filter: blur(18px); }
.head-inner { min-height: 72px; }
.head-inner nav { align-items: center; gap: .3rem; }
.head-inner nav a, .staff-link {
  padding: .59rem .8rem;
  border-radius: 8px;
  transition: color .18s, background .18s;
}
.head-inner nav a[aria-current="page"] { background: #ffffff17; color: #ffe1a1; }
.staff-link { border: 1px solid #ffffff35; }
.head-actions { display: flex; align-items: center; gap: .55rem; }
.account-link { color: var(--ink); background: var(--gold); border-color: var(--gold); font-weight: 750; }
.account-link:hover, .account-link[aria-current="page"] { color: var(--ink); background: #ffdc8a; }
.staff-link[aria-current="page"]:not(.account-link) { color: #fff; background: #ffffff18; }
.hero {
  background:
    radial-gradient(ellipse at 26% 5%, #1b3b64 0%, transparent 58%),
    linear-gradient(135deg, #0b1a34, #08162c 75%);
}
.hero-inner {
  position: relative;
  isolation: isolate;
  min-height: clamp(475px, 43vw, 620px);
  display: flex;
  padding-block: clamp(2.5rem, 5vw, 3.9rem);
}
.hero-copy { max-width: 55%; }
.hero h1 { font-size: clamp(3.6rem, 8.3vw, 7.8rem); font-weight: 800; letter-spacing: -.07em; }
.hero-intro { margin-bottom: 1.2rem; }
.event-dates { margin: 0 0 1.25rem; padding-inline-start: .75rem; border-inline-start: 2px solid var(--gold); }
.hero-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.button { transition: background .2s, border-color .2s, transform .2s; }
.button:hover { transform: translateY(-1px); }
.button.hero-secondary { border-color: #ffffff55; background: #ffffff09; color: #fff; }
.button.hero-secondary:hover { background: #ffffff18; }
.hero-photo {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 37%;
  right: min(0px, calc((1280px - 100vw) / 2));
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #183858;
  box-shadow: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 32%);
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #102643 0%, #102643e6 12%, #10264318 51%),
    linear-gradient(0deg, #08162cde 0%, #08162c00 47%);
}
.hero-photo img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 58% 53%; }
.hero-photo figcaption {
  z-index: 1;
  inset: auto 1.3rem 1.3rem auto;
  display: grid;
  gap: .2rem;
  padding: .7rem .9rem;
  border: 1px solid #ffffff45;
  border-radius: 12px;
  background: #08162cbd;
  font-weight: 700;
  font-size: .94rem;
}
.hero-photo figcaption small { font-size: .75rem; font-weight: 500; color: #d4e0f1; }
.home-content { padding-block: clamp(2.5rem, 6vw, 4.6rem); }
.home-intro, .about-school { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(1.2rem, 5vw, 4rem); }
.home-intro { margin-top: clamp(3rem, 7vw, 5.8rem); }
.home-intro p, .about-school p { color: var(--muted); line-height: 1.7; max-width: 62ch; }
.home-intro .eyebrow { color: var(--accent); }
.school-photo { position: relative; margin: 0; overflow: hidden; border-radius: 20px; background: #d8e1ed; }
.school-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; }
.school-photo figcaption {
  position: absolute; inset: auto 0 0;
  padding: 1.5rem .9rem .7rem;
  background: linear-gradient(transparent, #08162cd9); color: #fff; font-size: .78rem;
}
.category-section .section-head { margin-bottom: 1.1rem; align-items: center; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; }
.category-card {
  position: relative; isolation: isolate; display: flex; align-items: end; justify-content: space-between; min-height: 206px;
  border-radius: 20px; padding: 1.25rem; color: #fff; background: var(--category-bg); overflow: hidden; text-decoration: none;
  transition: transform .24s ease, box-shadow .24s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: 0 13px 24px #0a224733; }
.category-card h3 { font-size: clamp(1.12rem, 2vw, 1.46rem); line-height: 1.15; margin: 0 0 .2rem; }
.category-count { font-size: .8rem; opacity: .88; }
.category-arrow {
  display: grid; place-items: center; flex: 0 0 auto; width: 2.25rem; height: 2.25rem;
  border: 1px solid #ffffff85; border-radius: 50%; background: #07122374; font-size: 1.15rem;
}
.category-art { position: absolute; inset: 0; z-index: -1; background: var(--category-art); background-size: cover; background-position: center; transition: transform .25s ease; }
.category-card:hover .category-art { transform: scale(1.035); }
[data-category="0"] {
  --category-bg: #153f39;
  --category-art: linear-gradient(0deg,#081e1ff5 6%,#0d302e42 80%), url('/assets/school-sports.webp');
  --category-hue: 158;
}
[data-category="1"] {
  --category-bg: #432b62;
  --category-art: linear-gradient(0deg,#211132f5 6%,#3e215541 80%), url('/assets/school-arts.jpg');
  --category-hue: 276;
}
[data-category="2"] {
  --category-bg: #1e416f;
  --category-art: linear-gradient(0deg,#0d233ff5 6%,#17355d41 80%), url('/assets/science.jpg');
  --category-hue: 216;
}
.window-heading {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(1.65rem, 4vw, 3rem); border-radius: 23px;
  color: #fff; background: linear-gradient(118deg, #081a36, #183c6b 86%);
  margin-bottom: 1.3rem;
}
.window-heading::after {
  content: ""; position: absolute; z-index: -1; inset: -110% -8% -105% 48%;
  background: repeating-radial-gradient(circle at 75% 50%, transparent 0 26px, #abc6ea24 27px 28px, transparent 29px 55px);
  transform: rotate(-16deg);
}
.window-heading h1, .branch-hero h1 {
  font-size: clamp(2.55rem, 6vw, 5.1rem); margin: 0; line-height: 1.01;
  letter-spacing: -.062em; overflow-wrap: anywhere;
}
.window-heading > p:not(.eyebrow) { margin: .8rem 0 0; max-width: 58ch; line-height: 1.6; color: #dce7f7; }
.window-heading .eyebrow { color: #ffd17d; }
.directory-window[data-category]:not([data-category=""]) .directory-heading {
  background: linear-gradient(118deg, hsl(var(--category-hue) 58% 13%), hsl(var(--category-hue) 57% 30%) 86%);
}
.directory-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: .75rem;
}
.directory-toolbar .categories { margin-block: 0; }
.filter-option {
  display: inline-flex; align-items: center; min-height: 39px; padding: .48rem .85rem; border: 1px solid #c8d4e5;
  color: #173052; border-radius: 99px; font-weight: 650; font-size: .89rem; text-decoration: none;
  transition: color .2s, background .2s, border-color .2s;
}
.filter-option:hover { background: #e6eefb; }
.filter-option[aria-current="true"] { color: #fff; background: #142d50; border-color: #142d50; }
.branch-results { margin: .75rem 0; min-height: 1.2em; color: var(--muted); font-size: .85rem; }
.branch-card {
  --branch-hue: var(--category-hue, 216);
  --branch-color: hsl(var(--branch-hue) 78% 62%);
  --branch-dark: hsl(var(--branch-hue) 54% 17%);
  --branch-ink: hsl(var(--branch-hue) 64% 29%);
  padding: 0; gap: 0; overflow: hidden; border-radius: 17px; box-shadow: 0 5px 18px #14294c0a;
}
.branch-card:hover { border-color: var(--branch-color); }
.branch-card-copy { display: flex; flex-direction: column; flex: 1; gap: .5rem; padding: 1rem 1.2rem 1.15rem; }
.branch-card-copy .eyebrow, .branch-action { color: var(--branch-ink); }
.branch-card-copy h3 { font-size: 1.42rem; }
.branch-card-copy p { margin-bottom: .35rem; font-size: .9rem; }
.branch-card .branch-art { height: 118px; flex: 0 0 auto; }
.branch-art {
  position: relative; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  color: var(--branch-color);
  background: radial-gradient(ellipse at 68% 30%, hsl(var(--branch-hue) 56% 29%), transparent 75%), var(--branch-dark);
}
.branch-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 15px 15px; mask-image: linear-gradient(120deg, transparent, #000);
}
.art-shape, .art-detail { position: absolute; display: block; }
.art-shape { width: 54%; height: 65%; border: 2px solid currentColor; border-radius: 16px; transform: rotate(-12deg); opacity: .82; }
.art-detail { width: 18%; aspect-ratio: 1; border: 2px solid currentColor; border-radius: 50%; }
[data-branch="basketball"] { --branch-hue: 24; }
[data-branch="badminton"] { --branch-hue: 85; }
[data-branch="futsal"] { --branch-hue: 147; }
[data-branch="volleyball"] { --branch-hue: 8; }
[data-branch="padel"] { --branch-hue: 176; }
[data-branch="esports"] { --branch-hue: 264; }
[data-branch="arm-wrestling"] { --branch-hue: 351; }
[data-branch="chess"] { --branch-hue: 41; }
[data-branch="dance"] { --branch-hue: 316; }
[data-branch="research"] { --branch-hue: 36; }
[data-branch="chemun"] { --branch-hue: 215; }
[data-branch="spark"] { --branch-hue: 188; }
[data-branch="basketball"] .art-shape {
  background: linear-gradient(90deg, transparent 49.7%, currentColor 50% 50.5%, transparent 50.8%);
}
[data-branch="basketball"] .art-detail { width: 12%; background: radial-gradient(circle, transparent 35%, #ffba8842 36%); }
[data-branch="badminton"] .art-shape {
  width: 36%; height: 50%; border: 0; transform: rotate(-30deg);
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 10px);
  clip-path: polygon(0 0, 100% 0, 68% 100%, 32% 100%);
}
[data-branch="badminton"] .art-detail { width: 13%; height: 18%; top: 66%; left: 53%; background: var(--branch-dark); transform: rotate(-30deg); }
[data-branch="futsal"] .art-shape {
  border-radius: 6px;
  background: linear-gradient(90deg, #ffffff0e 50%, transparent 50%) 0 0/16% 100%,
    linear-gradient(90deg, transparent 49.4%, currentColor 49.5% 50.5%, transparent 50.6%);
}
[data-branch="futsal"] .art-detail { width: 13%; }
[data-branch="volleyball"] .art-shape {
  width: 64%; height: 33%; border-radius: 3px; transform: rotate(-14deg) translateY(18%);
  background: repeating-linear-gradient(90deg, transparent 0 11px, currentColor 12px 13px),
    repeating-linear-gradient(0deg, transparent 0 11px, currentColor 12px 13px);
}
[data-branch="volleyball"] .art-detail { top: 16%; left: 62%; width: 11%; background: var(--branch-dark); }
[data-branch="padel"] .art-shape {
  box-shadow: inset 0 0 0 7px var(--branch-dark), inset 0 0 0 9px currentColor;
  background: linear-gradient(0deg, transparent 48.5%, currentColor 49% 51%, transparent 51.5%);
}
[data-branch="padel"] .art-detail { width: 6%; border-width: 0; background: currentColor; left: 64%; top: 32%; }
[data-branch="esports"] .art-shape {
  border: 0; width: 62%; height: 58%; border-radius: 0;
  background: repeating-linear-gradient(90deg, transparent 0 15px, currentColor 16px 17px),
    repeating-linear-gradient(0deg, transparent 0 15px, currentColor 16px 17px);
  transform: perspective(240px) rotateX(31deg) rotate(-12deg);
}
[data-branch="esports"] .art-detail { border-radius: 4px; transform: rotate(-12deg); box-shadow: 0 0 18px currentColor; background: var(--branch-dark); width: 11%; }
[data-branch="arm-wrestling"] .art-shape {
  width: 72%; border: 0; border-radius: 0; transform: none; background: currentColor;
  clip-path: polygon(0 100%, 43% 15%, 50% 52%, 77% 4%, 100% 0, 53% 100%, 46% 64%, 23% 100%);
}
[data-branch="arm-wrestling"] .art-detail { display: none; }
[data-branch="chess"] .art-shape {
  width: 42%; height: 68%; border-radius: 4px;
  background: conic-gradient(#ffe6b07a 25%, transparent 0 50%, #ffe6b07a 0 75%, transparent 0) 0 0/25% 25%;
  transform: rotate(-17deg) skewX(10deg);
}
[data-branch="chess"] .art-detail { width: 8%; background: var(--branch-dark); left: 63%; top: 20%; }
[data-branch="dance"] .art-shape {
  border: 0; width: 76%; height: 108%; transform: none;
  background: conic-gradient(from 140deg at 26% 0%, #ffffff00, #f2a9f6b0 12deg, #ffffff00 39deg),
    conic-gradient(from 184deg at 76% 0%, #ffffff00, #de89f4a8 22deg, #ffffff00 42deg);
}
[data-branch="dance"] .art-detail { bottom: 12%; width: 49%; height: 14%; border-radius: 50%; background: #e4a1f464; }
[data-branch="research"] .art-shape {
  width: 47%; height: 79%; border: 0; border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, transparent 0 12%, currentColor 13% 15%, transparent 16% 23%);
}
[data-branch="research"] .art-detail { width: 7%; background: currentColor; box-shadow: 0 0 20px currentColor; }
[data-branch="chemun"] .art-shape {
  width: 33%; aspect-ratio: 1; height: auto; max-height: 80%; border-radius: 50%;
  background: repeating-linear-gradient(0deg, transparent 0 17%, currentColor 18% 19%, transparent 20% 32%);
  transform: rotate(-16deg);
}
[data-branch="chemun"] .art-detail { width: 16%; height: 80%; aspect-ratio: auto; transform: rotate(-16deg); }
[data-branch="spark"] .art-shape {
  width: 65%; height: 89%; transform: rotate(12deg); border: 0; background: currentColor;
  clip-path: polygon(50% 0, 57% 38%, 88% 11%, 68% 44%, 100% 50%, 68% 56%, 88% 89%, 57% 62%, 50% 100%, 43% 62%, 12% 89%, 32% 56%, 0 50%, 32% 44%, 12% 11%, 43% 38%);
}
[data-branch="spark"] .art-detail { width: 7%; background: #fff; border: 0; box-shadow: 0 0 25px #a9fffb; }
.event-view[data-branch] {
  --branch-color: hsl(var(--branch-hue, 216) 78% 68%);
  --branch-dark: hsl(var(--branch-hue, 216) 57% 17%);
  --branch-ink: hsl(var(--branch-hue, 216) 64% 28%);
}
.branch-hero {
  display: grid; grid-template-columns: 1.13fr .87fr; overflow: hidden; border-radius: 24px;
  color: #fff; background: linear-gradient(115deg, #08172f, var(--branch-dark));
}
.branch-hero-copy { padding: clamp(1.5rem, 4vw, 3.2rem); align-self: center; }
.branch-hero .eyebrow { display: inline-block; margin-bottom: 1rem; color: var(--branch-color); text-underline-offset: .26rem; }
.branch-hero .intro { color: #e2ebf8; margin: .9rem 0 0; }
.branch-hero .button { margin-top: 1.15rem; }
.branch-hero .branch-art { min-height: 230px; background-color: var(--branch-dark); }
.branch-hero .branch-art:has(.branch-photo-credit) { background-size: cover; background-position: center; }
[data-branch="basketball"] .branch-hero .branch-art { background-image: linear-gradient(90deg,#441b0869,#1b160f1f),url('/assets/school-sports.webp'); }
[data-branch="dance"] .branch-hero .branch-art { background-image: linear-gradient(90deg,#37113c60,#26112917),url('/assets/school-arts.jpg'); }
.branch-hero .branch-art:has(.branch-photo-credit) .art-shape,
.branch-hero .branch-art:has(.branch-photo-credit) .art-detail { display: none; }
.branch-photo-credit {
  position: absolute; right: .75rem; bottom: .7rem; padding: .28rem .55rem;
  border-radius: 6px; color: white; background: #08162cdb; font-size: .72rem;
}
.branch-panel { border-top: 3px solid var(--branch-color); }
.branch-panel h2, .branch-panel .resources a { color: var(--branch-ink); }
.back { display: inline-block; margin: 0 0 1rem; color: #193756; }
.about-school { margin-block: clamp(1.7rem, 4vw, 3rem); }
.about-jumps { flex-wrap: wrap; gap: .55rem 1.25rem; margin-top: 1.35rem; }
.about-jumps a { position: relative; color: #ffe0a1; text-decoration: underline; text-underline-offset: .25em; }
.about-window section[id] { scroll-margin-top: 8rem; }
.values-section { margin: clamp(2.6rem, 6vw, 5rem) 0; }
.values-intro { margin-bottom: 1.35rem; }
.values-intro h2 { font-size: clamp(1.9rem, 4.2vw, 3.35rem); line-height: 1.08; margin: .2rem 0 .85rem; }
.values-intro p:not(.eyebrow), .values-stories p { max-width: 66ch; color: var(--muted); line-height: 1.65; }
.school-values {
  padding: clamp(1.3rem, 4vw, 3rem);
  border-radius: 24px;
  background: radial-gradient(ellipse at 95% 5%, #26476a, #112743 55%, #08162c);
  color: #fff;
}
.school-values .eyebrow, .school-values .text-link { color: #ffdc93; }
.school-values .values-intro h2 { max-width: 21ch; }
.values-grid, .values-stories, .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
  gap: 1rem;
}
.values-grid article {
  border: 1px solid #ffffff35;
  border-top: 3px solid #ffca63;
  border-radius: 13px;
  background: #ffffff0b;
  padding: 1.15rem;
}
.values-grid h3, .values-stories h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
.values-grid p { margin: 0; color: #e1ebf7; line-height: 1.6; }
.values-stories article { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.values-stories article > div { padding: 1.15rem; }
.values-stories p { margin: 0; }
.values-stories .school-photo { border-radius: 0; box-shadow: none; }
.values-stories .school-photo img { aspect-ratio: 1.65; }
.competition-values > .text-link { display: inline-block; margin-top: 1.25rem; }
.dashboard-grid { margin: 1.1rem 0; }
.dashboard-grid .panel { margin: 0; }
.access-panel { border-radius: 18px; box-shadow: 0 7px 25px #10294d0a; }
.dashboard-grid .access-panel { border-top: 3px solid #d5a448; }
.access-panel h2 { margin-top: 0; }
.access-panel p { color: var(--muted); line-height: 1.6; }
.access-panel .button { margin-top: .45rem; }
.branch-workspaces { grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
.branch-workspaces li { padding: 0; border: 0; }
.branch-workspaces a {
  display: block; padding: .75rem .85rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--paper); text-decoration: none;
}
.branch-workspaces a:hover { border-color: #8c9eb8; background: #e9eff9; }
.campus-section .section-head { margin-bottom: 1rem; }
.map-layout {
  display: grid; grid-template-columns: minmax(250px, .7fr) 1.3fr;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 10px 28px #122c5114;
}
.campus-address { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; padding: clamp(1.2rem, 4vw, 2.4rem); background: #0a2142; color: #fff; }
.campus-address h3 { font-size: 1.34rem; line-height: 1.18; margin: 0; }
.campus-address address { font-style: normal; color: #d5e4fa; line-height: 1.6; }
.campus-address .text-link { overflow-wrap: anywhere; }
.campus-map-holder, .event-campus-map { min-height: 340px; background: #d9e4f0; }
.event-campus-map { height: 100%; z-index: 1; }
.leaflet-control-attribution a { color: #123a66; }
@media (prefers-reduced-motion: no-preference) {
  #event-home:not([hidden]), .event-view:not([hidden]) { animation: window-in .32s ease-out both; }
  .branch-hero { animation: window-in .28s ease-out both; }
  @keyframes window-in { from { opacity: .55; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  .button:hover, .category-card:hover, .category-card:hover .category-art, .branch-card:hover { transform: none; }
}
@media (max-width: 780px) {
  .map-layout { grid-template-columns: 1fr; }
  .branch-hero .branch-art { min-height: 175px; }
}
@media (max-width: 660px) {
  .head-inner { min-height: 0; }
  .head-inner nav a { padding: .52rem .65rem; }
  .hero-inner { display: grid; gap: 1.5rem; padding-block: 2.2rem 1.4rem; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(3.05rem, 12vw, 5.5rem); }
  .hero-photo { position: relative; z-index: 0; inset: auto; border-radius: 16px; mask-image: none; }
  .hero-photo::after { background: linear-gradient(0deg, #08162c7d, transparent 60%); }
  .hero-photo img { height: auto; aspect-ratio: 1.65; }
  .hero-photo figcaption { inset: auto .65rem .65rem auto; }
  .home-intro, .about-school, .category-grid, .branch-hero { grid-template-columns: 1fr; }
  .directory-toolbar { align-items: stretch; flex-direction: column; }
  .category-card { min-height: 125px; }
  .branch-hero .branch-art { min-height: 155px; }
  .event-campus-map, .campus-map-holder { min-height: 285px; }
  .about-window section[id] { scroll-margin-top: 10rem; }
}
@media (max-width: 410px) {
  .brand img { width: 91px; }
  .head-actions { gap: .3rem; }
  .head-actions .staff-link { padding-inline: .5rem; font-size: .77rem; }
}
