/* ============================================================
   suPixel Global CSS — v1.0
   Brand: #6AADA8 teal, #1A1A2E dark accent
   Sharp corners, no border-radius unless specified
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand */
  --sp-teal: #6AADA8;
  --sp-teal-light: #8DC4C0;
  --sp-teal-dark: #4E8E89;
  --sp-teal-10: rgba(106, 173, 168, 0.1);
  --sp-teal-20: rgba(106, 173, 168, 0.2);
  --sp-dark: #1A1A2E;
  --sp-dark-mid: #22223A;
  --sp-dark-light: #2A2A45;

  /* Neutrals */
  --sp-white: #FFFFFF;
  --sp-off-white: #F7F8FA;
  --sp-grey-100: #F0F1F4;
  --sp-grey-200: #E2E4E9;
  --sp-grey-300: #C8CCD4;
  --sp-grey-400: #9BA1AE;
  --sp-grey-500: #6E7583;
  --sp-grey-600: #4A4F5C;
  --sp-grey-700: #2E3340;

  /* Semantic */
  --sp-success: #34C77B;
  --sp-warning: #F5A623;
  --sp-error: #E74C5F;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --nav-height: 72px;

  /* Motion */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--sp-grey-700);
  background: var(--sp-white);
}

/* --- RTL --- */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .hero-badge svg { transform: scaleX(-1); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--sp-dark);
}

h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, 2.75rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2vw + 0.25rem, 1.75rem); letter-spacing: -0.01em; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }

p { max-width: 68ch; }
.lead { font-size: 1.125rem; line-height: 1.7; color: var(--sp-grey-500); }

a { color: var(--sp-teal); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--sp-teal-dark); }

code, pre { font-family: var(--font-mono); }
code {
  background: var(--sp-grey-100);
  padding: 2px 6px;
  font-size: 0.875rem;
  color: var(--sp-dark);
}
pre {
  background: var(--sp-dark);
  color: var(--sp-grey-200);
  padding: var(--sp-6);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.7;
}
pre code { background: none; padding: 0; color: inherit; }

/* --- Container --- */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--sp-6); }
.container-wide { max-width: var(--container-wide); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: var(--sp-3) var(--sp-6);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: 1rem; }
.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: 0.8125rem; }

.btn-primary {
  background: var(--sp-teal);
  color: var(--sp-white);
  border-color: var(--sp-teal);
}
.btn-primary:hover {
  background: var(--sp-teal-dark);
  border-color: var(--sp-teal-dark);
  color: var(--sp-white);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--sp-dark);
  border-color: var(--sp-grey-300);
}
.btn-secondary:hover {
  border-color: var(--sp-teal);
  color: var(--sp-teal);
}

.btn-dark {
  background: var(--sp-dark);
  color: var(--sp-white);
  border-color: var(--sp-dark);
}
.btn-dark:hover {
  background: var(--sp-dark-mid);
  border-color: var(--sp-dark-mid);
  color: var(--sp-white);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--sp-white);
  border-color: rgba(255,255,255,0.3);
}
.btn-ghost:hover {
  border-color: var(--sp-white);
  color: var(--sp-white);
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sp-grey-200);
  transition: background var(--duration-normal) var(--ease-out);
}
.site-nav.scrolled { background: rgba(255,255,255,0.97); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--sp-dark);
  text-decoration: none;
}
.nav-logo:hover { color: var(--sp-dark); }
.nav-logo .logo-mark {
  width: 36px; height: 36px;
  background: var(--sp-dark);
  display: flex; align-items: center; justify-content: center;
}
.nav-logo .logo-dot {
  width: 14px; height: 14px;
  background: var(--sp-white);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  list-style: none;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sp-grey-600);
  transition: color var(--duration-fast) var(--ease-out);
}
.nav-links a:hover,
.nav-links a.active { color: var(--sp-teal); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.lang-select {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--sp-grey-200);
  background: transparent;
  color: var(--sp-grey-600);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236E7583' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sp-dark);
  transition: all var(--duration-fast) var(--ease-out);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-actions .btn { display: none; }
  .nav-actions { gap: var(--sp-2); }
  .nav-inner { padding: 0 var(--sp-4); }
  .nav-logo { font-size: 1rem; gap: var(--sp-2); flex-shrink: 0; }
  .nav-logo .logo-mark { width: 30px; height: 30px; }
  .nav-logo .logo-dot { width: 11px; height: 11px; }
  .lang-select { font-size: 0.75rem; padding: 6px 24px 6px 8px; }
  .nav-links {
    position: fixed;
    top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    left: 0; right: 0;
    background: var(--sp-white);
    flex-direction: column;
    padding: var(--sp-6);
    gap: var(--sp-4);
    border-bottom: 1px solid var(--sp-grey-200);
    transform: translateY(-120%);
    transition: transform var(--duration-normal) var(--ease-out);
    z-index: 999;
  }
  .nav-links.open { transform: translateY(0); }
  [dir="rtl"] .nav-links { flex-direction: column; }
}

