/* ============================================================
   Sylnora / Kuroko — design system
   Light, quiet chrome, one accent. Code blocks are the moment.
   4px grid · Inter + JetBrains Mono · lucide icons
   ============================================================ */

:root {
  /* ink ramp (cool neutral) */
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-softer: #eff1f4;
  --surface: #ffffff;
  --ink: #101318;
  --ink-2: #454c57;   /* secondary */
  --ink-3: #6b7280;   /* muted */
  --line: rgba(16, 19, 24, 0.09);
  --line-strong: rgba(16, 19, 24, 0.16);

  /* accent */
  --green: #16a34a;
  --green-ink: #15803d;
  --green-soft: rgba(22, 163, 74, 0.10);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.09);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.08);
  --amber: #b45309;

  /* code surface */
  --code-bg: #0e1116;
  --code-ink: #d7dde5;
  --code-line: rgba(255, 255, 255, 0.07);

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 18px;

  --shadow-s: 0 1px 2px rgba(16, 19, 24, 0.05);
  --shadow: 0 8px 28px rgba(16, 19, 24, 0.09);
  --shadow-l: 0 24px 64px rgba(16, 19, 24, 0.13);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv05", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout primitives ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.shell-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) {
  .shell, .shell-wide { padding: 0 20px; }
}

section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--green);
  flex: 0 0 auto;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.h-display {
  font-size: clamp(2.4rem, 5.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.038em;
  font-weight: 650;
}
.h-section {
  font-size: clamp(1.7rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
  font-weight: 620;
}
.h-card { font-size: 1.02rem; letter-spacing: -0.012em; font-weight: 600; }
.lead {
  font-size: 1.09rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 36rem;
  margin: 16px 0 0;
}
.sub { color: var(--ink-2); max-width: 40rem; margin: 12px 0 0; }

a { color: inherit; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 44px;
  border-radius: 10px;
  font-weight: 560;
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out),
              color 150ms var(--ease-out), transform 120ms var(--ease-out);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-s); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 0.86rem; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #23282f; }
  .btn-ghost:hover { border-color: rgba(16,19,24,0.3); }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.brand-mark span { transform: translateY(-0.5px); }
.brand em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 530;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 130ms var(--ease-out), background 130ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--ink); background: var(--bg-softer); }
}
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 9px;
  cursor: pointer;
  place-items: center;
  color: var(--ink);
}
.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 24px 16px;
}
.nav-mobile a {
  display: block;
  padding: 11px 4px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 530;
  font-size: 0.98rem;
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:last-child { border-bottom: 0; }
.nav.open .nav-mobile { display: block; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; }
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
}
.card .icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--bg-softer);
  color: var(--ink-2);
  margin-bottom: 14px;
}
.card .icon svg { width: 17px; height: 17px; }
.card .icon.green { background: var(--green-soft); color: var(--green-ink); }
.card .icon.blue { background: var(--blue-soft); color: var(--blue); }
.card p { margin: 6px 0 0; color: var(--ink-2); font-size: 0.93rem; line-height: 1.6; }

/* ---------- code blocks ---------- */
.codeblock {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(16, 19, 24, 0.4);
}
.codeblock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-line);
  font-family: var(--mono);
  font-size: 12px;
  color: #7c8593;
}
.codeblock-bar .dots { display: flex; gap: 6px; margin-right: 4px; }
.codeblock-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3038; }
.codeblock-bar .file { color: #a9b2bf; }
.codeblock-bar .lang {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #626b79;
  text-transform: uppercase;
}
.codeblock pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  tab-size: 4;
}
.codeblock pre code { font-family: inherit; }

/* kuroko / java / kotlin token colors (on dark) */
.tk-k { color: #7dd3a8; }          /* keywords */
.tk-a { color: #86c7f0; }          /* annotations @Plugin */
.tk-s { color: #e3c07f; }          /* strings */
.tk-n { color: #c4a7e7; }          /* numbers */
.tk-c { color: #5d6673; font-style: italic; } /* comments */
.tk-f { color: #93c5fd; }          /* function names */
.tk-t { color: #7ee0c0; }          /* types */
.tk-x { color: #e2e8f0; }

/* ---------- keycaps & badges ---------- */
.kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1.5px 6px;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--surface);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.badge .dot.amber { background: #d97706; }
.badge .dot.grey { background: #9aa3af; }

/* ---------- stats ---------- */
.stat-num {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-label { color: var(--ink-2); font-size: 0.9rem; margin-top: 6px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 56px;
  color: var(--ink-3);
  font-size: 0.9rem;
  background: var(--bg-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 600;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 8px 0; }
.footer a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .footer a:hover { color: var(--ink); }
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 20px;
  font-size: 0.84rem;
}
.footer-brand p { max-width: 30rem; margin: 10px 0 0; font-size: 0.9rem; }

/* ---------- noise overlay ---------- */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- custom cursor (fine pointers only) ---------- */
.cursor-ring, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 70;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(16, 19, 24, 0.28);
  transition: width 180ms var(--ease-out), height 180ms var(--ease-out),
              border-color 180ms var(--ease-out), background 180ms var(--ease-out), opacity 180ms;
}
.cursor-ring.is-hover {
  width: 46px; height: 46px;
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.07);
}
.cursor-dot { width: 5px; height: 5px; background: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  body.has-cursor { cursor: none; }
  body.has-cursor a, body.has-cursor button, body.has-cursor [role="button"] { cursor: none; }
  body.has-cursor .cursor-ring, body.has-cursor .cursor-dot { display: block; }
}

/* ---------- toast ---------- */
.toast-zone {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #f3f5f8;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  max-width: min(92vw, 420px);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast svg { width: 15px; height: 15px; color: #7dd3a8; flex: 0 0 auto; }

/* ---------- misc ---------- */
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
code.inline {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-softer);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5px 6px;
  color: var(--ink);
  white-space: nowrap;
}

/* copy button on code blocks */
.copy-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--code-line);
  color: #8b94a2;
  border-radius: 7px;
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color 130ms, border-color 130ms;
}
.copy-btn:hover { color: #d7dde5; border-color: rgba(255,255,255,0.2); }
.copy-btn svg { width: 13px; height: 13px; }

/* focus visibility */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* inputs */
input[type="text"], input[type="search"], textarea, select {
  font-size: 16px; /* no iOS zoom */
  font-family: inherit;
}

/* ---------- reveal base: visible by default, hidden only when GSAP confirmed ---------- */
.reveal { will-change: transform, opacity; }
html.anim-ready .reveal { opacity: 0; }
html.anim-ready .reveal-stagger > * { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.anim-ready .reveal, html.anim-ready .reveal-stagger > * {
    opacity: 1 !important;
  }
}

/* ---------- mobile-native: no horizontal document overflow ---------- */
/* grid items must be allowed to shrink below min-content so that
   code blocks scroll internally instead of stretching the page */
.hero-grid > *, .compare-grid > *, .desugar-grid > *, .errors-grid > *,
.eco-grid > *, .roadmap > *, .stats-grid > *, .footer-grid > *, .bento > * {
  min-width: 0;
}
@media (max-width: 960px) {
  .hero-grid, .compare-grid, .desugar-grid, .errors-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) { .eco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .eco-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .roadmap { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html, body { overflow-x: clip; }
