/* Theme tokens
   - Light is the default in :root.
   - prefers-color-scheme: dark applies dark tokens when no explicit theme is set.
   - [data-theme="dark"] / [data-theme="light"] override the OS preference. */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --fg: #16181d;
  --fg-muted: #5b6472;
  --accent: #2f5fd4;
  --accent-2: #7c4fc4;
  --accent-hover: #1f4cb8;
  --border: #e3e6ec;
  --border-soft: #ecedf2;
  --button-fg: #ffffff;
  --accent-soft-bg: rgba(47, 95, 212, 0.10);
  --accent-soft-border: rgba(47, 95, 212, 0.30);
  --accent-2-soft-bg: rgba(124, 79, 196, 0.10);
  --accent-2-soft-border: rgba(124, 79, 196, 0.30);
  --hero-glow-1: rgba(47, 95, 212, 0.10);
  --hero-glow-2: rgba(124, 79, 196, 0.08);
  --max: 960px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-alt: #11141b;
  --surface: #161a23;
  --fg: #e6e8ef;
  --fg-muted: #9aa3b2;
  --accent: #7aa2f7;
  --accent-2: #bb9af7;
  --accent-hover: #9bbcff;
  --border: #232836;
  --border-soft: #1c2030;
  --button-fg: #0b0d12;
  --accent-soft-bg: rgba(122, 162, 247, 0.15);
  --accent-soft-border: rgba(122, 162, 247, 0.35);
  --accent-2-soft-bg: rgba(187, 154, 247, 0.12);
  --accent-2-soft-border: rgba(187, 154, 247, 0.35);
  --hero-glow-1: rgba(122, 162, 247, 0.18);
  --hero-glow-2: rgba(187, 154, 247, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --bg-alt: #11141b;
    --surface: #161a23;
    --fg: #e6e8ef;
    --fg-muted: #9aa3b2;
    --accent: #7aa2f7;
    --accent-2: #bb9af7;
    --accent-hover: #9bbcff;
    --border: #232836;
    --border-soft: #1c2030;
    --button-fg: #0b0d12;
    --accent-soft-bg: rgba(122, 162, 247, 0.15);
    --accent-soft-border: rgba(122, 162, 247, 0.35);
    --accent-2-soft-bg: rgba(187, 154, 247, 0.12);
    --accent-2-soft-border: rgba(187, 154, 247, 0.35);
    --hero-glow-1: rgba(122, 162, 247, 0.18);
    --hero-glow-2: rgba(187, 154, 247, 0.12);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Hero */
.hero {
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--hero-glow-1), transparent 60%),
    radial-gradient(900px 500px at 10% 20%, var(--hero-glow-2), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 80px;
}
.hero.compact { padding-bottom: 24px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--fg);
}

/* Theme-aware image swap: any element with .logo-light is shown in light mode,
   .logo-dark in dark mode. Works with the data-theme override and the
   prefers-color-scheme fallback. */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}

/* Hero lockup figure */
.hero-lockup {
  margin: 0 0 22px;
  line-height: 1;
}
.hero-lockup img {
  width: 100%;
  max-width: 740px;
  height: auto;
}
.brand-sub {
  color: var(--fg-muted);
  font-weight: 400;
  margin-left: 4px;
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--fg-muted);
  font-size: 0.92rem;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  text-decoration: none;
}

/* Theme toggle — pinned just above the right edge of the nav content */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: max(16px, calc((100vw - var(--max)) / 2 + 16px));
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 24px 0;
}
@media (max-width: 600px) {
  .hero { padding-bottom: 48px; }
  .hero-inner { padding: 24px 14px 0; }
  .nav { padding: 14px 16px; }
  .section { padding: 40px 16px; }

  /* Compact nav: smaller text, tighter gap, drop the redundant subtitle */
  .brand { font-size: 0.95rem; }
  .brand-sub { display: none; }
  .nav-links { gap: 10px 14px; }
  .nav-links a { font-size: 0.82rem; }

  /* Give the hero lockup a touch more room on small screens */
  .hero-lockup { margin-bottom: 18px; }
}
.hero.compact .hero-inner { padding-top: 24px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent-2);
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.tagline {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin: 0 0 22px;
  max-width: 640px;
}
.meta {
  display: flex;
  gap: 22px;
  color: var(--fg-muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
  margin: 0;
}

/* Sections */
main { padding-bottom: 80px; }
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px;
}
.section.alt {
  background: var(--bg-alt);
  max-width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section.alt > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}
