:root {
  color-scheme: light;
  --navy: #0b1f4d;
  --navy-2: #14316e;
  --ink: #12203a;
  --muted: #5b6b86;
  --paper: #f3efe6;
  --card: #fffcf7;
  --line: rgba(11, 31, 77, 0.1);
  --lecture: #0f766e;
  --lecture-bg: #d9f3ee;
  --practice: #1d4ed8;
  --practice-bg: #dbe7ff;
  --meet: #7c3aed;
  --meet-bg: #eee4ff;
  --online: #be185d;
  --online-bg: #fde7f0;
  --gold: #c4a15a;
  --due-today: #be185d;
  --due-today-bg: rgba(190, 24, 93, 0.1);
  --due-tomorrow: #b45309;
  --due-tomorrow-bg: rgba(180, 83, 9, 0.12);
  --due-week: #0f766e;
  --due-week-bg: rgba(15, 118, 110, 0.1);
  --due-overdue: #9f1239;
  --due-overdue-bg: rgba(159, 18, 57, 0.12);
  --due-later: #14316e;
  --due-later-bg: rgba(11, 31, 77, 0.05);
  --btn: #0b1f4d;
  --btn-text: #fff;
  --elevated: #fff;
  --topbar: rgba(243, 239, 230, 0.78);
  --banner: rgba(255, 252, 247, 0.86);
  --nav-hover: rgba(11, 31, 77, 0.08);
  --lesson-hover: rgba(11, 31, 77, 0.028);
  --lesson-live: linear-gradient(90deg, rgba(190, 24, 93, 0.08), transparent 55%);
  --day-head: linear-gradient(180deg, rgba(196, 161, 90, 0.12), transparent);
  --hw-bg: #fff8e8;
  --hw-ink: #8a5a00;
  --tag-note-bg: #fff4d6;
  --tag-note-fg: #8a5a00;
  --club: #f7f4ec;
  --pre: #f4f1ea;
  --photo-ring: #fff;
  --photo-bg: #e8e4dc;
  --hours-bg: #0b1f4d;
  --hours-pill: #d9f3ee;
  --hours-pill-alt: #f6e7b8;
  --hours-pill-text: #0b1f4d;
  --glow-a: rgba(29, 78, 216, 0.16);
  --glow-b: rgba(15, 118, 110, 0.14);
  --now-card: linear-gradient(135deg, #102a68 0%, #0b1f4d 42%, #0c3d4a 100%);
  --now-border: transparent;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(11, 31, 77, 0.08);
  --shadow-hover: 0 22px 40px rgba(11, 31, 77, 0.14);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Unbounded", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --navy: #f2ece2;
  --navy-2: #c5d0e8;
  --ink: #f2ece2;
  --muted: #b7c2d6;
  --paper: #1e2a46;
  --card: #2a3858;
  --line: rgba(242, 236, 226, 0.12);
  --lecture: #6ec9bc;
  --lecture-bg: rgba(110, 201, 188, 0.18);
  --practice: #8bb6f5;
  --practice-bg: rgba(139, 182, 245, 0.18);
  --meet: #c4b0f0;
  --meet-bg: rgba(196, 176, 240, 0.18);
  --online: #e899ae;
  --online-bg: rgba(232, 153, 174, 0.18);
  --gold: #d4b56a;
  --due-today: #e899ae;
  --due-today-bg: rgba(232, 153, 174, 0.16);
  --due-tomorrow: #e4cc88;
  --due-tomorrow-bg: rgba(212, 181, 106, 0.16);
  --due-week: #6ec9bc;
  --due-week-bg: rgba(110, 201, 188, 0.16);
  --due-overdue: #f0a3b4;
  --due-overdue-bg: rgba(232, 153, 174, 0.2);
  --due-later: #c5d0e8;
  --due-later-bg: rgba(242, 236, 226, 0.06);
  --btn: #f0e6d2;
  --btn-text: #1e2a46;
  --elevated: #334366;
  --topbar: rgba(30, 42, 70, 0.88);
  --banner: rgba(42, 56, 88, 0.94);
  --nav-hover: rgba(242, 236, 226, 0.08);
  --lesson-hover: rgba(242, 236, 226, 0.04);
  --lesson-live: linear-gradient(90deg, rgba(232, 153, 174, 0.16), transparent 55%);
  --day-head: linear-gradient(180deg, rgba(212, 181, 106, 0.14), transparent);
  --hw-bg: rgba(212, 181, 106, 0.12);
  --hw-ink: #e4cc88;
  --tag-note-bg: rgba(212, 181, 106, 0.16);
  --tag-note-fg: #e4cc88;
  --club: #334366;
  --pre: #243356;
  --photo-ring: rgba(212, 181, 106, 0.35);
  --photo-bg: #334366;
  --hours-bg: #243356;
  --hours-pill: #b8e4de;
  --hours-pill-alt: #e8d5a3;
  --hours-pill-text: #1e2a46;
  --glow-a: rgba(139, 182, 245, 0.18);
  --glow-b: rgba(110, 201, 188, 0.14);
  --now-card: linear-gradient(135deg, #2c4a82 0%, #1e2a46 46%, #1b4548 100%);
  --now-border: rgba(212, 181, 106, 0.22);
  --shadow: 0 16px 40px rgba(8, 14, 28, 0.35);
  --shadow-hover: 0 18px 44px rgba(8, 14, 28, 0.42);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html.theme-ready body,
html.theme-ready .bg-glow,
html.theme-ready .topbar,
html.theme-ready .theme-btn,
html.theme-ready .nav-link,
html.theme-ready .chip,
html.theme-ready .icon-btn,
html.theme-ready .masthead-title,
html.theme-ready .masthead-kicker,
html.theme-ready .masthead-week,
html.theme-ready .now-card,
html.theme-ready .week-nav,
html.theme-ready .day-col,
html.theme-ready .lesson,
html.theme-ready .tag,
html.theme-ready .btn,
html.theme-ready .submit-btn,
html.theme-ready #toggle-form,
html.theme-ready .post-card,
html.theme-ready .post-when,
html.theme-ready .feed-group-title,
html.theme-ready .post-form,
html.theme-ready .post-form input,
html.theme-ready .post-form textarea,
html.theme-ready .info-card,
html.theme-ready .info-link,
html.theme-ready .mini-card,
html.theme-ready .hours,
html.theme-ready .hours span,
html.theme-ready .club-list li,
html.theme-ready .person-photo-wrap,
html.theme-ready .originals,
html.theme-ready .footer {
  transition:
    background-color 0.45s var(--ease),
    background 0.45s var(--ease),
    color 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 10% -10%, var(--glow-a), transparent 60%),
    radial-gradient(700px 360px at 100% 0%, var(--glow-b), transparent 55%);
}

.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.orb-a {
  width: 340px;
  height: 340px;
  left: -80px;
  top: 80px;
  background: radial-gradient(circle, rgba(196, 161, 90, 0.35), transparent 68%);
}

.orb-b {
  width: 420px;
  height: 420px;
  right: -120px;
  top: 12%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.22), transparent 68%);
  animation-duration: 22s;
  animation-delay: -4s;
}

