/* SafeW Global Styles */
:root {
  /* Palette */
  --bg-dark: #1B1231;
  --bg-paper: #F4F3F7;
  --text-main: #191523;
  --brand-color: #5214EB;
  --accent-color: #9977EE;
  --text-on-dark: #F4F3F7;

  /* Tokens */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  
  /* Typography */
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-main);
  background-color: var(--bg-paper);
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 0;
}

a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
ul, ol { padding-left: 0; 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(--bg-dark); color: var(--text-on-dark); }
.bg-light { background-color: var(--bg-paper); color: var(--text-main); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand img { height: 32px; width: auto; display: block; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--brand-color); }
.nav-links [aria-current="page"] { color: var(--brand-color); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 32px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}
.btn-secondary {
  border: 1px solid var(--text-main);
  background: transparent;
  color: var(--text-main);
}
.btn-dark {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}
.btn-outline-dark {
  border: 1px solid var(--text-on-dark);
  background: transparent;
  color: var(--text-on-dark);
}

.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--brand-color); outline-offset: 4px; }

/* Cards */
.card {
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card);
  padding: 32px;
  /* Rely on color contrast, no shadow/border per spec */
}
.bg-dark .card { background-color: rgba(255, 255, 255, 0.08); }

/* Feature Tabs (Pure CSS) */
.tab-radio { display: none; }
.tab-nav { display: flex; gap: 16px; border-bottom: 1px solid rgba(0,0,0,0.1); margin-bottom: 32px; flex-wrap: wrap; }
.tab-label {
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.tab-label:hover { opacity: 1; }
.tab-content { display: none; }
/* Selected States */
#tab-1:checked ~ .tab-nav label[for="tab-1"],
#tab-2:checked ~ .tab-nav label[for="tab-2"],
#tab-3:checked ~ .tab-nav label[for="tab-3"],
#tab-4:checked ~ .tab-nav label[for="tab-4"] {
  opacity: 1;
  color: var(--brand-color);
  border-bottom: 2px solid var(--brand-color);
}
#tab-1:checked ~ .content-1,
#tab-2:checked ~ .content-2,
#tab-3:checked ~ .content-3,
#tab-4:checked ~ .content-4 { display: block; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { text-align: left; padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.1); }
th { font-weight: 600; color: var(--brand-color); }
.bg-dark th, .bg-dark td { border-bottom-color: rgba(255,255,255,0.1); }

/* FAQ */
details {
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.5);
  padding: 16px 24px;
}
.bg-dark details { background: rgba(255,255,255,0.05); }
summary { 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.2em; }
details[open] summary::after { content: "-"; }
details p { margin-top: 12px; color: rgba(25, 21, 35, 0.8); }
.bg-dark details p { color: rgba(244, 243, 247, 0.8); }

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.news-card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.news-date { font-size: 0.85rem; color: var(--brand-color); margin-bottom: 8px; font-weight: 600; }
.news-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.news-excerpt { font-size: 0.95rem; color: rgba(25,21,35,0.7); flex-grow: 1; }

/* Footer */
.footer {
  padding: 64px 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-links a { display: block; margin-bottom: 12px; color: var(--text-main); opacity: 0.7; }
.footer-links a:hover { opacity: 1; }

/* Highlight */
.hl { color: var(--brand-color); }
.bg-dark .hl { color: var(--accent-color); }

/* SVG Animations */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.svg-draw path, .svg-draw rect, .svg-draw circle {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease-in-out infinite alternate;
}
.svg-float { animation: float 6s ease-in-out infinite; }
.svg-breathe { animation: breathe 4s ease-in-out infinite; }
.svg-delay-1 { animation-delay: 0.5s; }
.svg-delay-2 { animation-delay: 1s; }

@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;
  }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; } /* Simplified mobile nav for this demo */
  .hero-layout { flex-direction: column-reverse; }
}
