/* =============================================================
   Peaky Blinders Experience — Feuille de style principale
   Mobile-first, vanilla CSS, tokens issus du brandbook officiel.
   ============================================================= */

/* --------- 1. Tokens --------- */
:root {
    /* Couleurs */
    --shelby-black:   #0A0A0A;
    --smoke-brown:    #1A1612;
    --wool-gray:      #2A2520;
    --wool-gray-2:    #3A3530;
    --brass:          #8B6F3F;
    --brass-light:    #A8946B;
    --blood:          #7A1F1F;
    --blood-light:    #C4544F;
    --bone:           #E8E2D5;
    --ash:            #6B6055;
    --tweed:          #3D4A3A;

    /* Couleurs sémantiques */
    --bg:             var(--shelby-black);
    --bg-2:           var(--smoke-brown);
    --surface:        var(--wool-gray);
    --surface-2:      var(--wool-gray-2);
    --accent:         var(--brass);
    --accent-2:       var(--brass-light);
    --danger:         var(--blood);
    --success:        var(--tweed);
    --text:           var(--bone);
    --text-muted:     var(--ash);
    --border:         var(--wool-gray);
    --border-strong:  var(--wool-gray-2);

    /* Typo */
    --font-display:   'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-condensed: 'Oswald', 'Arial Black', Impact, sans-serif;
    --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono:      ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Échelle typographique */
    --fs-xxs:  10px;
    --fs-xs:   11px;
    --fs-sm:   13px;
    --fs-md:   15px;
    --fs-lg:   18px;
    --fs-xl:   22px;
    --fs-2xl:  28px;
    --fs-3xl:  36px;
    --fs-4xl:  48px;
    --fs-5xl:  64px;

    /* Espacements */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 56px;
    --space-10: 80px;

    /* Rayons */
    --radius-sm: 2px;
    --radius:    4px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Ombres */
    --shadow-soft:   0 4px 24px rgba(0,0,0,.4);
    --shadow-strong: 0 8px 32px rgba(0,0,0,.6);

    /* Transitions */
    --t-fast:   140ms ease;
    --t-base:   220ms ease;
    --t-slow:   400ms ease;

    /* Layout */
    --max-w:        1200px;
    --max-w-narrow: 720px;
    --bottom-nav-h: 64px;
    --topbar-h:     60px;

    /* Safe areas (iOS) */
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --------- 2. Reset --------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-md);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; transition: color var(--t-fast); }
a:hover, a:focus-visible { color: var(--accent); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

/* --------- 3. Typographie --------- */
.eyebrow {
    font-size: var(--fs-xxs);
    letter-spacing: 4px;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 600;
}
.eyebrow--muted { color: var(--text-muted); }
.eyebrow--blood { color: var(--blood-light); }

.display {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 3px;
    line-height: 1;
    color: var(--text);
}
.display--xl { font-size: clamp(40px, 9vw, 64px); }
.display--lg { font-size: clamp(32px, 7vw, 48px); }
.display--md { font-size: clamp(24px, 5.5vw, 36px); }

.heading {
    font-family: var(--font-condensed);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.15;
    color: var(--text);
}
.heading--xl { font-size: var(--fs-3xl); }
.heading--lg { font-size: var(--fs-2xl); }
.heading--md { font-size: var(--fs-xl); }
.heading--sm { font-size: var(--fs-lg); }

.label {
    font-size: var(--fs-xxs);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-2);
    font-weight: 700;
}

.muted { color: var(--text-muted); }
.serif { font-family: var(--font-display); }
.italic { font-style: italic; }
.center { text-align: center; }

/* Quote signature Peaky */
.quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--fs-lg);
    color: var(--text);
    line-height: 1.4;
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}
.quote::before { content: "\201C"; color: var(--accent); font-size: 1.5em; line-height: 0; vertical-align: -0.4em; margin-right: 4px; }
.quote::after  { content: "\201D"; color: var(--accent); font-size: 1.5em; line-height: 0; vertical-align: -0.4em; margin-left: 4px; }
.quote--source {
    display: block;
    margin-top: var(--space-4);
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--fs-xxs);
    letter-spacing: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --------- 4. Layout --------- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: var(--space-5);
}
.container--narrow { max-width: var(--max-w-narrow); }

.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-7); }