/* --- Section --- */
section { padding: var(--sp-24) 0; }
.section-dark { background: var(--sp-dark); color: var(--sp-white); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: var(--sp-white); }
.section-dark p, .section-dark .lead { color: var(--sp-grey-300); }
.section-light { background: var(--sp-off-white); }

.section-header {
  text-align: center;
  margin-bottom: var(--sp-16);
}
.section-header .overline {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sp-teal);
  margin-bottom: var(--sp-3);
}
.section-header p { margin: var(--sp-4) auto 0; }

/* --- Cards --- */
.card {
  background: var(--sp-white);
  border: 1px solid var(--sp-grey-200);
  padding: var(--sp-8);
  transition: all var(--duration-normal) var(--ease-out);
}
.card:hover {
  border-color: var(--sp-teal);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26,26,46,0.08);
}

.card-icon {
  width: 48px; height: 48px;
  background: var(--sp-teal-10);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-5);
}
.card-icon svg { width: 24px; height: 24px; color: var(--sp-teal); }

/* --- Grid --- */
.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* --- Footer --- */
.site-footer {
  background: var(--sp-dark);
  color: var(--sp-grey-400);
  padding: var(--sp-16) 0 var(--sp-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}
.footer-brand p { margin-top: var(--sp-4); font-size: 0.875rem; line-height: 1.7; }
.footer-col h5 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sp-grey-300);
  margin-bottom: var(--sp-5);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--sp-3); }
.footer-col a { font-size: 0.875rem; color: var(--sp-grey-400); }
.footer-col a:hover { color: var(--sp-teal); }

