/* ==========================================================================
   iziDizi — Base Styles
   Design tokens, reset, typography, layout, header, nav, hero.
   Companion: components.css
   ========================================================================== */

/* --- Design Tokens -------------------------------------------------------- */
:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --bg-primary: #0B1120;
  --bg-deep: #0B1120;
  --bg-secondary: #111827;
  --bg-tertiary: #1E293B;
  --text-primary: #E8E6E3;
  --text-secondary: #A8A29E;
  --text-tertiary: #9B948D;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-subtle: rgba(37, 99, 235, 0.1);
  --link-color: #60A5FA;
  --border: rgba(148, 163, 184, 0.65);
  --border-hover: rgba(148, 163, 184, 0.8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* --- Light Theme Tokens --------------------------------------------------- */
[data-theme="light"] {
  --bg-primary: #FAFAF7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0EFEB;
  --text-primary: #1C1917;
  --text-secondary: #57534E;
  --text-tertiary: #5C5651;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-glow: rgba(37, 99, 235, 0.10);
  --accent-subtle: rgba(37, 99, 235, 0.07);
  --link-color: #2563EB;
  --border: rgba(28, 25, 23, 0.48);
  --border-hover: rgba(28, 25, 23, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(224, 120, 86, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(37, 99, 235, 0.03), transparent),
    radial-gradient(ellipse 70% 50% at 60% 80%, rgba(217, 119, 87, 0.03), transparent);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(37, 99, 235, 0.03), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(37, 99, 235, 0.02), transparent);
}

/* --- Grain Texture Overlay ------------------------------------------------ */
body::before {
  content: '';
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

[data-theme="light"] body::before {
  opacity: 0.018;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* --- Accessibility -------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus { top: 16px; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cta-banner :focus-visible {
  outline-color: #fff;
  outline-width: 3px;
}

/* --- Typography ----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: #93C5FD; }

[data-theme="light"] a:hover { color: #1D4ED8; }

/* --- Layout Utilities ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 20px;
}

.section-header { text-align: center; margin-bottom: 3rem; }
.section-title { margin-bottom: 0.75rem; }

.section-subtitle {
  color: var(--text-tertiary);
  font-size: 1.0625rem;
  max-width: 560px;
  margin: 0 auto;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  text-align: center;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
  background: rgba(250, 250, 247, 0.88);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover { color: var(--text-primary); }

.logo svg { width: 28px; height: 28px; color: var(--accent); }

/* --- Navigation ----------------------------------------------------------- */
.nav { display: flex; align-items: center; gap: 28px; }

.nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.nav a.btn-primary,
.nav a.btn-primary:visited { color: #fff; }
.nav a.btn-primary:hover,
.nav a.btn-primary:focus { color: #fff; }

/* --- Mobile Nav Toggle ---------------------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.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);
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 60% 40% at 25% 45%, rgba(224, 120, 86, 0.05), transparent),
    radial-gradient(ellipse 50% 35% at 75% 55%, rgba(37, 99, 235, 0.04), transparent),
    linear-gradient(135deg, var(--bg-deep) 0%, #1a1f3a 50%, var(--bg-deep) 100%);
  padding: clamp(5rem, 12vw, 8rem) 20px clamp(4rem, 10vw, 6rem);
  text-align: center;
  overflow: hidden;
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.1875rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.trust-bar {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.trust-bar span { white-space: nowrap; }

/* --- Hero Badge ----------------------------------------------------------- */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
  color: var(--link-color);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge svg {
  width: 16px;
  height: 16px;
  display: inline-block;
}

/* --- Hero Trust Card ------------------------------------------------------ */
.hero-trust-card {
  margin-top: 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 10px 25px rgba(0, 0, 0, 0.4);
}

.hero-trust-card-inner {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
}

.hero-trust-item svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-trust-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-trust-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.hero-trust-divider {
  width: 1px;
  height: 32px;
  background: rgba(148, 163, 184, 0.12);
}

/* Hero animated dots (CSS-only) */
.hero-dots {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-dots::before,
.hero-dots::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--accent-glow);
  animation: hero-float 8s ease-in-out infinite;
}

.hero-dots::before {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 15%;
}

.hero-dots::after {
  width: 200px;
  height: 200px;
  bottom: 15%;
  right: 20%;
  animation-delay: -4s;
  animation-duration: 10s;
}

@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(30px, -20px) scale(1.1); opacity: 0.7; }
}

/* --- Hero Light Theme ----------------------------------------------------- */
[data-theme="light"] .hero {
  background:
    radial-gradient(ellipse 60% 40% at 25% 45%, rgba(37, 99, 235, 0.04), transparent),
    radial-gradient(ellipse 50% 35% at 75% 55%, rgba(37, 99, 235, 0.03), transparent),
    linear-gradient(135deg, #FAFAF7 0%, #F0EFEB 50%, #FAFAF7 100%);
}

[data-theme="light"] .hero-dots::before,
[data-theme="light"] .hero-dots::after {
  background: rgba(28, 25, 23, 0.03);
}

[data-theme="light"] .hero-trust-card {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 10px 25px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hero-trust-divider {
  background: rgba(28, 25, 23, 0.10);
}

[data-theme="light"] .btn-ghost:hover {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 4px 6px rgba(0, 0, 0, 0.06);
}

/* --- Theme Toggle --------------------------------------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.theme-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.theme-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Reduced Motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Responsive: Base (max 768px) ----------------------------------------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(11, 17, 32, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }

  .nav.js-hidden { display: none; }

  [data-theme="light"] .nav {
    background: rgba(250, 250, 247, 0.97);
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .theme-toggle {
    border-color: rgba(148, 163, 184, 0.3);
  }

  [data-theme="light"] .theme-toggle {
    border-color: var(--border);
  }

  .nav a {
    padding: 10px 0;
    border-bottom: none;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* --- Responsive: Small mobile hero (max 480px) ---------------------------- */
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 280px; }
}