.divider {
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: var(--space-5) auto;
    border: 0;
}
.divider--full { width: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }

/* --------- 5. Boutons --------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 14px 28px;
    font-family: var(--font-condensed);
    font-size: var(--fs-xs);
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    cursor: pointer;
    user-select: none;
    text-align: center;
    line-height: 1.2;
    min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(139,111,63,.25);
}
.btn--primary:hover { background: var(--accent-2); color: var(--bg); }

.btn--ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn--ghost:hover { background: rgba(139,111,63,.12); color: var(--accent-2); }

.btn--danger {
    background: var(--blood);
    color: var(--bone);
}
.btn--danger:hover { background: #8e2525; }

.btn--link {
    background: transparent;
    color: var(--accent-2);
    border: 0;
    border-bottom: 1px solid var(--accent-2);
    padding: 8px 0;
    min-height: 0;
    border-radius: 0;
}
.btn--link:hover { color: var(--accent); border-color: var(--accent); }

.btn--block { width: 100%; }
.btn--lg    { padding: 18px 32px; font-size: var(--fs-sm); }
.btn--sm    { padding: 10px 18px; font-size: 10px; min-height: 36px; }

/* --------- 6. Cartes --------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: var(--space-6);
}
.card--accent { border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.card--blood  { border-left: 3px solid var(--blood); border-radius: 0 var(--radius) var(--radius) 0; }
.card--top {
    border-top: 2px solid var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-2);
}
.card--ghost { background: transparent; }

/* Numéros romains pour les actes */
.act-number {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: var(--fs-3xl);
    color: var(--accent);
    line-height: 1;
}
.act-number--blood { color: var(--blood); }

/* --------- 7. Badges --------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: var(--fs-xxs);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 800;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    color: var(--accent-2);
    background: var(--bg-2);
}
.badge--solid    { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.badge--blood    { background: var(--blood); color: var(--bone); border-color: var(--blood); }
.badge--success  { background: var(--tweed); color: var(--bone); border-color: var(--tweed); }
.badge--ghost    { background: transparent; }
.badge--vip      { background: var(--accent); color: var(--bg); font-weight: 900; }

/* --------- 8. Forms --------- */
.field { margin-bottom: var(--space-5); }
.field__label {
    display: block;
    font-size: var(--fs-xxs);
    letter-spacing: 3px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
    font-weight: 700;
}
.field__hint {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.field__error {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--blood-light);
}
.input,
.textarea,
.select {
    display: block;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-size: var(--fs-md);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus,
.textarea:focus,
.select:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139,111,63,.18);
}
.input::placeholder,
.textarea::placeholder { color: var(--ash); }
.textarea { min-height: 120px; resize: vertical; }

/* Checkbox custom — rétro/Peaky */
.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
    width: 22px; height: 22px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
    flex-shrink: 0;
}
.check input:checked + .check__box {
    background: var(--accent);
}
.check input:checked + .check__box::after {
    content: "";
    width: 6px; height: 11px;
    border-right: 2px solid var(--bg);
    border-bottom: 2px solid var(--bg);
    transform: rotate(45deg) translate(-1px, -1px);
}

/* --------- 9. Alertes / messages --------- */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.alert--error   { border-color: var(--blood); color: var(--bone); background: rgba(122,31,31,.18); }
.alert--success { border-color: var(--tweed); color: var(--bone); background: rgba(61,74,58,.2); }
.alert--info    { border-color: var(--accent); color: var(--bone); background: rgba(139,111,63,.12); }

/* --------- 10. Hero (homepage) --------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--space-9) + var(--safe-top)) var(--space-5) var(--space-9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(139,111,63,.18), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.hero__smoke {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(closest-side at 20% 80%, rgba(168,148,107,.08), transparent 60%),
        radial-gradient(closest-side at 80% 20%, rgba(168,148,107,.06), transparent 60%);
    opacity: 0;
    animation: smoke-rise 14s ease-in-out 1.5s infinite alternate;
}
.hero__above-fold {
    position: relative;
    z-index: 2;
    max-width: 720px;
}
.hero__byorder {
    font-size: var(--fs-xxs);
    letter-spacing: 6px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}
.hero__title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--bone);
    line-height: 1;
    font-size: clamp(44px, 11vw, 84px);
    margin: 0 0 var(--space-2);
}
.hero__subtitle {
    font-size: var(--fs-sm);
    letter-spacing: 8px;
    color: var(--accent-2);
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}
.hero__quote {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--accent-2);
    font-size: var(--fs-md);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto var(--space-7);
}
.hero__cta-row {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* --------- 11. Compte à rebours --------- */
.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: var(--space-3);
    max-width: 520px;
    margin: var(--space-7) auto 0;
}
.countdown__cell {
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-top: 2px solid var(--accent);
    padding: var(--space-4) var(--space-2);
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
}
.countdown__num {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(28px, 8vw, 44px);
    color: var(--bone);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: block;
}
.countdown__label {
    margin-top: var(--space-2);
    display: block;
    font-size: var(--fs-xxs);
    letter-spacing: 3px;
    color: var(--accent-2);
    text-transform: uppercase;
}

