/* =============================================================================
   KChannels — App Product Page System
   -----------------------------------------------------------------------------
   A reusable, token-driven stylesheet for individual app product pages.

   MODEL: a fixed KChannels FRAME (top bar + footer) wraps a themeable CANVAS.
   The frame is always the same — it is the brand lineage. Everything inside
   the canvas reads from per-app CSS custom properties, so each app can look
   like anything while sharing the same structural grammar.

   TO ADD A NEW APP:
     1. Copy apps/_template/ to apps/<app>/
     2. Override the theme tokens below in the page's own <style> (on :root)
     3. Drop in content + screenshots; link it from the homepage Work grid.

   THEME CONTRACT (override these per app):
     --app-bg          page background
     --app-bg-2        slightly elevated background (bands)
     --app-surface     card / panel surface
     --app-text        primary text
     --app-muted       secondary text
     --app-rule        hairline borders
     --app-accent      primary accent (the app's signature colour)
     --app-accent-2    secondary accent
     --app-on-accent   text colour on top of --app-accent
     --app-glow        ambient hero glow (usually accent at low alpha)
     --app-font-display / --app-font-body / --app-font-mono
     --app-display-weight / --app-display-spacing
     --app-radius
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ---- KChannels brand constants (the FRAME — not app-themeable) ---- */
  --kct-bg:     #070705;
  --kct-ink:    #e8e4dc;
  --kct-muted:  #9a9490;
  --kct-teal:   #1a9c88;
  --kct-purple: #8b2fc9;
  --kct-rule:   #1c1a16;
  --kct-serif:  'Outfit', system-ui, sans-serif;
  --kct-mono:   'DM Mono', ui-monospace, monospace;

  /* ---- Default theme tokens (neutral dark; apps override these) ---- */
  --app-bg:        #0d0d12;
  --app-bg-2:      #121219;
  --app-surface:   #16161f;
  --app-text:      #ececf2;
  --app-muted:     #9aa0ad;
  --app-rule:      rgba(255,255,255,0.10);
  --app-accent:    #00d4ff;
  --app-accent-2:  #1a9c88;
  --app-on-accent: #07121a;
  --app-glow:      rgba(0,212,255,0.18);

  --app-font-display: 'DM Sans', system-ui, sans-serif;
  --app-font-body:    'DM Sans', system-ui, sans-serif;
  --app-font-mono:    'DM Mono', ui-monospace, monospace;
  --app-display-weight: 700;
  --app-display-spacing: -0.01em;

  --app-radius:      14px;
  --app-section-pad: clamp(80px, 11vw, 150px);
  --app-gutter:      clamp(20px, 5vw, 64px);
  --app-maxw:        1180px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--app-font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap { max-width: var(--app-maxw); margin: 0 auto; padding: 0 var(--app-gutter); }

/* =============================================================================
   FRAME — fixed KChannels chrome (top bar + footer). Brand-constant.
   ============================================================================ */
