/* =========================================================================
   LightMesh 2.0 — design tokens
   ========================================================================= */
:root{
  --bg:        #070b18;
  --bg-elev:   #0b1226;
  --surface:   #101a34;
  --surface-2: #0d1730;
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);

  --text:       #eef2ff;
  --text-muted: #9aa3c7;
  --text-dim:   #5c6488;

  /* spectrum accents — one per session, low to high "wavelength" */
  --s1: #8b6bff; /* violet   */
  --s2: #3ea6ff; /* blue     */
  --s3: #2dd4bf; /* teal     */
  --s4: #fbbf24; /* amber    */
  --s5: #fb6b4a; /* coral    */

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 18px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* subtle ambient glow */
body::before{
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(50% 60% at 20% 0%, rgba(139,107,255,0.16), transparent 70%),
    radial-gradient(40% 50% at 80% 10%, rgba(62,166,255,0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-guide{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
}
.bg-guide path{
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1.4;
}

/* =========================================================================
   Nav
   ========================================================================= */
.nav{
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
}
.nav__brand{
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.1;
}
.nav__mark{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--s2);
}
.nav__sub{
  font-size: 0.78rem;
  color: var(--text-muted);
}
.nav__cta{
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-2);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.nav__cta:hover{
  color: var(--text);
  border-color: var(--s2);
  background: rgba(62,166,255,0.08);
}

/* =========================================================================
   Floating glass menu
   ========================================================================= */
.nav__menu-wrap{
  position: relative;
}
.nav__menu-btn{
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: rgba(16, 26, 52, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.nav__menu-btn:hover{
  border-color: var(--s2);
  background: rgba(62,166,255,0.1);
}
.nav__menu-btn span{
  width: 18px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .2s ease;
}
.nav__menu-btn[aria-expanded="true"] span:nth-child(1){
  transform: translateY(6.6px) rotate(45deg);
}
.nav__menu-btn[aria-expanded="true"] span:nth-child(2){
  opacity: 0;
}
.nav__menu-btn[aria-expanded="true"] span:nth-child(3){
  transform: translateY(-6.6px) rotate(-45deg);
}

.nav__panel{
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border-2);
  background: rgba(16, 24, 48, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
}
.nav__panel[data-open]{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nav__panel-link{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav__panel-link:hover{
  background: rgba(255,255,255,0.06);
  color: var(--s2);
}
.nav__panel-link-arrow{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.nav__panel-link--muted{
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.nav__panel-link--muted .nav__panel-link-label{ color: var(--text-muted); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero{
  position: relative;
  z-index: 2;
  padding: clamp(40px, 9vw, 96px) clamp(20px, 5vw, 64px) clamp(60px, 8vw, 100px);
  overflow: hidden;
}
.hero__photons{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero__content{
  position: relative;
  z-index: 1;
}
.hero__eyebrow{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--s3);
  margin: 0 0 18px;
}
.hero__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.02em;
}
.hero__title-accent{
  background: linear-gradient(90deg, var(--s1), var(--s2) 40%, var(--s3) 70%, var(--s4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__version{
  position: relative;
  display: inline-block;
}
.hero__version-num{
  position: relative;
  display: inline-block;
}
.hero__version-num.is-glitching{
  animation: glitch-jitter 0.42s steps(2, end) 2;
}
.hero__version-num.is-glitching::before,
.hero__version-num.is-glitching::after{
  content: attr(data-glitch);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.hero__version-num.is-glitching::before{
  color: var(--s2);
  animation: glitch-slice-a 0.42s steps(2, end) 2;
}
.hero__version-num.is-glitching::after{
  color: var(--s5);
  animation: glitch-slice-b 0.42s steps(2, end) 2;
}
@keyframes glitch-jitter{
  0%, 100%{ transform: translate(0, 0); }
  20%{ transform: translate(-1px, 1px); }
  40%{ transform: translate(1px, -1px); }
  60%{ transform: translate(-1px, -1px); }
  80%{ transform: translate(1px, 1px); }
}
@keyframes glitch-slice-a{
  0%{ clip-path: inset(0 0 60% 0); transform: translate(-3px, -1px); }
  50%{ clip-path: inset(10% 0 40% 0); transform: translate(2px, 1px); }
  100%{ clip-path: inset(0 0 60% 0); transform: translate(-3px, -1px); }
}
@keyframes glitch-slice-b{
  0%{ clip-path: inset(50% 0 0 0); transform: translate(3px, 1px); }
  50%{ clip-path: inset(35% 0 5% 0); transform: translate(-2px, -1px); }
  100%{ clip-path: inset(50% 0 0 0); transform: translate(3px, 1px); }
}

.hero__tagline{
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 20px 0 0;
}
.hero__cta-game{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 14px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--s1), var(--s2));
  color: #0a0e1c;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(139,107,255,0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero__cta-game:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(139,107,255,0.5);
}
.hero__cta-game-icon{ font-size: 1.15rem; line-height: 1; }
.hero__cta-game-arrow{ transition: transform .2s ease; }
.hero__cta-game:hover .hero__cta-game-arrow{ transform: translateX(4px); }

.hero__meta{
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 56px);
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hero__meta-item{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero__meta-label{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero__meta-value{
  font-size: 0.95rem;
  color: var(--text);
}
.hero__scroll-cue{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 56px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-family: var(--font-mono);
}
.hero__scroll-cue span{
  width: 26px;
  height: 1px;
  background: var(--text-dim);
  position: relative;
  overflow: hidden;
}
.hero__scroll-cue span::after{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--s3);
  animation: pulse-line 1.8s ease-in-out infinite;
}
@keyframes pulse-line{
  0%{ transform: translateX(-100%); }
  50%{ transform: translateX(0%); }
  100%{ transform: translateX(100%); }
}
.hero__scroll-cue:hover{ color: var(--text); }

/* =========================================================================
   Sessions
   ========================================================================= */
.sessions{
  position: relative;
  z-index: 2;
  padding: 0 0 100px;
}
.sessions__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 64px);
  margin-bottom: 28px;
}
.sessions__title{
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
  font-weight: 600;
}
.sessions__controls{
  display: flex;
  gap: 10px;
}
.scroll-btn{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.scroll-btn:hover{
  border-color: var(--s2);
  background: rgba(62,166,255,0.1);
}
.scroll-btn:active{ transform: scale(0.94); }

.track-wrap{
  padding: 0 clamp(20px, 5vw, 64px);
}
.track{
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  scrollbar-width: none;
}
.track::-webkit-scrollbar{ display: none; }

.card{
  --accent: var(--s1);
  scroll-snap-align: start;
  flex: 0 0 clamp(280px, 78vw, 340px);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease;
}
.card::before{
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}
.card:hover{
  border-color: var(--border-2);
  transform: translateY(-3px);
}

.card__eyebrow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.card__index{ color: var(--accent); }

.card__field{
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.card__title{
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.card__speaker{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card__speaker-name{
  font-size: 0.95rem;
  font-weight: 500;
}
.card__speaker-inst{
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card__datetime{
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.card__status{
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer{
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.timer__label{
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.timer__value{
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  width: fit-content;
}
.badge--live{ color: var(--s4); }
.badge--live .dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--s4);
  box-shadow: 0 0 10px var(--s4);
  animation: blink 1.1s ease-in-out infinite;
}
.badge--ended{ color: var(--text-dim); }
.badge--ended .dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
@keyframes blink{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.35; }
}

.card__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* ---- Add to Calendar: button + popup ---------------------------------- */
.cal-btn{
  cursor: pointer;
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
}
.cal-btn__chevron{
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform .2s ease;
}
.cal-btn[aria-expanded="true"]{
  color: var(--text);
  border-color: var(--text-muted);
}
.cal-btn[aria-expanded="true"] .cal-btn__chevron{ transform: rotate(180deg); }

.cal-menu{
  position: fixed;               /* escapes card/track overflow clipping */
  z-index: 1000;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: rgba(13, 23, 48, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  transform-origin: top left;
  animation: cal-pop .14s ease-out;
}
.cal-menu[hidden]{ display: none; }
.cal-menu--above{ transform-origin: bottom left; }
@keyframes cal-pop{
  from{ opacity: 0; transform: translateY(-4px) scale(.97); }
  to{ opacity: 1; transform: none; }
}
.cal-menu a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}
.cal-menu a:hover,
.cal-menu a:focus-visible{
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.cal-menu__icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
}
@media (prefers-reduced-motion: reduce){
  .cal-menu{ animation: none; }
  .cal-btn__chevron{ transition: none; }
}
.btn{
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  color: var(--text);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover{ transform: translateY(-1px); }
.btn--primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e1c;
}
.btn--primary:hover{ filter: brightness(1.08); }
.btn--ghost{
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover{
  color: var(--text);
  border-color: var(--text-muted);
}
.card__note{
  font-size: 0.8rem;
  color: var(--text-dim);
}

.progress{
  margin: 22px clamp(20px, 5vw, 64px) 0;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress__bar{
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--s1), var(--s3));
  border-radius: 2px;
  transition: width .2s ease, transform .2s ease;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer{
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 40px 20px 60px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.site-footer__main {
  display: grid;
  grid-template-columns: 1fr  1fr;
  gap: 48px;
  margin-bottom: 40px;
  align-items: start;
}
.site-footer p{ margin: 6px 0; }
.site-footer__muted a{
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer__muted a:hover{ color: var(--text); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 640px){
  .hero__meta{ gap: 22px; }
  .card{ flex-basis: 82vw; }
  .nav__panel{
    min-width: 0;
    width: min(84vw, 300px);
  }
}
