/* =========================================
   SafeW Global Styles (style.css)
   ========================================= */

/* --- Reset & Variables --- */
:root {
  /* Colors */
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-text: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  
  /* Tokens */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  
  /* Typography */
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --- Layout --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

/* --- Sections --- */
.section {
  padding-block: var(--section-y);
}

.section-header {
  margin-bottom: calc(var(--gap) * 1.5);
  max-width: 800px;
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.paper-surface .badge { color: var(--color-brand); }
.dark-surface .badge { color: var(--color-accent); }

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.hl {
  color: var(--color-brand);
}
.dark-surface .hl { color: var(--color-accent); }

p { margin-top: 0; margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* --- Components: Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 2rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(137, 237, 110, 0.4);
}

.btn-secondary {
  border: 2px solid var(--color-text);
  color: var(--color-text);
}

.dark-surface .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
}
.dark-surface .btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Components: Cards --- */
.card {
  background: white;
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(21, 21, 35, 0.35);
}

.dark-surface .card {
  background: var(--color-paper);
  color: var(--color-text);
}

/* --- Components: Table --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 600px;
}

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

th {
  background-color: rgba(0,0,0,0.03);
  font-weight: 700;
}

tr:last-child td { border-bottom: none; }

/* --- Components: FAQ --- */
details {
  background: white;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

summary {
  padding: 1.25rem;
  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;
  color: var(--color-brand);
}

details[open] summary::after { content: "-"; }

details > div {
  padding: 0 1.25rem 1.25rem;
  color: #444;
}

/* --- Components: Header/Footer --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo img { height: 32px; width: auto; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav-links a:hover,
.nav-links [aria-current="page"] {
  color: var(--color-brand);
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 4rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a:hover { text-decoration: underline; }

.copyright {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(245, 240, 229, 0.6);
}

/* --- SVG Animation System --- */
.svg-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke: currentColor;
  vertical-align: middle;
}

/* Draw Effect */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s ease-in-out infinite alternate;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* Float/Breathe Effect */
.float-element {
  animation: floatY 4s ease-in-out infinite alternate;
}

@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* Pulse Effect */
.pulse-element {
  animation: pulseOpacity 2s ease-in-out infinite alternate;
}

@keyframes pulseOpacity {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Accessibility: 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;
  }
  .svg-icon { animation: none; }
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .nav-links { display: none; } /* Simplified for single-file constraint, usually would have hamburger */
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
