/* =========================================
   SafeW Global Styles & Design Tokens
   ========================================= */

:root {
    /* --- Color Palette --- */
    --color-dark-bg: #21163C;
    --color-paper-bg: #E9E8EA;
    --color-text-main: #191523;
    --color-brand: #5214EB;
    --color-accent: #ED926E;
    
    /* --- Derived Colors --- */
    --color-white: #FFFFFF;
    --color-dark-text: #F4F2F7;
    --color-border-light: rgba(25, 21, 35, 0.1);
    --color-border-dark: rgba(244, 242, 247, 0.15);
    --color-overlay-dark: rgba(33, 22, 60, 0.85);

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Outfit', var(--font-sans); /* High-thin condensed feel */
    
    /* --- Spacing & Layout --- */
    --section-y: clamp(3.5rem, 7vw, 6rem);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --content-max: 1280px;
    --radius-card: 20px;
    --radius-btn: 12px;
    --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
    --card-border: 0;

    /* --- Component Heights --- */
    --header-height: 72px;
}

/* =========================================
   Base Reset & Typography
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--color-text-main);
    background-color: var(--color-paper-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

ul, ol {
    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);
    position: relative;
}

.section--dark {
    background-color: var(--color-dark-bg);
    color: var(--color-dark-text);
}

.section--paper {
    background-color: var(--color-paper-bg);
    color: var(--color-text-main);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: var(--gap);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   Typography Components
   ========================================= */
.badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.section--paper .badge {
    color: var(--color-brand);
    background-color: rgba(82, 20, 235, 0.08);
}

.section--dark .badge {
    color: var(--color-accent);
    background-color: rgba(237, 146, 110, 0.15);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.6rem, 6.4vw, 5rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    max-width: 38em;
}

.text-hl {
    color: var(--color-brand);
}

.section--dark .text-hl {
    color: var(--color-accent);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: none;
    text-align: center;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-dark-bg);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 146, 110, 0.4);
}

.btn--secondary {
    background-color: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
}

.section--dark .btn--secondary {
    border-color: var(--color-dark-text);
    color: var(--color-dark-text);
}

.btn--secondary:hover {
    background-color: rgba(25, 21, 35, 0.05);
}

.section--dark .btn--secondary:hover {
    background-color: rgba(244, 242, 247, 0.1);
}

.btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(233, 232, 234, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    height: var(--header-height);
}

.section--dark ~ .site-header,
.site-header.is-dark {
    background-color: rgba(33, 22, 60, 0.9);
    border-bottom-color: var(--color-border-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
}

.brand img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    opacity: 1;
}

.section--dark .nav-link {
    color: var(--color-dark-text);
}

.section--paper .nav-link {
    color: var(--color-text-main);
}

/* =========================================
   Cards & Panels
   ========================================= */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: var(--card-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -12px rgba(25, 21, 35, 0.35);
}

.section--dark .card {
    background-color: rgba(244, 242, 247, 0.05);
    border: 1px solid var(--color-border-dark);
    box-shadow: none;
}

.section--dark .card:hover {
    background-color: rgba(244, 242, 247, 0.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* =========================================
   Tables
   ========================================= */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-white);
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.data-table th {
    background-color: rgba(25, 21, 35, 0.03);
    font-weight: 600;
    color: var(--color-text-main);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================
   FAQ / Details
   ========================================= */
.faq-item {
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 8px;
}

.faq-item summary {
    padding: 16px 0;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.5;
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding-bottom: 16px;
    padding-left: 24px;
    opacity: 0.85;
    font-size: 0.95rem;
}

/* =========================================
   SVG Animations
   ========================================= */
@keyframes flow-line {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.6; r: 3; }
    50% { opacity: 1; r: 5; }
}

.anim-flow {
    stroke-dasharray: 10 10;
    animation: flow-line 2s linear infinite;
}

.anim-float {
    animation: float 6s ease-in-out infinite;
}

.anim-pulse {
    animation: pulse-dot 3s ease-in-out infinite;
}

/* 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;
    }
    .anim-flow, .anim-float, .anim-pulse {
        animation: none !important;
    }
}

/* =========================================
   Specific Sections Styling
   ========================================= */
.hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    align-items: center;
}

.timeline {
    position: relative;
    padding-left: 32px;
    border-left: 2px solid var(--color-brand);
}

.section--dark .timeline {
    border-left-color: var(--color-accent);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -39px;
    top: 6px;
    width: 12px;
    height: 12px;
    background-color: var(--color-accent);
    border-radius: 50%;
    border: 2px solid var(--color-paper-bg);
}

.section--dark .timeline-item::before {
    border-color: var(--color-dark-bg);
}

.timeline-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 4px;
    display: block;
}

.section--dark .timeline-time {
    color: var(--color-accent);
}

.news-card time {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-main);
    opacity: 0.6;
    margin-bottom: 8px;
}

.section--dark .news-card time {
    color: var(--color-dark-text);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none; /* Simplify for mobile view in this static context */
    }
    h1 {
        font-size: clamp(2.2rem, 8vw, 3.5rem);
    }
}
