/* ==========================================================================
   Berry International College — v8 live 3D halo hero + "Explore Berry" 3D portals
   Loaded after immersive.css on index.html.
   ========================================================================== */

/* 1. Halo hero ------------------------------------------------------------- */
.hero--halo { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: max(660px, 100svh); padding: calc(var(--header-h, 88px) + var(--sp-7)) 0 clamp(64px, 9vh, 112px); background: #050B1A; overflow: hidden; color: var(--white);
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(217, 168, 102, 0.55), transparent) 1; }
.halo__media { position: absolute; inset: 0; z-index: -1; }
.halo__poster, .halo__video, .halo__canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; display: block; }
.halo__video, .halo__canvas { opacity: 0; transition: opacity 1.4s var(--ease, ease); }
.hero--halo.is-playing .halo__video { opacity: 1; }
.hero--halo.is-live .halo__canvas { opacity: 1; }
.halo__canvas { touch-action: pan-y; cursor: grab; }
.hero--halo.is-live .halo__canvas { transition: none; }
/* soft shade so the headline always reads, plus a fade into the next band */
.halo__shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 11, 26, 0.78) 0%, rgba(5, 11, 26, 0.45) 30%, rgba(5, 11, 26, 0) 55%),
    linear-gradient(180deg, rgba(5, 11, 26, 0.55) 0%, rgba(5, 11, 26, 0) 22%, rgba(5, 11, 26, 0) 62%, rgba(5, 11, 26, 0.85) 100%); }

