/* kapKit landing page
   Fonts: Satoshi (Indian Type Foundry, free license) + Geist Mono (OFL), self-hosted.
   Theme follows the system setting. One accent: banana yellow.
   The "holo" gradient comes from the kapKit banana mark and is used only for
   the logo glow, one headline word, and the card hover foil. */

@font-face {
  font-family: "Satoshi";
  src: url("fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0f0f11;
  --bg-2: #141417;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);
  --text: #ededef;
  --muted: #a1a1aa;
  --accent: #f4d04b;
  --accent-ink: #1a1606;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 24px 60px -24px rgb(0 0 0 / 0.6);
  --nav-glass: rgb(24 24 27 / 0.72);
  --holo: linear-gradient(100deg, #ff7ac6 0%, #ffd34d 22%, #6dff9c 44%, #4fe3ff 64%, #a98bff 82%, #ff7ac6 100%);
  --grain-opacity: 0.05;

  --radius: 20px;      /* cards */
  --radius-sm: 12px;   /* media wells */
  /* buttons and nav island are full pills */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  /* z-index scale */
  --z-grain: 60;
  --z-nav: 50;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f5;
    --bg-2: #ececee;
    --surface: #fbfbfb;
    --surface-2: #ffffff;
    --line: rgb(24 24 27 / 0.08);
    --line-strong: rgb(24 24 27 / 0.16);
    --text: #18181b;
    --muted: #52525b;
    --accent: #f4d04b;
    --accent-ink: #1a1606;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.9) inset, 0 24px 50px -28px rgb(24 24 27 / 0.28);
    --nav-glass: rgb(251 251 251 / 0.72);
    --grain-opacity: 0.035;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.ic { width: 1.1em; height: 1.1em; flex: none; }

/* Film grain, fixed and non-interactive so it never repaints on scroll */
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

section[id] { scroll-margin-top: 84px; }
#top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 80px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  height: 44px; padding: 0 18px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffdc5e; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Nav: full-width bar that becomes an island on scroll ---------- */
.nav-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  display: flex; justify-content: center;
  padding: 0 var(--gutter);
  transition: padding 0.5s var(--ease-out);
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  width: 100%; max-width: var(--maxw);
  height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition:
    max-width 0.6s var(--ease-out),
    height 0.5s var(--ease-out),
    padding 0.5s var(--ease-out),
    background-color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}
.is-island .nav-wrap { padding-top: 12px; }
.is-island .nav {
  max-width: 560px;
  height: 54px;
  padding: 0 8px 0 18px;
  background: var(--nav-glass);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
@media (prefers-reduced-transparency: reduce) {
  .is-island .nav { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; transition: transform 0.5s var(--ease-out); }
.brand:hover img { transform: rotate(-12deg) scale(1.06); }
.wordmark { font-family: "Geist Mono", ui-monospace, monospace; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  display: inline-block; padding: 8px 12px; border-radius: 999px;
  color: var(--muted); font-size: 15px; font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.nav-gh {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600;
  transition: background-color 0.2s, transform 0.2s var(--ease-out);
}
.nav-gh:hover { background: var(--surface-2); }
.nav-gh:active { transform: scale(0.97); }
.is-island .nav-gh-label { display: none; }
.is-island .nav-gh { width: 38px; padding: 0; justify-content: center; }

@media (max-width: 767px) {
  .nav-links { display: none; }
  .is-island .nav { max-width: 260px; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  min-height: 100dvh;
  padding: 96px var(--gutter) 48px;
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 40px;
}
.hero-title {
  margin: 0;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.hero-title .line { display: block; overflow: hidden; padding: 0 0.12em 0.1em 0; margin-right: -0.12em; white-space: nowrap; }
.hero-title .line > span { display: inline-block; }
.hero-title em { font-style: italic; font-weight: 800; padding-right: 0.06em; }
.holo-text {
  background: var(--holo); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  margin: 24px 0 0; max-width: 42ch;
  font-size: clamp(17px, 1.5vw, 20px); color: var(--muted);
}
.hero-ctas { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stage {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 560px; justify-self: end;
  --px: 0; --py: 0;
}
.stage-glow {
  position: absolute; inset: 14%;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #ff7ac6, #ffd34d, #6dff9c, #4fe3ff, #a98bff, #ff7ac6);
  filter: blur(70px); opacity: 0.32;
}
@media (prefers-color-scheme: light) { .stage-glow { opacity: 0.38; } }
.stage-banana {
  position: absolute; left: 50%; top: 50%; width: 44%; height: auto;
  translate: -50% -50%;
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * -10px)) rotate(-8deg);
  filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.35));
}
.sticker {
  position: absolute; border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.55), 0 0 0 1px var(--line);
  will-change: transform;
}
.sticker-overlay {
  width: 86%; left: -6%; top: 10%;
  border-radius: 22px;
  transform: translate(calc(var(--px) * 22px), calc(var(--py) * 16px)) rotate(-4deg);
}
.sticker-chat {
  width: 92%; right: -8%; bottom: 16%;
  border-radius: 16px;
  transform: translate(calc(var(--px) * 30px), calc(var(--py) * 22px)) rotate(3deg);
}
.sticker-goal {
  left: 6%; bottom: 2%;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px 12px 12px;
  background: #19191c; color: #ededef; border-radius: 999px;
  transform: translate(calc(var(--px) * 14px), calc(var(--py) * 12px)) rotate(-2deg);
}
.sticker-goal img { width: 44px; height: 44px; }
.goal-text { display: flex; flex-direction: column; line-height: 1.15; }
.goal-label { font-family: "Geist Mono", monospace; font-size: 12px; color: #a1a1aa; }
.goal-count { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-count b { color: var(--accent); }

/* ---------- Section shared ---------- */
.section-title {
  margin: 0 0 40px;
  font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800;
}

/* ---------- Tools bento ---------- */
.tools { max-width: var(--maxw); margin: 0 auto; padding: 72px var(--gutter) 96px; }
.bento {
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}
.tool-overlay { grid-column: 1 / span 7; }
.tool-statcmd { grid-column: 8 / span 5; }
.tool.tool-nextgoal { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; }
.tool-nextgoal .tool-body { padding: 24px 28px; }
.tool-nextgoal .tool-media { min-height: 300px; }

.tool {
  --mx: 50%; --my: 50%; --foil: 0;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  transition: transform 0.5s var(--ease-out);
}
/* Holographic border foil that follows the pointer.
   Mask layers: spotlight (intersect) over a 1.5px ring (content-box excluded from border-box). */
.tool::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from 120deg at var(--mx) var(--my), #ff7ac6, #ffd34d, #6dff9c, #4fe3ff, #a98bff, #ff7ac6);
  -webkit-mask:
    radial-gradient(280px circle at var(--mx) var(--my), #000 0%, transparent 75%),
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: source-in, xor, source-over;
  mask:
    radial-gradient(280px circle at var(--mx) var(--my), #000 0%, transparent 75%),
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: intersect, exclude, add;
  opacity: var(--foil);
  transition: opacity 0.4s var(--ease-out);
}
.tool:hover { --foil: 1; }
@media (hover: hover) { .tool:hover { transform: translateY(-3px); } }

.tool-media {
  position: relative; overflow: hidden;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  min-height: 220px;
  padding: 32px;
}
.tool-media img { transition: transform 0.7s var(--ease-out); }
.tool:hover .tool-media img { transform: scale(1.03); }

/* Each media well gets its own backdrop so the grid is not white-on-white */
.media-overlay {
  flex: 1;
  min-height: 260px;
  background:
    radial-gradient(120% 90% at 20% 0%, rgb(244 208 75 / 0.22), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgb(79 227 255 / 0.12), transparent 60%),
    #1b1b1f;
}
.media-overlay img { width: min(100%, 560px); border-radius: 20px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.7); }
.media-statcmd {
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.035) 0 1px, transparent 1px 28px),
    linear-gradient(160deg, #1f2a22 0%, #16161a 70%);
}
.media-statcmd { flex: 1; }
.media-statcmd img { width: 100%; border-radius: 14px; box-shadow: 0 20px 40px -16px rgb(0 0 0 / 0.7); }
.media-nextgoal {
  grid-template-columns: auto 1fr; gap: 24px;
  background: linear-gradient(140deg, #6453d6 0%, #3a2f8a 55%, #1f1a4a 100%);
}
.ng-icon { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 6px rgb(255 255 255 / 0.12); }
.ng-obs { width: 100%; max-width: 340px; border-radius: 10px; box-shadow: 0 20px 40px -16px rgb(0 0 0 / 0.7); justify-self: end; }

.tool-body { padding: 20px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 700; line-height: 1.2; }
.tool p { margin: 0; color: var(--muted); max-width: 60ch; }
.tool-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.stars {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: "Geist Mono", monospace; font-size: 14px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.stars .ic { color: var(--accent); width: 15px; height: 15px; }
@media (prefers-color-scheme: light) { .stars .ic { color: #d9a90b; } }

@media (prefers-color-scheme: light) {
  .media-overlay {
    background:
      radial-gradient(120% 90% at 20% 0%, rgb(244 208 75 / 0.45), transparent 55%),
      radial-gradient(90% 80% at 100% 100%, rgb(79 227 255 / 0.25), transparent 60%),
      #ececee;
  }
  .media-statcmd {
    background:
      repeating-linear-gradient(0deg, rgb(24 24 27 / 0.05) 0 1px, transparent 1px 28px),
      linear-gradient(160deg, #dcefe1 0%, #ececee 70%);
  }
}

/* ---------- Works with (the page's one marquee) ---------- */
.works { padding: 40px 0 96px; }
.works-title {
  max-width: var(--maxw); margin: 0 auto 36px; padding: 0 var(--gutter);
  font-size: 20px; font-weight: 600; color: var(--muted); text-align: center; letter-spacing: -0.01em;
}
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 72px; padding: 0 36px; }
.logo {
  display: block; width: 40px; height: 40px; flex: none;
  background-color: var(--text); opacity: 0.6;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 32s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { flex-wrap: wrap; justify-content: center; width: auto; gap: 40px; }
  .marquee-track [data-clone] { display: none; }
}

/* ---------- Open source ---------- */
.oss { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 120px; }
.oss-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 40px;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.oss-card::before {
  content: ""; position: absolute; right: -12%; top: -40%; width: 60%; aspect-ratio: 1;
  border-radius: 50%; background: var(--holo); filter: blur(90px); opacity: 0.16; pointer-events: none;
}
.oss-copy h2 { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.oss-copy p { margin: 16px 0 0; color: var(--muted); max-width: 46ch; }
.oss-ctas { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.oss-stat { position: relative; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.oss-num {
  display: inline-flex; align-items: center; gap: 0.12em;
  font-size: clamp(88px, 12vw, 168px); line-height: 0.9; font-weight: 800; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.oss-num .ic { width: 0.55em; height: 0.55em; color: var(--accent); }
@media (prefers-color-scheme: light) { .oss-num .ic { color: #e2b412; } }
.oss-cap { font-family: "Geist Mono", monospace; font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 32px var(--gutter) 40px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.footer .brand img { width: 26px; height: 26px; }
.footer .wordmark { font-size: 17px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 15px; }
.footer-links a:hover { color: var(--text); }
.footer-note { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-title .line > span { transform: translateY(105%); animation: rise 1s var(--ease-out) forwards; }
  .hero-title .line:nth-child(2) > span { animation-delay: 0.09s; }
  .hero-sub, .hero-ctas { opacity: 0; transform: translateY(14px); animation: fade-up 0.9s var(--ease-out) forwards; }
  .hero-sub { animation-delay: 0.25s; }
  .hero-ctas { animation-delay: 0.35s; }
  .holo-text { animation: holo-shift 6s ease-in-out infinite alternate; }

  .stage-glow { animation: glow-in 1.4s var(--ease-out) both; }
  .stage-banana { animation: pop 1s 0.15s var(--ease-out) both; }
  .sticker-overlay { animation: drop-in 1s 0.35s var(--ease-out) both; }
  .sticker-chat { animation: drop-in 1s 0.5s var(--ease-out) both; }
  .sticker-goal { animation: drop-in 1s 0.65s var(--ease-out) both; }

  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal.is-in { opacity: 1; transform: none; }
  .tool.reveal.is-in { transition: opacity 0.9s var(--ease-out), transform 0.5s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms), 0s; }
}
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade-up { to { opacity: 1; transform: none; } }
@keyframes holo-shift { to { background-position: 100% 0; } }
@keyframes glow-in { from { opacity: 0; scale: 0.6; } }
@keyframes pop { from { opacity: 0; scale: 0.6; } }
@keyframes drop-in { from { opacity: 0; translate: 0 40px; } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .hero { grid-template-columns: 1fr; padding-top: 112px; gap: 24px; min-height: auto; }
  .hero-stage { justify-self: center; max-width: 520px; aspect-ratio: 5 / 4; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tool-overlay, .tool-statcmd { grid-column: 1 / -1; }
  .tool.tool-nextgoal { grid-template-columns: 1fr; }
  .tool-nextgoal .tool-body { padding: 20px 14px 14px; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .hero { padding-top: 104px; padding-bottom: 32px; }
  .hero-stage { aspect-ratio: 1 / 1; width: 100%; }
  .sticker-overlay { left: -2%; width: 90%; }
  .sticker-chat { right: -2%; width: 96%; bottom: 22%; }
  .sticker-goal { bottom: 0; }
  .bento { grid-template-columns: 1fr; }
  .tool-media, .media-overlay { min-height: 200px; padding: 22px; }
  .media-nextgoal { grid-template-columns: 1fr; justify-items: center; }
  .ng-obs { justify-self: center; }
  .oss-card { grid-template-columns: 1fr; }
  .oss-stat { align-items: flex-start; text-align: left; }
  .footer-note { margin-left: 0; width: 100%; }
  .tool-actions .btn { flex: 1 1 auto; justify-content: center; }
}
