@layer academy {
:root {
  --bg: #0a0912;
  --surface: #151220;
  --surface-strong: #1d1829;
  --text: #faf6ff;
  --muted: #b9b0c9;
  --pink: #ffa9d1;
  --lavender: #c7a9fb;
  --gold: #f8d5aa;
  --border: rgba(255, 255, 255, 0.14);
  --danger: #ffb6c6;
  --success: #bdf3d3;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 8%, rgba(87, 48, 116, 0.28), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.65;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Outfit", system-ui, sans-serif;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

::selection {
  background: var(--lavender);
  color: #20172d;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.narrow {
  width: min(760px, calc(100% - 36px));
  margin-inline: auto;
}

.topbar {
  padding: 9px 18px;
  background: var(--lavender);
  color: #21172e;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 9, 18, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  flex: 0 0 auto;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand b {
  color: var(--pink);
}

.brand small {
  display: block;
  margin-top: 6px;
  color: #c8bdd8;
  font: 700 0.5rem/1 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.25em;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #d6cee2;
  font-size: 0.79rem;
  font-weight: 700;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: #fff;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: none;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}

.member-menu {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.session-link,
.session-name,
.session-logout {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #e9e0f2;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.session-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-logout {
  color: var(--muted);
}

.session-skeleton {
  width: 112px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff0a, #ffffff1d, #ffffff0a);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(115deg, #ffc0da, #baa1ff);
  box-shadow: 0 12px 42px rgba(237, 158, 211, 0.15);
  color: #21152c;
}

.button-small {
  min-height: 40px;
  padding: 9px 15px;
  font-size: 0.74rem;
}

.button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.text-link {
  color: #f1d8ff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(241, 216, 255, 0.4);
  text-underline-offset: 4px;
}

.text-button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--pink);
}

.page-hero {
  padding: clamp(64px, 9vw, 108px) 0 58px;
}

.page-hero.compact {
  padding-bottom: 36px;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--pink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-hero h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.page-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ffb5d5, #c6abff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero .lead {
  max-width: 690px;
  color: #d3c9de;
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.9;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.section {
  padding: 54px 0 84px;
}

.section-title {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-title h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.section-title p,
.muted {
  color: var(--muted);
}

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

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(29, 24, 41, 0.95), rgba(16, 14, 25, 0.95));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.17);
  padding: clamp(24px, 4vw, 36px);
}

.card h2 {
  font-size: clamp(1.65rem, 4vw, 2.4rem);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 190, 220, 0.3);
  border-radius: 999px;
  color: #ffd0e5;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.notice-card,
.status-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  padding: 20px;
}

.notice-card strong,
.status-card strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
}

.status-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-label {
  width: fit-content;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(189, 243, 211, 0.1);
  color: var(--success) !important;
  font-size: 0.65rem !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-layout {
  width: min(1040px, calc(100% - 36px));
  margin: clamp(48px, 8vw, 90px) auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 0.7fr);
  gap: 42px;
  align-items: center;
}

.auth-story {
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 34px;
  background: #24192f;
  box-shadow: var(--shadow);
}

.auth-story img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.58;
}

.auth-story::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 26%, rgba(11, 8, 17, 0.94) 86%);
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  padding: 36px;
}

.auth-story h1 {
  margin-bottom: 15px;
  font-size: clamp(2.5rem, 5vw, 4.1rem);
}

.auth-story p {
  max-width: 520px;
  color: #ded4e7;
}

.auth-panel {
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(21, 18, 32, 0.96);
  box-shadow: var(--shadow);
  padding: clamp(26px, 5vw, 42px);
}

.auth-panel h2 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.tabs {
  margin: 24px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #090810;
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: #262033;
  color: #fff;
}

.field {
  margin-bottom: 17px;
}

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

label {
  display: block;
  margin-bottom: 7px;
  color: #e7deef;
  font-size: 0.78rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0c0a13;
  color: #fff;
  padding: 12px 14px;
}

input::placeholder {
  color: #7f758d;
}

.field-hint {
  margin: 7px 0 0;
  color: #91869f;
  font-size: 0.72rem;
}

