/* ==========================================================================
   Knightsphere design system
   Layered on Bootstrap 5.3. Light theme with dark navy contrast sections.
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
}

:root {
  --ks-ink: #0a0f1f;
  --ks-navy: #0f1730;
  --ks-navy-2: #16203f;
  --ks-accent: #3d5afe;
  --ks-accent-600: #2f47e0;
  --ks-accent-050: #eef1ff;
  --ks-accent-100: #dfe5ff;
  --ks-cyan: #22d3ee;
  --ks-text: #0a0f1f;
  --ks-muted: #586178;
  --ks-subtle: #8a92a6;
  --ks-line: #e5e8f0;
  --ks-line-dark: rgba(255, 255, 255, .1);
  --ks-surface: #ffffff;
  --ks-surface-2: #f6f7fb;
  --ks-surface-3: #eef0f6;
  --ks-radius: 1rem;
  --ks-radius-lg: 1.5rem;
  --ks-shadow-sm: 0 1px 2px rgba(10, 15, 31, .06);
  --ks-shadow: 0 1px 2px rgba(10, 15, 31, .04), 0 8px 24px -8px rgba(10, 15, 31, .12);
  --ks-shadow-lg: 0 2px 4px rgba(10, 15, 31, .04), 0 24px 48px -16px rgba(10, 15, 31, .22);
  --ks-ease: cubic-bezier(.2, .7, .2, 1);
  --ks-header-h: 76px;

  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ks-text);
  --bs-body-bg: var(--ks-surface);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.7;
  --bs-primary: var(--ks-accent);
  --bs-primary-rgb: 61, 90, 254;
  --bs-link-color: var(--ks-accent);
  --bs-link-color-rgb: 61, 90, 254;
  --bs-link-hover-color: var(--ks-accent-600);
  --bs-link-hover-color-rgb: 47, 71, 224;
  --bs-border-color: var(--ks-line);
  --bs-secondary-color: var(--ks-muted);
  --bs-emphasis-color: var(--ks-ink);
  --bs-focus-ring-color: rgba(61, 90, 254, .35);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--ks-header-h) + 1rem); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01"; }
::selection { background: var(--ks-accent); color: #fff; }

h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5 {
  font-weight: 700; letter-spacing: -.025em; color: var(--ks-ink); line-height: 1.12;
}
h1, .h1 { font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem); letter-spacing: -.035em; }
h2, .h2 { font-size: clamp(1.85rem, 1.45rem + 1.7vw, 2.75rem); letter-spacing: -.03em; }
h3, .h3 { font-size: clamp(1.25rem, 1.15rem + .4vw, 1.5rem); }
h4, .h4 { font-size: 1.15rem; }
.lead { font-size: clamp(1.075rem, 1rem + .3vw, 1.25rem); color: var(--ks-muted); line-height: 1.65; font-weight: 400; }
.text-muted, .text-body-secondary { color: var(--ks-muted) !important; }
a { text-underline-offset: .2em; }
img, svg { max-width: 100%; }
.bi { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; flex-shrink: 0; }

:focus-visible { outline: 3px solid var(--ks-accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden-focusable:focus { position: fixed !important; top: .75rem; left: .75rem; z-index: 2000; background: var(--ks-ink); color: #fff; padding: .6rem 1rem; border-radius: .5rem; }

/* Layout ----------------------------------------------------------------- */
.section { padding-block: clamp(4rem, 3rem + 5vw, 7.5rem); position: relative; }
.section-sm { padding-block: clamp(3rem, 2.5rem + 3vw, 5rem); }
.section-alt { background: var(--ks-surface-2); }
.container { --bs-gutter-x: 2rem; }
@media (min-width: 1400px) { .container { max-width: 1240px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ks-accent); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: currentColor; border-radius: 2px; }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head.text-center { margin-inline: auto; }
.section-head.text-center .eyebrow::after { content: ""; width: 1.5rem; height: 2px; background: currentColor; border-radius: 2px; }
.section-head p { margin-bottom: 0; }

