/* =========================================
   SafeW Global Styles
   ========================================= */

:root {
  /* Colors */
  --color-dark-face: #13102D;
  --color-paper-face: #F7F5F3;
  --color-body-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  
  /* Derived Colors for Borders/Lines */
  --border-color: rgba(23, 21, 35, 0.16);
  
  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-condensed: "Inter", var(--font-sans); /* Simulating condensed feel via tracking/weight if font not available */
  
  /* Spacing & Layout */
  --content-max: 1120px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --radius-card: 24px;
  --radius-btn: 999px;
  --header-height: 72px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-body-text);
  background-color: var(--color-paper-face);
  line-height: 1.55;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

ul, ol {
  list-style: none;
}

/* =========================================
   Typography
   ========================================= */

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: var(--gap);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-top: calc(var(--section-y) * 0.8);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-top: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.text-center {
  text-align: center;
}

/* Highlight span for keywords */
.hl {
  color: var(--color-brand);
}
.dark-mode .hl {
  color: var(--color-accent);
}

/* Badge / Eyebrow */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}
.dark-mode .badge {
  color: var(--color-accent);
}

/* =========================================
   Layout Containers
   ========================================= */

.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);
}

/* =========================================
   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 var(--ease-out), opacity 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-face);
  border: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-body-text);
  border: 1px solid var(--color-body-text);
}
.btn-outline:hover {
  background-color: rgba(23, 21, 35, 0.05);
  transform: translateY(-2px);
}
.dark-mode .btn-outline {
  color: var(--color-paper-face);
  border-color: var(--color-paper-face);
}
.dark-mode .btn-outline:hover {
  background-color: rgba(247, 245, 243, 0.1);
}

/* =========================================
   Cards & Panels
   ========================================= */

.card {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: transform 0.2s var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
}

.panel {
  background-color: var(--color-dark-face);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 4vw, 3rem);
  color: var(--color-paper-face);
  position: relative;
  overflow: hidden;
}

/* =========================================
   Navigation
   ========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 245, 243, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.dark-header {
  background-color: rgba(19, 16, 45, 0.9);
  border-bottom-color: rgba(247, 245, 243, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-body-text);
}
.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-brand);
}
.dark-header .nav-link {
  color: var(--color-paper-face);
}
.dark-header .nav-link:hover, .dark-header .nav-link[aria-current="page"] {
  color: var(--color-accent);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-body-text);
}

/* =========================================
   Hero Section
   ========================================= */

.hero-section {
  padding-top: calc(var(--header-height) + var(--section-y));
  padding-bottom: var(--section-y);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.hero-content {
  max-width: 540px;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-body-text);
  margin-bottom: 2rem;
}

.hero-facts {
  display: flex;
  gap: 16px;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--color-body-text);
  opacity: 0.7;
}

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   FAQ Section
   ========================================= */

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

details {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
details[open] {
  border-color: var(--color-brand);
}

summary {
  padding: 16px 24px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform 0.2s ease;
}
details[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 20px 24px;
  color: var(--color-body-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================================
   Feature Grid
   ========================================= */

.feature-group-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand);
  margin: 2rem 0 1rem 0;
  border-left: 4px solid var(--color-brand);
  padding-left: 12px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  margin-bottom: 2rem;
}

.feature-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-icon {
  width: 24px;
  height: 24px;
  stroke: var(--color-brand);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* =========================================
   Tables
   ========================================= */

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: rgba(39, 20, 235, 0.05);
  font-weight: 700;
  color: var(--color-body-text);
  width: 30%;
}

tr:last-child td {
  border-bottom: none;
}

td a {
  color: var(--color-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
td a:hover {
  color: var(--color-accent); /* Fallback logic handled by context usually, but keep safe */
}
.dark-mode td a {
  color: var(--color-accent);
}

/* =========================================
   News Cards
   ========================================= */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-body-text);
  opacity: 0.6;
  margin-bottom: 8px;
}

.news-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 0.95rem;
  color: var(--color-body-text);
  line-height: 1.6;
}

/* =========================================
   Steps
   ========================================= */

.steps-container {
  counter-reset: step-counter;
  display: grid;
  gap: 24px;
}

.step-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  counter-increment: step-counter;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background-color: var(--color-brand);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.dark-mode .step-number {
  background-color: var(--color-accent);
  color: var(--color-dark-face);
}

.step-content h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

/* =========================================
   SVG Animations
   ========================================= */

@keyframes orbit-spin {
  0% { transform: rotate(0deg) scale(0.95); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(0.95); }
}

@keyframes orbit-pulse {
  0% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 0.8; transform: scale(1.1); }
  100% { opacity: 0.3; transform: scale(0.9); }
}

@keyframes float-bubble {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

@keyframes dash-flow {
  to { stroke-dashoffset: -20; }
}

.svg-orbit-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: orbit-spin 20s linear infinite;
}

.svg-orbit-ring-reverse {
  transform-origin: center;
  transform-box: fill-box;
  animation: orbit-spin 25s linear infinite reverse;
}

.svg-orbit-dot {
  transform-origin: center;
  transform-box: fill-box;
  animation: orbit-pulse 4s ease-in-out infinite alternate;
}

.svg-float {
  animation: float-bubble 6s ease-in-out infinite;
}

svg path.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 3s ease forwards;
}

@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;
  }
  .svg-orbit-ring, 
  .svg-orbit-ring-reverse, 
  .svg-orbit-dot, 
  .svg-float {
    animation: none !important;
  }
}

/* =========================================
   Responsive Design
   ========================================= */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    margin: 0 auto;
  }
  .hero-facts {
    justify-content: center;
  }
  .nav-links {
    display: none; /* Simplification for static demo, normally would toggle */
  }
  .mobile-menu-btn {
    display: block;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --section-y: 3rem;
  }
  h1 {
    font-size: 2.2rem;
  }
  .panel {
    padding: 1.5rem;
  }
}

/* =========================================
   Dark Mode Overrides for Sections
   ========================================= */

.dark-bg {
  background-color: var(--color-dark-face);
  color: var(--color-paper-face);
}

.light-bg {
  background-color: var(--color-paper-face);
  color: var(--color-body-text);
}

/* Override text colors inside dark bg */
.dark-bg h1, .dark-bg h2, .dark-bg h3, .dark-bg p, .dark-bg li {
  color: var(--color-paper-face);
}
.dark-bg .badge {
  color: var(--color-accent);
}
.dark-bg .hl {
  color: var(--color-accent);
}
.dark-bg .btn-outline {
  color: var(--color-paper-face);
  border-color: var(--color-paper-face);
}

/* Light cards inside dark section */
.dark-bg .card {
  background-color: #fff;
  color: var(--color-body-text);
  border-color: var(--border-color);
}
.dark-bg .card h3, .dark-bg .card p {
  color: var(--color-body-text);
}
.dark-bg .card .feature-icon {
  stroke: var(--color-brand);
}

/* Footer */
.site-footer {
  background-color: var(--color-dark-face);
  color: var(--color-paper-face);
  padding: 4rem 0 2rem 0;
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-size: 1rem;
}
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-col a:hover {
  color: var(--color-accent);
}
.footer-bottom {
  border-top: 1px solid rgba(247, 245, 243, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

