:root {
  color-scheme: light;
  --radius: 0.75rem;
  --bg: oklch(98.5% 0.005 90);
  --panel: oklch(100% 0 0);
  --text: oklch(20% 0.02 260);
  --muted: oklch(50% 0.02 260);
  --line: oklch(92% 0.01 90);
  --input: oklch(92% 0.01 90);
  --primary: oklch(55% 0.18 155);
  --primary-foreground: oklch(99% 0.005 155);
  --secondary: oklch(95% 0.02 155);
  --accent: oklch(75% 0.15 65);
  --accent-text: oklch(25% 0.05 65);
  --danger: oklch(57.7% 0.245 27.325);
  --ok: oklch(55% 0.18 155);
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  color: var(--primary-foreground);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.5rem;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  padding: 0 1rem;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.button-link,
.nav a {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.button-link {
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.25rem;
  padding: 0 1rem;
}

.button-link:hover {
  background: oklch(49% 0.17 155);
}

.secondary-button {
  background: var(--panel);
  border-color: var(--input);
  color: var(--text);
}

.secondary-button:hover {
  background: var(--secondary);
  color: var(--text);
}

button:hover {
  background: oklch(49% 0.17 155);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  padding: 0.65rem 0.75rem;
}

input {
  height: 2.5rem;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.shell {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.topbar {
  backdrop-filter: blur(8px);
  align-items: center;
  background: color-mix(in oklab, var(--panel) 80%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 0;
  padding: 0.625rem max(0.75rem, calc((100vw - 42rem) / 2));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.75rem;
  min-width: 0;
}

.brand-logo {
  background: #07943f;
  border-radius: 0.85rem;
  display: block;
  flex: 0 0 3rem;
  height: 3rem;
  object-fit: contain;
  width: 3rem;
}

.brand-text {
  display: grid;
  min-width: 0;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.nav {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
  scrollbar-width: none;
}

.menu-toggle {
  display: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  align-items: center;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 500;
  height: 2rem;
  justify-content: center;
  padding: 0.45rem 0.75rem;
}

.nav a:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 42rem;
  padding: 2rem 1rem;
}

.index-wrap {
  display: grid;
  gap: 2rem;
  margin: 0 auto;
  max-width: 42rem;
  padding: 1rem;
}

.join-bubble {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 25px rgb(15 23 42 / 0.08);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) 7rem auto;
  margin-top: 1rem;
  padding: 0.75rem;
}

.join-bubble strong,
.join-bubble span {
  display: block;
}

.join-bubble span {
  color: var(--muted);
  font-size: 0.875rem;
}

.hero {
  padding: 3rem 0 4rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  font-weight: 700;
}

.lead {
  color: var(--text);
  font-size: 1.075rem;
  line-height: 1.65;
  margin-left: auto;
  margin-right: auto;
  max-width: 48rem;
}

.info-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.5rem;
}

.info-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 1rem;
}

.info-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.panel + .panel {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.login-tabs {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(2, 1fr);
  padding: 0.25rem;
}

.tab-active,
.tab-muted {
  box-shadow: none;
  width: 100%;
}

.tab-muted {
  background: transparent;
  color: var(--muted);
}

.tab-muted:hover {
  background: var(--secondary);
  color: var(--text);
}

.stack {
  display: grid;
  gap: 1rem;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 1.5rem;
  letter-spacing: 0;
}

h2 {
  font-size: 1.125rem;
}

h3 {
  font-size: 1rem;
}

label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

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

.code {
  background: var(--panel);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-size: clamp(2rem, 10vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1.25rem;
  text-align: center;
}

.small-code {
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  overflow-wrap: anywhere;
}

.student-row,
.answer-row,
.admin-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-row {
  align-items: stretch;
  display: grid;
  grid-template-columns: 1fr auto;
}

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

.inline-form,
.settings-form {
  display: grid;
  gap: 0.5rem;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.settings-form {
  align-items: center;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
}

.settings-form label {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  white-space: nowrap;
}

.settings-form input[type="checkbox"] {
  box-shadow: none;
  height: 1rem;
  width: 1rem;
}

.control-form {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(12rem, 1.2fr) minmax(8rem, 1fr) minmax(8rem, 1fr) minmax(8rem, 1fr) minmax(8rem, 1fr) auto auto;
  padding: 1rem 0;
}

.control-form input,
.control-form select {
  min-width: 0;
}

.homework-control {
  grid-template-columns: minmax(12rem, 1.2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) minmax(8rem, 1fr) auto auto;
}

.homework-control textarea {
  grid-column: 1 / -1;
  min-height: 120px;
}

.control-form [data-row-status] {
  align-self: center;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: oklch(50% 0.22 27);
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
}

.status.active {
  background: var(--secondary);
  color: var(--ok);
}

.status.locked {
  background: color-mix(in oklab, var(--danger) 12%, white);
  color: var(--danger);
}

.feedback {
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem;
}

.feedback.correct {
  background: var(--secondary);
  color: var(--ok);
}

.feedback.incorrect,
.locked-message {
  background: color-mix(in oklab, var(--danger) 12%, white);
  color: var(--danger);
}

.locked-message {
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.875rem;
}

.home-empty {
  padding: 4rem 0;
  text-align: center;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.home-actions a:not(.button-link) {
  align-items: center;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.25rem;
  justify-content: center;
  padding: 0 1rem;
}

.home-actions a:not(.button-link):hover {
  background: var(--accent);
  color: var(--accent-text);
}

@media (max-width: 640px) {
  .student-row,
  .answer-row,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }

  .menu-toggle {
    align-items: center;
    background: white;
    border: 1px solid #dddbea;
    border-radius: 999px;
    box-shadow: var(--shadow);
    display: inline-flex;
    flex: 0 0 2.5rem;
    flex-direction: column;
    gap: 0.25rem;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    width: 2.5rem;
  }

  .menu-toggle:hover {
    background: #eeeafd;
  }

  .menu-toggle span {
    background: #121326;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 1.1rem;
  }

  .nav {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
  }

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

  .nav a {
    flex: none;
    height: 2.65rem;
    text-align: center;
    width: 100%;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 1rem;
  }

  .join-bubble {
    border-radius: var(--radius);
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .grid,
  .index-wrap {
    padding: 1rem 0.75rem 2rem;
  }

  .code {
    font-size: clamp(1.7rem, 14vw, 3rem);
    padding: 1rem;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1;
  }

  .login-tabs,
  .inline-form,
  .settings-form,
  .control-form,
  .homework-control,
  .account-row {
    grid-template-columns: 1fr;
  }

  .settings-form label {
    justify-content: flex-start;
  }
}

/* Glosio visual layer */
body {
  background: #f8f8fb;
}

.topbar {
  background: color-mix(in oklab, white 92%, transparent);
  border-bottom-color: #dddbea;
}

.glosio-mark {
  align-items: center;
  background: linear-gradient(135deg, #8b4ff2 0%, #d85dd8 48%, #f2a13d 100%);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  flex: 0 0 3rem;
  font-size: 1.7rem;
  font-weight: 800;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.grid,
.index-wrap {
  max-width: 58rem;
}

.nav a {
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  color: #62657a;
  height: 2.5rem;
}

.nav a:hover {
  background: #eeeafd;
  color: #121326;
}

.hero {
  background: linear-gradient(135deg, #eee0ff 0%, #f6d9f0 58%, #fff0de 100%);
  border: 1px solid #e0ddee;
  border-radius: 0 0 2rem 2rem;
  margin-inline: calc(50% - 50vw);
  padding: 8rem max(1.25rem, calc((100vw - 58rem) / 2)) 5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(90deg, #884df0, #df62cf, #f3a13e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  align-items: center;
  background: white;
  border: 1px solid #ddd8ea;
  border-radius: 999px;
  color: #62657a;
  display: inline-flex;
  justify-self: center;
  padding: 0.45rem 1rem;
}

.feature-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.feature-card {
  background: linear-gradient(135deg, #fff 0%, #fbf9ff 100%);
  border: 1px solid #dddbea;
  border-radius: 1.25rem;
  min-width: 0;
  padding: 2rem;
  text-align: left;
}

.feature-card span {
  color: #8b4ff2;
  display: block;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h2 {
  font-size: 1.5rem;
}

.feature-card p {
  color: #686b80;
  font-size: 1.05rem;
}

select {
  background: white;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  height: 2.5rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
}

.site-footer {
  border-top: 1px solid #dddbea;
  color: #686b80;
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  margin-top: 4rem;
  padding: 3rem 1rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.site-footer .newsletter-link {
  background: #8b4ff2;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  padding: 0.55rem 1rem;
}

#publicInfoBanner {
  background: var(--banner-color, #8b4ff2);
  color: white;
  padding: 0.75rem 1rem;
}

.public-banner-content {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 0 auto;
  max-width: 58rem;
  text-align: center;
}

.public-banner-content a {
  background: rgb(255 255 255 / 0.18);
  border: 1px solid rgb(255 255 255 / 0.36);
  border-radius: 999px;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
}

.news-section {
  padding-top: 1.5rem;
}

.news-list {
  display: grid;
  gap: 0.75rem;
}

.news-card {
  align-items: start;
  background: white;
  border: 1px solid #dddbea;
  border-radius: 1rem;
  box-shadow: none;
  color: #121326;
  display: grid;
  gap: 0.35rem;
  height: auto;
  justify-content: stretch;
  line-height: 1.4;
  padding: 1rem;
  text-align: left;
  white-space: normal;
}

.news-card span {
  color: #686b80;
  font-weight: 400;
}

.modal-backdrop {
  align-items: center;
  background: rgb(18 19 38 / 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 100;
}

.modal-panel {
  background: white;
  border-radius: 1.25rem;
  box-shadow: 0 24px 80px rgb(18 19 38 / 0.25);
  color: #121326;
  max-height: min(80vh, 42rem);
  max-width: 42rem;
  overflow: auto;
  padding: 2rem;
  position: relative;
  width: min(100%, 42rem);
}

.modal-close {
  background: #f2f0fb;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  color: #121326;
  font-size: 1.5rem;
  height: 2.25rem;
  padding: 0;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 2.25rem;
}

.article-body {
  color: #303247;
  line-height: 1.7;
  margin-top: 1.25rem;
}

.settings-check {
  align-items: center;
  display: inline-flex;
  gap: 0.55rem;
}

.settings-check input {
  box-shadow: none;
  height: 1rem;
  width: 1rem;
}

@media (max-width: 640px) {
  .hero {
    padding: 5rem 1rem 3.5rem;
  }

  .nav {
    overflow-x: visible;
    padding-bottom: 0.25rem;
  }
}
