:root {
  --bg: #0f1c24;
  --bg-2: #17303b;
  --ink: #f3efe6;
  --muted: #b7c4c9;
  --accent: #2f9e7b;
  --accent-ink: #04150f;
  --line: rgba(243, 239, 230, 0.14);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #255566 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1d4a3a 0%, transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  display: flex;
  flex-direction: column;
}

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

.site-header, .site-footer, main {
  width: min(960px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

nav { display: flex; gap: 1rem; align-items: center; }
nav a { color: var(--muted); font-weight: 600; text-decoration: none; }
nav a:hover { color: var(--ink); }
nav .cta {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.45rem 0.9rem;
  border-radius: 0.35rem;
}
nav .cta:hover { text-decoration: none; filter: brightness(1.05); }

main { flex: 1; padding: 2rem 0 4rem; }

.hero { padding-top: 3rem; max-width: 36rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}
.lede {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 0.4rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.panel {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(7, 16, 22, 0.35);
  max-width: 36rem;
}
.panel h1 { font-size: 2rem; }
.panel p { color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); font-size: 0.95rem; }
.error {
  color: #ffb4a8;
  background: rgba(120, 30, 20, 0.35);
  border: 1px solid rgba(255, 180, 168, 0.35);
  padding: 0.65rem 0.8rem;
  border-radius: 0.35rem;
}
.auth-form {
  display: grid;
  gap: 0.9rem;
  margin: 1.25rem 0;
}
.auth-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.auth-form input {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
}
.auth-form .btn {
  justify-self: start;
  cursor: pointer;
  font: inherit;
}
.inline-form { display: inline; margin: 0; }
.linkish {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.linkish:hover { color: var(--ink); text-decoration: underline; }
.nav-email {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
}
.status.ok { border-color: rgba(47, 158, 123, 0.55); background: rgba(47, 158, 123, 0.12); }
.status.wait { background: rgba(0, 0, 0, 0.2); }
.status p { margin: 0 0 0.5rem; }
.status p:last-child { margin-bottom: 0; }

.start-here {
  margin-top: 1.75rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.14);
}
.start-here h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}
.start-here .muted { margin: 0 0 0.85rem; }
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ack-form {
  display: grid;
  gap: 0.75rem;
  max-width: 36rem;
}
.ack-label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.4;
}
.ack-label input { margin-top: 0.25rem; }
.ack-done { margin: 0; }
.weeks-locked { margin-top: 1.25rem; }

.week-list { margin-top: 1.75rem; }
.week-list h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}
.week-list ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.week-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.18);
}
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.week-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
@media (max-width: 600px) {
  .week-row { flex-direction: column; align-items: flex-start; }
}

.textbook-link {
  margin: 0.75rem 0 1rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}
.textbook-link a {
  color: #8fd6b8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.textbook-link a:hover { color: var(--ink); }

.vo-placeholder {
  font-size: 0.8rem;
  margin: 0;
  font-style: italic;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.vo-player { width: min(100%, 16rem); height: 2rem; }

.deck {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: calc(100vh - 10rem);
}
.deck-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.deck-course-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0.2rem 0 0.4rem;
}
.deck-links { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.deck-links button { cursor: pointer; font: inherit; }
.deck-resume-note {
  margin: 0.65rem 0 0;
  max-width: 36rem;
  color: var(--accent);
}
.deck-stage {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(47, 158, 123, 0.12), transparent 55%),
    rgba(7, 16, 22, 0.45);
  padding: 1.25rem 1.35rem 1.5rem;
  min-height: 22rem;
}
.slide { animation: slideIn 180ms ease-out; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.slide-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.slide-count {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.slide-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 0 0 1rem;
  line-height: 1.15;
}
.slide-body {
  max-height: min(52vh, 28rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.deck-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}
.deck-controls .btn {
  cursor: pointer;
  font: inherit;
}
.deck-progress {
  height: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.deck-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 160ms ease;
}
.deck-hint { margin: 0; font-size: 0.85rem; }

.lecture-body {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.05rem;
}
.lecture-body p { margin: 0 0 0.9rem; }
.lecture-body h3 {
  color: var(--ink);
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}
.lecture-body ul, .lecture-body ol { margin: 0 0 0.9rem; padding-left: 1.3rem; }
.lecture-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: #d7efe4;
}
.lecture-body pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  color: #e8fff5;
}
.lecture-body pre code { color: inherit; }

@media (max-width: 700px) {
  .deck-controls { grid-template-columns: 1fr 1fr; }
  .deck-progress { grid-column: 1 / -1; order: -1; }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
  .hero { padding-top: 1.5rem; }
}
