/* =========================
   Theme system (CSS-only)
   - default: dark
   - checkbox checked: light
========================= */

:root{
  /* dark defaults */
  --bg: #0b0f17;
  --panel: #0f1624;
  --panel-2: #0c1320;
  --text: #e7eefc;
  --muted: #a9b7d3;
  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.14);
  --accent: #6ae4ff;
  --accent2: #8b5cff;
  --shadow: 0 18px 40px rgba(0,0,0,.45);
  --r: 18px;
  --max: 1120px;
  --field: rgba(8,12,18,.6);
}

/* Toggle lives before .page so we can theme via sibling selector */
.theme-toggle{
  position: fixed;
  inset: 0 auto auto 0;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle:checked ~ .page{
  /* light theme overrides */
  --bg: #f6f8ff;
  --panel: #ffffff;
  --panel-2: #f2f5ff;
  --text: #0c1220;
  --muted: rgba(12,18,32,.70);
  --line: rgba(12,18,32,.10);
  --line2: rgba(12,18,32,.16);
  --shadow: 0 18px 44px rgba(12,18,32,.12);
  --field: rgba(255,255,255,.8);
}

/* =========================
   Base
========================= */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(106,228,255,.14), transparent 60%),
    radial-gradient(1200px 700px at 90% 10%, rgba(139,92,255,.14), transparent 60%),
    #0b0f17;
  color: #e7eefc;
  line-height: 1.55;
}

/* Ensure page uses theme vars */
.page{
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(106,228,255,.12), transparent 60%),
    radial-gradient(1200px 700px at 90% 10%, rgba(139,92,255,.12), transparent 60%),
    var(--bg);
}

a{ color: inherit; text-decoration: none; }
.container{ width: min(100% - 40px, var(--max)); margin: 0 auto; }
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* =========================
   Topbar
========================= */
.topbar{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand{
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900;
  letter-spacing: .2px;
}
.brand__logo{ display: inline-grid; place-items: center; }
.brand__name{ font-size: 16px; }

.nav{
  display: flex; gap: 10px; align-items: center;
  font-weight: 800;
  color: var(--muted);
}
.nav a{ padding: 8px 10px; border-radius: 10px; }
.nav a:hover{ background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }

/* =========================
   Theme Switch (CSS-only)
========================= */
.switch{
  position: relative;
  width: 54px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}
.switch__track{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid var(--line2);
}
.switch__thumb{
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 999px;
  left: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.switch__icons{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  color: var(--muted);
  font-weight: 900;
  pointer-events: none;
}
.theme-toggle:checked ~ .page .switch__thumb{
  transform: translateX(20px);
}

/* =========================
   Buttons
========================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, filter .12s ease;
  cursor: pointer;
}
.btn:active{ transform: translateY(1px); }

.btn--primary{
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 95%, white), color-mix(in srgb, var(--accent2) 95%, white));
  color: color-mix(in srgb, var(--bg) 10%, #07101a);
}
.btn--primary:hover{ filter: brightness(1.04); }

.btn--secondary{
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: var(--line2);
}
.btn--secondary:hover{ background: color-mix(in srgb, var(--text) 9%, transparent); }

.btn--ghost{
  background: transparent;
  border-color: var(--line2);
}
.btn--ghost:hover{ background: color-mix(in srgb, var(--text) 6%, transparent); }

.pill{
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--muted);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

/* =========================
   Hero
========================= */
.hero{ padding: 54px 0 22px; }
.hero__grid{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: start;
}

.hero h1{
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
  margin: 14px 0 12px;
}
.grad{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead{
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 60ch;
}
.hero__cta{ display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 18px; }

.hero__stats{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 14px;
}
.stat{
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 12px;
}
.stat__num{ font-weight: 1000; font-size: 16px; }
.stat__label{ color: var(--muted); font-size: 13px; font-weight: 800; }

/* Mock card */
.hero__card{
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 7%, transparent), color-mix(in srgb, var(--text) 4%, transparent));
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 4px);
  padding: 14px;
  box-shadow: var(--shadow);
}
.hint{ margin: 10px 2px 0; color: color-mix(in srgb, var(--muted) 90%, transparent); font-size: 12px; }