.section h2 {
  font-size: 1.7rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.section h3 {
  margin-top: 28px;
  font-size: 1.1rem;
  color: var(--fg);
}
.muted { color: var(--fg-muted); }

.topics {
  columns: 2;
  column-gap: 32px;
  padding-left: 18px;
  margin: 8px 0 0;
}
.topics li { margin: 4px 0; }
@media (max-width: 600px) { .topics { columns: 1; } }

/* Goals grid */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.goal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.goal-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.goal-num {
  color: var(--accent-2);
  margin-right: 6px;
}
.goal-sub {
  margin: 0 0 14px;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.goal ul {
  padding-left: 18px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.goal ul li { margin: 6px 0; }

.status {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 8px;
}
.status.confirmed {
  background: var(--accent-soft-bg);
  color: var(--accent);
  border: 1px solid var(--accent-soft-border);
}
.status.tentative {
  background: var(--accent-2-soft-bg);
  color: var(--accent-2);
  border: 1px solid var(--accent-2-soft-border);
}

/* Dates */
.dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.date-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.date-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin: 0 0 6px;
}
.date-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.cta-row { margin-top: 12px; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--button-fg);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
}
.button:hover { background: var(--accent-hover); text-decoration: none; }

/* Schedule */
.schedule {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.schedule td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.schedule .time {
  width: 80px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Info dot + popover bubble */
.info-dot {
  anchor-name: --dbg-anchor;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0;
  border: 1px solid var(--accent-soft-border);
  border-radius: 50%;
  background: var(--accent-soft-bg);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease, transform 0.15s ease;
}
.info-dot:hover { background: var(--accent-soft-border); transform: translateY(-1px); }
.info-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bubble {
  max-width: min(340px, calc(100vw - 32px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  font-size: 0.9rem;
  line-height: 1.55;
}
.bubble p { margin: 0; }
.bubble p + p { margin-top: 8px; }
.bubble .bubble-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Anchor the bubble just to the right of the dot where supported; otherwise
   it stays a centered card. Flips to the left/below if there's no room. */
@supports (anchor-name: --a) {
  .bubble {
    position: fixed;
    position-anchor: --dbg-anchor;
    top: anchor(top);
    left: anchor(right);
    margin-left: 10px;
    position-try-fallbacks: flip-inline, flip-block;
  }
}

/* Speakers */
.speakers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.speaker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.speaker .name { margin: 0; font-weight: 600; }
.speaker .affil { margin: 4px 0 0; color: var(--fg-muted); font-size: 0.9rem; }

/* Organizers */
.organizers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.organizer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.organizer .name { margin: 0; font-weight: 600; }
.organizer .affil { margin: 4px 0 10px; color: var(--fg-muted); font-size: 0.9rem; }
.organizer .interests {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--accent-2);
  font-style: italic;
  letter-spacing: 0.01em;
}

.bio-details {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.bio-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--accent);
  list-style: none;
  user-select: none;
}
.bio-details summary::-webkit-details-marker { display: none; }
.bio-details summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
.bio-details[open] summary::before {
  content: "▾ ";
}
.bio-details summary:hover { color: var(--accent-hover); }
.bio-details .bio {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* Papers */
.papers {
  list-style: decimal;
  padding-left: 22px;
}
.papers li { margin: 18px 0; }
.paper-title { margin: 0; font-weight: 600; }
.paper-authors { margin: 4px 0 0; color: var(--fg-muted); font-size: 0.95rem; }
.paper-links { margin: 6px 0 0; font-size: 0.9rem; }

/* Committee */
.committee-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 24px;
}
.committee-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.pc-name { font-weight: 500; }
.pc-affil { color: var(--fg-muted); }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
