@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,600&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --bg-deep: #ece2c8;
  --ink: #0a1f3a;
  --muted: #556171;
  --accent: #c3ac68;
  --accent-dark: #967f3f;
  --teal: #003057;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(2, 37, 67, 0.14);
  --soft-shadow: 0 10px 30px rgba(2, 37, 67, 0.1);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7df 0%, var(--bg) 65%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-orb {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
  z-index: 0;
}

.orb-1 {
  background: radial-gradient(circle, #e8d6a3 0%, rgba(232, 214, 163, 0) 70%);
  top: -120px;
  left: -90px;
}

.orb-2 {
  background: radial-gradient(circle, #8fb0c8 0%, rgba(143, 176, 200, 0) 70%);
  top: 180px;
  right: -120px;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 48, 87, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 48, 87, 0.08) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.3;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: linear-gradient(90deg, #002a4f 0%, #003764 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(179, 163, 105, 0.35);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbc886, #bcaa63);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #003057;
  letter-spacing: 0.08em;
}

.title {
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
}

.subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.landing-page-active .viewer-actions {
  display: none;
}

.nav-toggle {
  display: none;
  background: var(--accent);
  color: #003057;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: inherit;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-link {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  line-height: 1;
}

.top-link:hover {
  background: rgba(195, 172, 104, 0.22);
  border-color: rgba(195, 172, 104, 0.75);
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  color: #ffffff;
  cursor: pointer;
}

.dropdown-toggle[aria-expanded="true"] {
  background: rgba(179, 163, 105, 0.2);
  border-color: rgba(179, 163, 105, 0.6);
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
  padding: 10px;
  display: none;
  min-width: 280px;
  max-height: 55vh;
  overflow-y: auto;
  z-index: 20;
}

.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background: rgba(179, 163, 105, 0.18);
  color: var(--teal);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  padding: 28px 32px 48px;
}

.sidebar {
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  height: calc(100vh - 140px);
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  margin-bottom: 12px;
}

.sidebar-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
}

.sidebar-caption {
  color: var(--muted);
  font-size: 0.85rem;
}

.lecture-list {
  overflow-y: auto;
  padding-right: 8px;
  display: grid;
  gap: 10px;
}

.lecture-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 48, 87, 0.12);
  transition: transform 0.2s ease, border 0.2s ease;
}

.lecture-item.lecture-item--plain::before {
  content: "⌂";
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(179, 163, 105, 0.12);
  border: 1px solid rgba(0, 48, 87, 0.12);
  color: var(--teal);
  font-size: 1.05rem;
  font-weight: 600;
}

.lecture-item:hover {
  transform: translateY(-2px);
  border-color: rgba(179, 163, 105, 0.55);
}

.lecture-item.active {
  background: rgba(195, 172, 104, 0.18);
  border-color: rgba(150, 127, 63, 0.58);
}

.lecture-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(179, 163, 105, 0.2);
  font-weight: 600;
  color: var(--teal);
}

.lecture-title {
  font-weight: 600;
}

.lecture-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.content {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 180px);
  grid-template-rows: auto 1fr;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.viewer-info {
  min-width: 0;
  flex: 0 1 auto;
}

.viewer-info h1 {
  margin: 0 0 4px;
  font-family: "Fraunces", serif;
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.viewer-meta {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.viewer-info {
  min-width: 0;
  max-width: 48%;
}

.viewer-actions {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.viewer-actions .viewer-foot {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.viewer-frame-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 78vh;
  height: 100%;
}

.lecture-frame {
  border: none;
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-foot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.foot-card {
  background: linear-gradient(180deg, #ffffff 0%, #faf6ea 100%);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(150, 127, 63, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  flex: 0 0 auto;
  max-width: none;
  overflow: hidden;
}

.foot-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.52rem;
  color: var(--muted);
  white-space: nowrap;
}

.foot-value {
  font-weight: 600;
  margin-top: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}

#video-links {
  white-space: normal;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 6;
}

#video-card {
  overflow: visible;
  position: relative;
  z-index: 6;
}

#video-links .video-dropdown {
  position: relative;
  width: 100%;
}

#video-links .video-trigger {
  display: inline-block;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

#video-links .video-trigger[aria-expanded="true"] {
  color: #00263a;
}

#video-links .video-dropdown-menu {
  left: 0;
  right: auto;
  min-width: 240px;
  max-width: 320px;
}

#video-links .video-dropdown-menu a {
  text-decoration: none;
}

.foot-sub {
  font-size: 0.64rem;
  color: var(--muted);
}

.resource-link {
  color: var(--teal);
  text-decoration: none;
}

.resource-link.disabled {
  color: var(--muted);
  text-decoration: none;
  pointer-events: none;
}

.click-card {
  cursor: pointer;
}

.click-card:hover {
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
}

.hero-text h1 {
  font-family: "Fraunces", serif;
  font-size: 2.4rem;
  margin: 8px 0 12px;
}

.hero-text p {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.badge {
  background: rgba(179, 163, 105, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--teal);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

button {
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: #003057;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  color: var(--teal);
  border: 1px solid rgba(0, 48, 87, 0.3);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
}

.hero-panel {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel-card {
  background: rgba(179, 163, 105, 0.14);
  border-radius: 16px;
  padding: 14px;
}

.panel-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.panel-value {
  font-weight: 600;
  margin-top: 6px;
}

.panel-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--soft-shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(179, 163, 105, 0.22);
  color: #5f4c1f;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.list li::before {
  content: "●";
  color: var(--accent);
  margin-right: 8px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mini-link {
  background: rgba(179, 163, 105, 0.2);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--teal);
  font-size: 0.85rem;
}

.mini-link:hover {
  background: rgba(179, 163, 105, 0.3);
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: relative;
    top: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    right: 32px;
    background: var(--card);
    padding: 12px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .dropdown-menu {
    right: auto;
    left: 0;
  }

  .dropdown-toggle {
    color: var(--ink);
    border-color: rgba(0, 48, 87, 0.2);
  }

  .hero-text h1 {
    font-size: 1.9rem;
  }

  .viewer-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .viewer-actions .viewer-foot {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .lecture-frame {
    height: 60vh;
  }
}

@media (max-width: 1200px) {
  .viewer-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .viewer-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .viewer-actions .viewer-foot {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
