/* =========================================
   SafeW Shared Styles & Design Tokens
   ========================================= */

:root {
  /* Colors */
  --color-dark-surface: #13102D;
  --color-paper-surface: #D6D4ED;
  --color-text-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* Spacing & Layout */
  --content-max: 960px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --radius-card: 24px;
  --radius-btn: 999px;

  /* Shadows & Borders */
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --card-border: 0;
  --border-color: rgba(23, 21, 35, 0.12);

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-paper-surface);
  color: var(--color-text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   Layout & Utilities
   ========================================= */

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
}

.text-center {
  text-align: center;
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: center;
}

/* =========================================
   Header & Nav
   ========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(214, 212, 237, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-area img {
  height: 32px;
  width: auto;
}

.nav-desktop {
  display: flex;
  gap: 24px;
}

.nav-desktop a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}

.btn-secondary {
  background-color: transparent;
  border: 1.5px solid var(--color-text-body);
  color: var(--color-text-body);
}

.dark-mode .btn-secondary {
  border-color: var(--color-paper-surface);
  color: var(--color-paper-surface);
}

.btn-nav:hover {
  transform: translateY(-1px);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

/* =========================================
   Hero Section
   ========================================= */

.hero-section {
  background-color: var(--color-dark-surface);
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--section-y) * 0.8);
  padding-bottom: calc(var(--section-y) * 1.2);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.hero-content {
  color: var(--color-paper-surface);
}

.hero-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}

.hero-title span.hl {
  color: var(--color-accent);
}

.hero-desc {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.7;
  opacity: 0.9;
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* =========================================
   Components: Cards, Tables, Details
   ========================================= */

.card {
  background-color: #fff;
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.35);
}

.section-header {
  margin-bottom: 48px;
}

.breadcrumb {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-brand);
  margin-bottom: 12px;
  display: block;
}

.dark-mode .breadcrumb {
  color: var(--color-accent);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 16px;
  text-wrap: balance;
}

.section-title span.hl {
  color: var(--color-brand);
}

.dark-mode .section-title span.hl {
  color: var(--color-accent);
}

.section-subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 640px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  color: var(--color-brand);
}

.dark-mode .feature-icon {
  color: var(--color-accent);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.data-table th,
.data-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: rgba(23, 21, 35, 0.04);
  font-weight: 600;
  width: 35%;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.news-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: 8px;
  display: block;
}

.dark-mode .news-date {
  color: var(--color-accent);
}

.news-excerpt {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 8px;
}

details.faq-item {
  background-color: #fff;
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

summary {
  font-weight: 600;
  cursor: pointer;
  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: 300;
}

details[open] summary::after {
  content: "−";
}

.faq-answer {
  margin-top: 12px;
  opacity: 0.9;
  line-height: 1.7;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-step {
  position: relative;
  padding-bottom: 32px;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.step-number {
  position: absolute;
  left: -32px;
  top: 0;
  width: 24px;
  height: 24px;
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  z-index: 1;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* =========================================
   Footer
   ========================================= */

.site-footer {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
  padding: 48px 0;
  margin-top: var(--section-y);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  opacity: 0.7;
  font-size: 0.9rem;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-accent);
}

/* =========================================
   SVG Animations
   ========================================= */

/* Draw Effect */
.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 3s ease-in-out infinite alternate;
}

@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* Float Effect */
.float {
  animation: floatMove 4s ease-in-out infinite alternate;
}

@keyframes floatMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* Fade In Up */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Pulse */
.pulse {
  animation: pulseAnim 2s ease-in-out infinite;
}

@keyframes pulseAnim {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Flow Line */
.flow-line {
  stroke-dasharray: 12 6;
  animation: flowDash 1s linear infinite;
}

@keyframes flowDash {
  from { stroke-dashoffset: 18; }
  to { stroke-dashoffset: 0; }
}

/* 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
   ========================================= */

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-visual {
    order: -1;
    aspect-ratio: 16/9;
  }

  .nav-desktop {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Dark Mode Context Helper for Sections */
.dark-mode {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
}

.dark-mode .section-title span.hl {
  color: var(--color-accent);
}

.dark-mode .section-subtitle {
  color: var(--color-paper-surface);
}

.dark-mode .breadcrumb {
  color: var(--color-accent);
}

.dark-mode .timeline::before {
  background-color: rgba(214, 212, 237, 0.2);
}

.dark-mode .step-number {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}