.kct-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,7,5,0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--kct-rule);
}
.kct-top-in {
  max-width: var(--app-maxw); margin: 0 auto;
  padding: 14px var(--app-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.kct-brand { display: flex; align-items: center; gap: 11px; }
.kct-brand img { width: 30px; height: 30px; display: block; }
.kct-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.kct-brand-name { font-family: var(--kct-serif); font-weight: 600; font-size: 16px; color: var(--kct-ink); letter-spacing: 0.01em; }
.kct-brand-sub  { font-family: var(--kct-mono); font-weight: 500; font-size: 8.5px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(232,228,220,0.62); }
.kct-back {
  font-family: var(--kct-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(232,228,220,0.8); transition: color .2s; white-space: nowrap;
}
.kct-back:hover { color: var(--kct-ink); }

.kct-foot {
  background: var(--kct-bg);
  border-top: 1px solid var(--kct-rule);
  padding: 48px 0 56px;
}
.kct-foot-bar { height: 3px; background: linear-gradient(90deg, var(--kct-teal), var(--kct-purple)); }
.kct-foot-in {
  max-width: var(--app-maxw); margin: 0 auto; padding: 36px var(--app-gutter) 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.kct-foot-copy { font-family: var(--kct-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; color: rgba(232,228,220,0.6); }
.kct-foot-copy b { color: var(--kct-ink); font-weight: 400; }
.kct-foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.kct-foot-links a {
  font-family: var(--kct-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(232,228,220,0.62); transition: color .2s;
}
.kct-foot-links a:hover { color: var(--kct-ink); }

/* =============================================================================
   SHARED COMPONENT GRAMMAR — themed via --app-* tokens
   ============================================================================ */

/* Eyebrow + section title share one rhythm across all apps */
.eyebrow {
  font-family: var(--app-font-mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--app-accent);
}
.eyebrow.muted { color: var(--app-muted); }

.title {
  font-family: var(--app-font-display);
  font-weight: var(--app-display-weight);
  letter-spacing: var(--app-display-spacing);
  line-height: 1.06;
  color: var(--app-text);
}

.accent { color: var(--app-accent); }
.mono   { font-family: var(--app-font-mono); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--app-font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.06em;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  cursor: pointer; white-space: nowrap;
}
.btn-accent {
  background: var(--app-accent); color: var(--app-on-accent); font-weight: 500;
  box-shadow: 0 8px 30px -8px var(--app-glow);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px var(--app-glow); }
.btn-ghost { border-color: var(--app-rule); color: var(--app-text); }
.btn-ghost:hover { border-color: var(--app-accent); color: var(--app-accent); }

/* ---- Section shell ---- */
.section { padding: var(--app-section-pad) 0; border-top: 1px solid var(--app-rule); position: relative; }
.section.band { background: var(--app-bg-2); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head .eyebrow { display: block; margin-bottom: 18px; }
.section-head .title { font-size: clamp(30px, 4.4vw, 50px); }
.section-lede { margin-top: 22px; color: var(--app-muted); font-size: clamp(16px, 1.4vw, 19px); max-width: 620px; }

/* =============================================================================
   HERO
   ============================================================================ */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 9vw, 120px) 0 clamp(72px, 9vw, 130px); }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 380px at 78% 22%, var(--app-glow), transparent 70%),
    radial-gradient(700px 520px at 12% 92%, color-mix(in srgb, var(--app-accent-2) 14%, transparent), transparent 72%);
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero-eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--app-accent); }
.hero-title { font-size: clamp(40px, 6.2vw, 76px); }
.hero-tagline {
  font-family: var(--app-font-mono); font-weight: 500; font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: 0.04em; color: var(--app-accent); margin-top: 26px;
}
.hero-lede { margin-top: 24px; max-width: 480px; color: var(--app-muted); font-size: clamp(16px, 1.4vw, 18px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

/* Hero media slot — each app supplies its own signature visual inside this. */
.hero-media { width: 100%; display: flex; justify-content: center; }

/* =============================================================================
   STEPS  (how it works)
   ============================================================================ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 2.4vw, 32px); }
.step { border-top: 1px solid var(--app-rule); padding-top: 22px; }
.step-n { display: block; width: 24px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--app-accent), var(--app-accent-2)); }
.step-t { font-family: var(--app-font-display); font-weight: 600; font-size: 19px; margin: 14px 0 8px; color: var(--app-text); }
.step-d { color: var(--app-muted); font-size: 14.5px; line-height: 1.6; }

/* =============================================================================
   FEATURES
   ============================================================================ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 1.8vw, 22px); }
.feature {
  background: var(--app-surface); border: 1px solid var(--app-rule);
  border-radius: var(--app-radius); padding: 28px 26px 30px;
  transition: border-color .25s ease, transform .25s ease;
}
.feature:hover { border-color: color-mix(in srgb, var(--app-accent) 55%, var(--app-rule)); transform: translateY(-3px); }
.feature-k { font-family: var(--app-font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--app-accent); }
.feature-t { font-family: var(--app-font-display); font-weight: 600; font-size: 20px; margin: 14px 0 10px; color: var(--app-text); }
.feature-d { color: var(--app-muted); font-size: 14.5px; line-height: 1.62; }

/* =============================================================================
   SHOTS (screenshot filmstrip)
   ============================================================================ */
.shots {
  display: flex; gap: 20px; overflow-x: auto; padding: 8px 0 22px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shots::-webkit-scrollbar { height: 6px; }
.shots::-webkit-scrollbar-thumb { background: var(--app-rule); border-radius: 999px; }
.shot { flex: 0 0 auto; width: clamp(200px, 24vw, 248px); scroll-snap-align: start; }
.shot img {
  width: 100%; height: auto; display: block; border-radius: var(--app-radius);
  border: 1px solid var(--app-rule);
  box-shadow: 0 24px 60px -34px #000;
}
.shot-cap {
  display: block; margin-top: 14px;
  font-family: var(--app-font-mono); font-size: 11.5px; line-height: 1.45;
  letter-spacing: 0.01em; color: var(--app-muted);
}

/* =============================================================================
   NOTE (honest security callout)
   ============================================================================ */
.note {
  border: 1px solid color-mix(in srgb, var(--app-accent) 35%, var(--app-rule));
  border-radius: var(--app-radius); padding: clamp(28px, 4vw, 44px);
  background: color-mix(in srgb, var(--app-accent) 5%, var(--app-surface));
  max-width: 820px;
}
.note .feature-k { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.note p { color: var(--app-muted); font-size: 15.5px; line-height: 1.72; }
.note p + p { margin-top: 14px; }
.note b { color: var(--app-text); font-weight: 500; }

/* =============================================================================
   FINE PRINT (disclaimers, legal asides) — deliberately understated
   ============================================================================ */
.section.fine { padding: clamp(40px, 5vw, 60px) 0; }
.finenote {
  max-width: 780px; margin: 0;
  font-size: 12px; line-height: 1.7;
  color: var(--app-muted); opacity: 0.7;
}
.finenote-label {
  display: block; margin-bottom: 8px;
  font-family: var(--app-font-mono); font-weight: 500; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--app-muted); opacity: 0.9;
}

/* =============================================================================
   FINAL CTA
   ============================================================================ */
.cta { text-align: center; }
.cta .title { font-size: clamp(36px, 6vw, 68px); }
.cta-sub { font-family: var(--app-font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; color: var(--app-muted); margin-top: 22px; }
.cta .hero-actions { justify-content: center; margin-top: 34px; }

/* =============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .kct-brand-text { display: none; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--app-accent); outline-offset: 3px; border-radius: 6px;
}
