/* ==========================================================================
   BYALYS — Cabinet digital. Thème clair, éditorial, institutionnel.
   Display: Instrument Serif · Texte: IBM Plex Sans · Mono: IBM Plex Mono
   ========================================================================== */

:root {
    --paper:      #fbfaf6;   /* fond principal, blanc cassé chaud */
    --paper-2:    #f4f1e8;   /* sections alternées */
    --surface:    #ffffff;
    --line:       #e6e1d4;
    --line-strong:#cfc8b5;
    --ink:        #14171f;   /* texte principal */
    --ink-dim:    #4a4f5b;   /* texte secondaire */
    --muted:      #7a7f8c;
    --accent:     #1a3a5c;   /* marine profond */
    --accent-2:   #2a5a8c;
    --accent-soft:rgba(26, 58, 92, .08);
    --accent-ink: #ffffff;
    --danger:     #b04444;

    --nav-h: 76px;
    --radius: 16px;
    --radius-sm: 10px;
    --ease: cubic-bezier(.22, 1, .36, 1);

    --display: 'Instrument Serif', 'Times New Roman', serif;
    --sans: 'IBM Plex Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.02rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

main { padding-top: var(--nav-h); }

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Typography ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: -.01em;
    line-height: 1.1;
    color: var(--ink);
}
.display-4 { font-size: clamp(2.4rem, 5vw, 3.7rem); }
.display-5 { font-size: clamp(2rem, 4vw, 2.9rem); }
.display-6 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.lead { font-size: 1.13rem; color: var(--ink-dim); font-weight: 400; }

/* Bootstrap colour remaps ------------------------------------------------ */
.bg-primary { background: var(--accent) !important; color: #fff !important; }
.bg-light   { background: var(--paper-2) !important; }
.bg-dark    { background: var(--ink) !important; }
.text-white, .text-light { color: #fff !important; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--accent) !important; }
.text-white-50 { color: rgba(255, 255, 255, .7) !important; }
hr { border-color: var(--line); opacity: 1; }

/* Buttons ---------------------------------------------------------------- */
.btn {
    font-family: var(--sans);
    font-weight: 500;
    font-size: .96rem;
    letter-spacing: 0;
    border-radius: 999px;
    padding: .75rem 1.6rem;
    border: 1px solid transparent;
    transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .35s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: .95rem 2rem; font-size: 1rem; }

.btn-primary, .btn-light {
    background: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
    box-shadow: 0 6px 24px -10px rgba(26, 58, 92, .4);
}
.btn-primary:hover, .btn-light:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff !important;
    box-shadow: 0 12px 30px -10px rgba(26, 58, 92, .5);
}
.btn-outline-light, .btn-outline-primary {
    background: transparent;
    color: var(--ink) !important;
    border-color: var(--line-strong);
}
.btn-outline-light:hover, .btn-outline-primary:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent) !important;
}

/* Cards ------------------------------------------------------------------ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
}
.card.bg-primary { background: var(--accent) !important; color: #fff !important; }
.shadow, .shadow-sm { box-shadow: 0 8px 30px -16px rgba(20, 23, 31, .15) !important; }
.card-title { color: var(--ink); font-family: var(--display); font-weight: 400; }

/* Generic icon medallion (Bootstrap rounded-circle blocks) --------------- */
.rounded-circle.bg-primary,
.bg-primary.bg-opacity-10 {
    background: var(--accent-soft) !important;
    border: 1px solid rgba(26, 58, 92, .15);
}
.bg-primary.bg-opacity-10 .text-primary,
.rounded-circle .text-primary { color: var(--accent) !important; }

/* Badges ----------------------------------------------------------------- */
.badge.bg-primary {
    background: var(--paper-2) !important;
    color: var(--accent) !important;
    border: 1px solid var(--line);
    font-family: var(--sans);
    font-weight: 500;
    letter-spacing: 0;
    padding: .5em .85em;
    border-radius: 999px;
}

