:root {
  --bg-0: #e8edf2;
  --bg-1: #dde5ec;
  --fg: #14181d;
  --muted: #5a6470;
  --accent: #1b7d8a;
  --hairline: rgba(20, 24, 29, 0.12);
  --panel-bg: rgba(255, 255, 255, 0.5);
  --panel-brd: rgba(255, 255, 255, 0.6);
  --rim: rgba(255, 255, 255, 0.75);
  --glow: rgba(255, 255, 255, 0.14);
  --bloom-a: rgba(24, 125, 145, 0.22);
  --bloom-b: rgba(206, 176, 122, 0.16);
  --bloom-c: rgba(70, 120, 200, 0.18);
  --lg-tint-rgb: 255, 255, 255;
  --lg-tint-opacity: 0.06;
  --lg-shadow-blur: 20px;
  --lg-shadow-spread: -5px;
  --lg-shadow-color: rgba(255, 255, 255, 0.45);
  --lg-outer-shadow-blur: 24px;
  --lg-outer-shadow: rgba(0, 0, 0, 0.18);
  --lg-fallback-tint: 0.2;
  --lg-fallback-shine: rgba(255, 255, 255, 0.5);
  --apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --display: var(--apple);
  --body: "Karla", ui-sans-serif, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pointer-x: 50%;
  --pointer-y: 30%;
  --pointer-glow-strength: 0.75;
  --corner-pad: clamp(1rem, 2.5vw, 1.6rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-resolved-theme="light"]) {
    --bg-0: #0b0e11;
    --bg-1: #0f141a;
    --fg: #e9eef2;
    --muted: #98a2ad;
    --accent: #71c4c2;
    --hairline: rgba(233, 238, 242, 0.12);
    --panel-bg: rgba(26, 31, 37, 0.45);
    --panel-brd: rgba(255, 255, 255, 0.1);
    --rim: rgba(255, 255, 255, 0.16);
    --glow: rgba(200, 214, 224, 0.05);
    --bloom-a: rgba(58, 150, 152, 0.2);
    --bloom-b: rgba(150, 120, 70, 0.15);
    --bloom-c: rgba(66, 104, 168, 0.17);
    --lg-tint-rgb: 18, 24, 22;
    --lg-tint-opacity: 0.28;
    --lg-shadow-blur: 22px;
    --lg-shadow-spread: -4px;
    --lg-shadow-color: rgba(255, 255, 255, 0.28);
    --lg-outer-shadow-blur: 28px;
    --lg-outer-shadow: rgba(0, 0, 0, 0.5);
    --lg-fallback-tint: 0.14;
    --lg-fallback-shine: rgba(255, 255, 255, 0.3);
  }
}

html[data-resolved-theme="dark"] {
  --bg-0: #0b0e11;
  --bg-1: #0f141a;
  --fg: #e9eef2;
  --muted: #98a2ad;
  --accent: #71c4c2;
  --hairline: rgba(233, 238, 242, 0.12);
  --panel-bg: rgba(26, 31, 37, 0.45);
  --panel-brd: rgba(255, 255, 255, 0.1);
  --rim: rgba(255, 255, 255, 0.16);
  --glow: rgba(200, 214, 224, 0.05);
  --bloom-a: rgba(58, 150, 152, 0.2);
  --bloom-b: rgba(150, 120, 70, 0.15);
  --bloom-c: rgba(66, 104, 168, 0.17);
  --lg-tint-rgb: 18, 24, 22;
  --lg-tint-opacity: 0.28;
  --lg-shadow-blur: 22px;
  --lg-shadow-spread: -4px;
  --lg-shadow-color: rgba(255, 255, 255, 0.28);
  --lg-outer-shadow-blur: 28px;
  --lg-outer-shadow: rgba(0, 0, 0, 0.5);
  --lg-fallback-tint: 0.14;
  --lg-fallback-shine: rgba(255, 255, 255, 0.3);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--body);
  color: var(--fg);
  background:
    radial-gradient(ellipse 80% 50% at 15% 10%, var(--bloom-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 0%, var(--bloom-b), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--bloom-c), transparent 55%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}

/* Soft pointer glow that follows the cursor */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--pointer-glow-strength);
  background: radial-gradient(24rem 24rem at var(--pointer-x) var(--pointer-y), var(--glow), transparent 60%);
  transition: opacity 0.4s var(--ease);
}

html.lg-chrome {
  --pointer-x: 50vw;
  --pointer-y: 30vh;
}

html.lg-chrome body::after {
  inset: auto;
  width: 48rem;
  height: 48rem;
  left: 0;
  top: 0;
  margin-left: -24rem;
  margin-top: -24rem;
  background: radial-gradient(24rem 24rem at 50% 50%, var(--glow), transparent 60%);
  transform: translate3d(var(--pointer-x), var(--pointer-y), 0);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    display: none;
  }
}

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

/* ---- Home liquid-glass squircle (matches main site .c-tl) ---- */
.corner {
  position: fixed;
  z-index: 80;
  --lg-filter: none;
  isolation: isolate;
  display: grid;
  place-items: center;
  color: var(--fg);
  box-shadow: 0 6px var(--lg-outer-shadow-blur) var(--lg-outer-shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.4s var(--ease);
  will-change: transform;
}

.corner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 var(--lg-shadow-blur) var(--lg-shadow-spread) var(--lg-shadow-color);
  background-color: rgba(var(--lg-tint-rgb), var(--lg-tint-opacity));
  pointer-events: none;
}