.orb-c {
  width: 280px;
  height: 280px;
  left: 35%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.22), transparent 68%);
  animation-duration: 16s;
  animation-delay: -8s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(28px, -36px, 0) scale(1.08); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shine {
  from { transform: translateX(-130%) rotate(18deg); }
  to { transform: translateX(220%) rotate(18deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(250, 113, 140, 0.45); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(250, 113, 140, 0); }
}

@keyframes sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px) saturate(1.2);
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

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

.brand-mark {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 56px;
  min-width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(130deg, #b8fff8, #00a3a0 28%, #0b1f4d 52%, #7ee8e0 78%, #00a3a0);
  background-size: 220% 220%;
  animation: sheen 5s ease infinite alternate, seal-glow 3.4s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(0, 163, 160, 0.45),
    0 10px 22px rgba(11, 31, 77, 0.2);
  transition: transform 0.35s var(--ease);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  position: relative;
  z-index: 1;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 0;
  background: conic-gradient(from 90deg, transparent 0 55%, rgba(126, 232, 224, 0.95), #00a3a0, transparent 78%);
  animation: spin 7s linear infinite;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  z-index: 2;
  width: 34%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  mix-blend-mode: soft-light;
  animation: shine 3.4s ease-in-out infinite;
  pointer-events: none;
}

.brand-mark:hover {
  transform: scale(1.06) rotate(-4deg);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes seal-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(0, 163, 160, 0.4),
      0 10px 22px rgba(11, 31, 77, 0.18),
      0 0 14px rgba(0, 163, 160, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(126, 232, 224, 0.9),
      0 12px 26px rgba(11, 31, 77, 0.22),
      0 0 28px rgba(0, 163, 160, 0.5);
  }
}

.brand-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand h1 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.theme-btn:hover {
  transform: translateY(-1px);
}

.theme-btn svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-btn .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-btn .icon-sun {
  opacity: 0;
  transform: rotate(-180deg) scale(0.45);
}

html[data-theme="dark"] .theme-btn .icon-moon {
  opacity: 0;
  transform: rotate(180deg) scale(0.45);
}

html[data-theme="dark"] .theme-btn .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

html.theme-ready .theme-btn svg {
  transition: transform 0.55s var(--ease), opacity 0.35s ease;
}

.page-nav {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
}

.nav-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 999px;
  flex: 1;
  text-align: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.nav-link:hover {
  background: var(--nav-hover);
}

.nav-link.is-active {
  background: var(--btn);
  color: var(--btn-text);
  box-shadow: var(--shadow);
}

.view { display: none; padding: 28px 0 64px; }
.view.is-active { display: block; animation: rise 0.5s var(--ease); }
.view-part { display: none; }
.view-part.is-active { display: block; animation: rise 0.55s var(--ease); }
body[data-page="homework"] .view-part,
body[data-page="info"] .view-part { display: none !important; }
body[data-page="schedule"] .view { display: none; }
body[data-page="homework"] .view[data-view="homework"] { display: block; }
body[data-page="info"] .view[data-view="info"] { display: block; }

.hero {
  padding: 28px 0 6px;
}

.masthead {
  animation: rise 0.55s var(--ease);
}

.masthead-kicker {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lecture);
}

.masthead-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 8vw, 72px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.masthead-week {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.masthead-week::before {
  content: "";
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--lecture);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  animation: rise 0.55s var(--ease);
}

.now-wrap { padding: 10px 0 8px; }

.now-card {
  position: relative;
  overflow: hidden;
  background: var(--now-card);
  background-size: 160% 160%;
  animation: rise 0.65s var(--ease) 0.08s both, sheen 10s ease infinite alternate;
  color: #fff;
  border: 1px solid var(--now-border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 24px 50px rgba(11, 31, 77, 0.22);
}

.now-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 161, 90, 0.28), transparent 70%);
  pointer-events: none;
}

