/* SafeW Global Styles */

:root {
  /* Brand Palette */
  --color-dark-surface: #1B1231;
  --color-paper: #F4F3F7;
  --color-text-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* UI Tokens */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  
  /* Spacing & Rhythm */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height: 1.55;
  
  /* Container */
  --content-max: 1280px;
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-text-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.bg-dark {
  background-color: var(--color-dark-surface);
  color: var(--color-paper);
}

.bg-light {
  background-color: var(--color-paper);
  color: var(--color-text-body);
}

/* Headers & Badges */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.badge-light {
  color: var(--color-brand);
}

.badge-dark {
  color: var(--color-accent);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.text-accent {
  color: var(--color-accent);
}

.text-brand {
  color: var(--color-brand);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-paper);
  border: 1px solid var(--color-paper);
}

.btn-outline-light {
  background-color: transparent;
  color: var(--color-text-body);
  border: 1px solid var(--color-text-body);
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  background-color: rgba(255, 255, 255, 0.05); /* Slightly lighter than dark surface */
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.bg-dark .card {
  background-color: rgba(255, 255, 255, 0.08);
}

.card-body {
  position: relative;
  z-index: 1;
}

/* Feature Row (Alternating) */
.feature-row {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-bottom: var(--section-y);
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

@media (min-width: 768px) {
  .feature-row {
    flex-direction: row;
    align-items: center;
  }
  .feature-row.reverse {
    flex-direction: row-reverse;
  }
  .feature-text {
    flex: 1;
  }
  .feature-visual {
    flex: 1;
  }
}

.feature-visual {
  background-color: var(--color-dark-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Timeline (Quick Start) */
.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
  font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Table */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

th {
  font-weight: 600;
  background-color: rgba(0,0,0,0.02);
}

.bg-dark .table-container {
  border: 1px solid rgba(255,255,255,0.1);
}

.bg-dark th, .bg-dark td {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* FAQ Details */
details {
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
}

summary {
  padding: 16px 24px;
  background-color: rgba(0,0,0,0.03);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
}

details[open] summary::after {
  content: "-";
}

details p {
  padding: 16px 24px;
  margin: 0;
  background-color: white;
}

.bg-dark details summary {
  background-color: rgba(255,255,255,0.05);
  color: var(--color-paper);
}

.bg-dark details p {
  background-color: rgba(255,255,255,0.02);
  color: var(--color-paper);
}

/* Header & Footer Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 243, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 16px 0;
}

.bg-dark .header {
  background-color: rgba(27, 18, 49, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 1;
}

.nav-link[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
  font-weight: 600;
}

.footer {
  padding: 64px 0 32px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.bg-dark .footer {
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  opacity: 0.6;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-col a:hover {
  opacity: 1;
}

.copyright {
  font-size: 0.85rem;
  opacity: 0.5;
  text-align: center;
}

/* Hero Area */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: calc(var(--section-y) * 1.5);
  padding-bottom: var(--section-y);
}

.hero-content {
  max-width: 600px;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.hero-visual {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Persona Cards */
.persona-card {
  background-color: white;
  border-radius: var(--radius-card);
  padding: 32px;
  height: 100%;
}

.bg-dark .persona-card {
  background-color: rgba(255,255,255,0.05);
}

/* SVG Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes dash-flow {
  to { stroke-dashoffset: -24; }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.anim-float {
  animation: float 6s ease-in-out infinite;
}

.anim-float-delayed {
  animation: float-delayed 7s ease-in-out infinite;
  animation-delay: 1s;
}

.anim-dash {
  stroke-dasharray: 12 12;
  animation: dash-flow 1s linear infinite;
}

.anim-pulse {
  animation: pulse-opacity 3s ease-in-out infinite;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility for SVG sizing */
.svg-icon {
  width: 24px;
  height: 24px;
}
