:root {
  color-scheme: dark;
  --background: #050914;
  --panel: rgba(12, 20, 37, 0.9);
  --panel-soft: rgba(18, 30, 52, 0.68);
  --border: rgba(148, 179, 219, 0.2);
  --text: #f6f8fc;
  --muted: #a9b8ce;
  --cyan: #54e5ff;
  --cyan-dark: #062f3a;
  --gold: #ffd978;
  --danger: #ff9f9f;
  --success: #8bf0be;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(84, 229, 255, 0.13), transparent 28rem),
    radial-gradient(circle at 88% 80%, rgba(255, 217, 120, 0.1), transparent 26rem),
    linear-gradient(145deg, #03060d 0%, var(--background) 48%, #080d18 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(circle, rgba(255,255,255,.7) 1px, transparent 1.2px);
  background-size: 70px 70px;
}

a { color: inherit; }

.site-header {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.15rem;
}

.home-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.home-link:hover,
.home-link:focus-visible { color: var(--cyan); }

main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 89px);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 100px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: center;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.65rem, 6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.intro-copy {
  max-width: 660px;
  margin: 28px 0 38px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  line-height: 1.7;
}

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

.access-card {
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-soft);
  backdrop-filter: blur(16px);
}

.access-card-full {
  border-color: rgba(255, 217, 120, 0.38);
  box-shadow: inset 0 0 30px rgba(255, 217, 120, 0.04);
}

.access-number {
  color: var(--cyan);
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.access-card h2 {
  margin: 30px 0 8px;
  font-size: 1rem;
}

.access-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.account-panel {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(84, 229, 255, 0.24);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0,0,0,0.42), inset 0 1px rgba(255,255,255,0.04);
  backdrop-filter: blur(22px);
}

.panel-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: -110px;
  border-radius: 50%;
  background: rgba(84, 229, 255, 0.2);
  filter: blur(55px);
  pointer-events: none;
}

.account-view { position: relative; }
.account-view[hidden] { display: none !important; }

.account-view h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

.account-view > p:not(.panel-kicker) {
  color: var(--muted);
  line-height: 1.6;
}