.now-label {
  margin: 0 0 8px;
  opacity: 0.72;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.now-card > * {
  position: relative;
  z-index: 1;
}

.now-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 32px);
}

.now-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-size: 13px;
  font-weight: 600;
}

.now-card .btn {
  margin-top: 16px;
  position: relative;
  background: #fff;
  color: #0b1f4d;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.now-card .btn:hover {
  transform: translateY(-2px);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #fb7185;
  vertical-align: 1px;
  animation: pulse 1.6s ease-out infinite;
}

.now-countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.now-countdown strong {
  font-family: var(--display);
  font-size: clamp(24px, 5.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.now-countdown span {
  opacity: 0.72;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.now-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.now-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8c56a, #f7e7b4);
  box-shadow: 0 0 16px rgba(232, 197, 106, 0.45);
  transition: width 0.85s linear;
}

.now-card.is-live .now-bar > i {
  background: linear-gradient(90deg, #fb7185, #f4c16a);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.4);
}

.day-track {
  margin-top: 16px;
}

.day-track-rail {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.day-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.day-seg.is-done {
  background: rgba(232, 197, 106, 0.28);
}

.day-seg.is-live {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.day-seg > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(232, 197, 106, 0.95), rgba(247, 231, 180, 0.95));
  transition: width 0.85s linear;
}

.day-seg.is-live > i {
  background: linear-gradient(90deg, #fb7185, #f4c16a);
}

.day-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 2;
}

.day-playhead.is-hidden {
  display: none;
}

.day-track-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.7;
}

.schedule-section { padding: 20px 0 64px; }

.toolbar,
.day-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px;
}

.week-meta {
  min-width: 180px;
  text-align: center;
}

.week-meta strong { display: block; }
.week-meta span { color: var(--muted); font-size: 13px; }

.icon-btn,
.chip,
.btn {
  font: inherit;
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 22px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.icon-btn:hover { transform: translateY(-1px) scale(1.04); }

.icon-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.icon-btn:disabled:hover {
  transform: none;
}

.chips, .day-switch { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

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

.chip.is-active {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
  box-shadow: var(--shadow);
}

.toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.board {
  display: grid;
  gap: 16px;
}

.board.two {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .board.two { grid-template-columns: 1fr 1fr; }
}

.day-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.55s var(--ease) both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.board.two .day-col:nth-child(2) { animation-delay: 0.08s; }

.day-col:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.day-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--day-head);
}

.day-head h3 { margin: 0; font-size: 18px; }
.day-head span { color: var(--muted); font-size: 13px; }

.lesson {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  animation: rise 0.45s var(--ease) both;
  transition: background 0.25s var(--ease);
  overflow: hidden;
}

.lesson-progress {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--online), var(--gold));
  transition: width 0.85s linear;
  pointer-events: none;
}