/* --------- 12. Logo --------- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-align: left;
}
.logo__title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--bone);
    line-height: 1;
    letter-spacing: 2px;
    font-size: var(--fs-xl);
}
.logo__subtitle {
    font-size: 9px;
    letter-spacing: 5px;
    color: var(--accent-2);
    text-transform: uppercase;
    margin-top: 4px;
}
.logo__cap { color: var(--accent); display: inline-flex; }

/* Logo lock-up (avec lignes) */
.logo-lockup {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}
.logo-lockup__rule {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.logo-lockup__rule::before,
.logo-lockup__rule::after {
    content: "";
    width: 40px;
    height: 1px;
    background: var(--accent);
}

/* --------- 13. Topbar (app) --------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border-strong);
    padding: calc(var(--safe-top) + 12px) var(--space-5) 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.topbar__brand .logo__title { font-size: var(--fs-lg); }
.topbar__brand .logo__subtitle { font-size: 8px; letter-spacing: 4px; }

.topbar__action {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--accent-2);
    position: relative;
}
.topbar__action[data-badge]:not([data-badge="0"])::after {
    content: attr(data-badge);
    position: absolute;
    top: -4px; right: -4px;
    background: var(--blood);
    color: var(--bone);
    font-size: 9px;
    letter-spacing: 0;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --------- 14. Bottom nav (mobile) --------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: var(--bg);
    border-top: 1px solid var(--accent);
    padding: 8px var(--space-2) calc(8px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}
.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    color: var(--text-muted);
    border-radius: var(--radius);
    text-decoration: none;
    transition: color var(--t-fast);
}
.bottom-nav__item.is-active { color: var(--accent); }
.bottom-nav__item.is-active .bottom-nav__icon { transform: translateY(-2px); }
.bottom-nav__item:hover { color: var(--accent-2); }
.bottom-nav__icon {
    transition: transform var(--t-fast);
    width: 22px; height: 22px;
}
.bottom-nav__label {
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

/* Espace pour bottom-nav sur mobile */
.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-5)); }

/* --------- 15. Page wrappers --------- */
.page {
    padding: var(--space-7) 0;
}
.page__head {
    text-align: center;
    margin-bottom: var(--space-7);
}

/* --------- 16. Animations --------- */
@keyframes smoke-rise {
    0%   { opacity: .3; transform: translateY(0) scale(1); }
    50%  { opacity: .8; }
    100% { opacity: .4; transform: translateY(-20px) scale(1.05); }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: .55; }
}
.fade-in   { animation: fade-up var(--t-slow) ease both; }
.flicker   { animation: flicker 4s infinite; }
.delay-1   { animation-delay: .1s; }
.delay-2   { animation-delay: .25s; }
.delay-3   { animation-delay: .45s; }
.delay-4   { animation-delay: .7s; }

/* Curtain reveal */
@keyframes curtain {
    from { transform: scaleY(1); }
    to   { transform: scaleY(0); }
}
.curtain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--shelby-black);
    transform-origin: top;
    animation: curtain 1.1s cubic-bezier(.86,0,.07,1) .3s forwards;
    pointer-events: none;
}

/* --------- 17. Utilitaires --------- */
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* --------- 18. Responsive --------- */
@media (min-width: 768px) {
    :root {
        --fs-md: 16px;
    }
    .container { padding-inline: var(--space-6); }
    .section { padding-block: var(--space-10); }
    .bottom-nav { display: none; }
    .has-bottom-nav { padding-bottom: 0; }
}

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