/* =========================================================================
   KCS — Kustom Computing Solutions · client-sites hub (landing page)
   Themed to match yourkcs.com: dark navy, indigo→blue gradient accent,
   Space Grotesk + Inter, rounded corners.
   ========================================================================= */

:root {
  --bg:        #12141d;
  --bg-2:      #161b27;
  --bg-3:      #1e2538;
  --panel:     #1c2240;
  --panel-2:   #242b48;
  --text:      #edeff5;
  --muted:     #a3abc2;
  --muted-2:   #7e87a0;
  --heading:   #ffffff;
  --accent:    #6c6fff;
  --accent-2:  #4e8fff;
  --grad:      linear-gradient(135deg, #6c6fff 0%, #4e8fff 100%);
  --line:      rgba(255, 255, 255, .14);
  --line-2:    rgba(255, 255, 255, .24);
  --nav-bg:    rgba(18, 20, 29, .96);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;

  --wrap: 1280px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lwrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-display); font-size: .72rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 1.8rem; height: 2px; border-radius: 2px; background: var(--grad); }

/* ------------------------------------------------------------- header */
.lheader { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .4s var(--ease), border-color .4s var(--ease); border-bottom: 1px solid transparent; }
.lheader.scrolled { background: rgba(18,20,29,.92); backdrop-filter: blur(14px) saturate(140%); border-bottom-color: var(--line); }
.lnav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0 var(--gutter); min-height: 76px; max-width: var(--wrap); margin-inline: auto; transition: min-height .4s var(--ease); }
.lheader.scrolled .lnav { min-height: 76px; }
.lbrand { display: inline-flex; align-items: center; flex-shrink: 0; }
.lbrand-logo { height: 64px; width: auto; transition: height .4s var(--ease); }
.lheader.scrolled .lbrand-logo { height: 64px; }
.lnav-links { display: flex; align-items: center; gap: 1.3rem; }
.lnav-links a:not(.lbtn) { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: .02em; color: var(--muted); transition: color .3s var(--ease); }
.lnav-links a:not(.lbtn):hover { color: var(--heading); }
.lnav .lbtn { height: 64px; width: 180px; padding: 0; font-size: 16px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }

