:root {
  --ink: #f4f4f2;
  --muted: #a5a5a0;
  --line: #2a2a28;
  --cream: #ece5d5;
  --blue: #28a9e0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #070707;
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  background: #000000;
  border-color: var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

.site-header {
  border-bottom: 3px solid #d6d5d5;
}
.nav-left,
.nav-links,
.user-profile,
.window-controls,
.editor-tab,
.progress-container {
  display: flex;
  align-items: center;
}
.nav-left {
  gap: 40px;
}
.logo {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  color: var(--blue);
  font-family: Consolas, monospace;
  display: inline-flex;
  align-items: center;
}
.logo-mark img {
  display: block;
  width: 60px;
  height: 40px;
  margin-left: 0;
  object-fit: contain;
}
.nav-links {
  gap: 24px;
}
.nav-item {
  color: #d9d9d9;
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-item:hover {
  color: white;
}
.nav-item.active {
  background: var(--cream);
  color: #161616;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
}
.user-profile {
  gap: 10px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.avatar-link {
  display: inline-flex;
  padding: 4px;
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.2s ease;
}
.avatar-link:hover,
.avatar-link:focus-visible {
  background: #ffffff14;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.profile-link,
.logout-button,
.login-link {
  color: var(--muted);
  font-size: 0.9rem;
}
.profile-link {
  text-decoration: none;
}
.profile-link:hover,
.logout-button:hover,
.login-link:hover {
  color: var(--ink);
}
.login-link {
  text-decoration: none;
}
.profile-link {
  padding: 6px 14px;
  color: #070707;
  background: #28a9e0;
  cursor: pointer;
  border-radius: 15px;
}
.logout-button {
  padding: 6px 14px;
  color: #070707;
  background: #28a9e0;
  cursor: pointer;
  border: none;
  border-radius: 15px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  color: #161616;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-info {
  display: flex;
  flex-direction: column;
}
.username {
  font-size: 0.9rem;
  font-weight: 600;
}
.user-level,
.footer-quote,
.progress-count {
  color: var(--muted);
  font-size: 0.75rem;
}

.workspace {
  flex: 1;
  width: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.challenge-banner {
  width: 100%;
  padding: 16px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #161616;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.challenge-kicker,
.output-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.challenge-banner strong {
  font-size: 1.05rem;
}
.editor-window {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
  box-shadow: 0 10px 30px #0008;
}
.editor-header {
  padding: 12px 16px;
  background: #161616;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.window-controls {
  gap: 8px;
  margin-right: 20px;
}
.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.red {
  background: #ff0303;
}
.yellow {
  background: #ffc800;
}
.green {
  background: #00ff1a;
}
.editor-tab {
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #d9d9d9;
  font-size: 0.85rem;
}
.python-badge {
  color: var(--blue);
  font-weight: 700;
}
.editor-body {
  min-height: 250px;
  padding: 50px 30px;
  overflow-x: auto;
  color: var(--blue);
  font:
    1.25rem/1.8 Consolas,
    "Courier New",
    monospace;
}
.code-line {
  min-height: 1.8em;
  white-space: pre;
  display: block;
}
.code-text {
  color: var(--blue);
}
.blank {
  width: auto;
  min-width: 28px;
  padding: 0 3px;
  border: 0;
  border-bottom: 2px solid white;
  outline: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  text-align: center;
}
.blank:focus {
  border-color: var(--cream);
}
.editor-status {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}
.status-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #00ff1a;
}
.editor-feedback {
  padding: 0 16px 12px;
}
.feedback {
  min-height: 18px;
  margin: 0;
  font-size: 0.8rem;
}
.feedback.correct {
  color: #00ff1a;
}
.feedback.incorrect {
  color: #ff7970;
}
.feedback.checking {
  color: var(--muted);
}
.output-panel {
  margin-top: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.output-panel pre {
  margin: 6px 0 0;
  color: #00ff1a;
  white-space: pre-wrap;
  font:
    0.85rem/1.5 Consolas,
    monospace;
}
.site-footer {
  gap: 18px;
  border-top: 1px solid var(--line);
}
.footer-actions {
  display: flex;
  gap: 10px;
}
.btn {
  border: 0;
  border-radius: 6px;
  padding: 12px 28px;
  background: var(--cream);
  color: #161616;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn:hover {
  background: #fff8e7;
}
.skip-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.skip-button:hover {
  background: #1d1d1b;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.progress-container {
  gap: 15px;
}
.level-text {
  font-weight: 600;
  font-size: 0.9rem;
}
.progress-bar-bg {
  width: 120px;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--cream);
}
.footer-quote {
  margin: 0;
  font-size: 0.85rem;
}

.auth-page {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: radial-gradient(
    circle at 20% 10%,
    #202c31 0,
    #101211 42%,
    #070707 100%
  );
}
.auth-card {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111211;
  box-shadow: 0 20px 60px #000b;
}
.auth-logo {
  font-size: 1.1rem;
}
.auth-kicker {
  margin: 42px 0 8px;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-card h1,
.profile-heading h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.auth-copy,
.profile-heading p,
.profile-note {
  color: var(--muted);
  line-height: 1.6;
}
.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}
.auth-form label {
  color: #d9d9d9;
  font-size: 0.8rem;
}
.auth-form input {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: #080908;
  color: var(--ink);
  font: inherit;
}
.auth-form input:focus {
  border-color: var(--blue);
}
.auth-error {
  margin: 0 0 4px;
  color: #ff7970;
  font-size: 0.8rem;
}
.auth-button {
  width: 100%;
  margin-top: 8px;
}
.profile-page {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 70px 20px;
}
.profile-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}
.profile-heading h1 {
  margin-top: 5px;
}
.profile-heading p {
  margin: 8px 0 0;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  font-size: 1.5rem;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 34px 0;
}
.profile-stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111211;
}
.profile-stat span,
.profile-stat small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.profile-stat strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 2rem;
}
.progress-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.progress-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.progress-section h2 {
  margin: 0;
  font-size: 1.1rem;
}
.progress-section-head span {
  color: var(--muted);
  font-size: 0.85rem;
}
.large-progress {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--line);
}
.large-progress div {
  height: 100%;
  background: var(--blue);
}
.profile-note {
  margin: 14px 0 0;
  font-size: 0.8rem;
}
.dashboard-language-list {
  margin-top: 18px;
}
.dashboard-language {
  display: grid;
  grid-template-columns: 150px 70px 1fr 45px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}
.dashboard-language:hover {
  color: var(--ink);
}
.dashboard-language-name {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.dashboard-language-name i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dashboard-language-bar {
  height: 5px;
  background: var(--line);
}
.dashboard-language-bar i {
  display: block;
  height: 100%;
}
.dashboard-language strong {
  color: var(--ink);
  text-align: right;
}
.profile-continue {
  display: inline-block;
  text-decoration: none;
}

.home-page {
  background: #000000;
}
.home-hero,
.language-section,
.about-section {
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
}
.home-hero {
  position: relative;
  min-height: 90vh;
  width: 100%;
  padding: 40px 20px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
  grid-template-rows: 1fr auto;
  align-items: start;
  overflow: hidden;
  background: url("/static/herobg.png") bottom no-repeat;
  background-size: cover;
}
.home-hero > div {
  position: relative;
  z-index: 1;
  width: 50%;
}
.home-hero > div:first-child {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}
.home-hero h1 {
  max-width: 760px;
  margin: 14px 0 20px;
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}
.home-hero h1 em {
  color: var(--blue);
  font-style: normal;
}
.home-hero p {
  max-width: 570px;
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.7;
}
.hero-button {
  display: inline-block;
  text-decoration: none;
}
.home-hero > .hero-note {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  width: 100%;
  padding: 0 20px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
}
.hero-note-mark {
  grid-row: span 2;
  display: block;
  margin: 0;
  color: var(--blue);
  font:
    5rem/0.8 Consolas,
    "Inter",
    sans-serif;
}
.hero-note strong {
  display: block;
  font-size: 2.2rem;
  color: var(--cream);
}
.hero-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.hero-line {
  width: 40px;
  height: 3px;
  margin: 22px 0 12px;
  background: var(--blue);
}
.language-section {
  padding: 64px 0 96px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}
.section-heading h2,
.about-section h2 {
  margin: 9px 0 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.section-count {
  color: var(--muted);
  font-size: 0.8rem;
}
.language-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.language-card {
  min-height: 300px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080808;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}
.language-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.language-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.language-number {
  color: var(--accent);
  font:
    0.8rem Consolas,
    monospace;
}
.language-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.language-card h3 {
  margin: 38px 0 8px;
  font-size: 1.4rem;
}
.language-card p {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.card-progress {
  margin-top: auto;
  padding-top: 22px;
}
.card-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
}
.card-progress strong {
  color: var(--ink);
}
.card-progress-track {
  height: 4px;
  margin-top: 9px;
  background: var(--line);
}
.card-progress-track span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.card-link,
.text-link,
.back-link {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.8rem;
}
.card-link {
  margin-top: 20px;
}
.card-link:hover,
.text-link:hover,
.back-link:hover {
  color: var(--blue);
}
.about-section {
  padding: 68px 0 84px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 90px;
}
.about-section h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin-bottom: 6px;
}
.about-section h2 em {
  color: var(--blue);
  font-style: normal;
}
.about-intro p {
  max-width: 440px;
  margin-top: 28px;
}
.about-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.about-steps {
  display: grid;
}
.about-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-top: 1px solid var(--line);
}
.about-step > span {
  color: var(--blue);
  font:
    0.8rem Consolas,
    monospace;
}
.about-step h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.about-step p {
  font-size: 0.82rem;
}
.about-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.about-topics {
  max-width: 700px;
  font-size: 0.8rem;
}
.about-topics strong {
  display: block;
  margin-bottom: 5px;
  color: var(--cream);
}
.home-footer {
  width: min(1180px, 100% - 40px);
  margin: auto;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}
.back-link {
  margin-left: auto;
}

@media (max-width: 700px) {
  .site-header,
  .site-footer {
    padding: 14px 16px;
  }
  .nav-left {
    gap: 18px;
  }
  .nav-links {
    gap: 10px;
  }
  .nav-item:not(.active) {
    display: none;
  }
  .user-info,
  .footer-quote {
    display: none;
  }
  .header-actions {
    gap: 10px;
  }
  .workspace {
    padding: 16px;
  }
  .editor-body {
    min-height: 250px;
    padding: 34px 18px;
    font-size: 1rem;
  }
  .challenge-banner {
    padding: 14px 16px;
    flex-direction: column;
    gap: 4px;
  }
  .site-footer {
    flex-wrap: wrap;
  }
  .progress-container {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .btn {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
  .footer-actions {
    margin-left: auto;
  }
  .auth-card {
    padding: 28px 22px;
  }
  .profile-page {
    padding-top: 42px;
  }
  .profile-heading {
    align-items: flex-start;
  }
  .dashboard-language {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .dashboard-language-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .dashboard-language strong {
    grid-column: 2;
    grid-row: 1;
  }
  .profile-stats {
    grid-template-columns: 1fr;
  }
  .home-hero,
  .language-section,
  .about-section {
    width: min(100% - 32px, 560px);
  }
  .home-hero {
    min-height: auto;
    padding: min(85vw, 605px) 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url("/static/mobilehero.png");
    background-position: top center;
    background-size: 100% auto;
  }
  .home-hero > div:first-child {
    order: 2;
    width: min(100%, 520px);
    margin: 34px auto 0;
  }
  .home-hero h1 {
    font-size: 2.8rem;
  }
  .home-hero p {
    font-size: 0.9rem;
    line-height: 1.55;
  }
  .home-hero::after {
    right: -110px;
    top: 34px;
  }
  .home-hero > .hero-note {
    order: 1;
    align-self: flex-start;
    width: 100%;
    padding: 0;
    margin-top: 9px;
  }
  .hero-note-mark {
    font-size: 2.8rem;
    margin-left: 7px;
  }
  .hero-note strong {
    font-size: 0.6rem;
  }
  .hero-note p {
    width: 70px;
    font-size: 0.42rem;
  }
  .language-grid {
    grid-template-columns: 1fr;
  }
  .language-card {
    min-height: 250px;
  }
  .section-heading,
  .about-section {
    display: block;
  }
  .section-count {
    display: block;
    margin-top: 12px;
  }
  .about-intro p {
    margin-top: 24px;
  }
  .about-bottom {
    display: block;
  }
  .about-bottom .text-link {
    display: inline-block;
    margin-top: 24px;
  }
  .home-footer {
    width: calc(100% - 32px);
  }
  .back-link {
    margin: 12px 0 0;
  }
}