/* Forms ------------------------------------------------------------------ */
.form-label {
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink);
}
.form-control {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: .8rem 1rem;
    font-family: var(--sans);
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Alerts ----------------------------------------------------------------- */
.alert {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    color: var(--ink);
    border-radius: var(--radius-sm);
}
.alert-error, .alert-danger { border-left-color: var(--danger); }

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar.fixed-top {
    height: var(--nav-h);
    background: rgba(251, 250, 246, .9) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.navbar-brand {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.55rem;
    letter-spacing: 0;
    color: var(--ink) !important;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.navbar-brand::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.navbar .nav-link {
    font-family: var(--sans);
    font-size: .95rem;
    font-weight: 400;
    color: var(--ink-dim) !important;
    padding: .4rem 1rem !important;
    position: relative;
    transition: color .2s;
}
.navbar .nav-link:hover { color: var(--ink) !important; }
.navbar .nav-link.active { color: var(--accent) !important; font-weight: 500; }
.navbar .nav-link.active::after {
    content: "";
    position: absolute;
    left: 1rem; right: 1rem; bottom: .1rem;
    height: 1.5px;
    background: var(--accent);
    border-radius: 2px;
}
.navbar-toggler {
    border: 1px solid var(--line-strong);
    padding: .4rem .55rem;
}
.navbar-toggler:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='%231a3a5c' stroke-width='2.2' stroke-linecap='round' d='M5 8h20M5 15h20M5 22h20'/%3e%3c/svg%3e");
}
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 18px 40px -14px rgba(20, 23, 31, .18);
}
.dropdown-item { color: var(--ink-dim); font-size: .92rem; }
.dropdown-item:hover { background: var(--paper-2); color: var(--ink); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer.bg-dark {
    background: var(--ink) !important;
    border-top: 1px solid var(--line);
    margin-top: 0 !important;
    padding-top: 4rem !important;
    padding-bottom: 2rem !important;
}
footer h5 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.6rem;
    color: #fff;
}
footer h6 {
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, .6);
}
footer a { color: rgba(255, 255, 255, .75) !important; transition: color .2s; }
footer a:hover { color: #fff !important; }
footer .text-muted { color: rgba(255, 255, 255, .55) !important; }
footer .social-links a {
    display: inline-flex;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    margin-top: .5rem;
}
footer .social-links a:hover {
    border-color: rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .05);
}

/* ==========================================================================
   GENERIC HERO (services page etc.)
   ========================================================================== */
.hero {
    position: relative;
    border-bottom: 1px solid var(--line);
}
.hero.bg-primary { background: transparent !important; }
.hero .fa-10x {
    font-size: 7rem;
    color: var(--accent);
    opacity: .1 !important;
}

.service-card { transition: transform .4s var(--ease), border-color .3s; }
.service-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.step-number.bg-primary {
    background: var(--accent) !important;
    color: #fff !important;
    font-family: var(--display);
    font-weight: 400;
}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */
.by-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--accent);
}
.by-eyebrow::before {
    content: "";
    width: 24px; height: 1.5px;
    background: var(--accent);
}

.by-section-head { max-width: 700px; }
.by-section-head h2 { margin-top: 1rem; }
.by-section-head p { color: var(--ink-dim); margin-top: 1rem; font-size: 1.13rem; }

/* --- Hero --------------------------------------------------------------- */
.by-hero {
    position: relative;
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
    border-bottom: 1px solid var(--line);
}
.by-hero__grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.by-hero__title {
    font-size: clamp(2.8rem, 6.5vw, 5rem);
    margin: 1.4rem 0 0;
    font-weight: 400;
    letter-spacing: -.015em;
}
.by-hero__title em {
    font-style: italic;
    color: var(--accent);
}
.by-hero__text {
    margin: 1.6rem 0 2.2rem;
    font-size: 1.18rem;
    color: var(--ink-dim);
    max-width: 32rem;
}
.by-hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; }
.by-hero__meta {
    margin-top: 3rem;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}
.by-stat__num {
    font-family: var(--display);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
}
.by-stat__label {
    font-family: var(--sans);
    font-size: .9rem;
    color: var(--ink-dim);
    margin-top: .5rem;
}

