:root {
  color-scheme: light;
  --bg: #f2f7fe;
  --circle: #e2edfc;
  --bar: #ffffff;
  --bar-line: #e4ecf7;
  --text: #15233d;
  --muted: #5a6a82;
  --hover: #edf3fc;
  --mark: #2f6fde;
  --mark-tail: #a9c8f6;
  --card-from: #2f80f0;
  --card-to: #1252d0;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15181d;
  --circle: #1c2027;
  --bar: #20242b;
  --bar-line: #2e333b;
  --text: #f2f4f7;
  --muted: #a3abb7;
  --hover: #2c3139;
  --mark: #5b93f0;
  --mark-tail: #3a5684;
  --card-from: #2a6fd6;
  --card-to: #0f43ad;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 0% 100%, var(--circle) 0 200px, transparent 201px),
    radial-gradient(circle at 92% 104%, var(--circle) 0 240px, transparent 241px),
    radial-gradient(circle at 80% 0%, var(--circle) 0 300px, transparent 301px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button { font: inherit; cursor: pointer; }

a:focus-visible, .top button:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 2px;
}

.card button:focus-visible, .card a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

/* Floating top bar */
.top { padding-top: 16px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  background: var(--bar);
  border: 1px solid var(--bar-line);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(30, 70, 140, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mark { width: 36px; height: 25px; }
.mark-arc { stroke: var(--mark); }
.mark-tail { stroke: var(--mark-tail); }

.top-right { display: flex; align-items: center; gap: 6px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  border-radius: 12px;
  color: var(--text);
}

.icon-button:hover, .login:hover { background: var(--hover); }

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Shows the mode you would switch to */
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.login, .get-started {
  flex: none;
  height: 40px;
  white-space: nowrap;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

.login { display: inline-flex; align-items: center; background: none; color: var(--text); }

.get-started {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2f6fde;
  color: #fff;
  transition: background 0.15s ease;
}

.get-started:hover { background: #235ec4; }

.top [hidden] { display: none; }

.channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

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

.channel svg { flex: none; width: 24px; height: 24px; }

/* Profile circle */
.profile { position: relative; }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #2f6fde;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.avatar:hover { background: #235ec4; }

.profile-menu {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 10;
  width: min(260px, calc(100vw - 48px));
  padding: 16px;
  background: var(--bar);
  border: 1px solid var(--bar-line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(30, 70, 140, 0.16);
}

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

.profile-email { margin: 2px 0 12px; font-weight: 600; overflow-wrap: anywhere; }

/* Big blue card */
.stage {
  display: flex;
  flex: 1;
  padding-top: 20px;
  padding-bottom: 20px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 440px;
  overflow: hidden;
  padding: 56px 64px;
  background:
    radial-gradient(circle at 74% 128%, rgba(255, 255, 255, 0.09) 0 42%, transparent 42.2%),
    radial-gradient(circle at 108% -8%, rgba(255, 255, 255, 0.1) 0 36%, transparent 36.2%),
    linear-gradient(135deg, var(--card-from), var(--card-to));
  border-radius: 40px;
  box-shadow: 0 18px 44px rgba(20, 80, 200, 0.22);
  color: #fff;
}

/* Soft flash of light when the mocks open */
.card::after {
  content: "";
  position: absolute;
  top: 60%;
  left: 32%;
  width: 1100px;
  height: 1100px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.28), transparent);
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.card.open::after { animation: flash 1.1s ease-out; }

@keyframes flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.arc {
  position: absolute;
  right: 5%;
  bottom: 13%;
  width: min(32%, 330px);
}

.arc-main { stroke: #fff; }
.arc-tail { stroke: rgba(255, 255, 255, 0.35); }

.card-text { position: relative; z-index: 1; width: min(620px, 62%); }

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.accent { color: #a8dcff; }

.lede {
  max-width: 28em;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
}

/* The button and the mocks share one space, so opening only fades and slides */
.choice { display: grid; }

.choice > * { grid-area: 1 / 1; }

.start-area { justify-self: start; transition: opacity 0.25s ease, transform 0.3s ease; }

.card.open .start-area { opacity: 0; transform: scale(0.94); }

.start {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 16px 30px;
  background: #fff;
  border: 0;
  border-radius: 999px;
  color: var(--card-to);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(8, 40, 110, 0.28);
  transition: transform 0.15s ease;
}

.start:hover { transform: translateY(-2px); }

/* The two mock tests */
.mocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-top: 32px;
}

.mock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 20px 22px;
  background: #fff;
  border: 0;
  border-radius: 20px;
  color: #15233d;
  text-align: left;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.5s ease, transform 0.6s var(--ease), background 0.15s ease;
}

.card.open .mock { opacity: 1; transform: none; transition-delay: 0.14s, 0.14s, 0s; }
.card.open .mock:nth-child(2) { transition-delay: 0.26s, 0.26s, 0s; }

.mock:hover { background: #e9f2ff; }

.mock-name { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }

.mock-note { color: #5a6a82; font-size: 14px; }

.back {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 6px 10px;
  margin-left: -10px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card.open .back { opacity: 1; transition-delay: 0.4s; }

.back:hover { color: #fff; text-decoration: underline; }

/* The card clears and lists a subject's mocks */
.card-text { transition: opacity 0.2s ease; }

.card.in-subject .card-text { opacity: 0; }

.subject {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
  padding: 44px 64px;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.card.in-subject .subject { opacity: 1; visibility: visible; transition-delay: 0.1s; }

.subject h2 { margin: 12px 0 22px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.03em; line-height: 1.1; }

.subject-back {
  padding: 6px 10px;
  margin-left: -10px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.subject-back:hover { color: #fff; text-decoration: underline; }

.subject-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: min(620px, 62%);
}

.subject-mock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 22px;
  background: #fff;
  border-radius: 20px;
  color: #15233d;
  transition: background 0.15s ease;
}

a.subject-mock:hover { background: #e9f2ff; }

.subject-mock.soon { opacity: 0.6; }

/* Log in and register */
.auth {
  width: min(420px, calc(100% - 32px));
  margin: auto;
  padding: 32px;
  background: var(--bar);
  border: 1px solid var(--bar-line);
  border-radius: 24px;
  box-shadow: 0 10px 34px rgba(30, 70, 140, 0.08);
}

.auth [hidden] { display: none; }

.auth-title { margin: 22px 0 18px; font-size: 28px; }

.auth-form { display: grid; gap: 14px; }

.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }

.auth-form input {
  height: 46px;
  padding: 0 14px;
  background: none;
  border: 1px solid var(--bar-line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
}

.auth-form input:focus { outline: 2px solid var(--mark); outline-offset: 1px; }

.auth-form .get-started { height: 46px; margin-top: 4px; }

.auth-form .get-started:disabled { opacity: 0.6; cursor: default; }

.auth-message { margin: 16px 0 0; font-size: 15px; }

.auth-switch { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 0; }

.auth-link { padding: 0; background: none; border: 0; color: var(--mark); font-size: 15px; font-weight: 500; }

.auth-link:hover { text-decoration: underline; }

.end { padding-top: 14px; padding-bottom: 18px; color: var(--muted); font-size: 13px; text-align: center; }

.end p { margin: 0; }

@media (max-width: 860px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .channel { padding: 0 8px; }
  .channel span { display: none; }
  .card { align-items: flex-start; padding: 40px 26px 150px; border-radius: 30px; }
  .card-text { width: 100%; }
  .subject { padding: 40px 26px 150px; }
  .subject-list { width: 100%; }
  .arc { right: 22px; bottom: 26px; width: 150px; }
  .lede { font-size: 18px; }
}

@media (max-width: 560px) {
  .bar { padding-right: 10px; }
  .top-right { gap: 2px; }
  .login, .get-started { padding: 0 12px; font-size: 14px; }
}

@media (max-width: 400px) {
  .brand { gap: 6px; font-size: 16px; }
  .mark { width: 28px; height: 20px; }
  .channel { padding: 0 4px; }
  .icon-button { width: 34px; }
  .login, .get-started { padding: 0 9px; }
}

@media (max-width: 460px) {
  .bar { padding-left: 14px; }
  .login { display: none; }
  .mock { padding: 16px; }
  .mock-name { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .start, .start-area, .mock, .back, .card-text, .subject { transition: none; }
  .card.open .mock, .card.open .mock:nth-child(2), .card.open .back { transition-delay: 0s; }
  .card.open::after { animation: none; }
}
