/* khekimoglu.com · liquid-glass dark adaptation of KH DL v1.1
 * The KH system runs bright by default; this page runs its dark counterpart:
 * ink page, cobalt-to-violet orbs, and translucent glass panels.
 * Tokens are overridden in one scope so every DS component re-themes itself.
 */

.kh-glass-scope {
  /* --- token overrides (dark glass) --- */
  --bg: #090D1D;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.028);
  --ink: #F3F5FF;
  --ink-2: #D9DDF0;
  --muted: #9AA3BF;
  --hairline: rgba(255, 255, 255, 0.12);
  --on-ink: #FFFFFF;
  --on-ink-muted: #A9B1C9;

  --brand-soft: rgba(31, 59, 230, 0.22);
  --brand-2-soft: rgba(124, 92, 255, 0.20);

  --ok-tint: rgba(18, 161, 90, 0.16);
  --warn-tint: rgba(199, 127, 0, 0.16);
  --down-tint: rgba(224, 69, 58, 0.16);
  --idle-tint: rgba(107, 116, 128, 0.18);
  --ok: #37C983;
  --warn: #F0A82D;
  --down: #F06A5E;

  --shadow-sm: 0 1px 2px rgba(3, 5, 14, 0.3), 0 6px 20px rgba(3, 5, 14, 0.35);
  --shadow-md: 0 12px 34px rgba(3, 5, 14, 0.5);
  --shadow-lg: 0 24px 60px rgba(3, 5, 14, 0.6);

  /* glass knobs (tweakable) */
  --glass-blur: 28px;
  --orb-opacity: 0.85;

  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: clip;
}

html, body { overflow-x: clip; }

html { scroll-behavior: smooth; }
.kh-glass-scope [id] { scroll-margin-top: 96px; }
body { margin: 0; background: #090D1D; }

/* ---------- ambient orb field (fixed, behind everything; drifts gently with scroll) ---------- */
.kh-orb-field {
  position: fixed;
  inset: -30% 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--orb-opacity);
  transform: translateY(calc(var(--scroll-y, 0) * -0.045px));
  will-change: transform;
}
.kh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}
.kh-orb-a {
  width: 620px; height: 620px; top: -12%; right: -10%;
  background: radial-gradient(circle at 32% 32%, rgba(42, 75, 255, 0.5), transparent 62%);
  animation: kh-orb-drift-a 26s ease-in-out infinite;
}
.kh-orb-b {
  width: 540px; height: 540px; top: 42%; left: -14%;
  background: radial-gradient(circle at 40% 40%, rgba(124, 92, 255, 0.42), transparent 60%);
  animation: kh-orb-drift-b 32s ease-in-out infinite;
}
.kh-orb-c {
  width: 420px; height: 420px; bottom: -14%; right: 18%;
  background: radial-gradient(circle at 45% 45%, rgba(31, 59, 230, 0.34), transparent 62%);
  animation: kh-orb-drift-a 38s ease-in-out infinite reverse;
}
@keyframes kh-orb-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, 50px) scale(1.08); }
}
@keyframes kh-orb-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(70px, -46px) scale(1.05); }
}

/* ---------- liquid glass panels ---------- */
.lg-panel,
.lg-strong {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(3, 5, 14, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.14);
}
.lg-strong {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(50px) saturate(1.6);
  -webkit-backdrop-filter: blur(50px) saturate(1.6);
}
/* thin gradient border that fades mid-side (mask-composite trick) */
.lg-panel::before,
.lg-strong::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(163, 175, 255, 0.18) 22%,
    rgba(255, 255, 255, 0) 42%,
    rgba(255, 255, 255, 0) 58%,
    rgba(163, 175, 255, 0.16) 78%,
    rgba(255, 255, 255, 0.34) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* components dropped inside a glass wrap go transparent and inherit the glass */
.lg-panel > *, .lg-strong > * { position: relative; z-index: 1; }
.lg-wrap { --surface: transparent; --shadow-sm: none; }

/* DS cards (ThoughtCard, Card) pick up blur directly */
.kh-glass-scope .kh-lift {
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  box-shadow: 0 8px 32px rgba(3, 5, 14, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.kh-glass-scope .kh-lift:hover { box-shadow: 0 16px 44px rgba(3, 5, 14, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.14); }

/* ---------- layout ---------- */
.kh-page {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
.kh-section { margin-top: clamp(var(--section-gap-mobile), 10vw, var(--section-gap)); }
.kh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min), 100%), 1fr));
  gap: var(--grid-gap);
}

