:root {
    --base: #0b0b0d;
    --surface: #17171b;
    --surface-trans: rgba(23, 23, 27, 0.7);
    --accent: #dc2626;
    --details: #c0c4cc;
    --text-main: #f4f4f5;
    --text-muted: #9ca3af;
    --glow: 0 0 20px rgba(220, 38, 38, 0.15);
    --radius: 4px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    margin: 0;
    background: #050505;
    padding: clamp(0.5rem, 3vw, 2rem);
    color: var(--text-main);
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    hyphens: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.2;
}

a { color: var(--text-main); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* Core Layout */
.app-frame {
    background: var(--base);
    border: 1px solid var(--details);
    min-height: calc(100vh - clamp(1rem, 6vw, 4rem));
    display: flex;
    flex-direction: column;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-core {
    max-width: 72ch;
    margin: 0 auto;
}

/* Header */
.site-header {
    position: static;
    border-bottom: 1px solid var(--surface);
    background: var(--base);
    z-index: 50;
}

.header-top {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-weight: 800;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 1px;
}

.header-nav {
    border-top: 1px solid var(--surface);
    padding: 0.75rem 0;
    text-align: center;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--details);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--details);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Nav Overlay */
.mobile-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--details);
    padding: 2rem 1.5rem;
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 40;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.mobile-overlay.active { display: flex; }
.mobile-overlay a {
    font-size: 1.125rem;
    font-weight: 800;
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 1.5rem;
    background: var(--surface);
    overflow: hidden;
    border-bottom: 1px solid var(--details);
}

.hero-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    filter: grayscale(100%) contrast(1.2);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.fact-card {
    background: var(--surface-trans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--details);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--glow);
    min-width: 300px;
}

.fact-card h3 {
    font-size: 0.875rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    padding-bottom: 0.5rem;
}

.fact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.fact-list li {
    font-size: 0.875rem;
    display: flex;
    gap: 0.75rem;
}
.fact-list li::before {
    content: '■';
    color: var(--details);
    font-size: 0.5rem;
    margin-top: 0.25rem;
}

/* Stat Strip */
.stat-strip {
    background: var(--surface);
    border-bottom: 1px solid var(--surface);
    padding: 1rem 0;
}
.stat-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}
.stat-item {
    text-align: center;
}
.stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--details);
    letter-spacing: 0.05em;
}

/* UI Components */
.panel {
    background: var(--surface-trans);
    border: 1px solid rgba(192, 196, 204, 0.1);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--glow);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.panel:hover {
    transform: translateY(-2px);
    border-color: rgba(220, 38, 38, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--text-main);
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--details);
    transition: all 0.15s linear;
    text-decoration: none;
    letter-spacing: 0.05em;
}
.btn:hover, .btn:active {
    box-shadow: 0 0 0 var(--details);
    transform: translate(4px, 4px);
    color: #fff;
}

/* Tabs */
.tabs-container {
    margin: 4rem 0;
}
.tab-headers {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--surface);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 800;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.875rem;
}
.tab-btn.active, .tab-btn:hover {
    color: var(--text-main);
    border-bottom-color: var(--accent);
}
.tab-content { display: none; animation: fadeIn 0.3s var(--ease); }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Masonry / Grid */
.grid-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

/* Accordion */
.accordion {
    margin: 2rem 0;
}
details.faq-item {
    background: var(--surface);
    border: 1px solid rgba(192, 196, 204, 0.2);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
details.faq-item summary {
    padding: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
    content: '+';
    color: var(--accent);
    font-size: 1.25rem;
}
details.faq-item[open] summary::after { content: '−'; }
details.faq-item .faq-body {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(192, 196, 204, 0.1);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--details);
    border-radius: var(--radius);
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th, td {
    padding: 1rem;
    border-bottom: 1px solid rgba(192, 196, 204, 0.1);
}
th {
    background: var(--surface);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: var(--details);
}
tr:nth-child(even) { background: rgba(23, 23, 27, 0.3); }
tr:hover { background: rgba(220, 38, 38, 0.05); }

/* Forms & Tools */
.tool-panel {
    background: var(--surface);
    border: 1px solid var(--details);
    border-radius: var(--radius);
    overflow: hidden;
}
.tool-body { padding: 2rem; }
.form-group { margin-bottom: 1.5rem; }
label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--details);
    margin-bottom: 0.5rem;
}
input, textarea, select {
    width: 100%;
    background: var(--base);
    border: 1px solid rgba(192, 196, 204, 0.2);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-family: inherit;
    transition: border-color 0.2s;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}
textarea { resize: vertical; min-height: 120px; }
.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
#preview-box {
    background: var(--base);
    border: 1px dashed var(--details);
    padding: 1.5rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-family: monospace;
    color: var(--text-muted);
}

/* Page Layout Wrappers */
.page-section { padding: 4rem 0; }
.page-header {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--details);
}
.page-header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.page-header p {
    color: var(--details);
    font-weight: 700;
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--details);
    background: var(--surface);
}
.footer-stat-row {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(192, 196, 204, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-col h4 {
    font-size: 0.875rem;
    color: var(--details);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-col a {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(192, 196, 204, 0.1);
    color: var(--details);
    font-size: 0.75rem;
}

/* Utility & Animations */
.reveal-hidden { opacity: 0; transform: translateY(20px); transition: all 0.6s var(--ease); }
.reveal-visible { opacity: 1; transform: translateY(0); }
.text-crimson { color: var(--accent); }
.text-silver { color: var(--details); }

/* Article Formatting */
article h2 { margin-top: 3rem; color: var(--details); border-bottom: 1px solid rgba(192, 196, 204, 0.2); padding-bottom: 0.5rem; }
article p { margin-bottom: 1.5rem; }
article img { border: 1px solid var(--details); margin: 2rem 0; box-shadow: var(--glow); }

/* Breakpoints */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .mobile-toggle { display: block; }
    .hero-content { grid-template-columns: 1fr; }
    .footer-stat-row { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