.day-col .lesson:nth-child(2) { animation-delay: 0.05s; }
.day-col .lesson:nth-child(3) { animation-delay: 0.1s; }
.day-col .lesson:nth-child(4) { animation-delay: 0.15s; }
.day-col .lesson:nth-child(5) { animation-delay: 0.2s; }
.day-col .lesson:nth-child(6) { animation-delay: 0.25s; }
.day-col .lesson:nth-child(7) { animation-delay: 0.3s; }
.day-col .lesson:nth-child(8) { animation-delay: 0.35s; }

.lesson:hover { background: var(--lesson-hover); }

.lesson.is-live {
  background: var(--lesson-live);
  box-shadow: inset 3px 0 0 var(--online);
}

.lesson:last-child { border-bottom: 0; }

.time {
  font-weight: 800;
  font-size: 13px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.time.is-split {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-top: 2px;
}

.time-part {
  display: block;
  line-height: 1.2;
}

.time-part.is-now {
  color: var(--online);
}

.time-gap {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
  line-height: 1;
  margin: 1px 0;
}

.lesson.is-empty .time,
.lesson.is-empty .title { color: #9aa7bd; font-weight: 500; }

.title {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 15px;
}

.meta { margin: 0; color: var(--muted); font-size: 13px; }

.flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-lk { background: var(--lecture-bg); color: var(--lecture); }
.tag-pz { background: var(--practice-bg); color: var(--practice); }
.tag-meet { background: var(--meet-bg); color: var(--meet); }
.tag-online { background: var(--online-bg); color: var(--online); }
.tag-note { background: var(--tag-note-bg); color: var(--tag-note-fg); }
.tag-hw { background: var(--tag-note-bg); color: var(--tag-note-fg); }
.tag-due { background: var(--due-later-bg); color: var(--due-later); }
.is-due-today .tag-due { background: var(--due-today-bg); color: var(--due-today); }
.is-due-tomorrow .tag-due { background: var(--due-tomorrow-bg); color: var(--due-tomorrow); }
.is-due-week .tag-due { background: var(--due-week-bg); color: var(--due-week); }
.is-due-overdue .tag-due { background: var(--due-overdue-bg); color: var(--due-overdue); }

.note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--hw-ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--elevated);
  color: var(--navy);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}

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

.btn-online {
  background: var(--online);
  color: #fff;
  margin-top: 8px;
}

.btn-online:hover { filter: brightness(1.08); }

.empty-day {
  padding: 28px 18px;
  color: var(--muted);
}

.week-homework {
  margin-top: 16px;
}

.week-homework h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.hw-item {
  background: var(--hw-bg);
}

.hw-item.is-due-today {
  background: var(--due-today-bg);
  box-shadow: inset 3px 0 0 var(--due-today);
}

.hw-item.is-due-tomorrow {
  background: var(--due-tomorrow-bg);
  box-shadow: inset 3px 0 0 var(--due-tomorrow);
}

.hw-item.is-due-week {
  background: var(--due-week-bg);
  box-shadow: inset 3px 0 0 var(--due-week);
}

.hw-item.is-due-overdue {
  background: var(--due-overdue-bg);
  box-shadow: inset 3px 0 0 var(--due-overdue);
}

.hw-item.is-due-today .time,
.hw-item.is-due-today .tag-due { color: var(--due-today); }

.hw-item.is-due-tomorrow .time,
.hw-item.is-due-tomorrow .tag-due { color: var(--due-tomorrow); }

.hw-item.is-due-week .time,
.hw-item.is-due-week .tag-due { color: var(--due-week); }

.hw-item.is-due-overdue .time,
.hw-item.is-due-overdue .tag-due { color: var(--due-overdue); }

.hw-item .time {
  color: var(--hw-ink);
}

.originals {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px 16px;
}

.originals summary {
  cursor: pointer;
  font-weight: 800;
  padding: 12px 0;
}

.originals-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 860px) {
  .originals-grid { grid-template-columns: repeat(2, 1fr); }
}

.originals figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.originals img {
  border-radius: 12px;
  border: 1px solid var(--line);
}