#loadingView {
  min-height: 370px;
  display: grid;
  place-content: center;
  justify-items: center;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(84, 229, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

form { margin-top: 28px; }

label {
  display: block;
  margin-bottom: 9px;
  color: #dce7f6;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(2, 7, 14, 0.8);
  border: 1px solid rgba(148, 179, 219, 0.28);
  border-radius: 12px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(84, 229, 255, 0.12);
}

button,
.button-link {
  min-height: 50px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:hover,
.button-link:hover { transform: translateY(-1px); }

button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  color: #001217;
  border: 1px solid var(--cyan);
  background: linear-gradient(135deg, #8cf0ff, var(--cyan));
  box-shadow: 0 10px 30px rgba(84, 229, 255, 0.14);
}

.button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.google-button {
  width: 100%;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #172033;
  border: 1px solid #d8dee8;
  background: #fff;
}

.google-button svg { width: 21px; height: 21px; flex: 0 0 auto; }
.google-button:hover, .google-button:focus-visible { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(84, 229, 255, 0.1); }

.sign-in-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  color: #7f8da2;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sign-in-divider::before,
.sign-in-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.privacy-note {
  margin: 18px 0 0;
  font-size: 0.78rem;
}

.privacy-note a { color: #d9e5f5; text-underline-offset: 3px; }
.privacy-note a:hover, .privacy-note a:focus-visible { color: var(--cyan); }

.account-details {
  margin: 28px 0;
  border-top: 1px solid var(--border);
}

.account-details > div {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd { margin: 0; overflow-wrap: anywhere; }

.access-badge {
  display: inline-flex;
  padding: 7px 11px;
  color: var(--success);
  border: 1px solid rgba(139, 240, 190, 0.28);
  border-radius: 999px;
  background: rgba(139, 240, 190, 0.07);
  font-size: 0.82rem;
  font-weight: 800;
}

.access-badge.full {
  color: var(--gold);
  border-color: rgba(255, 217, 120, 0.3);
  background: rgba(255, 217, 120, 0.08);
}

.university-purchase {
  margin: 0 0 22px;
  padding: 19px;
  border: 1px solid rgba(84, 229, 255, 0.34);
  border-radius: 16px;
  background: rgba(2, 7, 14, 0.5);
}

.university-purchase[hidden] { display: none; }

.purchase-kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.university-purchase h3 { margin: 0; font-size: 1.08rem; }
.purchase-copy { margin: 10px 0 15px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.purchase-details { margin: 0; border-top: 1px solid var(--border); }
.purchase-details > div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.purchase-actions { margin-top: 15px; display: grid; gap: 9px; }
.purchase-actions button { width: 100%; }

.membership-actions {
  margin: 0 0 22px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 7, 14, 0.46);
}

.membership-actions.is-full {
  border-color: rgba(255, 217, 120, 0.34);
  box-shadow: inset 0 0 28px rgba(255, 217, 120, 0.035);
}

.membership-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.membership-kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.membership-heading-row h3 {
  margin: 0;
  font-size: 1.08rem;
}

.connection-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.membership-actions.is-full .connection-status {
  color: var(--gold);
  border-color: rgba(255, 217, 120, 0.28);
  background: rgba(255, 217, 120, 0.06);
}

.membership-copy,
.provider-note {
  color: var(--muted);
  line-height: 1.5;
}

.membership-copy {
  margin: 13px 0 15px;
  font-size: 0.82rem;
}

.provider-note {
  margin: 12px 0 0;
  font-size: 0.7rem;
}

.membership-purchase-options {
  margin-top: 15px;
}

.plan-prompt {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.direct-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.plan-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 132px;
  padding: 16px 14px 14px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  text-align: left;
}

.plan-option-featured {
  border-color: rgba(255, 217, 120, 0.58);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 217, 120, 0.14), transparent 48%),
    rgba(255, 217, 120, 0.055);
  box-shadow: inset 0 0 26px rgba(255, 217, 120, 0.035);
}

.plan-option:hover,
.plan-option:focus-visible {
  border-color: var(--cyan);
  outline: none;
  transform: translateY(-1px);
}

.plan-option-featured:hover,
.plan-option-featured:focus-visible {
  border-color: var(--gold);
}

.plan-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 4px 7px;
  color: #15100a;
  border-radius: 999px;
  background: var(--gold);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-name {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-price {
  margin-top: 4px;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.plan-price small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.plan-equivalent,
.plan-saving {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.25;
}

.plan-saving {
  color: var(--cyan);
  font-weight: 800;
}

.plan-option-featured .plan-saving {
  color: var(--gold);
}

.billing-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.45;
}

.membership-divider {
  display: flex;
  margin: 15px 0 10px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.64rem;
}

.membership-divider::before,
.membership-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.provider-button {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  font-size: 0.78rem;
}

.patreon-button {
  border-color: rgba(255, 99, 76, 0.4);
}

.provider-button:hover,
.provider-button:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

.membership-actions.is-full .membership-purchase-options {
  display: none;
}

.preview-access {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid rgba(255, 217, 120, 0.4);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 217, 120, 0.12), transparent 45%),
    rgba(2, 7, 14, 0.6);
  box-shadow: inset 0 0 30px rgba(255, 217, 120, 0.035);
}

.preview-access[hidden] { display: none; }

.preview-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-access h3 {
  margin: 0;
  font-size: 1.08rem;
}

.preview-access > p:not(.preview-kicker) {
  margin: 10px 0 15px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.preview-button {
  width: 100%;
  min-height: 46px;
  color: #211a05;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, #ffe8a7, var(--gold));
  box-shadow: 0 10px 28px rgba(255, 217, 120, 0.12);
}

.account-message {
  position: relative;
  min-height: 24px;
  margin: 20px 0 0;
  color: var(--success);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.legal-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.legal-footer a { text-underline-offset: 4px; }
.legal-footer a:hover, .legal-footer a:focus-visible { color: var(--cyan); }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .account-panel { min-height: 0; }
}

@media (max-width: 640px) {
  .site-header,
  main,
  .legal-footer { width: min(100% - 28px, 1180px); }

  .site-header { padding: 20px 0; }
  .home-link { font-size: 0.82rem; }
  main { padding: 48px 0; }
  .access-grid { grid-template-columns: 1fr; }
  .access-card { min-height: 0; }
  .access-card h2 { margin-top: 18px; }
  .membership-heading-row { display: grid; }
  .connection-status { justify-self: start; }
  .direct-plan-grid { grid-template-columns: 1fr; }
}

@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;
  }
}
