/* ============================================================
   K2 LABS — design system
   Modern tech studio · monochrome + one accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  /* accent — overridable via Tweaks */
  --accent: #16A36B;
  --accent-ink: #ffffff;

  /* light theme (default) */
  --bg: #F6F5F1;
  --bg-2: #EFEDE7;
  --surface: #FFFFFF;
  --ink: #0E0E10;
  --ink-2: #45454B;
  --ink-3: #8A8A90;
  --line: rgba(14, 14, 16, 0.13);
  --line-2: rgba(14, 14, 16, 0.06);
  --shadow-sm: 0 1px 2px rgba(14,14,16,0.04), 0 2px 8px rgba(14,14,16,0.04);
  --shadow-lg: 0 18px 50px -18px rgba(14,14,16,0.30), 0 4px 14px rgba(14,14,16,0.06);

  /* metrics */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 16px;
  --radius-lg: 26px;
}

[data-theme="dark"] {
  --bg: #0B0B0D;
  --bg-2: #111114;
  --surface: #141417;
  --ink: #F4F3F0;
  --ink-2: #B4B4BA;
  --ink-3: #76767C;
  --line: rgba(255, 255, 255, 0.15);
  --line-2: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.7), 0 4px 14px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  transition: background .5s ease, color .5s ease;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }

/* ---------- layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: clamp(72px, 11vw, 150px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .num { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
.display {
  font-size: clamp(44px, 8.4vw, 116px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.94;
}
.h2 { font-size: clamp(30px, 4.6vw, 58px); letter-spacing: -0.03em; }
.lead { font-size: clamp(17px, 2vw, 21px); color: var(--ink-2); line-height: 1.6; max-width: 56ch; text-wrap: pretty; }

/* ---------- buttons ---------- */
.btn {
  --pad-y: 14px; --pad-x: 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s, color .25s, border-color .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translate(3px,-3px); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 14.5px; color: var(--ink-2); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
@media (max-width: 760px) { .nav-links .nav-only { display: none; } }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.03em; color: var(--ink); }
.logo .k2 { position: relative; }
.logo .dot { color: var(--accent); }
.logo .labs { font-weight: 400; color: var(--ink-2); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-tag { margin-bottom: 26px; }
.hero h1 { margin-bottom: 28px; }
.hero .lead { margin-bottom: 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta { display: flex; gap: 34px; margin-top: 56px; flex-wrap: wrap; }
.hero-meta .stat .n { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.hero-meta .stat .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.hero-meta .stat .n .dot { color: var(--accent); }

/* topo backdrop */
.topo { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .9; }
.topo svg { width: 100%; height: 100%; }
.topo path { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0.10; }
.topo path.lit { stroke: var(--accent); opacity: 0.55; }
.hero .wrap { position: relative; z-index: 1; }

/* hero peak visual (for split / centered) */
.peak {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.peak svg { width: 100%; height: 100%; overflow: visible; }
.peak .ring { fill: none; stroke: var(--line); stroke-width: 1.2; }
.peak .ring.lit { stroke: var(--accent); }

/* icon cluster (split hero) */
.cluster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cluster .tile {
  aspect-ratio: 1; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; color: var(--ink-3);
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s, border-color .3s;
}
.cluster .tile:hover { transform: translateY(-6px) rotate(-2deg); box-shadow: var(--shadow-lg); border-color: var(--accent); color: var(--accent); }
.cluster .tile.accent { background: var(--ink); color: var(--bg); }

/* hero layout variants */
.hero[data-layout="centered"] .hero-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.hero[data-layout="centered"] .hero-actions { justify-content: center; }
.hero[data-layout="centered"] .hero-meta { justify-content: center; }
.hero[data-layout="centered"] .hero-visual { display: none; }
.hero[data-layout="centered"] .display { font-size: clamp(52px, 12vw, 150px); }

.hero[data-layout="split"] .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
@media (max-width: 900px) { .hero[data-layout="split"] .hero-grid { grid-template-columns: 1fr; } .hero[data-layout="split"] .hero-visual { order: -1; max-width: 380px; } }

.hero[data-layout="editorial"] .hero-grid { grid-template-columns: 1fr; }
.hero[data-layout="editorial"] .hero-visual { display: none; }
.hero[data-layout="editorial"] .display { font-size: clamp(54px, 13vw, 168px); }
.hero[data-layout="editorial"] .lead { margin-left: auto; max-width: 48ch; }
.hero[data-layout="editorial"] .ed-row { display: grid; grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 900px) { .hero[data-layout="editorial"] .ed-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; } }

/* ============================================================
   WHAT WE DO
   ============================================================ */
.svc-head { display: grid; gap: 26px; margin-bottom: 64px; max-width: 760px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (max-width: 860px) { .svc-grid { grid-template-columns: 1fr; } }
.svc {
  background: var(--bg);
  padding: clamp(28px, 3.4vw, 44px);
  display: flex; flex-direction: column; gap: 16px;
  min-height: 270px;
  transition: background .35s;
}
.svc:hover { background: var(--surface); }
.svc .idx { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .12em; }
.svc .gly { width: 42px; height: 42px; color: var(--accent); margin-bottom: 6px; }
.svc h3 { font-size: 23px; }
.svc p { color: var(--ink-2); font-size: 15.5px; margin: 0; }
.svc .tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); border: 1px solid var(--line); border-radius: 100px; padding: 5px 11px; }

/* ============================================================
   APPS
   ============================================================ */
.apps-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 54px; }
.apps-head .lead { margin: 14px 0 0; }
.apps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 1080px) { .apps-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .apps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .apps-grid { grid-template-columns: 1fr; } }

