/* ============================================================
   AI Data Agent — productpagina (Spation AI Data Agent).
   Prefix: ad-. Gedeelde tokens en componenten staan in site.css.
   De plakhoogtes --banner-h en --sticky-h (banner, banner + subnavigatie) zet site.js.
   ============================================================ */

@keyframes ad-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 145, 77, .55); }
    50% { box-shadow: 0 0 0 16px rgba(255, 145, 77, 0); }
}

/* Koppen zonder balance waar het ontwerp dat ook niet heeft */
.ad-nobalance { text-wrap: wrap; }

/* --- Subnavigatie ------------------------------------------- */
.ad-subnav {
    position: sticky; top: var(--banner-h); z-index: 30;
    background: var(--navy-2); border-bottom: 1px solid var(--navy-line);
    color: var(--on-dark); line-height: normal;
}
.ad-subnav__inner {
    display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center;
    gap: 12px clamp(20px, 3vw, 32px);
    padding-top: 10px; padding-bottom: 10px;
    overflow-x: auto; scrollbar-width: none;
}
.ad-subnav__inner::-webkit-scrollbar { display: none; }
.ad-subnav__left { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 16px clamp(20px, 3vw, 32px); white-space: nowrap; }
.ad-subnav__name { font: 600 clamp(16px, 2vw, 18px) var(--font-display); }
.ad-subnav__links { display: flex; flex-wrap: nowrap; gap: 12px clamp(16px, 2.2vw, 24px); font-size: 14px; color: var(--on-dark-2); }
.ad-subnav__actions { flex: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ad-subnav__btn { padding: 9px 16px; border: 1px solid var(--navy-line); border-radius: 10px; font-size: clamp(14px, 1.7vw, 15px); }
.ad-subnav__btn--orange { border: 0; background: var(--orange); color: var(--navy); font-weight: 600; }

/* --- Hero --------------------------------------------------- */
.ad-hero { background: var(--navy); color: var(--on-dark); }
.ad-hero__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: clamp(24px, 3.5vw, 40px); align-items: center;
    padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(52px, 8.5vw, 104px);
}
.ad-hero__copy { display: flex; flex-direction: column; gap: clamp(18px, 2.6vw, 28px); animation: rise .8s ease-out both; }
.ad-hero__lead { max-width: 540px; }
.ad-hero__meta { font: 400 14px var(--font-mono); color: var(--on-dark-3); }
.ad-hero__media {
    height: clamp(220px, 40vw, 520px);
    display: flex; align-items: center; justify-content: center;
    animation: rise 1s .15s ease-out both;
}
.ad-hero__media img { width: 100%; height: 100%; object-fit: contain; display: block; animation: bob 6s ease-in-out infinite; }

/* --- Secties (licht) ---------------------------------------- */
.ad-section { scroll-margin-top: var(--sticky-h); }
.ad-section__inner { display: flex; flex-direction: column; padding-top: var(--section-y); padding-bottom: var(--section-y); }
.ad-head { display: flex; flex-direction: column; gap: 14px; }
.ad-head--narrow { max-width: 820px; }
.ad-head__lead { font-size: clamp(16px, 2.1vw, 19px); line-height: 1.55; color: var(--text-2); text-wrap: pretty; }

/* 01 · Het probleem */
.ad-problem { gap: clamp(28px, 4vw, 48px); }
.ad-problem__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ad-problem__card {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: clamp(20px, 2.6vw, 28px); display: flex; flex-direction: column; gap: 10px;
}
.ad-problem__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--orange); }
.ad-problem__card h3 { font: 600 clamp(18px, 2.4vw, 22px) var(--font-display); }
.ad-problem__card p { color: var(--text-2); line-height: 1.5; }

