/* SafeW Global Styles */

/* Design Tokens */
:root {
    /* Colors */
    --color-dark: #240F29;
    --color-paper: #F6F3F7;
    --color-body: #201523;
    --color-brand: #A711CF;
    --color-accent: #ED6E73;
    
    /* Spacing & Sizing */
    --radius-card: 0;
    --radius-btn: 0;
    --card-border: 0;
    --card-shadow: none;
    --section-y: clamp(2.5rem, 5vw, 4rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --content-max: 1280px;
    
    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-paper);
    color: var(--color-body);
    line-height: 1.55;
    font-size: 16px;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.grid {
    display: grid;
    gap: var(--gap);
}

.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    align-items: center;
}

/* Typography Helpers */
.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.paper-theme .section-label {
    color: var(--color-brand);
}

.dark-theme .section-label {
    color: var(--color-accent);
}

.highlight-text {
    color: var(--color-brand);
}

.dark-theme .highlight-text {
    color: var(--color-accent);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-wrap: balance;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

/* Sections */
.section {
    padding: var(--section-y) 0;
    position: relative;
}

/* Separator */
.section-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(32, 21, 35, 0.1);
    border: none;
}

.dark-theme {
    background-color: var(--color-dark);
    color: var(--color-paper);
}

.dark-theme .section-divider {
    background-color: rgba(246, 243, 247, 0.1);
}

/* Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(246, 243, 247, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
    padding: 0.75rem 0;
}

.dark-theme.site-header {
    background-color: rgba(36, 15, 41, 0.95);
    border-bottom-color: rgba(246, 243, 247, 0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 1.5rem;
    position: relative;
}

.nav-link[aria-current="page"] {
    color: var(--color-brand);
}

.dark-theme .nav-link[aria-current="page"] {
    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;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-secondary {
    border-color: var(--color-body);
    color: var(--color-body);
    background: transparent;
}

.dark-theme .btn-secondary {
    border-color: var(--color-paper);
    color: var(--color-paper);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background-color: rgba(32, 21, 35, 0.05);
}

.dark-theme .btn-secondary:hover {
    background-color: rgba(246, 243, 247, 0.1);
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    stroke-width: 2;
}

/* Cards */
.card {
    background-color: var(--color-paper);
    border: 1px solid rgba(32, 21, 35, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.dark-theme .card {
    background-color: var(--color-dark);
    border: 1px solid rgba(246, 243, 247, 0.1);
}

.card:hover {
    transform: translateY(-4px);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(32, 21, 35, 0.1);
}

.dark-theme .table-wrapper {
    border-color: rgba(246, 243, 247, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
}

.dark-theme th, .dark-theme td {
    border-bottom-color: rgba(246, 243, 247, 0.1);
}

th {
    background-color: rgba(32, 21, 35, 0.03);
    font-weight: 700;
}

.dark-theme th {
    background-color: rgba(246, 243, 247, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* FAQ Details */
details {
    border-bottom: 1px solid rgba(32, 21, 35, 0.1);
    padding: 1rem 0;
}

.dark-theme details {
    border-bottom-color: rgba(246, 243, 247, 0.1);
}

summary {
    font-weight: 700;
    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.5rem;
    font-weight: 300;
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details p {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Timeline (Quick Start) */
.timeline-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-accent);
    min-width: 3rem;
    line-height: 1;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

/* Feature Grid */
.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* News Grid */
.news-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Footer */
.site-footer {
    background-color: var(--color-dark);
    color: var(--color-paper);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a:hover {
    text-decoration: underline;
}

/* SVG Animation Styles */
.svg-container {
    position: relative;
    width: 100%;
    height: auto;
}

.star {
    fill: var(--color-accent);
    opacity: 0.3;
}

.line-path {
    stroke: var(--color-accent);
    stroke-width: 1;
    fill: none;
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    opacity: 0.5;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

@keyframes drawLine {
    0% { stroke-dashoffset: 1; opacity: 0; }
    20% { opacity: 0.5; }
    80% { opacity: 0.5; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

.animate-star {
    animation: twinkle 4s infinite ease-in-out;
}

.animate-line {
    animation: drawLine 8s infinite linear;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
    
    .star {
        opacity: 0.5;
    }
    
    .line-path {
        stroke-dashoffset: 0;
        opacity: 0.3;
    }
}
