/* SafeW Global Styles */
:root {
    /* Colors */
    --color-dark: #271334;
    --color-paper: #E9E8EA;
    --color-text-body: #1D1523;
    --color-brand: #8A13DD;
    --color-accent: #9EED6E;
    
    /* Tokens */
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-border: 2px solid var(--color-text-body);
    --card-shadow: 4px 4px 0 var(--color-text-body);
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1280px;
    
    /* Typography */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-paper);
    color: var(--color-text-body);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* Layout */
.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.6rem, 6.4vw, 5rem);
    margin-bottom: var(--gap);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    margin-bottom: calc(var(--gap) * 1.5);
}

h3 {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    margin-bottom: calc(var(--gap) * 0.5);
}

p {
    margin-bottom: var(--gap);
    max-width: 38em;
}

.hl {
    color: var(--color-brand);
}

.dark-mode .hl {
    color: var(--color-accent);
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.paper .eyebrow {
    color: var(--color-brand);
}

.dark .eyebrow {
    color: var(--color-accent);
}

/* Components */
.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;
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

.btn-primary:hover {
    background-color: #8dd65d;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-text-body);
    color: var(--color-text-body);
}

.dark .btn-secondary {
    border-color: var(--color-paper);
    color: var(--color-paper);
}

.card {
    background-color: var(--color-paper);
    border: var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-card);
    padding: 24px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.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%, 300px), 1fr));
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--gap);
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(29, 21, 35, 0.1);
}

th {
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

/* FAQ */
details {
    border: var(--card-border);
    border-radius: var(--radius-card);
    margin-bottom: var(--gap);
    background: var(--color-paper);
    padding: 16px 24px;
}

summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 24px;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

details[open] summary::after {
    content: "-";
}

details > div {
    margin-top: var(--gap);
    padding-top: var(--gap);
    border-top: 1px solid rgba(29, 21, 35, 0.1);
}

/* Header & Footer */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-paper);
    border-bottom: 1px solid rgba(29, 21, 35, 0.1);
    padding: 16px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo img {
    height: 32px;
    width: auto;
}

nav ul {
    display: flex;
    gap: 24px;
}

nav a {
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover, nav a[aria-current="page"] {
    color: var(--color-brand);
}

footer {
    background-color: var(--color-dark);
    color: var(--color-paper);
    padding: var(--section-y) 0;
    margin-top: var(--section-y);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.footer-nav ul {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-nav a:hover {
    opacity: 1;
    color: var(--color-accent);
}

/* SVG Animations */
svg {
    width: 100%;
    height: auto;
}

.svg-draw {
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: drawLine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.svg-float {
    animation: float 6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.svg-pulse {
    animation: pulse 3s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.svg-slide {
    animation: slideIn 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes drawLine {
    0% { stroke-dashoffset: 1; }
    20% { stroke-dashoffset: 0; }
    80% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes slideIn {
    0%, 100% { transform: translateX(0); opacity: 0; }
    10%, 90% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(10px); opacity: 1; }
}

/* 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-draw, .svg-float, .svg-pulse, .svg-slide {
        animation: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    nav ul {
        display: none; /* Simple mobile hide for this static site */
    }
    .header-inner {
        justify-content: space-between;
    }
}