/* --- 02 · In actie ------------------------------------------ */
.ad-action { background: var(--blue); color: var(--on-dark); }
.ad-action__inner {
    display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px);
    padding-top: clamp(52px, 8.5vw, 104px); padding-bottom: clamp(52px, 8.5vw, 104px);
}
.ad-action__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px clamp(28px, 4vw, 48px); }
.ad-action__head .ad-head { max-width: 720px; }
.ad-action__intro { font-size: clamp(16px, 2vw, 18px); line-height: 1.55; color: #e4eefa; max-width: 380px; text-wrap: pretty; }

.ad-demo {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(18px, 2.6vw, 28px);
    padding: clamp(18px, 3vw, 36px);
    background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 24px;
    box-shadow: 0 40px 80px -40px rgba(11, 27, 51, .6);
}

/* Tabel met ongeclassificeerde data */
.ad-table {
    flex: 1 1 440px; min-width: min(100%, 440px);
    display: flex; flex-direction: column; gap: 6px;
    padding: clamp(14px, 2.4vw, 24px); border-radius: 16px;
    background: var(--surface-soft); color: var(--navy); line-height: normal;
}
.ad-table__label { font: 400 14px var(--font-mono); color: var(--text-3); padding-bottom: 8px; }
.ad-table__grid { display: flex; flex-direction: column; gap: 6px; }
.ad-table__row {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px 56px 52px; gap: 8px;
    padding: 10px 8px; border-radius: 8px;
    font-size: clamp(14px, 1.7vw, 15px);
    transition: background-color .4s;
}
.ad-table__row > :first-child { font-weight: 600; }
.ad-table__row--head { padding: 6px 8px; border-radius: 0; border-bottom: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--text-2); }
.ad-table__row.is-active { background: var(--orange-soft); }
.ad-table__note { padding-top: 8px; font-size: 13px; font-style: italic; color: var(--text-3); }
/* Smal scherm: vaste kolommen krapper, anders overlapt de productnaam de volgende kolom */
@media (max-width: 460px) {
    .ad-table__row { grid-template-columns: 18px minmax(0, 1fr) 54px 44px 46px; gap: 6px; padding: 10px 6px; }
    .ad-table__row--head { padding: 6px; font-size: 13px; }
}

/* De agent in het midden */
.ad-agent { flex: 0 0 160px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ad-agent__orb {
    width: 120px; height: 120px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background: var(--blue); color: var(--on-dark);
    font: 700 clamp(16px, 2.1vw, 19px)/1.1 var(--font-display);
    animation: ad-glow 2.4s ease-in-out infinite;
}
.ad-agent__phase { min-height: 36px; font: 400 13px var(--font-mono); color: var(--blue-pale); text-align: center; }

/* BIM-elementen */
.ad-els { flex: 1 1 360px; min-width: min(100%, 360px); display: flex; flex-direction: column; gap: 10px; color: var(--on-dark); line-height: normal; }
.ad-els__label { font: 400 14px var(--font-mono); color: var(--blue-pale); }
.ad-el {
    display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
    background: var(--navy); border: 1px solid var(--navy-line); border-radius: 12px;
    transition: border-color .4s;
}
.ad-el.is-filled { border-color: var(--blue); }
.ad-el.is-current { border-color: var(--orange); }
.ad-el__top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: clamp(14px, 1.7vw, 15px); }
.ad-el__tag { flex: none; font: 400 13px var(--font-mono); color: var(--text-3); }
.ad-el__tag.is-on { color: var(--orange); }
.ad-el__vals { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 13px; color: var(--on-dark-3); }
.ad-el__vals b { color: var(--orange); font-weight: 600; white-space: nowrap; }

