/* =================================================================
   Magexpert — Dark Tech design system
   Single hand-written stylesheet. No framework.
   ================================================================= */

/* ---------- Theme tokens ---------- */
:root,
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0d1526;
  --bg-elev: #0f172a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: #1e293b;
  --border-strong: #294056;
  --text: #e6edf6;
  --muted: #95a4b8;
  --brand: #2baee2;
  --brand-2: #38bdf8;
  --brand-grad: linear-gradient(90deg, #2baee2, #38bdf8);
  --on-brand: #04141f;
  --shadow: 0 18px 50px rgba(2, 8, 20, 0.55);
  --shadow-sm: 0 6px 18px rgba(2, 8, 20, 0.45);
  --hero-glow: radial-gradient(60% 80% at 80% 0%, rgba(43, 174, 226, 0.22), transparent 60%),
    radial-gradient(50% 60% at 0% 20%, rgba(56, 189, 248, 0.12), transparent 60%);
  --header-bg: rgba(11, 18, 32, 0.72);
}

[data-theme="light"] {
  --bg: #f6f9fc;
  --bg-soft: #eef3f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-hover: #ffffff;
  --border: #e3e9f1;
  --border-strong: #cfdae7;
  --text: #0f1d2e;
  --muted: #51637a;
  --brand: #1b97c9;
  --brand-2: #2baee2;
  --brand-grad: linear-gradient(90deg, #1b97c9, #2baee2);
  --on-brand: #ffffff;
  --shadow: 0 18px 45px rgba(15, 29, 46, 0.12);
  --shadow-sm: 0 8px 22px rgba(15, 29, 46, 0.08);
  --hero-glow: radial-gradient(60% 80% at 80% 0%, rgba(43, 174, 226, 0.16), transparent 60%),
    radial-gradient(50% 60% at 0% 20%, rgba(56, 189, 248, 0.10), transparent 60%);
  --header-bg: rgba(255, 255, 255, 0.8);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.noscroll { overflow: hidden; }

img { max-width: 100%; display: block; }

a { color: var(--brand-2); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--brand); }

h1, h2, h3, h4 { line-height: 1.18; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1rem; }

/* ---------- Layout ---------- */
.container { width: min(1160px, 92%); margin-inline: auto; }

.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--alt { background: var(--bg-soft); }

.section-head { max-width: 640px; margin: 0 auto clamp(2rem, 4vw, 3.25rem); text-align: center; }
.section-head.left { margin-inline: 0; text-align: left; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 0.85rem;
}

.section-title { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--brand-grad);
  color: var(--on-brand);
  box-shadow: 0 10px 24px rgba(43, 174, 226, 0.32);
}
.btn--primary:hover { color: var(--on-brand); box-shadow: 0 14px 32px rgba(43, 174, 226, 0.45); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { color: var(--text); border-color: var(--brand); background: var(--surface); }

.btn--block { width: 100%; justify-content: center; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 72px;
}

.brand { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.brand span { color: var(--brand); }
.brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0 auto;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.96rem;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links li.active a { color: var(--text); }

.nav-item-soon { position: relative; }
.badge-soon {
  position: absolute;
  top: -2px;
  right: -6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--brand);
  padding: 1px 5px;
  border-radius: 6px;
}

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
}
.lang-switch a {
  padding: 0.32rem 0.7rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.lang-switch a.active { background: var(--brand-grad); color: var(--on-brand); }
.lang-switch a:not(.active):hover { color: var(--text); background: var(--surface); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { border-color: var(--brand); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile menu button */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(7rem, 14vw, 10rem) 0 clamp(3.5rem, 7vw, 6rem);
  background: var(--hero-glow), var(--bg);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin-bottom: 1rem; }
.hero h1 .hl {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 620px; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- Platforms strip ---------- */
.platforms { border-block: 1px solid var(--border); background: var(--bg-soft); }
.platforms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  padding: 1.6rem 0;
}
.platforms-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.platform-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0.78;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.platform-name:hover { opacity: 1; color: var(--brand-2); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  height: 100%;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-hover); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, rgba(43, 174, 226, 0.18), rgba(56, 189, 248, 0.08));
  border: 1px solid var(--border-strong);
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* ---------- Stats ---------- */
.stats { background: var(--bg-soft); border-block: 1px solid var(--border); }
.stats-grid { grid-template-columns: repeat(4, 1fr); text-align: center; gap: 1rem; }
.stat-num {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat-label { color: var(--muted); font-size: 0.92rem; margin-top: 0.4rem; }

/* ---------- Pricing ---------- */
.pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem 1.7rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.plan:hover { transform: translateY(-4px); }
.plan--featured { border-color: var(--brand); box-shadow: 0 16px 44px rgba(43, 174, 226, 0.22); }
.plan-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-grad);
  color: var(--on-brand);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}
