/* ============================================
   Rod's Tools — Apple-Inspired Edition (v2)
   Minimal, balanced, premium, reading-focused.
   ============================================ */

:root {
    /* Palette — inspired by Apple's restrained system */
    --ink:        #1d1d1f;
    --ink-soft:   #424245;
    --ink-mute:   #6e6e73;
    --ink-faint:  #86868b;
    --line:       #d2d2d7;
    --line-soft:  #e8e8ed;
    --paper:      #ffffff;
    --paper-warm: #fbfbfd;
    --paper-alt:  #f5f5f7;
    --accent:     #0071e3;  /* Apple blue */
    --accent-dk:  #0058b9;
    --night:      #000000;
    --night-soft: #1d1d1f;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Helvetica, Arial, sans-serif;

    /* Page geometry (A4) */
    --page-w: 210mm;
    --page-h: 297mm;
    --safety: 7mm;   /* Espace vide en bas de chaque page */
    --pad-x:  22mm;
    --pad-t:  18mm;
    --pad-b:  14mm;
}

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

html, body {
    background: #e8e8ed;
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    padding: 40px 0 100px;
    display: flex;
    justify-content: center;
}

.deck {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ========== PAGE FRAME ========== */
.page {
    width: var(--page-w);
    height: var(--page-h);
    background: var(--paper);
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.04);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
}

.page__inner {
    flex: 1;
    padding: var(--pad-t) var(--pad-x) var(--pad-b);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* The mandatory empty millimeter band at the very bottom of every page */
.page__safety {
    height: var(--safety);
    background: transparent; /* hérite de la couleur de la page parente */
    flex-shrink: 0;
}

/* Page variants */
.page--light   { background: var(--paper); }
.page--alt     { background: var(--paper-warm); }
.page--product { background: var(--paper-alt); }
.page--dark    { background: var(--night); color: #f5f5f7; }
.page--hero    {
    background: radial-gradient(ellipse at 30% 20%, #f5f5f7 0%, #ffffff 60%);
}

/* ========== TOPBAR ========== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-mute);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 38px;
}
.topbar--invert {
    color: rgba(255,255,255,.55);
    border-bottom-color: rgba(255,255,255,.10);
}
.wordmark {
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -.01em;
    text-transform: none;
    font-size: 13px;
}
.topbar--invert .wordmark { color: #fff; }
.topbar__meta { font-weight: 500; }

/* ========== TYPOGRAPHY ========== */
.kicker {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 18px;
}
.kicker--accent { color: var(--accent); }
.kicker--invert { color: #7ec5ff; }

.display {
    font-size: 78px;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.035em;
    color: var(--ink);
}
.display--md { font-size: 56px; line-height: 1.04; letter-spacing: -.03em; }
.display--invert { color: #fff; }
.display__accent {
    background: linear-gradient(135deg, #0071e3 0%, #56c5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.page--dark .display__accent {
    background: linear-gradient(135deg, #56c5ff 0%, #b39bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.headline {
    font-size: 46px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.025em;
    color: var(--ink);
    margin-bottom: 22px;
}

.lead {
    font-size: 20px;
    line-height: 1.45;
    color: var(--ink-mute);
    font-weight: 400;
    max-width: 560px;
    margin-top: 28px;
    letter-spacing: -.005em;
}

.body-lead {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-soft);
    font-weight: 400;
    max-width: 620px;
    letter-spacing: -.003em;
}
.body-lead--invert { color: rgba(255,255,255,.72); }

/* ========== PAGE 1 — HERO ========== */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
}
.hero .kicker { color: var(--ink-mute); }

/* ========== SECTION SHELL ========== */
.section { margin-bottom: 40px; }

/* ========== PILLARS (PAGE 2) ========== */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 30px;
}
.pillar {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 26px 22px;
    transition: transform .4s ease, box-shadow .4s ease;
}
.pillar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
}
.pillar__icon {
    display: inline-flex;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--paper-alt);
    color: var(--accent);
    margin-bottom: 18px;
}
.pillar__icon svg { width: 22px; height: 22px; }
.pillar h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
    margin-bottom: 8px;
}
.pillar p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-mute);
}

/* ========== VALUES (PAGE 3) ========== */
.values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-top: 30px;
    border-top: 1px solid var(--line-soft);
}
.value {
    padding: 28px 30px 28px 0;
    border-bottom: 1px solid var(--line-soft);
    position: relative;
}
.value:nth-child(even) { padding-left: 30px; padding-right: 0; border-left: 1px solid var(--line-soft); }
.value:nth-last-child(-n+2) { border-bottom: 0; }

.value__num {
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: .08em;
    font-weight: 500;
    display: block;
    margin-bottom: 14px;
}
.value__icon {
    display: inline-flex;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    color: var(--accent);
    align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.value__icon svg { width: 20px; height: 20px; }
.value h3 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.012em;
    margin-bottom: 6px;
}
.value p {
    font-size: 14px;
    color: var(--ink-mute);
    line-height: 1.5;
    max-width: 320px;
}

/* ========== PRODUCT HEROES ========== */
.product-hero { margin-bottom: 40px; }
.product-hero .body-lead { margin-top: 22px; }
.contact-hero { margin-bottom: 36px; }
.contact-hero .body-lead { margin-top: 22px; }