/* --- Hero visual card (replaces terminal) ------------------------------- */
.by-hero-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem;
    box-shadow: 0 24px 60px -32px rgba(20, 23, 31, .25);
    position: relative;
}
.by-hero-card__label {
    font-family: var(--sans);
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
}
.by-hero-card__title {
    font-family: var(--display);
    font-size: 1.65rem;
    margin: 0 0 1.5rem;
    line-height: 1.2;
}
.by-hero-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.by-hero-card__list li {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: .9rem 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 1rem;
}
.by-hero-card__list li:first-child { border-top: none; padding-top: 0; }
.by-hero-card__list i {
    color: var(--accent);
    margin-top: .25rem;
    flex: none;
    width: 22px;
    text-align: center;
}

/* --- Marquee ------------------------------------------------------------ */
.by-marquee {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--paper-2);
    padding: 1.2rem 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.by-marquee__track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: by-scroll 38s linear infinite;
}
.by-marquee span {
    font-family: var(--sans);
    font-size: .98rem;
    font-weight: 500;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 3rem;
    white-space: nowrap;
}
.by-marquee span::after { content: "•"; color: var(--accent); font-weight: 700; }
@keyframes by-scroll { to { transform: translateX(-50%); } }

/* --- Services grid ------------------------------------------------------ */
.by-section { padding: clamp(4rem, 9vw, 7rem) 0; }
.by-svc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
    margin-top: 3rem;
}
.by-svc {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    overflow: hidden;
    transition: transform .45s var(--ease), border-color .3s, box-shadow .35s var(--ease);
}
.by-svc::after {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease);
}
.by-svc:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 40px -20px rgba(20, 23, 31, .15);
}
.by-svc:hover::after { transform: scaleX(1); }
.by-svc__no {
    font-family: var(--sans);
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}
.by-svc__icon {
    width: 56px; height: 56px;
    margin: 1.2rem 0 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.35rem;
}
.by-svc h3 {
    font-size: 1.55rem;
    margin: 0 0 .7rem;
    font-weight: 400;
}
.by-svc p { color: var(--ink-dim); font-size: 1rem; margin: 0 0 1.3rem; }
.by-svc__tags {
    list-style: none;
    margin: 0; padding: 1.3rem 0 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.by-svc__tags li {
    font-family: var(--sans);
    font-size: .82rem;
    color: var(--ink-dim);
    padding: .3rem .8rem;
    background: var(--paper-2);
    border-radius: 999px;
}

/* --- Process ------------------------------------------------------------ */
.by-process { border-top: 1px solid var(--line); background: var(--paper-2); }
.by-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.3rem;
    margin-top: 3rem;
    counter-reset: step;
}
.by-step {
    padding: 1.9rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    position: relative;
}
.by-step::before {
    counter-increment: step;
    content: "0" counter(step);
    font-family: var(--display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
    opacity: .35;
}
.by-step h4 { font-size: 1.2rem; margin: .8rem 0 .4rem; font-weight: 400; }
.by-step p { color: var(--ink-dim); font-size: .95rem; margin: 0; }

/* --- CTA ---------------------------------------------------------------- */
.by-cta { padding: clamp(3rem, 7vw, 5rem) 0 clamp(4rem, 8vw, 6rem); }
.by-cta__panel {
    position: relative;
    background: var(--accent);
    color: #fff;
    border-radius: clamp(20px, 3vw, 28px);
    padding: clamp(2.8rem, 6vw, 4.8rem);
    text-align: center;
    overflow: hidden;
}
.by-cta__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 255, 255, .08), transparent 70%);
    pointer-events: none;
}
.by-cta__panel > * { position: relative; }
.by-cta__panel .by-eyebrow { color: rgba(255, 255, 255, .85); }
.by-cta__panel .by-eyebrow::before { background: rgba(255, 255, 255, .85); }
.by-cta__panel h2 {
    color: #fff;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    margin: 1rem auto .8rem;
    max-width: 18ch;
}
.by-cta__panel p {
    color: rgba(255, 255, 255, .82);
    font-size: 1.13rem;
    max-width: 42ch;
    margin: 0 auto 2rem;
}
.by-cta__panel .btn {
    background: #fff;
    color: var(--accent) !important;
    border-color: #fff;
    box-shadow: none;
}
.by-cta__panel .btn:hover { background: var(--paper); border-color: var(--paper); color: var(--accent) !important; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

[data-load] {
    opacity: 0;
    transform: translateY(16px);
    animation: by-load .9s var(--ease) forwards;
}
[data-load="1"] { animation-delay: .05s; }
[data-load="2"] { animation-delay: .16s; }
[data-load="3"] { animation-delay: .27s; }
[data-load="4"] { animation-delay: .38s; }
[data-load="5"] { animation-delay: .5s; }
@keyframes by-load { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    [data-load] { opacity: 1; transform: none; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .navbar.fixed-top { background: rgba(251, 250, 246, .98) !important; }
    .navbar-collapse {
        margin-top: .8rem;
        padding-top: .8rem;
        border-top: 1px solid var(--line);
    }
    .by-hero__grid { grid-template-columns: 1fr; }
    .by-hero-card { order: -1; }
    .by-svc-grid { grid-template-columns: 1fr; }
    .by-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .by-steps { grid-template-columns: 1fr; }
    .by-hero__actions .btn { width: 100%; text-align: center; }
    .by-hero__meta { gap: 1.5rem; }
}

/* ==========================================================================
   VALUE BAND (home)
   ========================================================================== */
.by-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
    margin-top: 3rem;
}
.by-value {
    padding: 2rem 1.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.by-value__icon {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.by-value h4 { font-size: 1.3rem; margin: 0 0 .5rem; font-weight: 400; }
.by-value p { color: var(--ink-dim); font-size: .98rem; margin: 0; }

/* ==========================================================================
   PAGE HERO (inner pages)
   ========================================================================== */
.by-page-hero {
    padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
    border-bottom: 1px solid var(--line);
}
.by-page-hero h1 {
    font-size: clamp(2.5rem, 5.5vw, 4.2rem);
    margin: 1.2rem 0 0;
    max-width: 20ch;
    font-weight: 400;
    letter-spacing: -.01em;
}
.by-page-hero p {
    margin: 1.4rem 0 0;
    font-size: 1.15rem;
    color: var(--ink-dim);
    max-width: 54ch;
}

/* ==========================================================================
   DETAILED SERVICE BLOCKS (services page)
   ========================================================================== */
.by-detail-list {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    margin-top: 3rem;
}
.by-detail {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.8rem, 4vw, 2.8rem);
    transition: border-color .3s, box-shadow .35s var(--ease);
}
.by-detail:hover {
    border-color: var(--line-strong);
    box-shadow: 0 14px 36px -20px rgba(20, 23, 31, .12);
}
.by-detail__head {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.by-detail__no {
    font-family: var(--sans);
    font-size: .9rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0;
}
.by-detail__icon {
    width: 56px; height: 56px;
    flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.3rem;
}
.by-detail__head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; font-weight: 400; }
.by-detail__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    margin-top: 1.7rem;
    padding-top: 1.7rem;
    border-top: 1px solid var(--line);
}
.by-detail__body > p { margin: 0; color: var(--ink-dim); font-size: 1.02rem; }
.by-detail__incl {
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 .9rem;
}
.by-feature-list { list-style: none; margin: 0; padding: 0; }
.by-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .35rem 0;
    color: var(--ink-dim);
    font-size: .98rem;
}
.by-feature-list li::before {
    content: "→";
    color: var(--accent);
    font-family: var(--sans);
    font-weight: 500;
}
.by-detail__tags {
    list-style: none;
    margin: 1.6rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.by-detail__tags li {
    font-family: var(--sans);
    font-size: .82rem;
    color: var(--ink-dim);
    padding: .3rem .8rem;
    background: var(--paper-2);
    border-radius: 999px;
}

@media (max-width: 767px) {
    .by-values { grid-template-columns: 1fr; }
    .by-detail__body { grid-template-columns: 1fr; }
}