.footer-bottom {
  border-top: 1px solid var(--sp-dark-light);
  padding-top: var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .footer-bottom { flex-direction: column; gap: var(--sp-4); text-align: center; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-teal { color: var(--sp-teal); }
.text-dark { color: var(--sp-dark); }
.text-muted { color: var(--sp-grey-500); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }
.mt-auto { margin-top: auto; }
.pt-nav { padding-top: var(--nav-height); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.hidden { display: none; }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-in {
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) forwards;
}
.animate-in.delay-1 { animation-delay: 0.1s; }
.animate-in.delay-2 { animation-delay: 0.2s; }
.animate-in.delay-3 { animation-delay: 0.3s; }
.animate-in.delay-4 { animation-delay: 0.4s; }

/* --- Pricing Table --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  align-items: start;
}
.pricing-card {
  background: var(--sp-white);
  border: 1px solid var(--sp-grey-200);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal) var(--ease-out);
}
.pricing-card:hover {
  border-color: var(--sp-teal);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(26,26,46,0.1);
}
.pricing-card.featured {
  border-color: var(--sp-teal);
  position: relative;
}
.pricing-card.featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sp-teal);
}
.pricing-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sp-teal-10);
  color: var(--sp-teal);
  padding: var(--sp-1) var(--sp-3);
  margin-bottom: var(--sp-4);
  align-self: flex-start;
}
.pricing-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sp-dark);
  margin-bottom: var(--sp-2);
}
.pricing-price {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sp-dark);
  line-height: 1.1;
  margin-bottom: var(--sp-1);
}
.pricing-price .currency { font-size: 1.5rem; vertical-align: top; line-height: 1.4; }
.pricing-price .period { font-size: 0.875rem; font-weight: 400; color: var(--sp-grey-400); }
.pricing-credits {
  font-size: 0.875rem;
  color: var(--sp-grey-500);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--sp-grey-200);
}
.pricing-features {
  list-style: none;
  margin-bottom: var(--sp-8);
  flex: 1;
}
.pricing-features li {
  font-size: 0.875rem;
  color: var(--sp-grey-600);
  padding: var(--sp-2) 0;
  padding-left: var(--sp-6);
  position: relative;
}
[dir="rtl"] .pricing-features li { padding-left: 0; padding-right: var(--sp-6); }
.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 12px;
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236AADA8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
[dir="rtl"] .pricing-features li::before { left: auto; right: 0; }

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

/* --- Docs --- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--sp-10);
  align-items: start;
}
.docs-sidebar { position: sticky; top: calc(var(--nav-height) + var(--sp-6)); }
.docs-sidebar ul { list-style: none; }
.docs-sidebar li { margin-bottom: var(--sp-1); }
.docs-sidebar a {
  display: block;
  font-size: 0.875rem;
  padding: var(--sp-2) var(--sp-4);
  color: var(--sp-grey-500);
  border-left: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
}
[dir="rtl"] .docs-sidebar a { border-left: none; border-right: 2px solid transparent; }
.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--sp-teal);
  border-left-color: var(--sp-teal);
  background: var(--sp-teal-10);
}
[dir="rtl"] .docs-sidebar a:hover,
[dir="rtl"] .docs-sidebar a.active {
  border-left-color: transparent;
  border-right-color: var(--sp-teal);
}

.docs-content h2 { margin-top: var(--sp-12); margin-bottom: var(--sp-4); }
.docs-content h3 { margin-top: var(--sp-8); margin-bottom: var(--sp-3); }
.docs-content p { margin-bottom: var(--sp-4); }
.docs-content pre { margin-bottom: var(--sp-6); }
.docs-content ul, .docs-content ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
}
[dir="rtl"] .docs-content ul, [dir="rtl"] .docs-content ol { padding-left: 0; padding-right: var(--sp-6); }
.docs-content li { margin-bottom: var(--sp-2); font-size: 0.9375rem; }

.docs-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-6); font-size: 0.875rem; }
.docs-table th { text-align: left; font-weight: 600; color: var(--sp-dark); padding: var(--sp-3) var(--sp-4); border-bottom: 2px solid var(--sp-grey-200); }
[dir="rtl"] .docs-table th { text-align: right; }
.docs-table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--sp-grey-100); color: var(--sp-grey-600); }

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
}

/* --- FAQ / Accordion --- */
.accordion-item { border-bottom: 1px solid var(--sp-grey-200); }
.accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--sp-5) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sp-dark);
  text-align: left;
}
[dir="rtl"] .accordion-trigger { text-align: right; }
.accordion-trigger svg {
  width: 20px; height: 20px;
  color: var(--sp-grey-400);
  transition: transform var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}
.accordion-item.open .accordion-trigger svg { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}
.accordion-item.open .accordion-body { max-height: 500px; }
.accordion-body-inner { padding-bottom: var(--sp-5); font-size: 0.9375rem; color: var(--sp-grey-500); line-height: 1.7; }

/* --- Changelog --- */
.changelog-entry {
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--sp-grey-200);
}
.changelog-version {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sp-dark);
}
.changelog-date {
  font-size: 0.8125rem;
  color: var(--sp-grey-400);
  font-weight: 400;
}
.changelog-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  margin-right: var(--sp-2);
}
[dir="rtl"] .changelog-tag { margin-right: 0; margin-left: var(--sp-2); }
.changelog-tag.added { background: rgba(52,199,123,0.1); color: #34C77B; }
.changelog-tag.fixed { background: rgba(106,173,168,0.1); color: var(--sp-teal); }
.changelog-tag.changed { background: rgba(245,166,35,0.1); color: #F5A623; }
.changelog-tag.security { background: rgba(231,76,95,0.1); color: #E74C5F; }
.changelog-list { list-style: none; margin-top: var(--sp-4); }
.changelog-list li { padding: var(--sp-2) 0; font-size: 0.9375rem; color: var(--sp-grey-600); }

/* --- Noise / Texture overlay --- */
.noise-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
