/* KLS Labs landing page. Colour tokens match filipkalus.com, so the two sites read as one family. */
:root {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --fg: #15171a;
  --fg-muted: #565c63;
  --fg-faint: #858b93;
  --line: #e6e4de;
  --accent: #0f5a4a;
  --accent-soft: #e3f0ea;
  --dot: #12a07a;
  --grid-dot: rgba(21, 23, 26, .10);
  --glow-dot: rgba(18, 160, 122, .9);
  --glow-wash: rgba(18, 160, 122, .10);
  --note: #fff3c4;
  --note-fg: #6b4e00;
  --note-line: #f0d77a;
  --radius: 22px;
  --radius-lg: 28px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -16px rgba(0,0,0,.18);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 22px 40px -22px rgba(0,0,0,.28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --bg-elev: #16191c;
    --fg: #eceef0;
    --fg-muted: #a3a9b1;
    --fg-faint: #6f757d;
    --line: #262a2f;
    --accent: #6fcbb3;
    --accent-soft: #13302a;
    --dot: #6fcbb3;
    --grid-dot: rgba(236, 238, 240, .08);
    --glow-dot: rgba(111, 203, 179, .95);
    --glow-wash: rgba(111, 203, 179, .09);
    --note: #3a3010;
    --note-fg: #f2d784;
    --note-line: #5d4b12;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 22px 40px -22px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113;
  --bg-elev: #16191c;
  --fg: #eceef0;
  --fg-muted: #a3a9b1;
  --fg-faint: #6f757d;
  --line: #262a2f;
  --accent: #6fcbb3;
  --accent-soft: #13302a;
  --dot: #6fcbb3;
  --grid-dot: rgba(236, 238, 240, .08);
  --glow-dot: rgba(111, 203, 179, .95);
  --glow-wash: rgba(111, 203, 179, .09);
  --note: #3a3010;
  --note-fg: #f2d784;
  --note-line: #5d4b12;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 22px 40px -22px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--dot) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Logo (inline SVG from logo/build_logo.py) */
.logo-svg { display: block; height: 100%; width: auto; fill: currentColor; overflow: visible; }
.logo-svg .lg-accent { fill: var(--dot); }

/* ---- Navigation */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 10px 12px 0; pointer-events: none; }
.nav-inner {
  display: flex; align-items: center; gap: 24px; height: 54px;
  max-width: calc(var(--maxw) - 24px); padding: 0 12px; pointer-events: auto;
  border: 1px solid transparent; border-radius: 99px;
  transition: background .3s, border-color .3s, box-shadow .3s, padding .3s var(--ease);
}
.nav.scrolled .nav-inner {
  padding-left: 22px;
  background: color-mix(in srgb, var(--bg-elev) 76%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-color: var(--line); box-shadow: var(--shadow);
}
.nav-logo { display: block; height: 19px; margin-right: auto; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.js .nav-logo.away { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 6px 12px; border-radius: 99px; font-size: 14.5px; font-weight: 500; color: var(--fg-muted); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: var(--accent-soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg-elev); }
.lang a { padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; color: var(--fg-muted); transition: color .2s, background .2s; }
.lang a:hover { color: var(--fg); }
.lang a[aria-current] { background: var(--fg); color: var(--bg); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg); cursor: pointer;
}
.icon-btn:hover { border-color: var(--fg-faint); }

/* ---- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--fg-faint); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { border-color: var(--fg); }
.btn svg { width: 16px; height: 16px; }
.btn.ok { border-color: var(--accent); color: var(--accent); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---- Hero */
@property --gx { syntax: "<percentage>"; inherits: true; initial-value: 72%; }
@property --gy { syntax: "<percentage>"; inherits: true; initial-value: 34%; }
.hero {
  position: relative; min-height: min(100vh, 900px); min-height: min(100svh, 900px);
  display: flex; align-items: center; overflow: hidden; isolation: isolate;
  padding: 120px 0 96px;
  background: radial-gradient(62% 58% at 90% 0%, var(--glow-wash), transparent 70%);
}
.hero::before, .hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-size: 26px 26px; background-position: 13px 13px;
}
.hero::before {
  background-image: radial-gradient(circle, var(--grid-dot) 1.2px, transparent 1.7px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero::after {
  background-image:
    radial-gradient(circle, var(--glow-dot) 1.7px, transparent 2.2px),
    radial-gradient(420px circle at var(--gx) var(--gy), var(--glow-wash), transparent 70%);
  background-size: 26px 26px, 100% 100%;
  background-position: 13px 13px, 0 0;
  -webkit-mask-image: radial-gradient(360px circle at var(--gx) var(--gy), #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
          mask-image: radial-gradient(360px circle at var(--gx) var(--gy), #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero.tracking::after { animation: none; }
@keyframes drift {
  0%   { --gx: 72%; --gy: 30%; }
  35%  { --gx: 58%; --gy: 62%; }
  70%  { --gx: 86%; --gy: 52%; }
  100% { --gx: 66%; --gy: 22%; }
}
.hero-inner { width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 34px; padding: 6px 14px 6px 12px;
  border: 1px solid var(--line); border-radius: 99px;
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--dot);
  opacity: 0; animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

.hero-logo { margin: 0; height: clamp(56px, 18vw, 148px); }
.hero-logo .logo-svg { max-width: 100%; }

/* Letters rise in one after another, then the dot drops into the open A */
.js .hero-logo .lg-ch {
  transform-box: fill-box;
  animation: rise .9s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}
.js .hero-logo .lg-accent {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: drop .9s cubic-bezier(.3, 1.5, .5, 1) both;
  animation-delay: 1s;
}
@keyframes rise { from { opacity: 0; transform: translateY(38%); } to { opacity: 1; transform: none; } }
@keyframes drop {
  0%   { opacity: 0; transform: translateY(-420%) scale(.6); }
  55%  { opacity: 1; transform: translateY(0) scale(1.12, .84); }
  100% { opacity: 1; transform: none; }
}

.headline {
  margin: 38px 0 0; max-width: 17ch;
  font-size: clamp(32px, 5.2vw, 60px); line-height: 1.04; font-weight: 600; letter-spacing: -.035em;
  text-wrap: balance;
}
.headline span { color: var(--fg-faint); }
.lede { margin: 20px 0 0; max-width: 58ch; font-size: clamp(16.5px, 1.6vw, 19px); color: var(--fg-muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.js .hero .headline, .js .hero .lede, .js .hero .cta, .js .hero .eyebrow {
  animation: fadeup .9s var(--ease) both;
}
.js .hero .eyebrow { animation-delay: 0s; }
.js .hero .headline { animation-delay: .55s; }
.js .hero .lede { animation-delay: .68s; }
.js .hero .cta { animation-delay: .8s; }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; width: 24px; height: 38px; margin-left: -12px;
  border: 1.5px solid var(--fg-faint); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--fg-muted); animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---- Sections */
.sec { padding: 48px 0; }
#expertise { padding-top: 88px; }
/* Title on the left, intro on the right */
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; align-items: end; margin-bottom: 44px; }
.sec-head .sec-label { grid-column: 1 / -1; }
.sec-head .sec-intro { margin: 0; }
.sec-label {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.sec-label span { font-family: var(--mono); font-weight: 500; letter-spacing: 0; color: var(--fg-faint); }
.sec-title { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
.sec-intro { margin: 16px 0 0; color: var(--fg-muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev) 40%, color-mix(in srgb, var(--accent-soft) 30%, var(--bg-elev)));
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
/* A thin highlight along the top edge on hover */
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(90deg, transparent, var(--dot), transparent);
}
.card:hover::after { opacity: .8; }
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.ico {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 24px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}
.ico svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.card p { margin: 0 0 22px; color: var(--fg-muted); font-size: 15.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; list-style: none; }
.tags li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); }

/* ---- Founder */
.founder {
  display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: center;
  padding: 44px; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--bg-elev) 45%, color-mix(in srgb, var(--accent-soft) 45%, var(--bg-elev)));
}
.founder-photo { width: 220px; height: 220px; border-radius: 36px; object-fit: cover; box-shadow: var(--shadow-lg); }
.founder .sec-title { font-size: clamp(28px, 3.4vw, 38px); }
.founder-copy > p:not(.sec-label) { margin: 16px 0 0; max-width: 56ch; color: var(--fg-muted); }
.link-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: 16px; margin-top: 26px; max-width: 440px;
  padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.lc-label { grid-column: 1; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.lc-url { grid-column: 1; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.lc-desc { grid-column: 1; font-size: 14px; color: var(--fg-muted); }
.lc-arrow { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: 22px; color: var(--accent); transition: transform .25s var(--ease); }
.link-card:hover .lc-arrow { transform: translate(3px, -3px); }

/* ---- Contact */
.contact {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
  padding: 44px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev); box-shadow: var(--shadow);
}
.contact-copy > p:not(.sec-label) { margin: 16px 0 0; color: var(--fg-muted); max-width: 44ch; }
.email-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list li:first-child { padding-top: 0; }
.contact-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.contact-list li > svg { flex: none; width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.contact-list li > div { flex: 1; min-width: 0; }
.copy-btn {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--fg-muted); font: inherit; font-weight: 700; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.copy-btn:hover { color: var(--fg); border-color: var(--fg-faint); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.ok { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.copy-btn.ok svg { display: none; }
.copy-btn.ok::after { content: "✓"; }
.contact-list .lbl { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.contact-list .val { font-weight: 500; overflow-wrap: anywhere; }
.contact-list a.val:hover { color: var(--accent); }

/* ---- Footer */
.site-footer { margin-top: 48px; padding: 44px 0 56px; border-top: 1px solid var(--line); font-size: 14px; color: var(--fg-muted); }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.foot-logo { display: block; height: 17px; color: var(--fg); }
.foot-links { display: flex; gap: 22px; }
.foot-links a:hover { color: var(--fg); }
.legal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 18px 32px; margin: 0; }
.legal dt { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.legal dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.copy { margin: 26px 0 0; color: var(--fg-faint); }

/* ---- Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Small screens */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-head .sec-intro { margin-top: 16px; }
  .contact { grid-template-columns: 1fr; gap: 32px; }
  .legal { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .nav { padding: 8px 8px 0; }
  .nav-inner { padding: 0 8px; }
  .nav.scrolled .nav-inner { padding-left: 18px; }
  .nav-links { display: none; }
  .hero { padding: 104px 0 88px; }
  .sec { padding: 32px 0; }
  #expertise { padding-top: 56px; }
  .founder { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .founder-photo { width: 120px; height: 120px; border-radius: 24px; }
  .contact { padding: 24px; }
  .legal { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
