/* =========================================
   SafeW Global Styles & Design System
   ========================================= */

:root {
    /* Colors */
    --color-dark: #240F29;
    --color-paper: #F6F3F7;
    --color-text: #201523;
    --color-brand: #A711CF;
    --color-accent: #ED6E73;
    
    /* Radius */
    --radius-card: 0;
    --radius-btn: 0;
    
    /* Borders & Shadows */
    --card-border: 0;
    --card-shadow: none;
    
    /* Spacing & Density */
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --line-height-base: 1.55;
    
    /* Layout */
    --content-max: 1120px;
    
    /* Font Family (System Stack) */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* =========================================
   Base Reset & Typography
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* =========================================
   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);
    position: relative;
}

.section-divider {
    border-top: 1px solid rgba(32, 21, 35, 0.1);
}

/* =========================================
   Typography Components
   ========================================= */
.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.75rem;
}

.dark-section .badge {
    color: var(--color-accent);
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--color-text);
}

.dark-section h1, 
.dark-section h2, 
.dark-section h3, 
.dark-section h4 {
    color: var(--color-paper);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

.hl {
    color: var(--color-brand);
    font-weight: 800;
}

.dark-section .hl {
    color: var(--color-accent);
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(246, 243, 247, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(32, 21, 35, 0.05);
    padding: 0.75rem 0;
    transition: background-color 0.3s ease;
}

.dark-section + .site-header {
    background-color: rgba(36, 15, 41, 0.95);
    border-bottom-color: rgba(246, 243, 247, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 32px;
    width: auto;
    vertical-align: middle;
}

.logo span {
    display: inline-block;
    margin-left: 0.75rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-text);
    vertical-align: middle;
}

.dark-section ~ .site-header .logo span {
    color: var(--color-paper);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, 
.nav-link[aria-current="page"] {
    color: var(--color-brand);
    border-bottom-color: var(--color-brand);
}

.dark-section ~ .site-header .nav-link {
    color: var(--color-paper);
}

.dark-section ~ .site-header .nav-link:hover,
.dark-section ~ .site-header .nav-link[aria-current="page"] {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid var(--color-brand);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-text);
}

.btn-secondary:hover {
    background-color: rgba(32, 21, 35, 0.05);
    transform: translateY(-2px);
}

.dark-section .btn-secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

.dark-section .btn-secondary:hover {
    background-color: rgba(246, 243, 247, 0.1);
}

/* =========================================
   Cards & Panels
   ========================================= */
.card {
    background-color: rgba(255, 255, 255, 0.6);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    border-radius: var(--radius-card);
}

.panel {
    background-color: var(--color-dark);
    padding: 2rem;
    border-radius: var(--radius-card);
    color: var(--color-paper);
}

/* =========================================
   Tables
   ========================================= */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 500px;
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
}

th {
    font-weight: 700;
    color: var(--color-text);
}

td {
    color: var(--color-text);
}

.dark-section th, 
.dark-section td {
    border-bottom-color: rgba(246, 243, 247, 0.1);
}

/* =========================================
   FAQ (Details/Summary)
   ========================================= */
.faq-item {
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
    padding: 1rem 0;
}

.faq-item summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: "+";
    color: var(--color-brand);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1;
}

.faq-item[open] summary::before {
    content: "-";
}

.faq-item p {
    margin-top: 0.75rem;
    margin-bottom: 0;
    color: var(--color-text);
    opacity: 0.9;
}

/* =========================================
   SVG Animations
   ========================================= */
.svg-anim-path {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawPath 8s ease-in-out infinite alternate;
}

.svg-anim-float {
    animation: float 6s ease-in-out infinite alternate;
}

.svg-anim-breathe {
    animation: breathe 4s ease-in-out infinite alternate;
}

.svg-anim-slide-in {
    animation: slideIn 10s ease-in-out infinite alternate;
}

@keyframes drawPath {
    0% { stroke-dashoffset: 1; }
    100% { stroke-dashoffset: 0; }
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

@keyframes breathe {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes slideIn {
    0% { transform: translateX(-10px); opacity: 0.5; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Transform origin for sub-elements */
.svg-sub-element {
    transform-box: fill-box;
    transform-origin: center;
}

/* 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-anim-path,
    .svg-anim-float,
    .svg-anim-breathe,
    .svg-anim-slide-in {
        animation: none;
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Simple hide for mobile in this static demo */
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
    }
}