.mock{
  overflow: hidden;
  border-radius: calc(var(--r) + 2px);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, #000);
}
.mock__top{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.dot{ width: 10px; height: 10px; border-radius: 999px; opacity: .9; }
.dot--r{ background: #ff5b5b; }
.dot--y{ background: #ffcd4b; }
.dot--g{ background: #30d878; }
.mock__title{ margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 900; }

.mock__body{
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 380px;
}
.mock__sidebar{
  border-right: 1px solid var(--line);
  padding: 10px;
  background: color-mix(in srgb, var(--text) 2%, transparent);
}
.mock__item{
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}
.mock__item.active{
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.mock__main{ padding: 12px; }

.kpis{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.kpi{
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.kpi__t{ color: var(--muted); font-weight: 900; font-size: 12px; }
.kpi__v{ font-size: 22px; font-weight: 1000; }

.panel{
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  padding: 12px;
  margin-bottom: 12px;
}
.panel__head{
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.panel__head h3{ margin: 0; font-size: 14px; }
.tag{
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 2%, transparent);
  font-weight: 900;
}

.panel__grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.panel__box{
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--bg) 75%, #000);
}
.panel__icon{
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.panel__box p{ margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.panel__box strong{ font-size: 13px; font-weight: 1000; }

.mini{
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--text) 2%, transparent);
  overflow: hidden;
}
.mini__row{
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}
.mini__row:first-child{ border-top: 0; }
.mini__right{ color: color-mix(in srgb, var(--text) 90%, transparent); font-weight: 900; }

.badge{
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; width: 42px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  font-size: 11px;
}
.badge.ok{ border-color: rgba(48,216,120,.25); background: rgba(48,216,120,.10); }
.badge.warn{ border-color: rgba(255,205,75,.25); background: rgba(255,205,75,.10); }
.badge.off{ border-color: rgba(255,91,91,.25); background: rgba(255,91,91,.10); }

/* =========================
   Sections
========================= */
.section{ padding: 56px 0; }
.section--alt{
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 4%, transparent), color-mix(in srgb, var(--text) 2%, transparent));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section__head{
  max-width: 70ch;
  margin-bottom: 20px;
}
.section__head h2{
  margin: 0 0 8px;
  font-size: clamp(22px, 2.5vw, 30px);
}
.section__head p{ margin: 0; color: var(--muted); font-weight: 800; }

/* cards */
.cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.card{
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  padding: 16px;
}
.card h3{ margin: 0 0 6px; font-size: 16px; }
.card p{ margin: 0; color: var(--muted); font-weight: 800; }

/* features */
.features{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.feature{
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.feature__icon{
  width: 42px; height: 42px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.feature h3{ margin: 0 0 4px; font-size: 16px; }
.feature p{ margin: 0; color: var(--muted); font-weight: 800; }

/* integrations */
.integrations{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.integration{
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  padding: 16px;
}
.integration__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.integration__badge{
  font-size: 11px;
  font-weight: 1000;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  color: var(--muted);
  white-space: nowrap;
}
.integration h3{ margin: 0; font-size: 16px; }
.integration ul{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.note{
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 18px;
  padding: 14px;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 90%, transparent);
}

/* pricing */
.pricing{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  align-items: stretch;
}
.price{
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price h3{ margin: 0; font-size: 16px; }
.price__num{
  margin: 0;
  font-size: 28px;
  font-weight: 1000;
}
.price__num span{ font-size: 14px; color: var(--muted); font-weight: 900; }
.price ul{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.price .btn{ margin-top: auto; }

.price--featured{
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--text) 3%, transparent));
  box-shadow: var(--shadow);
}
.ribbon{
  position: absolute;
  top: 14px; right: 14px;
  font-size: 11px;
  font-weight: 1000;
  padding: 6px 10px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--bg) 10%, #07101a);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.fineprint{ color: color-mix(in srgb, var(--muted) 90%, transparent); font-size: 12px; margin-top: 14px; font-weight: 800; }

/* contact */
.contact{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.contact__list{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.contact__item{
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.contact__k{ color: var(--muted); font-weight: 1000; font-size: 12px; }
.contact__v{ font-weight: 1000; }

.form{
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
label{ display: grid; gap: 6px; }
label span{ color: var(--muted); font-weight: 1000; font-size: 12px; }

input, textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: var(--field);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  font-weight: 800;
}
input:focus, textarea:focus{
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* footer */
.footer{
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--muted);
}
.footer__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand--small .brand__name{ font-size: 14px; }
.footer__links{ display: flex; gap: 12px; font-weight: 900; }
.footer__links a:hover{ color: var(--text); }

/* =========================
   Responsive
========================= */
@media (max-width: 980px){
  .hero__grid{ grid-template-columns: 1fr; }
  .mock__body{ grid-template-columns: 140px 1fr; }
  .cards, .pricing, .integrations{ grid-template-columns: 1fr; }
  .features{ grid-template-columns: 1fr; }
  .contact{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .nav{ display: none; }
  .hero__stats{ grid-template-columns: 1fr; }
  .panel__grid{ grid-template-columns: 1fr; }
  .mock__body{ grid-template-columns: 1fr; }
  .mock__sidebar{ display: none; }
}