.corner.lg-refraction::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  backdrop-filter: var(--lg-filter);
  -webkit-backdrop-filter: var(--lg-filter);
  isolation: isolate;
  pointer-events: none;
}

.corner.lg-fallback {
  background-color: rgba(var(--lg-tint-rgb), var(--lg-fallback-tint));
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
}

@media (prefers-color-scheme: dark) {
  html:not([data-resolved-theme="light"]) .corner.lg-refraction::after {
    backdrop-filter: var(--lg-filter) brightness(0.92) saturate(1.15);
    -webkit-backdrop-filter: var(--lg-filter) brightness(0.92) saturate(1.15);
  }
}

html[data-resolved-theme="dark"] .corner.lg-refraction::after {
  backdrop-filter: var(--lg-filter) brightness(0.92) saturate(1.15);
  -webkit-backdrop-filter: var(--lg-filter) brightness(0.92) saturate(1.15);
}

.corner svg {
  position: relative;
  z-index: 2;
  width: 52%;
  height: 52%;
}

.corner.squircle {
  border-radius: var(--lg-radius, 21px);
}

.corner.circle {
  border-radius: 50%;
}

.c-tl {
  top: var(--corner-pad);
  left: var(--corner-pad);
  width: 120px;
  height: 120px;
}

.c-tr {
  /* Empty theme orb: above every page element (no chat on this site) */
  z-index: 100;
  top: var(--corner-pad);
  right: var(--corner-pad);
  width: 120px;
  height: 120px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s var(--ease);
}

.c-tr.is-dragging {
  transition: none;
  cursor: grabbing;
}

.c-tr:active {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .c-tl,
  .c-tr {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 560px) {
  .c-tl,
  .c-tr {
    width: 80px;
    height: 80px;
  }
}

.wrap {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(7.5rem, 14vh, 9rem) 0 4rem;
}

.hero {
  margin-bottom: 1.25rem;
  animation: rise 0.7s var(--ease) both;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
}

.tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  position: relative;
  isolation: isolate;
  --lg-filter: none;
  box-shadow: 0 6px var(--lg-outer-shadow-blur) var(--lg-outer-shadow);
  animation: rise 0.75s var(--ease) 0.05s both;
}

.tabs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 var(--lg-shadow-blur) var(--lg-shadow-spread) var(--lg-shadow-color);
  background-color: rgba(var(--lg-tint-rgb), var(--lg-tint-opacity));
  pointer-events: none;
}

.tabs.lg-refraction::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  backdrop-filter: var(--lg-filter);
  -webkit-backdrop-filter: var(--lg-filter);
  isolation: isolate;
  pointer-events: none;
}

.tabs.lg-fallback {
  background-color: rgba(var(--lg-tint-rgb), var(--lg-fallback-tint));
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
}

.tab {
  position: relative;
  z-index: 2;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: 14px;
  cursor: pointer;
  transition:
    color 0.25s var(--ease),
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.tab[aria-selected="true"] {
  color: #fff;
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 80%, #000);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.tab[aria-selected="false"]:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

.subject-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subject-group {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-bg) 70%, transparent);
  padding: 0.85rem 0.85rem 0.7rem;
  animation: rise 0.65s var(--ease) both;
}

.subject-heading {
  margin: 0 0 0.55rem;
  padding: 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.elective-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.elective-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.elective-row:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.elective-row.is-current {
  color: var(--accent);
  font-weight: 650;
}

.view-detail {
  animation: rise 0.45s var(--ease) both;
}

.back {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0;
  margin: 0 0 1rem;
  cursor: pointer;
}

.back:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.detail-panel {
  position: relative;
  isolation: isolate;
  --lg-filter: none;
  border-radius: 22px;
  padding: 1.35rem 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 6px var(--lg-outer-shadow-blur) var(--lg-outer-shadow);
}

.detail-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 var(--lg-shadow-blur) var(--lg-shadow-spread) var(--lg-shadow-color);
  background-color: rgba(var(--lg-tint-rgb), var(--lg-tint-opacity));
  pointer-events: none;
}

.detail-panel.lg-refraction::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  backdrop-filter: var(--lg-filter);
  -webkit-backdrop-filter: var(--lg-filter);
  isolation: isolate;
  pointer-events: none;
}

.detail-panel.lg-fallback {
  background-color: rgba(var(--lg-tint-rgb), var(--lg-fallback-tint));
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
}

.detail-panel > * {
  position: relative;
  z-index: 2;
}

.detail-panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.detail-panel .meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.1rem;
}

.section {
  margin-top: 1.15rem;
}

.section h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-weight: 700;
}

.teacher-list,
.student-list,
.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.teacher-list li,
.student-list li,
.friend-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.95rem;
}

.teacher-list li:last-child,
.student-list li:last-child,
.friend-list li:last-child {
  border-bottom: 0;
}

.grade-block + .grade-block {
  margin-top: 0.85rem;
}

.grade-label {
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.friend-list li .yes {
  color: var(--accent);
  font-weight: 600;
}

.friend-list li .no {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.95rem;
}

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

