:root {
  --accent: #4fd6e0;
  --bg: #080b11;
  --surface: #0c1017;
  --text: #e6ecf5;
  --text-2: #c4cede;
  --muted: #8a97ab;
  --dim: #5f6c80;
  --faint: #4a5568;
  --line: rgba(255,255,255,.08);
  --r-lg: 18px;
  --r-md: 12px;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Space Grotesk', sans-serif;
  --stripes: repeating-linear-gradient(135deg, #131a26 0 12px, #0e141e 12px 24px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: 'Manrope', system-ui, sans-serif; color: var(--text); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1d2735; border-radius: 6px; border: 2px solid var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 78% -8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 600px at 6% 12%, rgba(120,120,255,.06), transparent 55%),
    var(--bg);
}

.mono { font-family: var(--mono); }
.kicker { font-size: 11px; letter-spacing: 3px; color: var(--accent); }
.label { font-family: var(--mono); font-size: 10px; letter-spacing: 2.5px; color: var(--dim); margin-bottom: 14px; }

/* hover helpers */
.lift { transition: transform .25s ease, border-color .25s ease; }
.lift:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent) !important; }
.navlink { transition: color .18s ease; cursor: pointer; }
.navlink:hover, .lift:hover h3 { color: var(--accent) !important; }
.btn { transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.btn:hover { transform: translateY(-2px); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 40px;
  background: rgba(8,11,17,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  isolation: isolate; overflow: hidden;
}
/* aurora: two slowly drifting layers of blurred colour behind the logo and menu */
.nav::before, .nav::after {
  content: ''; position: absolute; inset: -60% -40%; z-index: -1; pointer-events: none;
  filter: blur(24px); mix-blend-mode: screen;
}
.nav::before {
  background:
    radial-gradient(22% 60% at 18% 80%, rgba(61,255,176,.7), transparent 70%),
    radial-gradient(26% 65% at 48% 90%, color-mix(in srgb, var(--accent) 80%, transparent), transparent 70%),
    radial-gradient(20% 55% at 80% 80%, rgba(139,124,255,.7), transparent 70%);
  opacity: .5;
  animation: aurora 28s ease-in-out infinite alternate;
}
.nav::after {
  background:
    radial-gradient(18% 55% at 32% 85%, rgba(139,124,255,.6), transparent 70%),
    radial-gradient(24% 60% at 66% 80%, rgba(61,255,176,.55), transparent 70%);
  opacity: .35;
  animation: aurora 37s ease-in-out -12s infinite alternate-reverse;
}
@keyframes aurora {
  0% { transform: translateX(-10%) skewX(-12deg) scaleY(.9); }
  50% { transform: translateX(4%) skewX(6deg) scaleY(1.15); }
  100% { transform: translateX(12%) skewX(-4deg) scaleY(1); }
}
.nav-brand { display: flex; align-items: center; gap: 16px; }
.logo { height: 34px; filter: brightness(0) invert(1); display: block; }
.logo-sm { height: 30px; margin-bottom: 16px; }
.nav-sep { width: 1px; height: 26px; background: rgba(255,255,255,.12); }
.nav-brand .mono { font-size: 10px; color: var(--dim); letter-spacing: 2px; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 600; color: var(--muted); }
.nav-links a.is-active { color: var(--text); }

/* sections */
.sec { max-width: 1180px; margin: 0 auto; padding: 56px 40px 20px; }
.sec-top { padding: 64px 40px 40px; }
.sec-info { padding: 24px 40px 8px; }
.sec-detail { max-width: 1000px; padding: 44px 40px 20px; }

.kicker-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.kicker-line { flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), transparent); }

.pill {
  display: inline-flex; align-items: center; padding: 6px 12px; margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.pill .mono { font-size: 11px; letter-spacing: 1.5px; color: var(--accent); white-space: nowrap; }

/* hero */
.hero-grid { display: grid; grid-template-columns: 1.1fr .72fr .9fr; gap: 34px; align-items: start; }
.hero-title, .detail-title {
  font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1;
  margin: 0 0 20px; letter-spacing: -.5px; text-wrap: balance;
}
.presenter { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; font-size: 16px; color: var(--text-2); font-weight: 600; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1d2735, #121824); border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; color: var(--accent);
}
.avatars { display: flex; flex: none; }
.avatars .avatar + .avatar { margin-left: -12px; box-shadow: 0 0 0 2px var(--bg); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hero-desc { font-size: 16px; line-height: 1.65; color: #95a1b4; max-width: 560px; margin: 0 0 32px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 14px 22px;
  border-radius: var(--r-md); font: 700 15px 'Manrope', sans-serif; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--bg); border: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.16); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }

/* calendar icon */
.ico-cal { position: relative; width: 15px; height: 15px; flex: none; }
.ico-cal i { position: absolute; background: currentColor; border-radius: 1px; }
.ico-cal i:nth-child(1) { left: 0; right: 0; bottom: 0; height: 11px; background: none; border: 1.6px solid currentColor; border-radius: 3px; }
.ico-cal i:nth-child(2) { left: 0; right: 0; top: 3px; height: 1.6px; }
.ico-cal i:nth-child(3) { left: 3px; top: 0; width: 1.8px; height: 5px; }
.ico-cal i:nth-child(4) { right: 3px; top: 0; width: 1.8px; height: 5px; }

/* flyer */
.flyer { position: relative; display: block; width: 100%; aspect-ratio: 210/297; background: var(--stripes); overflow: hidden; }
.flyer > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.flyer-natural { aspect-ratio: auto; }
.flyer-natural > img { position: static; height: auto; }
.flyer-framed { border: 1px solid rgba(255,255,255,.09); border-radius: var(--r-lg); }
.flyer-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; letter-spacing: 2px; color: var(--faint); }
.flyer-badge {
  position: absolute; top: 12px; right: 12px; font-size: 10px; letter-spacing: 1px; color: #dbe4f0;
  background: rgba(8,11,17,.72); padding: 4px 8px; border-radius: 6px;
}