/* --- 03 · Hoe het werkt ------------------------------------- */
.ad-how { gap: clamp(24px, 3.5vw, 40px); }
.ad-how__body { display: flex; flex-wrap: wrap; align-items: stretch; gap: clamp(20px, 3vw, 32px) clamp(28px, 4vw, 48px); }
.ad-how__side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.ad-tabs { display: flex; flex-direction: column; gap: 8px; }
.ad-tab {
    display: flex; flex-direction: column; gap: 6px; padding: 20px 22px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    text-align: left; line-height: normal;
    transition: background-color .25s, border-color .25s;
}
.ad-tab__num { font: 500 14px var(--font-mono); color: var(--blue-dark); }
.ad-tab__text { font-size: clamp(15px, 1.8vw, 16px); line-height: 1.45; color: var(--text-2); }
.ad-tab.is-active { background: var(--navy); border-color: var(--navy); }
.ad-tab.is-active .ad-tab__num { color: var(--orange); }
.ad-tab.is-active .ad-tab__text { color: var(--on-dark-4); }
.ad-how__hint { padding: 8px 4px; font: 400 13px var(--font-mono); color: var(--text-3); }
.ad-how__panel {
    flex: 2 1 480px; min-width: min(100%, 480px); min-height: clamp(300px, 50vw, 540px);
    display: grid; align-items: center;
    padding: clamp(20px, 3vw, 32px); border-radius: 20px; background: var(--navy);
}
/* Alle schermafbeeldingen op dezelfde plek; alleen de actieve is zichtbaar */
.ad-how__pane { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; min-width: 0; visibility: hidden; }
.ad-how__pane.is-active { visibility: visible; }
.ad-how__pane img { display: block; width: auto; height: auto; max-width: 100%; max-height: 476px; object-fit: contain; border-radius: 8px; }
.ad-how__pane.is-active img { animation: rise .45s ease-out both; }

/* --- 04 · Use cases ----------------------------------------- */
.ad-uc { background: var(--navy); color: var(--on-dark); scroll-margin-top: var(--sticky-h); }
.ad-uc__grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: clamp(32px, 5vw, 56px); align-items: center;
    padding-top: clamp(52px, 8.5vw, 104px); padding-bottom: clamp(52px, 8.5vw, 104px);
}
.ad-uc__copy { display: flex; flex-direction: column; gap: clamp(16px, 2.2vw, 24px); min-width: 0; }
.ad-uc__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-pill {
    min-height: 44px; padding: 10px 16px; border-radius: 999px;
    border: 1px solid var(--navy-line); background: transparent; color: var(--on-dark);
    font: 500 clamp(14px, 1.7vw, 15px) var(--font-body);
    transition: background-color .2s;
}
.ad-pill.is-active { background: var(--bg); border-color: var(--bg); color: var(--navy); }
.ad-uc__cases { display: grid; }
.ad-case {
    grid-area: 1 / 1; display: flex; flex-direction: column; gap: clamp(16px, 2.2vw, 24px);
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .5s ease, transform .5s ease, visibility .5s;
}
.ad-case.is-active { opacity: 1; visibility: visible; transform: none; }
.ad-case__title { font: 600 clamp(28px, 5vw, 48px)/1.05 var(--font-display); letter-spacing: -1.5px; text-wrap: balance; }
.ad-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 20px;
    padding-top: 24px; border-top: 1px solid var(--navy-line);
}
.ad-stats__label { grid-column: 1 / -1; font: 400 13px var(--font-mono); color: var(--blue-pale); letter-spacing: 1px; }
.ad-stat { display: flex; flex-direction: column; gap: 4px; }
.ad-stat__num { font: 600 clamp(28px, 4.6vw, 44px) var(--font-display); }
.ad-stat__num--accent { color: var(--orange); }
.ad-stat__cap { font-size: clamp(14px, 1.7vw, 15px); line-height: normal; color: var(--on-dark-2); }
.ad-case__logo { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.ad-case__logo span { padding: 10px 14px; border-radius: 10px; background: var(--surface-soft); }
.ad-case__logo img { display: block; width: auto; height: 36px; }
.ad-case__text { font-size: clamp(15px, 1.8vw, 16px); line-height: 1.55; color: var(--on-dark-2); text-wrap: pretty; }
.ad-uc__media { display: grid; }
.ad-uc__img {
    grid-area: 1 / 1; align-self: center; display: block; width: 100%; height: auto;
    opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s;
}
.ad-uc__img.is-active { opacity: 1; visibility: visible; }

/* --- Licentie en demo --------------------------------------- */
.ad-cta-section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.ad-cta { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 20px; }
.ad-cta .cta-card { scroll-margin-top: calc(var(--sticky-h) + 16px); }