/* Product URL pill (landing page link) */
.product-url {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 10px 18px 10px 14px;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 980px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -.005em;
    transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.product-url:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, .12);
}
.product-url__icon { width: 16px; height: 16px; opacity: .8; }
.product-url__arrow {
    width: 14px;
    height: 14px;
    transition: transform .25s ease;
    margin-left: 2px;
}
.product-url:hover .product-url__arrow { transform: translateX(3px); }

.product-url--invert {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    color: #7ec5ff;
    backdrop-filter: blur(20px);
}
.product-url--invert:hover {
    border-color: rgba(126, 197, 255, .6);
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 6px 16px rgba(126, 197, 255, .15);
}

/* ========== FEATURES (PAGE 4) ========== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 24px;
}
.feature {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: 22px 20px;
    transition: border-color .3s ease, transform .3s ease;
}
.feature:hover {
    border-color: var(--line);
    transform: translateY(-2px);
}
.feature__icon {
    display: inline-flex;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--paper-warm);
    color: var(--accent);
    align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.feature__icon svg { width: 20px; height: 20px; }
.feature h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    letter-spacing: -.005em;
}
.feature p {
    font-size: 13px;
    color: var(--ink-mute);
    line-height: 1.45;
}

/* ========== RTG (PAGE 5 — DARK) ========== */
.rtg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 30px;
}
.rtg-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 24px 22px;
    backdrop-filter: blur(20px);
}
.rtg-card__icon {
    display: inline-flex;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    color: #7ec5ff;
    align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.rtg-card__icon svg { width: 22px; height: 22px; }
.rtg-card h4 {
    font-size: 17px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -.01em;
}
.rtg-card p {
    font-size: 14px;
    color: rgba(255,255,255,.6);
    line-height: 1.5;
}

/* ========== CONTACT (PAGE 6) ========== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 36px;
}
.contact-card {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.contact-card:hover {
    transform: translateY(-2px);
    border-color: var(--line);
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.contact-card__icon {
    display: inline-flex;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--paper-warm);
    color: var(--accent);
    align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.contact-card__icon svg { width: 22px; height: 22px; }
.contact-card__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-faint);
    font-weight: 500;
}
.contact-card__value {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -.005em;
}

/* ========== CTA BUTTONS ========== */
.cta-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 36px;
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 980px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -.005em;
    cursor: pointer;
    text-decoration: none;
    transition: background .25s ease, transform .25s ease;
}
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }
.btn-primary__icon {
    width: 16px; height: 16px;
    transition: transform .25s ease;
}
.btn-primary:hover .btn-primary__icon { transform: translateX(3px); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: transparent;
    color: var(--accent);
    border: 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 980px;
    text-decoration: none;
    transition: background .25s ease;
}
.btn-ghost:hover { background: var(--paper-alt); }
.btn-ghost__icon { width: 16px; height: 16px; }

/* ========== PAGE FOOT ========== */
.page__foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.page__foot--invert {
    color: rgba(255,255,255,.45);
    border-top-color: rgba(255,255,255,.08);
}
/* Bloc final page 6 : logo + footer ancré au bas, footer identique aux autres pages */
.final-block {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.final-block .page__foot { margin-top: 0; }
.final-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
}

/* ========== PRINT BUTTON (UI ONLY) ========== */
.print-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 12px 22px;
    background: var(--ink);
    color: #fff;
    border: 0;
    border-radius: 980px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    z-index: 999;
    transition: transform .2s ease, background .2s ease;
}
.print-btn:hover { transform: translateY(-2px); background: var(--night); }

/* ========== RESPONSIVE PREVIEW (screen only) ========== */
@media screen and (max-width: 900px) {
    body { padding: 16px 0 80px; }
    .page {
        width: 100%;
        height: auto;
        min-height: 100vh;
    }
    .page__inner { padding: 32px 24px; }
    .display { font-size: 52px; }
    .display--md { font-size: 38px; }
    .headline { font-size: 32px; }
    .pillars, .features, .contact-grid { grid-template-columns: 1fr; }
    .values, .rtg-grid { grid-template-columns: 1fr; }
    .value:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ========== PRINT ========== */
@media print {
    @page { size: A4 portrait; margin: 0; }

    html, body {
        background: #fff;
        padding: 0;
        margin: 0;
        display: block;
        width: 210mm;
    }

    .deck { gap: 0; display: block; }

    .page {
        width: 210mm;
        height: 297mm;
        box-shadow: none;
        border-radius: 0;
        page-break-after: always;
        break-after: page;
        overflow: hidden;
    }
    .page:last-child { page-break-after: auto; break-after: auto; }

    .page__inner {
        padding: var(--pad-t) var(--pad-x) var(--pad-b);
    }

    /* Force le layout desktop quel que soit le viewport d'impression */
    .pillars, .features, .contact-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .values, .rtg-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .value:nth-child(even) {
        padding-left: 30px !important;
        padding-right: 0 !important;
        border-left: 1px solid var(--line-soft) !important;
    }

    /* Préserve les couleurs et fonds Apple */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Fallback : Chrome rend mal le background-clip:text en impression
       (carré plein au lieu du texte). On utilise une couleur unie. */
    .display__accent {
        background: none !important;
        -webkit-text-fill-color: var(--accent) !important;
        color: var(--accent) !important;
    }
    .page--dark .display__accent {
        -webkit-text-fill-color: #7ec5ff !important;
        color: #7ec5ff !important;
    }

    /* Sécurité : aucune animation/opacity restante */
    .page, .pillar, .value, .feature, .rtg-card, .contact-card {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .print-btn { display: none !important; }
}