/* ---------- glass nav (sticky inside the page column so it aligns with content) ---------- */
.kh-nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 14px 0;
  pointer-events: none;
}
.kh-nav {
  pointer-events: auto;
  width: 100%;
  background: rgba(11, 16, 34, 0.3);
  transition: background 240ms var(--ease);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 9px 10px 9px 16px;
  border-radius: var(--radius-pill);
}
.kh-nav.is-scrolled { background: rgba(11, 16, 34, 0.62); }
.kh-nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.kh-nav-link {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: color var(--motion-hover) var(--ease), background var(--motion-hover) var(--ease);
}
.kh-nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.kh-nav-cta {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 4px 16px rgba(3, 5, 14, 0.25);
  transition: background var(--motion-hover) var(--ease), border-color var(--motion-hover) var(--ease);
}
.kh-nav-cta:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); }
@media (max-width: 860px) { .kh-nav-links { display: none; } }

/* ---------- hero ---------- */
.kh-hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  padding-top: 56px;
  padding-bottom: var(--space-8);
}

/* glass buttons (transparent, liquid) */
.kh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background var(--motion-hover) var(--ease), border-color var(--motion-hover) var(--ease);
}
.kh-btn-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 8px 26px rgba(3, 5, 14, 0.3);
}
.kh-btn-glass:hover { background: rgba(255, 255, 255, 0.17); border-color: rgba(255, 255, 255, 0.38); }
.kh-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.kh-btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.3); }
.kh-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: var(--mono-weight);
  letter-spacing: var(--mono-tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.kh-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112, 'wght' 830;
  font-size: var(--fs-hero);
  line-height: var(--display-leading-hero);
  letter-spacing: var(--display-tracking);
  text-transform: uppercase;
  color: var(--ink);
  max-width: 980px;
}
.kh-hero-title .grad {
  background: var(--gradient-vivid);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kh-hero-support {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
}
.kh-hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* liquid silk curtain: full-bleed flowing video behind the hero, faded into the page */
.kh-hero-media {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.kh-hero-media canvas.kh-sand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(0.6px);
}
/* fade the sand and scrim out with a mask (not painted overlays), so the ambient
 * orbs behind stay continuous and the hero blends seamlessly into the page */
.kh-hero-media {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 160px, #000 55%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent, #000 160px, #000 55%, transparent 96%);
}
/* side scrim so the headline stays readable over the silk */
.kh-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(9, 13, 29, 0.55) 0%, rgba(9, 13, 29, 0.25) 45%, transparent 75%);
}

/* glass now-line strip */
.kh-nowline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
  padding: 13px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
.kh-nowline .lbl { color: var(--muted); }
.kh-nowline .sep { color: var(--muted); opacity: 0.6; }
.kh-nowline .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 7px;
  vertical-align: 0.5px;
}

/* ---------- impact band under the hero ---------- */
.kh-stats-band { margin-top: 0; }
.kh-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.kh-stat-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-7);
}
.kh-stat-cell + .kh-stat-cell { border-left: 1px solid var(--hairline); }
.kh-stat-value {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 110, 'wght' 820;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--gradient-vivid);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kh-stat-sub {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .kh-stats-grid { grid-template-columns: 1fr; }
  .kh-stat-cell + .kh-stat-cell { border-left: none; border-top: 1px solid var(--hairline); }
}

/* ---------- section furniture ---------- */
.kh-lead {
  margin: var(--space-5) 0 var(--space-7);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
}

/* work cards */
.kh-work-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-7);
  transition: transform var(--motion-hover) var(--ease), box-shadow var(--motion-hover) var(--ease);
}
.kh-work-card:hover { transform: translateY(var(--lift-y)); }
.kh-mono-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
  color: var(--muted);
}
.kh-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 106, 'wght' 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.kh-card-prose {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}
.kh-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
}
.kh-tags {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
  color: var(--muted);
}

/* stack groups */
.kh-stack-group { padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; gap: var(--space-3); }
.kh-stack-list {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* now list */
.kh-now-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-7);
  align-items: start;
}
.kh-now-row + .kh-now-row { border-top: 1px solid var(--hairline); }
@media (max-width: 640px) { .kh-now-row { grid-template-columns: 1fr; gap: var(--space-2); } }