.lbtn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  padding: .75rem 1.4rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text);
  background: transparent; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), filter .3s var(--ease);
}
.lbtn:hover { border-color: var(--accent); color: #fff; background: rgba(108,111,255,.12); }
.lbtn.primary { background: var(--grad); border: none; color: #fff; }
.lbtn.primary:hover { filter: brightness(1.08); box-shadow: 0 16px 40px -16px rgba(78,143,255,.6); }
.lbtn .arrow { transition: transform .3s var(--ease); }
.lbtn:hover .arrow { transform: translateX(4px); }

/* ---- nav right cluster · theme toggle · mobile menu ---- */
.lnav-right { display: flex; align-items: center; gap: 1rem; }

.theme-toggle { flex-shrink: 0; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); transition: background .2s var(--ease), border-color .2s var(--ease), transform .1s; }
.theme-toggle:hover { border-color: rgba(108,111,255,.45); background: rgba(108,111,255,.12); }
.theme-toggle:active { transform: translateY(1px); }
.theme-ico { pointer-events: none; display: inline-flex; }
.theme-ico--moon { display: none; }
:root[data-theme="light"] .theme-ico--sun { display: none; }
:root[data-theme="light"] .theme-ico--moon { display: inline-flex; }

/* hamburger · KCS-style staggered bars (45/65/45), glow-pulse, no X-morph */
.lhamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; cursor: pointer; flex-shrink: 0; padding: 0 8px; overflow: hidden;
  width: 46px; height: 46px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease);
  animation: buttonGlowPulse 1.8s ease-in-out infinite;
}
.lhamburger span { display: block; width: 65%; height: 2.5px; border-radius: 2px; background: var(--muted); transition: background .15s var(--ease); }
.lhamburger span:nth-child(1) { width: 45%; align-self: flex-end; }
.lhamburger span:nth-child(3) { width: 45%; align-self: flex-start; }
.lhamburger:hover { background: var(--panel-2); border-color: rgba(108,111,255,.4); }
.lhamburger:hover span { background: #fff; }

/* drawer · KCS-style fixed overlay with card links */
.ldrawer {
  display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 45;
  flex-direction: column; gap: 8px; padding: 12px var(--gutter) 20px;
  background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.ldrawer.open { display: flex; animation: drawerSlideIn .22s ease both; }
.lheader:has(.ldrawer.open) { background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom-color: transparent; }
.ldrawer a:not(.lbtn) {
  color: var(--muted); font-family: var(--font-display); font-size: 15px; font-weight: 500;
  padding: 16px; border-radius: var(--r-sm);
  background: var(--bg-3); border: 1px solid var(--line); border-left: 6px solid transparent;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.ldrawer .lbtn { width: 100%; justify-content: center; height: 52px; margin-top: 4px; }
.ldrawer.open a:nth-child(1) { animation: linkFadeIn .18s ease .06s both; }
.ldrawer.open a:nth-child(2) { animation: linkFadeIn .18s ease .12s both; }
.ldrawer.open a:nth-child(3) { animation: linkFadeIn .18s ease .18s both; }
.ldrawer.open a:nth-child(4) { animation: linkFadeIn .18s ease .24s both; }
.ldrawer a:not(.lbtn):hover { color: #fff; background: var(--panel-2); border-left-color: var(--accent); animation: glowPulse 1.8s ease-in-out infinite; }

@keyframes buttonGlowPulse { 0%,100% { box-shadow: 0 0 8px rgba(108,111,255,.3); } 50% { box-shadow: 0 0 20px rgba(108,111,255,.7); } }
@keyframes glowPulse { 0%,100% { box-shadow: -3px 0 10px rgba(108,111,255,.35); } 50% { box-shadow: -3px 0 22px rgba(108,111,255,.75); } }
@keyframes drawerSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes linkFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

#work, #directory, #contact { scroll-margin-top: 88px; }

/* ---------------------------------------------------------------- hero */
.lhero { min-height: 100svh; display: flex; align-items: center; position: relative; padding: 9rem 0 4rem; overflow: hidden; }
.lhero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(62% 55% at 78% 12%, rgba(108,111,255,.20), transparent 68%); }
.lhero-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .6;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 84px 84px;
  -webkit-mask-image: radial-gradient(110% 80% at 75% 12%, #000, transparent 70%);
  mask-image: radial-gradient(110% 80% at 75% 12%, #000, transparent 70%);
}
.lhero .lwrap { position: relative; z-index: 1; }
.lhero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.7rem, 7.5vw, 6rem); line-height: 1.02; letter-spacing: -.03em; color: var(--heading); margin-top: 1.7rem; max-width: 17ch; }
.lhero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.lhero-sub { margin-top: 1.7rem; max-width: 54ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); }
.lhero-actions { margin-top: 2.4rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.lhero-meta { margin-top: clamp(2.5rem, 5vw, 4rem); display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); flex-wrap: wrap; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.lhero-meta div { min-width: 120px; }
.lhero-meta dt { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: .4rem; }
.lhero-meta dd { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }

/* ------------------------------------------------------------- sections */
.lsection { padding-block: clamp(4.5rem, 10vw, 9rem); position: relative; }
.lsection.alt { background: var(--bg-2); }
.lhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.lhead h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.02em; color: var(--heading); margin-top: .7rem; }
.lhead .count { font-family: var(--font-display); font-size: .8rem; letter-spacing: .1em; color: var(--muted); }

/* --------------------------------------------------------- sites grid */
.sites-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.site-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease);
}
.site-card.live:hover { transform: translateY(-6px); border-color: rgba(108,111,255,.55); box-shadow: 0 30px 70px -36px rgba(78,143,255,.5); }
.site-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-2); }
.site-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.site-card.live:hover .site-thumb img { transform: scale(1.05); }
.site-thumb.placeholder {
  display: grid; place-items: center; color: var(--muted-2);
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 14px, transparent 14px 28px), var(--panel-2);
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .2em; font-size: .72rem;
}
.site-tag { position: absolute; top: 1rem; left: 1rem; z-index: 2; font-family: var(--font-display); font-size: .64rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: .4rem .75rem; border-radius: 999px; }
.site-tag.live { background: var(--grad); color: #fff; }
.site-tag.soon { background: rgba(255,255,255,.08); color: var(--muted); border: 1px solid var(--line); }
.site-body { padding: clamp(1.3rem, 2.5vw, 1.9rem); display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.site-cat { font-family: var(--font-display); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.site-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 2.3vw, 1.95rem); letter-spacing: -.01em; color: var(--heading); }
.site-desc { color: var(--muted); font-size: .96rem; }
.site-visit { margin-top: auto; padding-top: 1rem; display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-size: .78rem; font-weight: 600; letter-spacing: .03em; color: var(--text); }
.site-visit .arrow { color: var(--accent); transition: transform .3s var(--ease); }
.site-card.live:hover .site-visit .arrow { transform: translateX(5px); }
.site-card.live > a.card-link { position: absolute; inset: 0; z-index: 1; }
.site-card.soon { opacity: .72; }

/* --------------------------------------------------------- directory */
.directory { border-top: 1px solid var(--line); }
.dir-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 1.5rem; align-items: center; padding: clamp(1.2rem, 2.5vw, 1.7rem) clamp(.6rem, 1.5vw, 1.2rem); border-bottom: 1px solid var(--line); border-radius: var(--r-sm); transition: background .3s var(--ease), padding-left .3s var(--ease); }
.dir-row:hover { background: rgba(108,111,255,.08); padding-left: 1.4rem; }
.dir-name { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2vw, 1.6rem); letter-spacing: -.01em; color: var(--heading); }
.dir-url { color: var(--muted); font-size: .9rem; word-break: break-all; }
.dir-open { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-size: .76rem; font-weight: 600; letter-spacing: .04em; color: var(--accent); white-space: nowrap; }
.dir-open .arrow { transition: transform .3s var(--ease); }
.dir-row:hover .dir-open .arrow { transform: translateX(5px); }
.dir-empty { padding: 1.4rem 0; color: var(--muted); }