.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s, border-color .3s;
  overflow: hidden;
}
.app-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .3s; pointer-events: none;
}
.app-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.app-card:hover::after { box-shadow: inset 0 0 0 1.5px var(--accent); }
.app-top { display: flex; align-items: center; justify-content: space-between; }
.app-icon { width: 64px; height: 64px; border-radius: 17px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--bg-2); flex-shrink: 0; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .4s; }
.app-icon img[src] { opacity: 1; }
.app-icon-empty { opacity: 0.35; }
.app-status { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 100px; padding: 5px 10px; white-space: nowrap; }
.app-status.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.app-body h3 { font-size: 20px; margin-bottom: 6px; }
.app-body p { color: var(--ink-2); font-size: 14.5px; margin: 0; min-height: 2.9em; }
.app-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.app-cat { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .05em; }
.app-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); transition: gap .2s, color .2s; }
.app-card:hover .app-link { color: var(--accent); gap: 10px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { position: relative; }
.contact-card {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 84px);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  position: relative; overflow: hidden;
}
@media (max-width: 820px) { .contact-card { grid-template-columns: 1fr; gap: 34px; } }
.contact-card .eyebrow { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.contact-card h2 { color: var(--bg); margin-bottom: 18px; }
.contact-card p { color: color-mix(in srgb, var(--bg) 72%, transparent); font-size: 17px; max-width: 42ch; }
.contact-right { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mail-btn {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 3vw, 30px); letter-spacing: -0.02em;
  color: var(--bg); display: inline-flex; align-items: center; gap: 12px;
  border-bottom: 2px solid color-mix(in srgb, var(--bg) 35%, transparent);
  padding-bottom: 6px; transition: border-color .3s, color .3s;
}
.mail-btn:hover { color: var(--accent); border-color: var(--accent); }
.contact-card .topo path { stroke: var(--bg); }
.contact-card .topo path.lit { stroke: var(--accent); opacity: .6; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding-block: 54px 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 44px; }
.footer-cols { display: flex; gap: 70px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; margin: 0 0 16px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--ink-2); margin-bottom: 11px; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-blurb { max-width: 30ch; color: var(--ink-3); font-size: 14px; margin-top: 16px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--line-2); }
.footer-bottom .legal { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-bottom a, .footer-bottom span { font-size: 13px; color: var(--ink-3); }
.footer-bottom a:hover { color: var(--ink); }

/* ============================================================
   reveal animation
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
  .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .85s cubic-bezier(.2,.8,.2,1), transform .85s cubic-bezier(.2,.8,.2,1); }
  .stagger.in > * { opacity: 1; transform: none; }
}

/* ============================================================
   LEGAL PAGES (privacy / terms)
   ============================================================ */
.legal-wrap { max-width: 760px; margin-inline: auto; padding-block: clamp(48px, 8vw, 96px); }
.legal-head { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.legal-head h1 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.03em; margin-bottom: 14px; }
.legal-head .meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }
.legal-body h2 { font-size: 18px; font-weight: 700; margin: 52px 0 8px; letter-spacing: 0.01em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 15.5px; font-weight: 600; margin: 24px 0 8px; color: var(--ink); }
.legal-body p, .legal-body li { color: var(--ink-2); font-size: 15.5px; line-height: 1.75; }
.legal-body ul, .legal-body ol { padding-left: 22px; }
.legal-body li { margin-bottom: 5px; }
.legal-article { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line-2); }
.legal-article:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.legal-body .placeholder { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px; padding: 16px 18px; color: var(--ink-3); font-size: 14.5px; font-family: var(--font-mono); }
.back-link { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; color: var(--ink-2); margin-bottom: 36px; font-weight: 500; transition: gap .2s, color .2s; }
.back-link:hover { color: var(--accent); gap: 12px; }

/* accent word color */
.accent { color: var(--accent); }

/* utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