/* about */
.kh-about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--grid-gap);
  align-items: stretch;
}
@media (max-width: 860px) { .kh-about-grid { grid-template-columns: 1fr; } }
.kh-prose-block p {
  margin: 0 0 var(--space-5);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}
.kh-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-8);
  text-align: center;
  min-height: 260px;
}

/* clients rail: bold, notable */
.kh-clients {
  margin: var(--grid-gap) 0 0;
  text-align: center;
  padding: var(--space-7);
}
.kh-clients-names {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(16px, 1.7vw, 20px);
  letter-spacing: -0.005em;
  line-height: 1.9;
  color: var(--ink-2);
}
.kh-clients-names .sep { color: var(--muted); opacity: 0.55; font-weight: 400; }

/* clients marquee: brand marks drift right to left, seamless loop */
.kh-clients-rail {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.kh-clients-track {
  display: flex;
  width: max-content;
  animation: kh-marquee 42s linear infinite;
  will-change: transform;
}
.kh-clients-track:hover { animation-play-state: paused; }
.kh-clients-seq {
  display: flex;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
  flex: 0 0 auto;
}
.kh-client {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--ink-2);
}
.kh-client-name {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.005em;
  line-height: 1;
}
.kh-client-logo {
  height: 22px;
  flex: 0 0 auto;
  color: var(--ink-2);
  opacity: 0.92;
}
.kh-client-logo * { fill: currentColor !important; stroke: none !important; }
.kh-client-logo.is-icon { width: 19px; height: 19px; }
.kh-client-logo.is-image { object-fit: contain; }
@keyframes kh-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .kh-clients-seq { gap: 36px; padding-right: 36px; }
  .kh-client-logo { height: 19px; }
  .kh-client-name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .kh-clients-track { animation: none; width: auto; }
  .kh-clients-seq { flex-wrap: wrap; justify-content: center; row-gap: var(--space-4); padding-right: 0; }
  .kh-clients-seq[aria-hidden] { display: none; }
}

/* ---------- reveal on scroll (liquid glass: drift up, sharpen, settle) ---------- */
.kh-reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.985);
  filter: blur(14px) saturate(1.15);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
  will-change: opacity, transform, filter;
}
.kh-reveal.is-in { opacity: 1; transform: none; filter: none; }

/* links */
.kh-inline-link {
  font-family: var(--font-body);
  font-weight: 600;
  color: #93A5FF;
  text-decoration: none;
  border-bottom: 1px solid rgba(147, 165, 255, 0.35);
}
.kh-inline-link:hover { color: #B9C4FF; }

/* contact block (compact glass gate) */
.kh-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: clamp(36px, 5vw, 56px) var(--space-7);
  border-radius: var(--radius-lg);
  max-width: 640px;
  margin: 0 auto;
}
.kh-contact-title {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 110, 'wght' 780;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.kh-contact-desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 460px;
}
.kh-contact-link {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-label);
  font-weight: 500;
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 2px;
}
.kh-contact-link:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); }

/* moving sheen inside every glass block */
.lg-panel::after,
.lg-strong::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 32%, rgba(124, 92, 255, 0.14) 50%, transparent 68%);
  background-size: 240% 240%;
  animation: kh-drift 18s ease-in-out infinite;
}

/* footer spacing */
.kh-footer-zone { margin-top: clamp(var(--section-gap-mobile), 10vw, var(--section-gap)); padding-bottom: var(--space-8); }

/* sand inside the contact block */
.kh-contact-sand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- mobile friendliness ---------- */
@media (max-width: 640px) {
  .kh-hero { min-height: auto; padding-top: 44px; padding-bottom: 56px; gap: var(--space-5); }
  .kh-nowline { font-size: 10.5px; padding: 11px 14px; gap: var(--space-2) var(--space-3); }
  .kh-nav { padding: 7px 8px 7px 12px; }
  .kh-stat-cell { padding: var(--space-6); }
  .kh-work-card, .kh-stack-group { padding: var(--space-6); }
  .kh-now-row { padding: var(--space-5) var(--space-6); }
  .kh-prose-block.lg-panel { padding: var(--space-6) !important; }
  .kh-btn { padding: 12px 20px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .kh-orb-a, .kh-orb-b, .kh-orb-c { animation: none; }
  .lg-panel::after, .lg-strong::after { animation: none; }
  .kh-reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