.board-page { padding-top: 12px; }

.board-status {
  min-height: 0;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.board-status:empty {
  display: none;
}

.post-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin: 16px 0 24px;
}

.post-form[hidden] {
  display: none !important;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .form-grid { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid .wide { grid-column: 1 / -1; }
}

.post-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.post-form input,
.post-form textarea {
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.post-form input:focus,
.post-form textarea:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.45);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.submit-btn,
#toggle-form {
  border: 0;
  background: var(--btn);
  color: var(--btn-text);
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.submit-btn:hover,
#toggle-form:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(11, 31, 77, 0.18);
}

.submit-btn { margin-top: 14px; }

#toggle-form {
  width: 100%;
  max-width: 280px;
  margin: 0;
}

.homework-compose {
  margin-top: 28px;
  padding-top: 8px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ghost-btn,
.text-btn {
  font: inherit;
  cursor: pointer;
}

.ghost-btn {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: var(--ink);
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 14px;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.text-btn {
  border: 1px solid var(--line);
  background: var(--elevated);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
}

.text-btn.danger { color: var(--online); }

.subject-filters {
  margin: 12px 0 14px;
  gap: 6px;
}

.subject-filters[hidden] {
  display: none !important;
}

.subject-filters .chip {
  max-width: 100%;
  padding: 5px 10px;
  font-size: 12px;
}

.subject-filters .chip-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.65;
}

.feed { display: grid; gap: 18px; }

.feed-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.feed-group {
  display: grid;
  gap: 12px;
}

.feed-group-title {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.feed-group.is-due-today .feed-group-title { color: var(--due-today); }
.feed-group.is-due-tomorrow .feed-group-title { color: var(--due-tomorrow); }
.feed-group.is-due-week .feed-group-title { color: var(--due-week); }
.feed-group.is-due-overdue .feed-group-title { color: var(--due-overdue); }

.post-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 16px 20px;
  animation: rise 0.45s var(--ease) both;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--due-later);
}

.post-card.is-due-today {
  background: linear-gradient(90deg, var(--due-today-bg), var(--card) 48%);
}
.post-card.is-due-today::before { background: var(--due-today); }

.post-card.is-due-tomorrow {
  background: linear-gradient(90deg, var(--due-tomorrow-bg), var(--card) 48%);
}
.post-card.is-due-tomorrow::before { background: var(--due-tomorrow); }

.post-card.is-due-week {
  background: linear-gradient(90deg, var(--due-week-bg), var(--card) 48%);
}
.post-card.is-due-week::before { background: var(--due-week); }

.post-card.is-due-overdue {
  background: linear-gradient(90deg, var(--due-overdue-bg), var(--card) 48%);
}
.post-card.is-due-overdue::before { background: var(--due-overdue); }

.post-card.is-due-later::before { background: var(--gold); }
.post-card.is-due-none::before { background: var(--line); }

.feed .post-card:nth-child(2) { animation-delay: 0.05s; }
.feed .post-card:nth-child(3) { animation-delay: 0.1s; }
.feed .post-card:nth-child(4) { animation-delay: 0.15s; }

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.post-main { min-width: 0; }

.post-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.post-card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: clamp(16px, 2.4vw, 20px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.post-card .meta { margin: 0; color: var(--muted); font-size: 13px; }
.post-card .body {
  white-space: pre-wrap;
  margin: 10px 0 0;
}

.post-card .btn {
  margin-top: 12px;
}

.post-card a { color: var(--practice); font-weight: 700; }

.post-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 10px 8px;
  border-radius: 18px;
  background: var(--due-later-bg);
  color: var(--due-later);
  text-align: center;
}

.post-when strong {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.post-when span {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-card.is-due-today .post-when {
  background: var(--due-today-bg);
  color: var(--due-today);
}

.post-card.is-due-tomorrow .post-when {
  background: var(--due-tomorrow-bg);
  color: var(--due-tomorrow);
}

.post-card.is-due-week .post-when {
  background: var(--due-week-bg);
  color: var(--due-week);
}

.post-card.is-due-overdue .post-when {
  background: var(--due-overdue-bg);
  color: var(--due-overdue);
}

.post-when.is-empty {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
}

.post-when.is-empty span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.setup-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 16px;
}

.setup-card ol { margin: 8px 0 0; padding-left: 20px; }
.setup-card pre {
  overflow: auto;
  background: var(--pre);
  padding: 10px;
  border-radius: 12px;
  font-size: 12px;
}

.info-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

@media (min-width: 700px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
}

.info-grid.tight { margin: 12px 0; }

.info-link,
.info-card,
.mini-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.info-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line);
}