.halo__inner { position: relative; width: 100%; pointer-events: none; }
.halo__content { max-width: 680px; }
.halo__content :is(a, button, .hero-pill, .halo__hint) { pointer-events: auto; }
.halo__title { margin: var(--sp-5) 0 var(--sp-5); font-size: clamp(2.6rem, 1.3rem + 3.4vw, 5rem); line-height: 0.98; letter-spacing: -0.035em; color: var(--white); text-wrap: balance; text-shadow: 0 6px 40px rgba(5, 11, 26, 0.55); }
.halo__title em { font-style: normal; background: linear-gradient(100deg, #CFE2F8 0%, #8DB9EA 35%, #D9A866 75%, #F1D3A6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.halo__lede { max-width: 46ch; color: rgba(236, 241, 250, 0.9); text-shadow: 0 2px 20px rgba(5, 11, 26, 0.9); }
.halo__hint { display: inline-flex; align-items: center; gap: 10px; margin-top: var(--sp-5); font-size: 0.82rem; letter-spacing: 0.02em; color: rgba(213, 220, 232, 0.8); }
.halo__hint-icon { position: relative; width: 30px; height: 18px; border: 1.5px solid rgba(217, 168, 102, 0.8); border-radius: 10px; }
.halo__hint-icon::after { content: ""; position: absolute; top: 50%; left: 5px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--bronze-light, #D9A866); animation: halo-hint 2.2s ease-in-out infinite; }
@keyframes halo-hint { 50% { transform: translateX(10px); } }
.hero--halo:not(.is-live) .halo__hint, .hero--halo.is-touched .halo__hint { opacity: 0; transition: opacity 0.6s; }

/* explore chips: float next to the six bigger blades (positioned by hero-halo.js) */
.halo__chips { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.halo-chip { position: absolute; left: 0; top: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; padding: 8px 14px 8px 11px; border-radius: 14px;
  color: var(--white); text-decoration: none; white-space: nowrap; pointer-events: auto; opacity: 0;
  background: rgba(8, 20, 46, 0.42); border: 1px solid rgba(141, 185, 234, 0.28); box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s; will-change: transform; }
.halo-chip b { font-family: var(--font-heading, inherit); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.01em; }
.halo-chip small { grid-column: 2; font-size: 0.7rem; color: rgba(213, 220, 232, 0.75); max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease, ease); }
.halo-chip__dot { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--bronze-light, #D9A866); box-shadow: 0 0 0 0 rgba(217, 168, 102, 0.6); animation: pulse 2.4s infinite; }
.halo-chip:hover, .halo-chip:focus-visible, .halo-chip.is-active { background: rgba(58, 107, 176, 0.55); border-color: rgba(217, 168, 102, 0.85); box-shadow: 0 16px 40px -12px rgba(58, 107, 176, 0.8); }
.halo-chip:hover small, .halo-chip:focus-visible small, .halo-chip.is-active small { max-height: 1.4em; }
.halo-chip:focus-visible { outline: 2px solid var(--bronze-light, #D9A866); outline-offset: 3px; }

/* chips sit as a tidy row when the ring is not live or on narrow screens */
.hero--halo:not(.is-live) .halo__chips, .hero--halo .halo__chips.is-row { position: static; }
@media (min-width: 900px) { .hero--halo:not(.is-live) .halo__chips { display: none; } }

.hero--halo .scroll-cue { z-index: 2; }

@media (max-width: 899px) {
  .hero--halo { flex-direction: column; justify-content: flex-end; align-items: stretch; min-height: max(720px, 100svh); padding-top: calc(var(--header-h, 88px) + 36vh); padding-bottom: var(--sp-7); }
  .hero--halo .hero-pill { display: none; }
  .halo__poster, .halo__video { object-position: 50% 30%; }
  .halo__shade { background: linear-gradient(180deg, rgba(5, 11, 26, 0.35) 0%, rgba(5, 11, 26, 0) 25%, rgba(5, 11, 26, 0.25) 45%, rgba(5, 11, 26, 0.92) 72%, #050B1A 100%); }
  .halo__chips { position: relative; inset: auto; order: 2; display: flex; gap: 8px; overflow-x: auto; padding: var(--sp-4) var(--gutter) 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .halo__chips::-webkit-scrollbar { display: none; }
  .halo-chip { position: relative; transform: none !important; opacity: 1 !important; flex: none; }
  .halo-chip small { max-height: 1.4em; }
  .halo__title { font-size: clamp(2.3rem, 10vw, 3.4rem); }
  .halo__hint { display: none; }
  .hero--halo .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .halo__hint-icon::after, .halo-chip__dot { animation: none; }
}
@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  .hero--halo.is-still .halo__chips { display: none; }
}

/* 2. Explore Berry — 3D video portals ----------------------------------------- */
.explore-portals { position: relative; padding: var(--section-y) 0; background: radial-gradient(120% 80% at 50% 0%, #10275a 0%, #050B1A 62%); color: var(--white); overflow: hidden;
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(217, 168, 102, 0.55), transparent) 1; }
.explore-portals .eyebrow { color: var(--bronze-light, #D9A866); }
.explore-portals h2 { color: var(--white); max-width: 18ch; }
.explore-portals h2 em { font-style: normal; color: var(--bronze-light, #D9A866); }
.explore-portals__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--head-gap); }
.explore-portals__head p { max-width: 44ch; color: var(--on-navy); margin: 0; }

.portals { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--grid-gap); perspective: 1400px; }
.portal { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; position: relative; grid-column: span 6; min-height: clamp(300px, 34vw, 440px); border-radius: 24px; overflow: hidden; isolation: isolate;
  color: var(--white); text-decoration: none; background: #0A1530; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(141, 185, 234, 0.16) inset; transition: transform 0.5s var(--ease, ease), box-shadow 0.4s; }
.portal:nth-child(1) { grid-column: span 7; }
.portal:nth-child(2) { grid-column: span 5; }
.portal:nth-child(3) { grid-column: span 5; }
.portal:nth-child(4) { grid-column: span 7; }
.portal img, .portal video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease, ease), filter 0.6s; }
.portal video { opacity: 0; transition: opacity 0.8s, transform 1.2s var(--ease, ease); }
.portal.is-playing video { opacity: 1; }
.portal::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 11, 26, 0) 35%, rgba(5, 11, 26, 0.88) 100%); }
.portal::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(500px circle at var(--mx) var(--my), rgba(217, 168, 102, 0.22), transparent 45%); }
.portal:hover::after, .portal:focus-visible::after { opacity: 1; }
.portal:hover, .portal:focus-visible { box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(217, 168, 102, 0.6) inset; }
.portal:hover img, .portal:hover video { transform: scale(1.05); }
.portal:focus-visible { outline: 2px solid var(--bronze-light, #D9A866); outline-offset: 4px; }
.portal__body { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(20px, 2.4vw, 34px); transform: translateZ(40px); }
.portal__tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 5px 11px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; background: rgba(5, 11, 26, 0.5); border: 1px solid rgba(141, 185, 234, 0.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.portal__tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bronze-light, #D9A866); }
.portal h3 { margin: 0 0 6px; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.3rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--white); }
.portal p { margin: 0; max-width: 40ch; color: rgba(213, 220, 232, 0.88); font-size: 0.95rem; }
.portal__go { position: absolute; right: clamp(20px, 2.4vw, 34px); bottom: clamp(20px, 2.4vw, 34px); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); transition: background 0.3s, transform 0.4s var(--ease, ease); }
.portal__go svg { width: 20px; height: 20px; }
.portal:hover .portal__go { background: var(--berry, #3A6BB0); transform: rotate(-45deg); border-color: transparent; }
.portal__body { padding-right: 96px; }

@media (max-width: 860px) {
  .portal, .portal:nth-child(n) { grid-column: span 12; min-height: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal { transform: none !important; }
  .portal video { display: none; }
}

/* keep text white on hover (the global link hover colour is for light sections) */
.halo-chip, .halo-chip:hover, .halo-chip:focus-visible, .portal, .portal:hover, .portal:focus-visible { color: var(--white); }
.halo-chip b, .portal h3 { color: inherit; }
