:root {
  --bg: #081322;
  --bg-2: #102038;
  --surface: #12243d;
  --surface-strong: #183352;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(120, 170, 255, 0.18);
  --primary: #4da3ff;
  --primary-strong: #2d6fe6;
  --accent: #7ce5ff;
  --text: #edf6ff;
  --muted: #b9cfe8;
  --heading: #ffffff;
  --success: #6fe3b1;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, #0e1f35 100%);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 19, 34, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
}

.brand {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--heading);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  transition: 0.25s ease;
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: var(--heading);
  border-color: rgba(125, 183, 255, 0.28);
  background: rgba(77, 163, 255, 0.12);
}

.social-mini,
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.social-mini a,
.footer-social a {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  color: var(--heading);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  transition: 0.25s ease;
}

.social-mini a:hover,
.footer-social a:hover {
  background: rgba(77, 163, 255, 0.18);
  transform: translateY(-2px);
}

.page-shell {
  padding: 2.5rem 0 4rem;
}

.hero-section {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 1rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-copy h1,
.section-head h2,
.info-card h2,
.book-copy h2,
.page-header h1,
.contact-layout h1 {
  margin: 0 0 1rem;
  color: var(--heading);
  line-height: 1.2;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.25s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--heading);
  box-shadow: 0 14px 26px rgba(45, 111, 230, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--heading);
}

.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 320px;
  background: rgba(255,255,255,0.04);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}

.info-card,
.news-panel,
.book-callout,
.page-body,
.contact-panel,
.card-panel,
.app-panel {
  background: rgba(14, 30, 52, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.info-card {
  padding: 1.4rem;
}

.card-tag {
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(124, 229, 255, 0.09);
  color: var(--accent);
}

.info-card h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  margin-bottom: 0.7rem;
}

.info-card p,
.page-body p,
.page-body li,
.contact-panel p,
.contact-list a,
.news-list li,
.app-panel p,
.app-panel li,
.card-panel p,
.card-panel li {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.news-panel,
.page-body,
.contact-panel,
.card-panel,
.app-panel {
  padding: 1.5rem;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.news-list li {
  padding-left: 1.2rem;
  position: relative;
}

.news-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
}

.book-callout {
  margin-top: 2rem;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.book-copy h2 {
  margin-bottom: 0.4rem;
}

.page-header {
  margin-bottom: 1.4rem;
}

.page-body {
  margin-top: 1.5rem;
}

.about-content-wrapper img.profile-img {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
  border-radius: 8px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.about-content-wrapper::after {
  content: "";
  display: table;
  clear: both;
}

@media (min-width: 768px) {
  .about-content-wrapper img.profile-img {
    float: right;
    margin: 0 0 1.5rem 2rem;
  }
}

.page-body h3,
.contact-layout h3,
.card-panel h3,
.app-panel h3 {
  color: var(--heading);
  margin: 1.25rem 0 0.7rem;
}

.page-body ul,
.card-panel ul,
.app-panel ul,
.contact-list {
  padding-left: 1.25rem;
}

.page-body strong {
  color: var(--heading);
}

.app-layout {
  display: grid;
  gap: 1.5rem;
}

.grade-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.grade-switcher button {
  min-width: 52px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--heading);
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
}

.grade-switcher button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
}

.grade-panel {
  display: none;
}

.grade-panel.active {
  display: block;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card-panel {
  padding: 1.2rem;
}

.card-panel h3 {
  margin-top: 0;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--heading);
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--heading);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

button[type="submit"] {
  border: none;
  cursor: pointer;
}

.contact-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.8rem;
}

.contact-list a {
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(9, 19, 34, 0.8);
  padding: 1.2rem 0;
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-wrap p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .nav-wrap,
  .footer-wrap,
  .book-callout,
  .hero-section,
  .contact-layout {
   grid-template-columns: 1fr;
   flex-direction: column;
   align-items: flex-start;
  }

  .nav-wrap {
   padding: 1rem 0;
  }

  .main-nav {
   justify-content: flex-start;
  }

  .content-grid {
   grid-template-columns: 1fr;
  }

  .field-row {
   grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-link {
   padding: 0.55rem 0.75rem;
   font-size: 0.88rem;
  }

  .hero-copy h1 {
   font-size: 2.3rem;
  }

  .page-shell {
   padding-top: 1.5rem;
  }
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 17, 29, 0.9);
  border-bottom: 1px solid rgba(126, 174, 255, 0.2);
  backdrop-filter: blur(12px);
}

.nav-container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.05em;
  opacity: 0.95;
}

.navbar {
  flex: 1;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.main-header .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  color: #cfe3ff;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s ease;
  border: 1px solid transparent;
}

