/* ==========================================================================
   SphinxTech — Design System
   Palette:  Primary #2563EB · Secondary #0F172A · Accent #38BDF8
             Background #FFFFFF · Surface #F8FAFC · Text #1E293B
   Type:     Inter (display + body + utility, differentiated by weight/scale)
   ========================================================================== */

:root {
  --color-primary: #2563EB;
  --color-primary-dark: #1D4ED8;
  --color-secondary: #0F172A;
  --color-accent: #38BDF8;
  --color-bg: #FFFFFF;
  --color-surface: #F8FAFC;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-secondary);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-body);
  color: var(--color-secondary);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; color: var(--color-text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

.lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 620px;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}
.section {
  padding: 104px 0;
}
.section--tight { padding: 72px 0; }
.section--surface { background: var(--color-surface); }
.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-secondary);
  color: #fff;
}
.btn-primary:hover { background: #1e293b; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-secondary); transform: translateY(-1px); }
.btn-accent {
  background: var(--color-primary);
  color: #fff;
}
.btn-accent:hover { background: var(--color-primary-dark); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28); transform: translateY(-1px); }
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-secondary);
  letter-spacing: -0.02em;
}
.brand svg { width: 30px; height: 30px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-secondary); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-secondary);
  margin: 5px 0;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 74px 0 0 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
    gap: 6px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-actions .btn-outline { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 100px;
  background: var(--color-secondary);
  color: #fff;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(680px 420px at 82% -10%, rgba(37, 99, 235, 0.55), transparent 60%),
    radial-gradient(520px 360px at 10% 110%, rgba(56, 189, 248, 0.28), transparent 60%);
  z-index: -2;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 70% 20%, black, transparent 70%);
  z-index: -1;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero .eyebrow { color: var(--color-accent); }
.hero .eyebrow::before { background: var(--color-accent); }
.hero h1 { color: #fff; }
.hero .lede { color: rgba(255,255,255,0.72); font-size: 1.2rem; margin-top: 20px; max-width: 540px; }
.hero .btn-row { margin-top: 36px; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,0.28); }
.hero .btn-outline:hover { border-color: #fff; }

.hero-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-mark svg { width: 100%; max-width: 420px; }

.stat-row {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.14);
}
.stat-row .stat b {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.stat-row .stat span {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
  .hero-mark svg { max-width: 260px; }
  .stat-row { gap: 32px; flex-wrap: wrap; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 76px 0 64px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.page-hero .lede { margin-top: 16px; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #CBD5E1;
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.94rem; }

@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }

/* ---------- Logo / stack strip ---------- */
.stack-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-secondary);
  background: #fff;
}
.stack-chip svg { width: 18px; height: 18px; }

/* ---------- Why-choose split ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: start;
}
.value-list { display: grid; gap: 26px; }
.value-item { display: flex; gap: 16px; }
.value-item .num {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--color-primary);
  padding-top: 3px;
  width: 28px;
  flex-shrink: 0;
}
.value-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.value-item p { font-size: 0.92rem; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--color-secondary);
  border-radius: var(--radius-lg);
  padding: 64px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 90% 0%, rgba(37,99,235,0.5), transparent 70%);
}
.cta-band h2, .cta-band p { color: #fff; position: relative; }
.cta-band p { color: rgba(255,255,255,0.68); margin-top: 10px; }
.cta-band .btn-accent { position: relative; }

@media (max-width: 720px) {
  .cta-band { flex-direction: column; text-align: center; padding: 48px 28px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,0.6);
  padding: 72px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 14px; }
.footer-brand svg { width: 26px; height: 26px; }
.footer-col h4 {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-col ul { display: grid; gap: 12px; }
.footer-col a { font-size: 0.9rem; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-secondary);
}
.form-field input,
.form-field textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.82rem; margin-top: 10px; }
.form-status {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}
.form-status.visible { display: block; }
.form-status.success { color: #16A34A; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Info blocks (contact / support) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: start;
}
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 30px;
}
.info-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.info-row:last-child { border-bottom: none; }
.info-row .icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #fff; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-row .icon svg { width: 17px; height: 17px; color: var(--color-primary); }
.info-row h4 { font-size: 0.86rem; color: var(--color-secondary); margin: 0 0 3px; font-weight: 700; }
.info-row p { font-size: 0.9rem; }

@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }

/* ---------- Product cards ---------- */
.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.product-card .badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(37,99,235,0.08);
  padding: 5px 12px;
  border-radius: 999px;
}
.product-card .icon-tile {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--color-secondary);
  display: flex; align-items: center; justify-content: center;
}
.product-card .icon-tile svg { width: 24px; height: 24px; color: var(--color-accent); }

/* ---------- Legal content ---------- */
.legal-content h2 { font-size: 1.35rem; margin-top: 48px; margin-bottom: 14px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { margin-bottom: 14px; font-size: 0.96rem; }
.legal-content ul { margin: 0 0 14px; padding-left: 20px; list-style: disc; }
.legal-content li { font-size: 0.96rem; color: var(--color-text-muted); margin-bottom: 8px; }
.legal-content .updated {
  font-size: 0.84rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 32px;
  display: block;
}
.legal-layout { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
.legal-toc { position: sticky; top: 100px; }
.legal-toc h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); margin-bottom: 14px; }
.legal-toc ul { display: grid; gap: 10px; }
.legal-toc a { font-size: 0.86rem; color: var(--color-text-muted); }
.legal-toc a:hover { color: var(--color-primary); }

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 28px;
}
.error-page .code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}
.error-page p { margin: 18px auto 32px; max-width: 420px; }

/* ---------- Hero illustration motion ---------- */
.hero-orbit { transform-origin: 210px 210px; animation: hero-spin 90s linear infinite; }
.hero-orbit--rev { animation-direction: reverse; animation-duration: 130s; }
.hero-node { animation: hero-pulse 3.4s ease-in-out infinite; }
.hero-node:nth-child(2) { animation-delay: 0.6s; }
.hero-node:nth-child(3) { animation-delay: 1.2s; }
.hero-node:nth-child(4) { animation-delay: 1.8s; }
@keyframes hero-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes hero-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- Utility ---------- */
.mt-lg { margin-top: 56px; }
.text-center { text-align: center; margin-left: auto; margin-right: auto; }