.form-error,
.form-status {
  min-height: 24px;
  margin: 0 0 14px;
  font-size: 0.79rem;
}

.form-error {
  color: var(--danger);
}

.form-status {
  color: var(--success);
}

.form-actions .button {
  width: 100%;
}

.auth-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.captcha-slot {
  min-height: 78px;
  margin: 16px 0;
  overflow-x: auto;
}

.captcha-slot[hidden] {
  display: none;
}

.gate-shell {
  min-height: 360px;
}

.gate-loading {
  display: grid;
  gap: 14px;
}

.skeleton-line {
  width: 100%;
  height: 18px;
  border-radius: 10px;
  background: linear-gradient(90deg, #ffffff08, #ffffff18, #ffffff08);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-line.short {
  width: 55%;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb5d5, #a88bf1);
  color: #271a30;
  font: 800 1.5rem "Outfit", system-ui, sans-serif;
  object-fit: cover;
}

.profile-strip h2 {
  margin-bottom: 4px;
}

.profile-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.plan-card {
  display: flex;
  flex-direction: column;
}

.plan-card.featured {
  border-color: rgba(211, 180, 255, 0.42);
  background: linear-gradient(150deg, #2b203b, #17131f);
}

.plan-name {
  margin: 18px 0 6px;
  font-size: 1.7rem;
}

.price {
  margin-bottom: 7px;
  font: 800 clamp(2.4rem, 5vw, 3.5rem)/1 "Outfit", system-ui, sans-serif;
  letter-spacing: -0.05em;
}

.price-note {
  color: var(--muted);
  font-size: 0.77rem;
}

.feature-list {
  margin: 24px 0 28px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 10px 0 10px 24px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d6ccdf;
  font-size: 0.84rem;
}

.feature-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--pink);
}

.plan-card .card-actions {
  margin-top: auto;
}

.comparison-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
}

.comparison {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(17, 14, 25, 0.84);
}

.comparison th,
.comparison td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.8rem;
}

.comparison th:not(:first-child),
.comparison td:not(:first-child) {
  text-align: center;
}

.comparison thead th {
  color: #f4e9fb;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.92rem;
}

.lesson-article {
  max-width: 820px;
}

.lesson-article > section {
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, #1a1625, #11101a);
  padding: clamp(24px, 5vw, 38px);
}

.lesson-article h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.lesson-article p,
.lesson-article li {
  color: #c9bfD3;
}

.lesson-article li + li {
  margin-top: 10px;
}

.prompt-box {
  margin: 18px 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #08070e;
  color: #ece2f1;
  padding: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.82rem/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.legal {
  padding: 64px 0 96px;
}

.legal h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
}

.legal h2 {
  margin-top: 40px;
  font-size: 1.55rem;
}

.legal p,
.legal li {
  color: #c8bed2;
}

.legal li + li {
  margin-top: 8px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: #9f94ac;
  font-size: 0.75rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.footer-links a:hover {
  color: #fff;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (max-width: 920px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 13px 0;
    gap: 12px;
  }

  .nav-toggle {
    display: grid;
    margin-left: auto;
  }

  .member-menu {
    order: 2;
  }

  .site-nav {
    width: 100%;
    order: 3;
    display: none;
    margin-left: 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
  }

  .site-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
  }

  .site-nav a {
    min-height: 48px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 36px));
  }

  .auth-story {
    min-height: 430px;
  }

  .plan-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    font-size: 0.58rem;
  }

  .header-inner {
    column-gap: 8px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand small {
    display: none;
  }

  .member-menu {
    margin-left: 0;
  }

  .session-join,
  .session-logout {
    display: none;
  }

  .session-name {
    max-width: 92px;
  }

  .grid-2,
  .field-row {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding-top: 58px;
  }

  .auth-layout {
    margin-block: 32px 58px;
  }

  .auth-story {
    min-height: 330px;
  }

  .auth-story-copy {
    padding: 26px;
  }

  .auth-story h1 {
    font-size: 2.5rem;
  }

  .profile-strip {
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
}