.dropdown-toggle {
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.main-header .nav-link:hover,
.main-header .nav-link.active {
  color: #fff;
  background: rgba(77, 163, 255, 0.12);
  border-color: rgba(130, 184, 255, 0.22);
}

.dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 310px;
  padding: 0.6rem;
  margin: 0;
  border: 1px solid rgba(126, 174, 255, 0.2);
  border-radius: 16px;
  background: rgba(11, 24, 38, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: #dfeeff;
  font-weight: 600;
  white-space: nowrap;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: rgba(77, 163, 255, 0.12);
  color: #fff;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lang-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(126, 174, 255, 0.2);
  background: rgba(255,255,255,0.02);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lang-btn.active {
  background: linear-gradient(135deg, #4da3ff, #2d6fe6);
  border-color: transparent;
}

.flag-icon {
  font-size: 0.72rem;
  font-weight: 700;
}

.page-container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.banner-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(126, 174, 255, 0.2);
  background: var(--banner-accent, #ffffff);
}

.banner-img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: 360px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

.banner-overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(6, 12, 20, 0.82));
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.22);
  border: 1px solid rgba(130, 184, 255, 0.22);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tabs-section {
  margin-top: 2rem;
  padding: 1.5rem 0 0;
}

.tabs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-btn {
  border: 1px solid rgba(126, 174, 255, 0.2);
  background: rgba(255,255,255,0.02);
  color: #dfeeff;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #4da3ff, #2d6fe6);
  color: #fff;
  border-color: transparent;
}

.tabs-body {
  border: 1px solid rgba(126, 174, 255, 0.2);
  border-radius: 22px;
  background: rgba(9, 19, 34, 0.7);
  padding: 1.5rem;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.18);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.app-copy {
  display: none;
}

.app-copy.is-active {
  display: block;
}

.grade-badge.app-copy.is-active {
  display: inline-flex;
}

.app-frame {
  width: 100%;
  min-height: 120px;
  border: 0;
  display: block;
  background: transparent;
}

.info-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.app-icon-box {
  display: flex;
  justify-content: center;
}

.app-icon {
  width: 168px;
  height: 168px;
  object-fit: contain;
  border-radius: 28px;
  border: 1px solid rgba(126, 174, 255, 0.2);
  background: rgba(255,255,255,0.03);
}

.app-meta-box {
  min-width: 0;
}

.app-title {
  color: #fff;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.15;
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  color: #dfeeff;
}

.meta-list li {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(126, 174, 255, 0.1);
}

.meta-list strong {
  color: #fff;
}

.price-tag {
  color: #92f0b5;
  font-weight: 700;
}

.playstore-link {
  color: #a9d9ff;
  text-decoration: none;
  font-weight: 700;
}

.app-short-desc {
  margin-top: 1.25rem;
  color: #dfeeff;
  font-size: 1.05rem;
}

.section-title {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 1.4rem;
  color: #fff;
}

.section-subtitle {
  margin-top: 1.5rem;
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}

.section-title + .section-subtitle {
  margin-top: 0.5rem;
}

.formatted-text {
  color: #dfeeff;
}

.formatted-text ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tech-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(126, 174, 255, 0.18);
  border-radius: 16px;
  padding: 1rem;
  color: #dfeeff;
}

.tech-card h4 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: #fff;
}

.floating-math-nav {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 17, 29, 0.9);
  border: 1px solid rgba(126, 174, 255, 0.2);
  box-shadow: 0 18px 36px rgba(0,0,0,0.25);
}

.floating-label {
  color: #dfeeff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fab-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(126, 174, 255, 0.18);
  background: rgba(255,255,255,0.02);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.fab-btn.active {
  background: linear-gradient(135deg, #4da3ff, #2d6fe6);
  border-color: transparent;
}

.hidden {
  display: none !important;
}

.anchor-target {
  position: relative;
  top: -90px;
  height: 0;
  overflow: hidden;
}

@media (max-width: 820px) {
  .nav-container {
   flex-wrap: wrap;
   padding: 0.75rem 0;
  }

  .navbar {
   width: 100%;
  }

  .nav-menu {
   justify-content: flex-start;
  }

  .info-grid,
  .tech-grid {
   grid-template-columns: 1fr;
  }

  .floating-math-nav {
   right: 0.75rem;
   bottom: 0.8rem;
  }
}

@media (max-width: 560px) {
  .banner-wrapper {
   min-height: 260px;
  }

  .banner-img {
   height: 260px;
  }

  .tabs-header {
   display: grid;
   grid-template-columns: 1fr;
  }

  .floating-math-nav {
   right: 0.5rem;
   bottom: 0.5rem;
   transform: scale(0.9);
   transform-origin: bottom right;
  }
}