.plan-name { font-size: 1.1rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.plan-price { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; margin: 0.4rem 0 0.2rem; }
.plan-price .per { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan-feature { color: var(--muted); margin: 1rem 0 1.5rem; flex-grow: 1; }
.plan .btn { margin-top: auto; }

/* ---------- Process ---------- */
.steps { grid-template-columns: repeat(4, 1fr); counter-reset: step; }
.step { position: relative; padding-top: 0.5rem; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--on-brand);
  background: var(--brand-grad);
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 60px;
  right: -10px;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---------- Testimonials ---------- */
.testimonials-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.quote {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
}
.quote-mark { font-size: 2.6rem; line-height: 0.5; color: var(--brand); font-family: Georgia, serif; height: 1.2rem; }
.quote-title { font-weight: 700; font-size: 1.05rem; margin: 0.6rem 0 0.5rem; }
.quote-text { color: var(--muted); font-size: 0.97rem; flex-grow: 1; }
.quote-author { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.2rem; }
.quote-author img { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; border: 1px solid var(--border-strong); background: var(--bg-elev); }
.quote-author .name { font-weight: 700; font-size: 0.95rem; }
.quote-author .loc { color: var(--muted); font-size: 0.85rem; }

/* ---------- Final CTA ---------- */
.cta-band {
  position: relative;
  text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  background: var(--hero-glow), var(--bg-elev);
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.cta-band p { color: var(--muted); max-width: 520px; margin: 0 auto 1.8rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: clamp(7rem, 13vw, 9rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  background: var(--hero-glow), var(--bg);
  text-align: center;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.breadcrumbs { color: var(--muted); font-size: 0.92rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand-2); }

/* ---------- Prose ---------- */
.prose { max-width: 760px; margin-inline: auto; }
.prose p { color: var(--muted); font-size: 1.04rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-item { display: flex; gap: 0.9rem; align-items: flex-start; }
.contact-item .ci-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, rgba(43, 174, 226, 0.18), rgba(56, 189, 248, 0.08));
  border: 1px solid var(--border-strong);
}
.contact-item h4 { margin: 0 0 0.15rem; font-size: 1rem; }
.contact-item p, .contact-item a { color: var(--muted); margin: 0; font-size: 0.97rem; }
.contact-item a:hover { color: var(--brand-2); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(1.5rem, 3vw, 2.2rem); box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control::placeholder { color: var(--muted); opacity: 0.8; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 174, 226, 0.18); }
textarea.form-control { min-height: 150px; resize: vertical; }

.alert { padding: 0.85rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-size: 0.95rem; border: 1px solid transparent; }
.alert--success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.4); color: #4ade80; }
.alert--error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.footer-brand .brand { display: inline-block; margin-bottom: 0.8rem; }
.footer-brand p { color: var(--muted); max-width: 320px; }
.footer-contact { list-style: none; padding: 0; margin: 1rem 0 0; }
.footer-contact li { margin-bottom: 0.5rem; }
.footer-contact a { color: var(--muted); }
.footer-contact a:hover { color: var(--brand-2); }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text); opacity: 0.85; }
.footer-col a:hover { color: var(--brand-2); opacity: 1; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.footer-social a:hover { border-color: var(--brand); color: var(--brand-2); }

/* ---------- Language banner ---------- */
.lang-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(140%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 92%;
  padding: 0.7rem 0.7rem 0.7rem 1.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lang-banner.show { transform: translateX(-50%) translateY(0); }
.lang-banner span { font-size: 0.92rem; color: var(--text); }
.lang-banner .btn { padding: 0.45rem 1rem; font-size: 0.85rem; }
.lang-banner .banner-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 0.4rem; }
.lang-banner .banner-close:hover { color: var(--text); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.18s ease;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { transform: translateY(-3px); border-color: var(--brand); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover, .plan:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4, .pricing-grid, .steps, .stats-grid, .testimonials-row { grid-template-columns: repeat(2, 1fr); }
  .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .nav-actions .lang-switch { display: none; }
  .nav-links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 1rem 5%;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 0.75rem 0.85rem; }
  .nav-links .lang-switch-mobile { display: flex; margin-top: 0.5rem; }
}

@media (max-width: 560px) {
  .grid-3, .grid-4, .pricing-grid, .steps, .stats-grid, .testimonials-row, .form-row { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