/* generated flyer (upcoming lecture without image); sizes scale with flyer width */
.flyer { container-type: inline-size; }
.flyer-gen {
  position: absolute; inset: 0; display: flex; flex-direction: column; text-align: center;
  padding: 13cqi 8cqi 8cqi;
  background:
    radial-gradient(90cqi 70cqi at 85% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(80cqi 60cqi at 0% 100%, rgba(120,120,255,.16), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 10cqi 10cqi,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 10cqi 10cqi,
    #0b1018;
}
.fg-brand img { display: block; width: 78%; margin: 0 auto; filter: brightness(0) invert(1); }
.fg-brand span { display: block; margin-top: 2cqi; font-size: 2.6cqi; letter-spacing: .5cqi; color: var(--accent); }
.fg-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4cqi; min-height: 0; }
.fg-presenter { font-size: 3.2cqi; letter-spacing: .4cqi; color: var(--text-2); }
.fg-title {
  font-family: var(--display); font-weight: 700; font-size: 9cqi; line-height: 1.05; letter-spacing: -.1cqi;
  color: #fff; text-wrap: balance; overflow-wrap: anywhere;
}
.fg-title.is-long { font-size: 7cqi; }
.fg-foot { border-top: .4cqi solid var(--accent); padding-top: 4cqi; }
.fg-date { font-family: var(--display); font-weight: 700; font-size: 6cqi; color: var(--accent); }
.fg-date em { font-style: normal; color: #fff; }
.fg-place { margin-top: 1.4cqi; font-size: 3.2cqi; font-weight: 700; letter-spacing: .3cqi; color: var(--text-2); }
.fg-url { margin-top: 2.4cqi; font-size: 2.6cqi; letter-spacing: .5cqi; color: var(--dim); }

/* date / countdown panel */
.panel {
  border: 1px solid rgba(255,255,255,.09); border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, rgba(22,29,41,.7), rgba(12,17,25,.7));
}
.panel-top { display: flex; align-items: stretch; }
.panel-date { padding: 22px 24px; text-align: center; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.panel-day { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--accent); }
.panel-mon { font-size: 12px; letter-spacing: 3px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.panel-facts { flex: 1; padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.panel-facts div { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.ico { color: var(--accent); }
.panel-bottom { padding: 22px 24px; border-top: 1px solid var(--line); }
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cd-grid > div { text-align: center; padding: 14px 4px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-md); }
.cd-grid b { display: block; font-variant-numeric: tabular-nums; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; }
.cd-grid span { display: block; font-size: 9px; letter-spacing: 1.5px; color: var(--dim); margin-top: 6px; }
.cd-grid .cd-accent { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.cd-accent b { color: var(--accent); }

/* info strip */
.info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-lg); overflow: hidden;
}
.info-grid > div { padding: 24px 26px; background: var(--surface); }
.info-grid b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent); }
.info-grid span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* cards */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.sec-head h2 { font-family: var(--display); font-weight: 700; font-size: 30px; margin: 12px 0 0; }
.more { font-size: 12px; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.recent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.year-group[hidden] { display: none; }
.card-body { padding: 15px 16px 17px; flex: 1; display: flex; flex-direction: column; }
.tag { font-size: 9px; letter-spacing: 1.5px; color: var(--accent); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.25; margin: 9px 0; transition: color .18s ease; }
.card-presenter { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: auto; }
.archive-grid .card-body { padding: 18px; }
.archive-grid .tag { font-size: 10px; }
.archive-grid h3 { font-size: 16.5px; margin: 10px 0 12px; }
.archive-grid .card-presenter { font-size: 13px; }

/* archive */
.archive-title { font-family: var(--display); font-weight: 700; font-size: 38px; margin: 14px 0 24px; }
.sub-title { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 8px 0 18px; }
.upcoming-grid { margin-bottom: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: .5px; padding: 8px 15px; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: var(--muted);
  transition: all .18s ease;
}
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* year groups */
.year-group + .year-group { margin-top: 48px; }
.year-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.year-num { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.year-count { font-size: 11px; letter-spacing: 1.5px; color: var(--dim); white-space: nowrap; }

/* detail */
.back { display: flex; width: fit-content; font-size: 12px; letter-spacing: 1px; color: var(--muted); margin-bottom: 28px; }
.sec-detail .pill { margin-bottom: 20px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding-bottom: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.detail-meta .presenter { margin: 0; gap: 12px; }
.detail-meta .avatar { width: 42px; height: 42px; }
.meta-main { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--text); }
.meta-sub { font-size: 11px; color: var(--dim); letter-spacing: 1px; margin-top: 4px; }
.meta-sep { width: 1px; height: 34px; background: rgba(255,255,255,.1); }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: start; }
.detail-body { font-size: 17px; line-height: 1.75; color: var(--text-2); margin: 0 0 24px; }
.detail-body p { margin: 0 0 1em; }
.detail-body a { color: var(--accent); text-decoration: underline; }
.detail-body img { max-width: 100%; height: auto; }
.detail-body h2, .detail-body h3 { font-family: var(--display); color: var(--text); line-height: 1.2; margin: 1.6em 0 .6em; }
.sec-detail .btn { padding: 13px 20px; font-size: 14px; }

/* video */
.video { aspect-ratio: 16/9; border: 1px solid rgba(255,255,255,.09); border-radius: var(--r-lg); overflow: hidden; background: var(--stripes); }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot.is-pulsing { flex: none; animation: pulse 1.6s ease-in-out infinite; }
.sec-live .kicker { color: #ff6b6b; }
.sec-live .kicker-line { background: linear-gradient(90deg, rgba(255,77,77,.4), transparent); }

/* gallery */
.gallery-head { display: flex; align-items: center; gap: 12px; margin: 56px 0 22px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { display: block; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { padding: 0; border: none; background: transparent; max-width: 92vw; max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(8,11,17,.9); backdrop-filter: blur(6px); }
.lightbox img { display: block; max-width: 92vw; max-height: 92vh; border-radius: var(--r-md); }
.lightbox-close {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1;
}

/* prev / next lecture */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager-item { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.pager-next { text-align: right; }
.pager-item .mono { font-size: 11px; letter-spacing: 1.5px; color: var(--accent); }
.pager-item b { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--text); transition: color .18s ease; }
.pager-item:hover b { color: var(--accent); }
.pager-item small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .pager { grid-template-columns: 1fr; } .pager > span { display: none; } }

/* footer */
.footer { margin-top: 64px; padding: 40px; border-top: 1px solid rgba(255,255,255,.07); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-about { font-size: 13.5px; line-height: 1.6; color: #7d8ba0; max-width: 340px; margin: 0; }
.footer-text { font-size: 13.5px; line-height: 1.9; color: var(--text-2); }
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.footer-copy { margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.05); font-size: 11px; letter-spacing: .5px; color: var(--faint); }

/* responsive */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .hero-grid > :first-child { grid-column: 1 / -1; }
  .hero-title { font-size: 34px; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav { padding: 14px 20px; gap: 14px; }
  .nav-kicker { display: none; }
  .nav-links { gap: 18px; }
  .sec, .sec-top, .sec-info, .sec-detail, .footer { padding-left: 22px; padding-right: 22px; }
  .sec-top { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-flyer, .detail-flyer { width: 100%; max-width: 320px; margin: 0 auto; }
  .hero-title, .detail-title { font-size: 30px; }
  .info-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 480px) {
  .nav-social { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-title { font-size: 30px; }
  .cd-grid > div { padding-left: 2px; padding-right: 2px; }
  .sec-head { flex-direction: column; align-items: flex-start; }
}
/* page transitions (cross-document view transitions; ignored where unsupported) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.nav { view-transition-name: site-nav; }
::view-transition-group(*) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(root) { animation: .2s ease-in both vt-out; }
::view-transition-new(root) { animation: .3s ease-out .05s both vt-in; }
/* title text: scale proportionally from the top-left corner instead of stretching */
.hero-title, .detail-title, .card h3 { width: fit-content; }
::view-transition-old(lecture-title), ::view-transition-new(lecture-title) {
  height: 100%; width: auto; object-fit: contain; object-position: left top;
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* reduced motion: no animations or transitions anywhere (aurora and live dot stay, just still) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .lift:hover, .btn:hover { transform: none; }
}