/* --------------------------------------------------------------- footer */
.lfooter { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem); background: var(--bg-2); }
.lfooter-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; }
.lfooter h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.02em; color: var(--heading); max-width: 16ch; }
.lfooter .contact { display: grid; gap: .6rem; font-size: .98rem; }
.lfooter .contact a { color: var(--muted); transition: color .3s var(--ease); }
.lfooter .contact a:hover { color: var(--accent); }
.footer-logo { height: 58px; width: auto; }
.lfooter-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.8rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted-2); }
.lfooter-bottom .motto { font-family: var(--font-display); letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; }
.lfooter-bottom .motto b { font-weight: 600; }
.lfooter-bottom .motto b:nth-child(2) { color: var(--accent); }

/* ---------------------------------------------------------- reveal + rwd */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .lhamburger, .ldrawer.open, .ldrawer.open a, .ldrawer a:hover { animation: none !important; }
}

@media (max-width: 860px) {
  .lnav-links { display: none; }
  .lhamburger { display: flex; }
  .lbrand-logo, .lheader.scrolled .lbrand-logo { height: 46px; }
  .lnav, .lheader.scrolled .lnav { min-height: 64px; }
  .lnav-right { gap: .5rem; }
}
@media (max-width: 760px) {
  .sites-grid { grid-template-columns: 1fr; }
  .dir-row { grid-template-columns: 1fr auto; }
  .dir-url { grid-column: 1 / -1; order: 3; }
  .lhero { padding-top: 7rem; }
  .lhero h1 { font-size: clamp(2.15rem, 9vw, 3rem); }
  .lhero-actions { flex-direction: column; align-items: stretch; }
  .lhero-actions .lbtn { width: 100%; justify-content: center; height: 52px; }
}

/* ===================================================== LIGHT THEME =====
   Mirrors yourkcs.com: near-white surfaces, steel-blue accent (#3b6ea5);
   dark mode keeps the purple. Toggled via <html data-theme="light">. */
:root[data-theme="light"] {
  --bg:       #eef1f4;
  --bg-2:     #e6eaef;
  --bg-3:     #dce2e9;
  --panel:    #ffffff;
  --panel-2:  #eef1f4;
  --text:     #1d2530;
  --muted:    #4c5663;
  --muted-2:  #6b7480;
  --heading:  #10171f;
  --accent:   #3b6ea5;
  --accent-2: #5a89bd;
  --grad:     linear-gradient(135deg, #3b6ea5 0%, #5a89bd 100%);
  --line:     rgba(34,45,58,.12);
  --line-2:   rgba(34,45,58,.22);
  --nav-bg:   rgba(238,241,244,.95);
}
:root[data-theme="light"] .lheader.scrolled { background: rgba(238,241,244,.95); }
:root[data-theme="light"] .lhero::after { background: radial-gradient(62% 55% at 78% 12%, rgba(59,110,165,.14), transparent 68%); }
:root[data-theme="light"] .lhero-grid { background-image: linear-gradient(rgba(34,45,58,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(34,45,58,.06) 1px, transparent 1px); }
:root[data-theme="light"] .lbtn:hover { background: rgba(59,110,165,.10); color: var(--heading); }
:root[data-theme="light"] .lbtn.primary { color: #fff; }
:root[data-theme="light"] .lbtn.primary:hover { box-shadow: 0 16px 40px -16px rgba(59,110,165,.45); }
:root[data-theme="light"] .site-card.live:hover { border-color: rgba(59,110,165,.5); box-shadow: 0 30px 70px -36px rgba(59,110,165,.32); }
:root[data-theme="light"] .site-tag.soon { background: rgba(34,45,58,.06); }
:root[data-theme="light"] .site-thumb.placeholder { background: repeating-linear-gradient(135deg, rgba(34,45,58,.05) 0 14px, transparent 14px 28px), var(--panel-2); }
:root[data-theme="light"] .dir-row:hover { background: rgba(59,110,165,.08); }
:root[data-theme="light"] .theme-toggle { background: rgba(34,45,58,.04); }
:root[data-theme="light"] .theme-toggle:hover { border-color: rgba(59,110,165,.45); background: rgba(59,110,165,.10); }
:root[data-theme="light"] .lhamburger:hover span { background: var(--heading); }
:root[data-theme="light"] .ldrawer a:not(.lbtn):hover { color: var(--heading); }
