/* 
 * SafeW Global Styles
 * Design Tokens & Base Variables
 */
:root {
    /* Colors - Palette */
    --color-dark: #140E25;      /* Deep background */
    --color-paper: #F5F0E5;     /* Paper background */
    --color-text-main: #191523; /* Main text color */
    --color-brand: #5214EB;     /* Brand accent (links, icons, badges on paper) */
    --color-accent: #C8ED6E;    /* Highlight accent (buttons on dark, badges on dark) */
    
    /* UI Elements */
    --radius-card: 8px;
    --radius-btn: 6px;
    --card-border: 1px solid rgba(25, 21, 35, 0.16);
    --card-shadow: none;
    
    /* Spacing & Layout */
    --section-y: clamp(5rem, 10vw, 9rem);
    --gap: clamp(1.5rem, 3vw, 2.5rem);
    --content-max: 1120px;
    
    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-sans);
    line-height: 1.75;
    color: var(--color-text-main);
    background-color: var(--color-paper);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* Typography Utilities */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 3vw, 3rem);
}

.section-header {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Theme Variations for Badges */
.badge--brand { color: var(--color-brand); }
.badge--accent { color: var(--color-accent); }

h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 1rem; }
p { margin-bottom: 1.5rem; max-width: 38em; }

/* Sections Layout */
.section {
    padding: var(--section-y) 0;
    position: relative;
}

.section--dark {
    background-color: var(--color-dark);
    color: var(--color-paper);
}

.section--paper {
    background-color: var(--color-paper);
    color: var(--color-text-main);
}

/* Card System */
.card {
    background: white;
    border: var(--card-border);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.section--dark .card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-paper);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 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);
    filter: brightness(1.05);
}

.btn--secondary {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid currentColor;
}

.section--dark .btn--secondary {
    color: var(--color-paper);
    border-color: var(--color-paper);
}

.btn--secondary:hover {
    background: rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.section--dark .btn--secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border: var(--card-border);
    border-radius: var(--radius-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

th {
    font-weight: 700;
    background: rgba(0,0,0,0.02);
}

tr:last-child td {
    border-bottom: none;
}

/* Lists */
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
li { margin-bottom: 0.5rem; }

/* Highlights */
.hl {
    color: var(--color-brand);
}
.section--dark .hl {
    color: var(--color-accent);
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-paper);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-link[aria-current="page"] {
    color: var(--color-brand);
    font-weight: 700;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-brand);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Footer */
.site-footer {
    background-color: var(--color-dark);
    color: rgba(255,255,255,0.6);
    padding: 4rem 0;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--color-paper);
    margin-bottom: 1rem;
}

.footer-links li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* SVG Animations (Concentric Breathing) */
.svg-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

@keyframes orbit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.3; transform: scale(0.95); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.anim-orbit {
    animation: orbit-spin 12s linear infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.anim-pulse {
    animation: pulse-opacity 4s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: center;
}

/* Accessibilty & 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;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .btn-group {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* Feature List Style */
.feature-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(82, 20, 235, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand);
}
.feature-content h3 { margin-bottom: 0.5rem; }
.feature-content p { margin-bottom: 0; font-size: 0.95rem; opacity: 0.9; }

/* Flow Step */
.flow-step {
    text-align: center;
    position: relative;
    padding: 1.5rem;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: var(--color-dark);
    font-weight: 800;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.arrow {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-brand);
    font-size: 1.5rem;
}
@media (max-width: 768px) {
    .arrow { display: none; }
}

/* Details / FAQ */
details {
    border: var(--card-border);
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    padding: 1rem;
    transition: background 0.2s;
}
summary {
    font-weight: 600;
    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.2rem;
    font-weight: 400;
}
details[open] summary::after {
    content: '−';
}
details p {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* News Cards */
.news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.news-date {
    font-size: 0.8rem;
    color: rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}
.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}
.news-excerpt {
    font-size: 0.9rem;
    color: rgba(0,0,0,0.7);
    flex-grow: 1;
}

/* Interface Visual Panel */
.visual-panel {
    background: var(--color-dark);
    border-radius: 16px;
    padding: 2rem;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Helper for SVG inside visual panels */
.visual-panel svg {
    width: 100%;
    height: 100%;
    max-width: 600px;
}

/* Timeline/List styling for deep dive */
.deep-dive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.deep-dive-item {
    border-left: 3px solid var(--color-brand);
    padding-left: 1.5rem;
}
.deep-dive-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.deep-dive-item p {
    font-size: 0.95rem;
    margin-bottom: 0;
}
