
:root {
    --bg-deep: #000000;
    --bg-primary: #0D0D0D;
    --bg-secondary: #1A1A1A;
    --accent-red: #E2192C;
    --accent-amber: #F5A623;
    --text-main: #E8E8E8;
    --text-secondary: #888888;
    --text-muted: #666666;
    --border-dim: #2A2A2A;
    --font-titles: 'Oswald', sans-serif;
    --font-body: 'Source Sans Pro', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* section:nth-of-type(even) removed — Tailwind bg-* classes handle section backgrounds explicitly */

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-family: var(--font-titles);
    text-transform: uppercase;
    font-weight: 700;
}

h1 {
    font-size: 4rem;
    letter-spacing: -1px;
}

h2 {
    margin-bottom: 1.5rem;
}

h3, h4 {
    text-transform: none;
    font-weight: 400;
}

/* Article content — scoped colors (no color on h/p per cascade gotcha) */
#article-content h2 {
    margin-bottom: 1rem;
    padding-bottom: 0;
}
#article-content h3, #article-content h4 {
    margin-bottom: 0.75rem;
}
#article-content p {
    margin-bottom: 1.25rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

code, pre, .tablature {
    font-family: var(--font-mono);
    background: #111;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* HEADER */
header {
    background-color: var(--bg-deep);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-dim);
}

.logo {
    font-family: var(--font-titles);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.logo span:first-child { color: #FFF; }
.logo span:last-child { color: var(--accent-red); }

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav ul li a {
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-red);
    transform: scaleX(0);
    transition: transform var(--transition);
    transform-origin: right;
}

nav ul li a:hover {
    color: var(--accent-red);
}

nav ul li a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* HERO SECTION */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(13,13,13,1)), url('https://images.unsplash.com/photo-1550985616-10810253b84d?q=80&w=2000') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
}

.hero h1 {
    color: #FFF;
    margin-bottom: 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero p {
    color: #AAA;
    font-size: 1.5rem;
    max-width: 800px;
}

/* ARTICLE CARDS */
.container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}

.card:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(226, 25, 44, 0.15);
    transform: translateY(-5px);
}

.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    filter: grayscale(20%) contrast(110%);
}

.card-content {
    padding: 1.5rem;
}

.badge {
    color: var(--accent-red);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.card-title {
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* BOXES / ENCADRÉS */
.box {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid;
}

.box-advice {
    background-color: #1E1410;
    border-color: var(--accent-amber);
}

.box-error {
    background-color: #1A0A0A;
    border-color: var(--accent-red);
}

.box-definition {
    background-color: #111;
    border-color: #444;
}

/* TABLES */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: #111;
}

th {
    background-color: var(--accent-red);
    color: #FFF;
    text-align: left;
    padding: 1rem;
    font-family: var(--font-titles);
}

td {
    padding: 1rem;
    border: 1px solid var(--border-dim);
}

/* FOOTER */
footer {
    background-color: var(--bg-deep);
    padding: 4rem 5% 2rem;
    border-top: 1px solid var(--border-dim);
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    text-align: center;
    grid-column: 1 / -1;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #FFF;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a, .footer-col p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--accent-red);
}

/* SEPARATORS */
hr {
    border: 0;
    border-top: 1px solid var(--border-dim);
    margin: 3rem 0;
}

/* ANIMATIONS */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: revealScroll 0.6s ease-out forwards;
}

@keyframes revealScroll {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ═══════════════════════════════════════════════════
   HARDEN — Text overflow, tables, forms, print styles
═══════════════════════════════════════════════════ */

/* Text overflow hardening */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

p, li, td, th {
    overflow-wrap: break-word;
}

/* Tables: horizontal scroll on mobile */
.table-wrapper, table {
    overflow-x: auto;
    display: block;
    width: 100%;
}

table {
    display: table;
    min-width: 400px;
}

/* Forms / selects / inputs — dark theme contrast fix */
select, input, textarea {
    color: var(--text-main);
    background-color: #1A1A1A;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
}

select:focus, input:focus, textarea:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
    border-color: var(--accent-red);
}

/* Image fallback */
img {
    max-width: 100%;
    height: auto;
}

img[src=""], img:not([src]) {
    background: var(--bg-secondary);
    min-height: 100px;
}

/* Safe area support (iOS notch) */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Print styles */
@media print {
    header, footer, .mobile-menu, #mobile-menu, nav {
        display: none !important;
    }
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    a { color: inherit; }
    h1, h2, h3 { color: #333; }
    .hero, section[class*="bg-"] {
        background: none !important;
        color: black !important;
    }
}

/* ═══════════════════════════════════════════════════
   POLISH — Scrollbar, easing, card hover, tinted neutrals
═══════════════════════════════════════════════════ */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Custom easing */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Enhanced card hover */
.card:hover, a.card:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 25px rgba(226, 25, 44, 0.2), 0 8px 32px rgba(0,0,0,0.4);
    transform: translateY(-4px);
    transition: all 0.3s var(--ease-out-expo);
}

/* Tablature block */
.tablature {
    font-family: var(--font-mono);
    background: #0A0A0A;
    color: var(--accent-red);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--border-dim);
    line-height: 1.8;
    white-space: pre;
}

/* Pre / code blocks */
pre {
    background: #0A0A0A;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    line-height: 1.6;
}

code {
    font-size: 0.875em;
}

/* Focus visible — keyboard nav */
:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 3px;
}

/* Advice / encadré boxes */
.advice-box, .box-advice {
    background-color: #1E1410;
    border-left: 4px solid var(--accent-amber);
    padding: 1.25rem 1.5rem;
    border-radius: 0 6px 6px 0;
}

.bg-advice {
    background-color: #1E1410;
    border-left: 4px solid var(--accent-amber);
}

.bg-error {
    background-color: #1A0A0A;
    border-left: 4px solid var(--accent-red);
}

.bg-definition {
    background-color: #111111;
    border-left: 4px solid #444444;
}

/* Hero image max-width */
.hero-img-wrapper {
    max-width: 1360px;
    margin: 0 auto;
}

/* Mega-menu dropdown opacity fix */
header nav .group > div {
    background-color: #0A0A0A;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS — Reveal, micro-interactions
═══════════════════════════════════════════════════ */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* Button hover pulse */
a[class*="bg-primary"]:hover,
button[class*="bg-primary"]:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    transition: all 0.2s var(--ease-out-expo);
}

/* Image hover zoom */
.card img, a.card img, article img.group-hover\:scale-110 {
    transition: transform 0.5s var(--ease-out-expo);
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════════════════ */

@media (max-width: 640px) {
    body { font-size: 16px; }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
    .container { padding: 0 1rem; }
    .tablature { font-size: 0.8rem; }
    table { min-width: unset; display: block; }
}