.info-link strong {
  font-size: 20px;
  color: var(--navy);
}

.info-link span:last-child,
.info-card p {
  color: var(--muted);
  font-size: 14px;
}

.info-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lecture);
}

.info-card {
  padding: 18px;
  margin-bottom: 16px;
}

.info-card h3 {
  margin: 4px 0 10px;
  font-size: 20px;
  color: var(--navy);
}

.person-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.person-photo-wrap {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--photo-ring);
  box-shadow: var(--shadow);
  background: var(--photo-bg);
}

.person-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
  transition: transform 0.35s var(--ease);
}

.person-card:hover .person-photo {
  transform: scale(1.05);
}

.info-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 0;
}

.info-contacts a,
.mini-card a,
.club-list a {
  color: var(--practice);
  font-weight: 800;
  text-decoration: none;
}

.mini-card {
  margin: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-card a { font-size: 16px; }

.hours {
  margin-top: 14px;
  background: var(--hours-bg);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--now-border);
}

.hours,
.hours p,
.hours-title {
  color: #fff;
}

.hours-title {
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

.hours ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hours li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 14px;
}

.hours span {
  background: var(--hours-pill);
  color: var(--hours-pill-text);
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 10px;
}

.hours li:nth-child(2) span {
  background: var(--hours-pill-alt);
}

.club-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.club-list li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--club);
  border-radius: 14px;
}

.club-list strong { color: var(--navy); }
.club-list span { color: var(--muted); font-size: 14px; }

.info-figure {
  margin: 12px 0 0;
}

.info-figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.info-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.footer {
  padding: 12px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
}

.footer-note {
  margin: 6px 0 0;
  max-width: 52em;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .container { width: calc(100% - 20px); }
  .brand-kicker { display: none; }
  .brand h1 { max-width: none; font-size: 13px; }
  .brand-mark { width: 46px; min-width: 46px; height: 46px; }
  .theme-btn { width: 38px; height: 38px; border-radius: 12px; }
  .hero { padding: 18px 0 2px; }
  .masthead-title { font-size: clamp(32px, 11vw, 52px); }
  .hero-lead { font-size: 15px; }
  .now-card { padding: 16px; border-radius: 20px; }
  .now-card h3 { font-size: 20px; }
  .toolbar, .day-switch { gap: 8px; }
  .week-nav { width: 100%; }
  .week-meta { min-width: 0; flex: 1; }
  .week-meta strong { font-size: 13px; }
  .toggle { margin-left: 0; width: 100%; }
  .lesson { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .chip { padding: 10px 12px; }
  .subject-filters .chip { padding: 5px 10px; }
  #toggle-form, .submit-btn, .ghost-btn { width: 100%; max-width: none; }
  .post-form input,
  .post-form textarea { font-size: 16px; }
  .board-page h2 { font-size: 26px; }
  .nav-link { font-size: 13px; padding: 10px 8px; }
  .person-row { flex-direction: column; align-items: center; text-align: center; }
  .person-photo-wrap { width: 110px; height: 110px; flex-basis: 110px; }
  .info-contacts { justify-content: center; }
}

html[data-theme="dark"] .masthead-kicker {
  color: var(--gold);
}
  color: #f2ece2;
  animation: rise 0.65s var(--ease) 0.08s both;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .now-card::before {
  background: radial-gradient(circle, rgba(212, 181, 106, 0.22), transparent 70%);
}

html[data-theme="dark"] .now-card .btn {
  background: #f0e6d2;
  color: #1e2a46;
}

html[data-theme="dark"] .pill {
  background: rgba(242, 236, 226, 0.12);
}

html[data-theme="dark"] .orb {
  opacity: 0.45;
}

html[data-theme="dark"] .brand-mark {
  animation: none;
  background: linear-gradient(130deg, #7ec8c2, #1e2a46 52%, #d4b56a);
  box-shadow: 0 0 0 1px rgba(212, 181, 106, 0.28);
}

html[data-theme="dark"] .brand-mark::before,
html[data-theme="dark"] .brand-mark::after {
  display: none;
}

html[data-theme="dark"] .live-dot {
  background: #e899ae;
}

html[data-theme="dark"] .hours,
html[data-theme="dark"] .hours p,
html[data-theme="dark"] .hours-title {
  color: #f2ece2;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
