/* ==========================================================
   Knowledge Hub — Technical Documentation & Resource Repository
   Hero · TDS tables (with search) · Case studies · CTA · Footer
   ========================================================== */
.kh-page {
    --kh-ease: cubic-bezier(.2, .75, .25, 1);
    --kh-gold: #b77f12;
    --kh-gold-btn: #b98414;
    --kh-paper: #f7f4ef;
    --kh-tan: #b5ada0;
    --kh-row: #e2e1dd;
    --kh-line: #c9c6c0;
    --kh-ink: #0b0b0b;
    background: var(--kh-paper);
    color: var(--kh-ink);
    font-family: "Outfit", "Afacad", sans-serif;
}
.kh-page 
.kh-page h1,
.kh-page h2,
.kh-page h3 { font-family: "Inter", "Roboto", sans-serif; font-weight: 600; letter-spacing: -.01em; }
.kh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kh-page sub { font-size: .66em; line-height: 0; vertical-align: -.2em; }

/* ---------------- buttons (skewed parallelograms) ---------------- */
.kh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: clamp(50px, 4.2vw, 60px);
    padding: 0 clamp(20px, 2.1vw, 30px);
    border: 1px solid var(--kh-gold-btn);
    font-family: "Outfit", sans-serif;
    font-size: clamp(10.5px, .84vw, 12px);
    font-weight: 400;
    letter-spacing: .035em;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transform: skewX(-10deg);
    transition: background .3s, color .3s, box-shadow .3s, transform .3s var(--kh-ease);
}
.kh-btn > span { display: block; transform: skewX(10deg); }
.kh-btn-solid { background: var(--kh-gold-btn); color: #17110a; }
.kh-btn-ghost { background: rgba(4, 10, 20, .6); color: #fff; border-left: 0; }
.kh-btn-outline { background: transparent; color: #c9951f; border-left: 0; }
@media (hover: hover) {
    .kh-btn-solid:hover { background: #cc9418; box-shadow: 0 10px 26px rgba(185, 132, 20, .35); transform: skewX(-10deg) translateY(-3px); }
    .kh-btn-ghost:hover, .kh-btn-outline:hover { background: rgba(185, 132, 20, .22); color: #fff; transform: skewX(-10deg) translateY(-3px); }
}
.kh-btn:focus-visible { outline: 2px solid #f5b528; outline-offset: 4px; }

/* ---------------- hero ---------------- */
.kh-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: clamp(560px, 47.7vw, 760px);
    padding: 0 !important;
    background: #040a16;
    color: #fff;
}
.kh-hero-bg {
    position: absolute;
    inset: -5% 0;
    z-index: -2;
    background: #040a16 url("../knowledge-hub/banner.jpg") center right / cover no-repeat;
    transform: translate3d(0, var(--hy, 0px), 0);
}
.kh-hero-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(3, 8, 18, .5) 0%, rgba(3, 8, 18, .18) 45%, rgba(3, 8, 18, 0) 70%);
}
.kh-hero-inner { padding: clamp(40px, 4.8vw, 70px) 0 clamp(52px, 6vw, 92px); }
.kh-eyebrow {
    margin: 0 0 clamp(14px, 1.4vw, 20px);
    font-size: clamp(11px, .98vw, 14px);
    font-weight: 300;
    letter-spacing: .035em;
    text-transform: uppercase;
    color: #fff;
}
.kh-page .kh-hero h1 {
    margin: 0 0 clamp(26px, 4vw, 58px);
    font-size: clamp(33px, 5.1vw, 74px);
    font-weight: 600;
    line-height: 1.19;
    letter-spacing: -.008em;
    text-transform: uppercase;
    color: #fff;
}
.kh-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.kh-line > span { display: block; }
.kh-hero-copy {
    max-width: 43em;
    margin: 0 0 clamp(26px, 3.6vw, 52px);
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 300;
    line-height: 1.65;
    color: #edf0f4;
}
.kh-hero-actions { display: flex; flex-wrap: wrap; align-items: center; row-gap: 12px; }
.kh-hero-actions .kh-btn-ghost { margin-left: -1px; }

/* hero entrance (pure CSS, runs on load) */
@keyframes khUp { from { opacity: 0; translate: 0 34px; } }
@keyframes khLeft { from { opacity: 0; translate: -40px 0; } }
@keyframes khRow { from { opacity: 0; translate: -22px 0; } }
@keyframes khZoom { from { opacity: 0; scale: .95; translate: 0 26px; } }
@keyframes khRise { from { translate: 0 108%; } }
@keyframes khHeroZoom { from { scale: 1.1; } }
@keyframes khFade { from { opacity: 0; } }
.kh-hero-bg { animation: khHeroZoom 2.2s var(--kh-ease) backwards; }
.kh-eyebrow { animation: khUp .8s var(--kh-ease) .1s backwards; }
.kh-line > span { animation: khRise 1s var(--kh-ease) backwards; }
.kh-line:nth-child(1) > span { animation-delay: .2s; }
.kh-line:nth-child(2) > span { animation-delay: .34s; }
.kh-line:nth-child(3) > span { animation-delay: .48s; }
.kh-hero-copy { animation: khUp .9s var(--kh-ease) .8s backwards; }
.kh-hero-actions .kh-btn { animation: khLeft .9s var(--kh-ease) 1s backwards; }
.kh-hero-actions .kh-btn + .kh-btn { animation-delay: 1.15s; }

/* ---------------- TDS ---------------- */
.kh-tds { padding: clamp(44px, 5vw, 72px) 0 clamp(34px, 2.6vw, 38px) !important; background: var(--kh-paper); }
.kh-tds-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.kh-page .kh-tds h2 {
    margin: 0 0 clamp(12px, 1.3vw, 18px);
    font-size: clamp(23px, 2.45vw, 36px);
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
    color: #050505;
}
.kh-page .kh-tds h2 em { font-style: normal; color: var(--kh-gold); }
.kh-tds-intro p {
    max-width: 49em;
    margin: 0;
    font-size: clamp(12.5px, .97vw, 14px);
    font-weight: 400;
    line-height: 1.65;
    color: #1f1f1f;
}
.kh-search {
    position: relative;
    flex: none;
    width: clamp(240px, 23.3vw, 336px);
    height: clamp(46px, 3.8vw, 55px);
    margin-top: clamp(0px, .8vw, 12px);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 3px 16px rgba(70, 55, 30, .1);
    transition: box-shadow .3s;
}
.kh-search:focus-within { box-shadow: 0 0 0 2px rgba(183, 127, 18, .55), 0 6px 20px rgba(70, 55, 30, .12); }
.kh-search input {
    width: 100%;
    height: 100%;
    padding: 0 54px 0 20px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: 400 14px "Outfit", sans-serif;
    color: #111;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.kh-search input::placeholder { color: #a39c90; }
.kh-search input::-webkit-search-cancel-button,
.kh-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.kh-search button {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: #222;
    cursor: pointer;
    transition: color .3s, transform .3s var(--kh-ease);
}
.kh-search button:hover { color: var(--kh-gold); transform: scale(1.1); }

.kh-status { margin: 16px 0 0; font-size: 13px; color: #5a554c; }
.kh-groups { display: grid; gap: clamp(26px, 3.5vw, 50px); margin-top: clamp(26px, 3.8vw, 54px); }
.kh-group { overflow: hidden; border-radius: 8px; background: var(--kh-row); }
.kh-group[hidden], .kh-row[hidden] { display: none !important; }
.kh-page .kh-group-head {
    margin: 0;
    padding: 0 clamp(18px, 2.5vw, 36px);
    display: flex;
    align-items: center;
    min-height: clamp(54px, 5vw, 72px);
    background: var(--kh-tan);
    font-size: clamp(15px, 1.45vw, 21px);
    font-weight: 600;
    letter-spacing: -.005em;
    line-height: 1.25;
    color: #080808;
}
.kh-rows { list-style: none; margin: 0; padding: 0; }
.kh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 2vw, 28px);
    min-height: clamp(66px, 6vw, 86px);
    padding: 14px clamp(18px, 4.8vw, 70px) 14px clamp(18px, 2.5vw, 36px);
    border-top: 1px solid var(--kh-line);
    transition: background .3s;
}
.kh-row.is-first { border-top: 0; }
.kh-row-text { margin: 0; font-size: clamp(11.5px, .93vw, 13.5px); line-height: 1.5; color: #1d1d1d; }
.kh-row-text strong { margin-right: 6px; font-size: clamp(12.5px, 1.07vw, 15.5px); font-weight: 600; color: #050505; }
.kh-dl {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(120px, 11.8vw, 170px);
    height: clamp(38px, 3vw, 44px);
    border-radius: 999px;
    background: #fff;
    font-size: clamp(11.5px, .87vw, 12.5px);
    font-weight: 500;
    text-decoration: none;
    color: #0b0b0b;
    transition: background .3s, color .3s, transform .3s var(--kh-ease), box-shadow .3s;
}
.kh-dl:focus-visible { outline: 2px solid var(--kh-gold); outline-offset: 3px; }
@media (hover: hover) {
    .kh-row:hover { background: #dad8d3; }
    .kh-dl:hover { background: var(--kh-gold); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(183, 127, 18, .35); }
}
.kh-empty { margin: clamp(26px, 3.8vw, 54px) 0 0; padding: 34px 24px; border-radius: 8px; background: var(--kh-row); text-align: center; font-size: 15px; line-height: 1.6; color: #2a2a2a; }
.kh-empty[hidden] { display: none; }
.kh-empty a { color: var(--kh-gold); }

/* ---------------- case studies ---------------- */
.kh-cases {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(54px, 6vw, 88px) 0 clamp(60px, 7vw, 100px) !important;
    background: #0b0704;
    color: #fff;
}
.kh-cases-bg {
    position: absolute;
    inset: -70px 0;
    z-index: -2;
    background: #0b0704 url("../knowledge-hub/banner2.jpg") center / cover no-repeat;
    transform: translate3d(0, var(--cy, 0px), 0);
}
.kh-cases-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(9, 6, 3, .5), rgba(9, 6, 3, .1) 38%, rgba(9, 6, 3, .3));
}
.kh-page .kh-cases h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(22px, 2.45vw, 36px);
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.kh-cases-sub {
    max-width: 44em;
    margin: clamp(10px, 1.1vw, 16px) auto 0;
    text-align: center;
    font-size: clamp(12.5px, .97vw, 14px);
    font-weight: 400;
    line-height: 1.65;
    color: #f4ede2;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.kh-case-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.9vw, 27px);
    width: min(100%, 1140px);
    margin: clamp(30px, 4vw, 58px) auto 0;
}
.kh-case {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(24px, 2.8vw, 40px) clamp(20px, 2.8vw, 40px) clamp(24px, 3vw, 44px);
    border-radius: 6px;
    background: #fff;
    color: #0b0b0b;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
    transition: transform .45s var(--kh-ease), box-shadow .45s var(--kh-ease);
}
.kh-page .kh-case h3 {
    margin: 0 0 clamp(8px, 1vw, 14px);
    font-size: clamp(17px, 1.45vw, 21px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.012em;
    color: #070707;
}
.kh-sector, .kh-overview { margin: 0; font-size: clamp(12.5px, .93vw, 13.5px); line-height: 1.65; color: #1a1a1a; }
.kh-sector { margin-bottom: clamp(20px, 2.6vw, 36px); }
.kh-sector b, .kh-overview b { margin-right: 4px; font-size: clamp(13.5px, 1.07vw, 15.5px); font-weight: 600; color: #050505; }
.kh-case-link {
    margin-top: auto;
    padding-top: clamp(22px, 3vw, 40px);
    width: max-content;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #050505;
    transition: color .3s;
}
.kh-case-link:focus-visible { outline: 2px solid var(--kh-gold); outline-offset: 4px; }
@media (hover: hover) {
    .kh-case:hover { transform: translateY(-8px); box-shadow: 0 26px 56px rgba(0, 0, 0, .5), 0 0 0 1px rgba(185, 132, 20, .6); }
    .kh-case-link:hover { color: var(--kh-gold); }
}
@media (min-width: 901px) {
    .kh-page .kh-case h3 { min-height: 3.75em; }
}

/* ---------------- CTA ---------------- */
.kh-cta { padding: clamp(36px, 3.9vw, 56px) 0 clamp(36px, 3.9vw, 56px) !important; background: var(--kh-paper); }
.kh-cta-card {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: center;
    gap: 28px;
    width: min(100%, 1140px);
    margin: 0 auto;
    padding: clamp(30px, 3.8vw, 56px) clamp(24px, 4.3vw, 62px);
    border-radius: 6px;
    background: #101010;
    color: #fff;
}
.kh-page .kh-cta h2 {
    max-width: 8.6em;
    margin: 0 0 clamp(8px, 1vw, 14px);
    font-size: clamp(24px, 2.5vw, 36px);
    font-weight: 600;
    line-height: 1.15;
    color: #fff;
}
.kh-cta-text p { max-width: 17.5em; margin: 0; font-size: clamp(12.5px, .97vw, 14px); font-weight: 300; line-height: 1.6; color: #e8e8e8; }
.kh-cta-actions { display: flex; flex-wrap: wrap; align-items: center; row-gap: 12px; }
.kh-cta-actions .kh-btn-outline { margin-left: -1px; }

/* ---------------- footer ---------------- */
.kh-footer { padding: clamp(44px, 5vw, 70px) 0 clamp(36px, 4vw, 56px); background: #000; color: #a3a3a3; font-family: "Outfit", sans-serif; }
.kh-footer-grid { display: grid; grid-template-columns: minmax(0, 31%) repeat(5, max-content); column-gap: clamp(24px, 2.7vw, 40px); align-items: start; }
.kh-footer .brand img { width: clamp(160px, 15.6vw, 225px); }
.kh-footer-tag { margin: clamp(20px, 2.4vw, 34px) 0 0; font-size: clamp(11.5px, .93vw, 13.5px); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; color: #8c8c8c; }
.kh-footer-addr { margin: clamp(12px, 1.3vw, 18px) 0 0; font-size: clamp(11px, .85vw, 12.5px); font-weight: 300; line-height: 1.7; color: #9c9c9c; }
.kh-social { display: flex; gap: 16px; margin: clamp(16px, 1.8vw, 24px) 0 0; }
.kh-social a { display: block; transition: transform .3s var(--kh-ease), filter .3s; }
.kh-social img { width: 28px; height: 28px; }
.kh-social a:hover { transform: translateY(-3px); filter: brightness(1.15); }
.kh-copy { margin: clamp(12px, 1.3vw, 18px) 0 0; font-size: clamp(10.5px, .8vw, 12px); font-weight: 300; line-height: 1.6; color: #8c8c8c; }
.kh-footer-col h4 {
    margin: 0 0 clamp(12px, 1.3vw, 18px);
    font-family: "Roboto", "Outfit", sans-serif;
    font-size: clamp(13px, 1.05vw, 15px);
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: #c9983c;
}
.kh-footer-col a {
    display: block;
    margin: 0;
    padding: 4.5px 0;
    font-size: clamp(11px, .85vw, 12.5px);
    font-weight: 300;
    line-height: 1.5;
    text-decoration: none;
    color: #a3a3a3;
    transition: color .25s, transform .25s var(--kh-ease);
}
.kh-footer-col a:hover { color: #f5b528; transform: translateX(4px); }
.kh-footer a:focus-visible { outline: 2px solid #f5b528; outline-offset: 3px; }

/* ---------------- scroll reveal (class set by JS; nothing is hidden without it) ---------------- */
.kh-anim [data-r]:not(.r-in) { opacity: 0; }
.kh-anim [data-r].r-in { animation: khUp .85s var(--kh-ease) var(--d, 0s) backwards; }
.kh-anim [data-r="left"].r-in { animation-name: khLeft; animation-duration: 1s; }
.kh-anim [data-r="row"].r-in { animation-name: khRow; animation-duration: .7s; }
.kh-anim [data-r="zoom"].r-in { animation-name: khZoom; animation-duration: 1s; }
.kh-anim .r-skip, .kh-anim .r-skip * { animation: none !important; }
/* inner choreography */
.kh-anim .kh-case.r-in h3 { animation: khUp .8s var(--kh-ease) calc(var(--d, 0s) + .2s) backwards; }
.kh-anim .kh-case.r-in .kh-sector { animation: khUp .8s var(--kh-ease) calc(var(--d, 0s) + .32s) backwards; }
.kh-anim .kh-case.r-in .kh-overview { animation: khUp .8s var(--kh-ease) calc(var(--d, 0s) + .44s) backwards; }
.kh-anim .kh-case.r-in .kh-case-link { animation: khFade .8s var(--kh-ease) calc(var(--d, 0s) + .6s) backwards; }
.kh-anim .kh-cta-card.r-in .kh-btn { animation: khLeft .9s var(--kh-ease) .55s backwards; }
.kh-anim .kh-cta-card.r-in .kh-btn + .kh-btn { animation-delay: .7s; }
.kh-anim .kh-group-head.r-in { animation-duration: .9s; }
.kh-anim .kh-dl { transition-delay: 0s; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
    .kh-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
    .kh-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .kh-page .wrap { width: calc(100% - 40px); }
    .kh-hero { min-height: 0; }
    .kh-hero-bg { background-position: 72% center; }
    .kh-hero-shade { background: linear-gradient(90deg, rgba(3, 8, 18, .72), rgba(3, 8, 18, .4) 70%, rgba(3, 8, 18, .25)); }
    .kh-hero-inner { padding: 44px 0 56px; }
    .kh-tds-head { flex-direction: column; gap: 22px; }
    .kh-search { width: 100%; margin-top: 0; }
    .kh-case-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
    .kh-cases-bg { background-position: 62% center; }
    .kh-cta-card { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 640px) {
    .kh-hero-copy { max-width: none; }
    .kh-hero-actions { flex-direction: column; align-items: stretch; width: min(100%, 340px); }
    .kh-hero-actions .kh-btn { width: 100%; }
    .kh-hero-actions .kh-btn-ghost { margin-left: 0; border-left: 1px solid var(--kh-gold-btn); }
    .kh-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px 18px; }
    .kh-dl { width: 100%; max-width: 200px; height: 42px; }
    .kh-row-text strong { display: block; margin: 0 0 3px; }
    .kh-group-head { min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
    .kh-cta-actions { flex-direction: column; align-items: stretch; width: min(100%, 340px); }
    .kh-cta-actions .kh-btn { width: 100%; }
    .kh-cta-actions .kh-btn-outline { margin-left: 0; border-left: 1px solid var(--kh-gold-btn); }
    .kh-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
    .kh-footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .kh-hero-bg, .kh-eyebrow, .kh-line > span, .kh-hero-copy, .kh-hero-actions .kh-btn { animation: none; }
    .kh-hero-bg, .kh-cases-bg { transform: none !important; }
    .kh-btn, .kh-dl, .kh-case, .kh-footer-col a, .kh-social a { transition: none; }
}
@media print {
    .kh-anim [data-r] { opacity: 1 !important; animation: none !important; }
}

/* Scroll-lock for the open mobile menu: lock the root, not <body>, so the sticky header keeps its place. */
body.kh-page.menu-open { overflow: clip; }
html:has(body.kh-page.menu-open) { overflow: hidden; }