/* Dark sections */
.section-dark {
  background: var(--ks-ink); color: rgba(255, 255, 255, .72);
  --ks-line: var(--ks-line-dark);
  isolation: isolate; overflow: hidden;
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4, .section-dark .h5 { color: #fff; }
.section-dark .lead, .section-dark .text-muted { color: rgba(255, 255, 255, .68) !important; }
.section-dark .eyebrow { color: #8fa2ff; }
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-grid-light {
  background-image:
    linear-gradient(rgba(10, 15, 31, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 15, 31, .045) 1px, transparent 1px);
  background-size: 56px 56px;
}
.glow { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: -1; opacity: .55; }
.glow-accent { background: var(--ks-accent); }
.glow-cyan { background: var(--ks-cyan); opacity: .25; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600; --bs-btn-padding-y: .8rem; --bs-btn-padding-x: 1.4rem;
  --bs-btn-border-radius: 999px; --bs-btn-font-size: .975rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  transition: transform .2s var(--ks-ease), box-shadow .2s var(--ks-ease), background-color .2s, color .2s, border-color .2s;
}
.btn-sm { --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; --bs-btn-font-size: .875rem; }
.btn-lg { --bs-btn-padding-y: 1rem; --bs-btn-padding-x: 1.75rem; --bs-btn-font-size: 1.05rem; }
.btn .bi { transition: transform .2s var(--ks-ease); }
.btn:hover .bi-arrow { transform: translateX(3px); }
.btn-primary {
  --bs-btn-bg: var(--ks-accent); --bs-btn-border-color: var(--ks-accent);
  --bs-btn-hover-bg: var(--ks-accent-600); --bs-btn-hover-border-color: var(--ks-accent-600);
  --bs-btn-active-bg: var(--ks-accent-600); --bs-btn-active-border-color: var(--ks-accent-600);
  --bs-btn-disabled-bg: var(--ks-accent); --bs-btn-disabled-border-color: var(--ks-accent);
  box-shadow: 0 8px 20px -8px rgba(61, 90, 254, .6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(61, 90, 254, .7); }
.btn-dark {
  --bs-btn-bg: var(--ks-ink); --bs-btn-border-color: var(--ks-ink);
  --bs-btn-hover-bg: var(--ks-navy-2); --bs-btn-hover-border-color: var(--ks-navy-2);
}
.btn-outline-dark {
  --bs-btn-color: var(--ks-ink); --bs-btn-border-color: var(--ks-line);
  --bs-btn-hover-bg: var(--ks-ink); --bs-btn-hover-border-color: var(--ks-ink);
  background: #fff;
}
.btn-outline-light { --bs-btn-border-color: rgba(255, 255, 255, .25); --bs-btn-hover-color: var(--ks-ink); }
.btn-light { --bs-btn-color: var(--ks-ink); }
.link-arrow {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; color: var(--ks-accent);
}
.link-arrow .bi { transition: transform .2s var(--ks-ease); }
.link-arrow:hover .bi, a:hover .link-arrow .bi { transform: translateX(4px); }

/* Header ----------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--ks-line); box-shadow: 0 6px 24px -18px rgba(10, 15, 31, .4); background: rgba(255, 255, 255, .92); }
.site-header .navbar { min-height: var(--ks-header-h); padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ks-ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.brand:hover { color: var(--ks-ink); }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; }
.site-header .nav-link {
  --bs-nav-link-color: var(--ks-ink); --bs-nav-link-hover-color: var(--ks-accent);
  font-weight: 550; font-size: .95rem; padding: .55rem .85rem !important; border-radius: .6rem; position: relative;
}
.site-header .nav-link.active { color: var(--ks-accent); }
@media (min-width: 1200px) {
  .site-header .nav-link.active::after {
    content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--ks-accent);
  }
}
.site-header .dropdown-toggle::after { display: none; }
.site-header .dropdown-toggle .bi { font-size: .7rem; margin-left: .2rem; transition: transform .2s; }
.site-header .dropdown-toggle.show .bi { transform: rotate(180deg); }
.navbar-toggler { border: 1px solid var(--ks-line); padding: .55rem .7rem; border-radius: .75rem; font-size: 1.25rem; color: var(--ks-ink); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }

.mega-menu {
  --bs-dropdown-border-color: var(--ks-line); --bs-dropdown-border-radius: 1.25rem;
  --bs-dropdown-link-active-bg: var(--ks-accent-050); --bs-dropdown-link-active-color: var(--ks-ink);
  padding: 1rem; box-shadow: var(--ks-shadow-lg);
}
@media (min-width: 1200px) {
  .mega-menu { width: min(860px, 92vw); left: 50% !important; transform: translateX(-38%); margin-top: .6rem !important; }
  .mega-menu.show { animation: menu-in .2s var(--ks-ease); }
}
@keyframes menu-in { from { opacity: 0; transform: translate(-38%, 6px); } to { opacity: 1; transform: translate(-38%, 0); } }
.mega-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
.mega-item {
  display: flex; gap: .8rem; align-items: flex-start; padding: .75rem .85rem; border-radius: .9rem;
  color: var(--ks-ink); text-decoration: none; transition: background-color .15s;
}
.mega-item:hover, .mega-item:focus-visible { background: var(--ks-surface-2); color: var(--ks-ink); }
.mega-item .icon-chip { width: 2.25rem; height: 2.25rem; font-size: 1rem; border-radius: .7rem; }
.mega-item strong { display: block; font-size: .9rem; font-weight: 650; line-height: 1.35; }
.mega-item span { display: block; font-size: .8rem; color: var(--ks-muted); line-height: 1.45; margin-top: .15rem; }
.mega-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: .75rem; padding: .9rem 1rem; border-radius: .9rem; background: var(--ks-surface-2); font-size: .9rem;
}

@media (max-width: 1199.98px) {
  .site-header .navbar-collapse {
    max-height: calc(100vh - var(--ks-header-h)); overflow-y: auto; padding: .5rem 0 1.5rem; border-top: 1px solid var(--ks-line); margin-top: .5rem;
  }
  .site-header .nav-link { padding: .8rem .25rem !important; font-size: 1.05rem; border-bottom: 1px solid var(--ks-line); border-radius: 0; display: flex; justify-content: space-between; align-items: center; }
  .mega-menu { border: 0; box-shadow: none; padding: .25rem 0 .75rem; background: transparent; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-item { padding: .6rem .25rem; }
  .mega-item span { display: none; }
  .mega-footer { display: none; }
  .header-cta { margin-top: 1.25rem; width: 100%; }
}
@media (min-width: 768px) and (max-width: 1199.98px) { .mega-grid { grid-template-columns: 1fr 1fr; } }

/* Icon chips ------------------------------------------------------------- */
.icon-chip {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 3rem; height: 3rem; border-radius: .9rem; font-size: 1.3rem;
  background: var(--ks-accent-050); color: var(--ks-accent);
  box-shadow: inset 0 0 0 1px rgba(61, 90, 254, .12);
}
.icon-chip-lg { width: 3.75rem; height: 3.75rem; font-size: 1.6rem; border-radius: 1.1rem; }
.icon-chip-dark { background: rgba(143, 162, 255, .1); color: #a9b6ff; box-shadow: inset 0 0 0 1px rgba(143, 162, 255, .2); }

/* Hero ------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(4rem, 3rem + 5vw, 7rem); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(61, 90, 254, .12), transparent 60%),
    radial-gradient(40rem 24rem at 0% 110%, rgba(34, 211, 238, .08), transparent 60%);
}
.hero .bg-grid-light { position: absolute; inset: 0; z-index: -1; mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%); }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.8vw, 4.5rem); letter-spacing: -.045em; line-height: 1.04; }
.hero h1 .accent { color: var(--ks-accent); }
.hero .lead { max-width: 36rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 2.25rem; font-size: .9rem; color: var(--ks-muted); }
.hero-badges span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-badges .bi { color: var(--ks-accent); }
.pill {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem .35rem .4rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--ks-line); font-size: .85rem; font-weight: 550; color: var(--ks-ink); box-shadow: var(--ks-shadow-sm);
  margin-bottom: 1.5rem;
}
.pill b { background: var(--ks-ink); color: #fff; font-size: .7rem; letter-spacing: .06em; padding: .2rem .55rem; border-radius: 999px; font-weight: 700; }

/* Hero visual: browser mockup + floating cards */
.hero-visual { position: relative; max-width: 560px; margin-inline: auto; padding: 1.5rem 0 2.5rem; }
.mock-browser { background: #fff; border-radius: 1.1rem; border: 1px solid var(--ks-line); box-shadow: var(--ks-shadow-lg); overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem .9rem; border-bottom: 1px solid var(--ks-line); background: var(--ks-surface-2); }
.mock-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: #d7dbe6; }
.mock-url { margin-left: .75rem; flex: 1; height: 1.4rem; border-radius: 999px; background: #fff; border: 1px solid var(--ks-line); font-size: .7rem; color: var(--ks-subtle); display: flex; align-items: center; padding-inline: .7rem; gap: .35rem; }
.mock-body { padding: 1.1rem; display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
.mock-panel { border-radius: .8rem; background: var(--ks-surface-2); padding: .9rem; }
.mock-panel.wide { grid-column: span 2; }
.mock-panel.dark { background: var(--ks-ink); color: #c9d1ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; line-height: 1.8; }
.mock-panel.dark .k { color: #8fa2ff; } .mock-panel.dark .s { color: #67e8f9; } .mock-panel.dark .c { color: #5b6585; }
.mock-line { height: .5rem; border-radius: 999px; background: #dfe3ee; margin-bottom: .45rem; }
.mock-line.accent { background: var(--ks-accent); opacity: .85; }
.w-40 { width: 40%; } .w-55 { width: 55%; } .w-70 { width: 70%; } .w-85 { width: 85%; }
.mock-bars { display: flex; align-items: flex-end; gap: .35rem; height: 4.2rem; margin-top: .6rem; }
.mock-bars span { flex: 1; border-radius: .3rem .3rem .15rem .15rem; background: var(--ks-accent-100); }
.mock-bars span:nth-child(odd) { background: var(--ks-accent); opacity: .85; }
.float-card {
  position: absolute; background: #fff; border: 1px solid var(--ks-line); border-radius: 1rem; box-shadow: var(--ks-shadow-lg);
  padding: .8rem 1rem; display: flex; align-items: center; gap: .7rem; font-size: .82rem; line-height: 1.35;
}
.float-card strong { display: block; font-size: .85rem; color: var(--ks-ink); }
.float-card small { color: var(--ks-muted); }
.float-card .icon-chip { width: 2.3rem; height: 2.3rem; font-size: 1rem; border-radius: .7rem; }
.float-ai { left: -1.5rem; bottom: .25rem; }
.float-drupal { right: -1.25rem; top: -.25rem; }
.orbit { position: absolute; inset: -12% -8%; z-index: -1; pointer-events: none; }
@media (max-width: 575.98px) { .float-ai { left: .25rem; } .float-drupal { right: .25rem; } }
@media (prefers-reduced-motion: no-preference) {
  .float-card { animation: float 6s ease-in-out infinite; }
  .float-drupal { animation-delay: -3s; }
  .orbit circle.spin { transform-origin: center; animation: spin 40s linear infinite; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards ------------------------------------------------------------------ */
.card-ks {
  position: relative; height: 100%; background: #fff; border: 1px solid var(--ks-line); border-radius: var(--ks-radius-lg);
  padding: clamp(1.5rem, 1.25rem + 1vw, 2rem); transition: transform .3s var(--ks-ease), box-shadow .3s var(--ks-ease), border-color .3s;
  display: flex; flex-direction: column;
}
.card-ks h2, .card-ks h3 { font-size: 1.2rem; margin: 1.25rem 0 .6rem; }
.card-ks p { color: var(--ks-muted); font-size: .95rem; margin-bottom: 1.25rem; }
.card-ks .link-arrow { margin-top: auto; font-size: .92rem; }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--ks-shadow-lg); border-color: transparent; }
.card-link .stretched-link:focus-visible { outline: none; }
.card-link:has(.stretched-link:focus-visible) { outline: 3px solid var(--ks-accent); outline-offset: 3px; }
.card-link h3 a { color: inherit; text-decoration: none; }

.card-highlight { padding: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem); overflow: hidden; }
.card-highlight::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  border: 1px solid var(--ks-line); box-shadow: 0 0 0 24px rgba(61, 90, 254, .025), 0 0 0 48px rgba(61, 90, 254, .02);
  transition: transform .5s var(--ks-ease);
}
.card-highlight:hover::after { transform: scale(1.15); }
.card-highlight .num { position: absolute; right: 1.75rem; top: 1.5rem; font-size: .8rem; font-weight: 700; color: var(--ks-subtle); letter-spacing: .08em; }

.card-dark { background: rgba(255, 255, 255, .03); border-color: var(--ks-line-dark); }
.card-dark p { color: rgba(255, 255, 255, .62); }
.card-dark.card-link:hover { background: rgba(255, 255, 255, .06); border-color: rgba(143, 162, 255, .35); box-shadow: none; }
.card-dark .link-arrow { color: #a9b6ff; }

.solution-card { flex-direction: row; gap: 1.1rem; align-items: flex-start; padding: 1.5rem; }
.solution-card h3 { margin: 0 0 .35rem; font-size: 1.08rem; }
.solution-card p { margin: 0; font-size: .9rem; }

/* Project cards */
.project-card { padding: 0; overflow: hidden; }
.project-thumb { aspect-ratio: 16 / 10; background: var(--ks-surface-3); overflow: hidden; display: block; position: relative; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ks-ease); }
.project-card:hover .project-thumb img { transform: scale(1.04); }
.project-thumb .placeholder-art { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ks-accent); font-size: 2.5rem; }
.project-body { padding: 1.5rem 1.6rem 1.75rem; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { margin: .5rem 0 .5rem; }
.tag {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--ks-accent-050); color: var(--ks-accent-600); width: fit-content;
}
.tag-neutral { background: var(--ks-surface-3); color: var(--ks-muted); }
.tag-dark { background: rgba(255, 255, 255, .08); color: #c9d1ff; }

/* Feature list ----------------------------------------------------------- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; }
.check-list .bi { color: var(--ks-accent); margin-top: .3rem; font-size: 1rem; }
.check-list.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .85rem 1.5rem; }
.section-dark .check-list .bi { color: #8fa2ff; }

.feature-row { display: flex; gap: 1rem; padding: 1.35rem 0; border-top: 1px solid var(--ks-line); }
.feature-row:first-child { border-top: 0; padding-top: 0; }
.feature-row h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
.feature-row p { margin: 0; color: var(--ks-muted); font-size: .95rem; }

/* Why section graphic */
.why-graphic { position: relative; border-radius: var(--ks-radius-lg); background: var(--ks-ink); padding: 2rem; overflow: hidden; isolation: isolate; color: #c9d1ff; min-height: 100%; }
.stack-layer {
  border: 1px solid var(--ks-line-dark); border-radius: 1rem; padding: 1rem 1.15rem; background: rgba(255, 255, 255, .03);
  display: flex; align-items: center; gap: .9rem; font-size: .9rem;
}
.stack-layer + .stack-layer { margin-top: .75rem; }
.stack-layer strong { color: #fff; display: block; font-size: .95rem; }
.stack-layer small { color: rgba(255, 255, 255, .55); }
.stack-layer .status { margin-left: auto; width: .55rem; height: .55rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); }

/* Drupal band */
.drupal-band { background: var(--ks-navy); }
.drupal-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.drupal-chip {
  display: flex; align-items: center; gap: .75rem; padding: 1rem 1.1rem; border-radius: 1rem;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--ks-line-dark); color: #fff; font-weight: 550; font-size: .95rem;
  transition: background-color .2s, border-color .2s;
}
.drupal-chip:hover { background: rgba(255, 255, 255, .07); border-color: rgba(143, 162, 255, .35); }
.drupal-chip .bi { color: #8fa2ff; font-size: 1.1rem; }
@media (max-width: 575.98px) { .drupal-chips { grid-template-columns: 1fr; } }
.drop-mark { width: 100%; max-width: 360px; }

/* AI section */
.ai-console { background: #fff; border: 1px solid var(--ks-line); border-radius: var(--ks-radius-lg); box-shadow: var(--ks-shadow-lg); overflow: hidden; }
.ai-console header { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--ks-line); font-weight: 650; font-size: .92rem; }
.ai-console header .dot { width: .5rem; height: .5rem; border-radius: 50%; background: #34d399; }
.ai-msgs { padding: 1.25rem; display: grid; gap: .85rem; font-size: .9rem; }
.ai-msg { max-width: 85%; padding: .75rem 1rem; border-radius: 1rem; line-height: 1.55; }
.ai-msg.user { margin-left: auto; background: var(--ks-ink); color: #fff; border-bottom-right-radius: .3rem; }
.ai-msg.bot { background: var(--ks-surface-2); border-bottom-left-radius: .3rem; }
.ai-sources { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.ai-sources span { font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; background: #fff; border: 1px solid var(--ks-line); color: var(--ks-muted); }
.ai-input { margin: 0 1.25rem 1.25rem; display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem 1rem; border-radius: 999px; border: 1px solid var(--ks-line); color: var(--ks-subtle); font-size: .85rem; }
.ai-input .send { margin-left: auto; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ks-accent); color: #fff; display: grid; place-items: center; font-size: .85rem; }

/* CTA band --------------------------------------------------------------- */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 2rem; background: var(--ks-ink); color: rgba(255, 255, 255, .72);
  padding: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(1.5rem, 1rem + 4vw, 5rem);
}
.cta-band h2 { color: #fff; }
.cta-band .lead { color: rgba(255, 255, 255, .7); }
.cta-band .bg-grid { position: absolute; inset: 0; z-index: -1; mask-image: radial-gradient(ellipse at 80% 50%, #000, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 80% 50%, #000, transparent 70%); }

/* Page banner ------------------------------------------------------------ */
.page-banner { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(3rem, 2rem + 3vw, 4.5rem); background: var(--ks-surface-2); border-bottom: 1px solid var(--ks-line); }
.page-banner .bg-grid-light { position: absolute; inset: 0; z-index: -1; mask-image: linear-gradient(to left, #000, transparent 75%); -webkit-mask-image: linear-gradient(to left, #000, transparent 75%); }
.page-banner h1 { max-width: 52rem; margin-bottom: 1rem; }
.page-banner .lead { max-width: 46rem; margin-bottom: 0; }
.page-banner.dark { background: var(--ks-ink); border-bottom: 0; }
.page-banner.dark h1 { color: #fff; }
.page-banner.dark .lead { color: rgba(255, 255, 255, .7); }
.page-banner.dark .breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .35); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .7); }
.page-banner.dark .breadcrumb a { color: rgba(255, 255, 255, .85); }
.page-banner .banner-icon { margin-bottom: 1.5rem; }

.breadcrumb { --bs-breadcrumb-divider: "/"; --bs-breadcrumb-margin-bottom: 1.5rem; font-size: .85rem; font-weight: 500; }
.breadcrumb a { color: var(--ks-ink); text-decoration: none; }
.breadcrumb a:hover { color: var(--ks-accent); }
.breadcrumb-item.active { color: var(--ks-muted); }

/* Prose ------------------------------------------------------------------ */
.prose { font-size: 1.05rem; color: #2b3245; max-width: 46rem; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul { padding-left: 0; list-style: none; margin-bottom: 1.5rem; display: grid; gap: .55rem; }
.prose ul li { position: relative; padding-left: 1.6rem; }
.prose ul li::before { content: ""; position: absolute; left: .2rem; top: .7em; width: .5rem; height: .5rem; border-radius: 2px; background: var(--ks-accent); transform: rotate(45deg); }
.prose > :first-child { margin-top: 0; }

.sidebar-card { position: sticky; top: calc(var(--ks-header-h) + 1.5rem); }
.panel { background: var(--ks-surface-2); border: 1px solid var(--ks-line); border-radius: var(--ks-radius-lg); padding: 1.75rem; }
.panel h2, .panel h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.panel-dark { background: var(--ks-ink); color: rgba(255, 255, 255, .72); border: 0; }
.panel-dark h2, .panel-dark h3 { color: #fff; }

.tech-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; margin: 0; }
.tech-list li { padding: .4rem .85rem; border-radius: 999px; background: #fff; border: 1px solid var(--ks-line); font-size: .85rem; font-weight: 550; }

/* Steps / process */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1rem; counter-reset: step; }
.step { position: relative; padding: 1.5rem 1.25rem; border-radius: var(--ks-radius); background: #fff; border: 1px solid var(--ks-line); counter-increment: step; }
.step::before { content: "0" counter(step); display: block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--ks-accent); margin-bottom: .9rem; }
.step h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.step p { font-size: .88rem; color: var(--ks-muted); margin: 0; }
.section-dark .step { background: rgba(255, 255, 255, .03); border-color: var(--ks-line-dark); }
.section-dark .step::before { color: #8fa2ff; }
.section-dark .step p { color: rgba(255, 255, 255, .6); }

/* Drupal page blocks */
.capability-block { padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem); border-top: 1px solid var(--ks-line); }
.capability-block:first-of-type { border-top: 0; }
.capability-block h2 { font-size: clamp(1.5rem, 1.3rem + .9vw, 2rem); }
.stat-label { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ks-subtle); }
.toc { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; font-size: .92rem; }
.toc a { display: block; padding: .45rem .75rem; border-radius: .6rem; color: var(--ks-muted); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover, .toc a.active { color: var(--ks-ink); background: #fff; border-left-color: var(--ks-accent); }

/* FAQ accordion */
.faq .accordion-item { border: 1px solid var(--ks-line); border-radius: 1rem !important; overflow: hidden; margin-bottom: .75rem; background: #fff; }
.faq .accordion-button { font-weight: 650; font-size: 1.02rem; padding: 1.25rem 1.5rem; color: var(--ks-ink); background: #fff; box-shadow: none; }
.faq .accordion-button:not(.collapsed) { color: var(--ks-accent); }
.faq .accordion-button:focus-visible { box-shadow: inset 0 0 0 3px var(--bs-focus-ring-color); }
.faq .accordion-body { padding: 0 1.5rem 1.4rem; color: var(--ks-muted); }

/* Forms ------------------------------------------------------------------ */
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-control, .form-select {
  border-radius: .8rem; border-color: #d9dde8; padding: .75rem 1rem; font-size: .975rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus { border-color: var(--ks-accent); box-shadow: 0 0 0 .25rem rgba(61, 90, 254, .14); }
.form-check-input:checked { background-color: var(--ks-accent); border-color: var(--ks-accent); }
.form-check-input:focus { box-shadow: 0 0 0 .25rem rgba(61, 90, 254, .2); border-color: var(--ks-accent); }
.req { color: #d63a4a; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-card { background: #fff; border: 1px solid var(--ks-line); border-radius: var(--ks-radius-lg); padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); box-shadow: var(--ks-shadow); }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 0; border-top: 1px solid var(--ks-line-dark); }
.contact-item:first-of-type { border-top: 0; }
.contact-item a { color: #fff; text-decoration: none; font-weight: 600; word-break: break-word; }
.contact-item a:hover { color: #a9b6ff; }
.contact-item small { display: block; color: rgba(255, 255, 255, .55); font-size: .8rem; }
.alert { border-radius: 1rem; border: 0; }
.alert-success { background: #e8f8f0; color: #0f5f3a; }
.alert-danger { background: #fdecee; color: #8a1c2b; }

/* Pagination */
.pagination { --bs-pagination-border-radius: .7rem; --bs-pagination-color: var(--ks-ink); --bs-pagination-active-bg: var(--ks-ink); --bs-pagination-active-border-color: var(--ks-ink); --bs-pagination-border-color: var(--ks-line); gap: .35rem; }
.pagination .page-link { border-radius: .7rem !important; min-width: 2.6rem; text-align: center; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-pills a { padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--ks-line); text-decoration: none; color: var(--ks-ink); font-size: .9rem; font-weight: 550; background: #fff; }
.filter-pills a.active, .filter-pills a:hover { background: var(--ks-ink); border-color: var(--ks-ink); color: #fff; }

/* Empty state */
.empty-state { text-align: center; padding: clamp(2.5rem, 2rem + 4vw, 5rem) 1.5rem; border: 1px dashed #cfd4e1; border-radius: var(--ks-radius-lg); background: var(--ks-surface-2); }
.empty-state .icon-chip { margin-bottom: 1.25rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.gallery figure { margin: 0; border-radius: var(--ks-radius); overflow: hidden; border: 1px solid var(--ks-line); background: var(--ks-surface-2); }
.gallery img { width: 100%; height: auto; display: block; }
.gallery figcaption { font-size: .85rem; color: var(--ks-muted); padding: .65rem .9rem; }
.project-hero-img { border-radius: var(--ks-radius-lg); overflow: hidden; border: 1px solid var(--ks-line); box-shadow: var(--ks-shadow-lg); }
.project-hero-img img { width: 100%; height: auto; display: block; }
.meta-list { display: grid; gap: 1.1rem; margin: 0; }
.meta-list dt { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ks-subtle); margin-bottom: .25rem; }
.meta-list dd { margin: 0; font-weight: 550; }

/* Error pages */
.error-page { min-height: 62vh; display: grid; place-items: center; text-align: center; padding-block: 5rem; }
.error-code { font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 800; letter-spacing: -.06em; line-height: 1; background: linear-gradient(180deg, var(--ks-ink), #4b5675); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--ks-ink); color: rgba(255, 255, 255, .62); padding-top: clamp(3.5rem, 3rem + 3vw, 5.5rem); font-size: .94rem; }
.site-footer .brand { color: #fff; }
.site-footer h2 { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1.25rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.site-footer a { color: rgba(255, 255, 255, .72); text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--ks-line-dark); margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); padding-block: 1.5rem; font-size: .85rem; }
.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-links a { width: 2.5rem; height: 2.5rem; border-radius: .75rem; display: grid; place-items: center; background: rgba(255, 255, 255, .06); border: 1px solid var(--ks-line-dark); font-size: 1.05rem; }
.social-links a:hover { background: var(--ks-accent); border-color: var(--ks-accent); }

.back-to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1020; width: 2.9rem; height: 2.9rem; border-radius: 50%;
  border: 1px solid var(--ks-line); background: #fff; color: var(--ks-ink); display: grid; place-items: center;
  box-shadow: var(--ks-shadow); opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s var(--ks-ease), visibility .25s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--ks-ink); color: #fff; }

/* Reveal on scroll (enabled by JS; content stays visible without JS) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ks-ease), transform .7s var(--ks-ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .reveal-delay-1 { transition-delay: .08s; } .js .reveal-delay-2 { transition-delay: .16s; } .js .reveal-delay-3 { transition-delay: .24s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .back-to-top, .cta-band { display: none !important; }
}
.bi-flip { transform: scaleX(-1); }
