/* Kotrain marketing site — immersive deep-space look (liquidink-inspired):
   near-black navy, drifting starfield, giant display type, glass panels,
   the Kotrain violet→cyan gradient as the nebula accent. Dark by design. */

:root {
  --bg: #01050b;
  --bg-2: #010e22;
  --ink: #f2f6fa;
  --muted: #8ca5ae;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.05);
  --accent: #6d5efc;
  --accent-2: #22d3ee;
  --grad: linear-gradient(115deg, #6d5efc 10%, #22d3ee 90%);
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: rgba(109, 94, 252, 0.45); }

/* ---- backdrop: starfield canvas + nebula glow ---- */
#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.nebula {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 40% at 70% -10%, rgba(109, 94, 252, 0.22), transparent 70%),
    radial-gradient(45% 35% at 15% 25%, rgba(34, 211, 238, 0.1), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgba(1, 14, 34, 0.9), transparent 70%);
}
main, header, footer { position: relative; z-index: 1; }

/* ---- nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 16px 28px;
  background: rgba(1, 5, 11, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800; letter-spacing: 0.14em; font-size: 15px;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand-mark { margin-right: 6px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 13.5px;
  letter-spacing: 0.04em; transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

/* ---- type ---- */
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.34em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 18px;
}
h2 {
  font-size: clamp(30px, 4.6vw, 52px); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 14px;
}
h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 6px; }
p { color: var(--muted); }
code {
  font-family: var(--mono); font-size: 0.85em;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}
a { color: var(--accent-2); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.micro { font-size: 12px; color: var(--muted); }
.center { text-align: center; }
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px;
  vertical-align: 2px; color: var(--accent-2);
}

/* ---- hero ---- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px; position: relative;
}
.display {
  font-size: clamp(64px, 14vw, 190px);
  font-weight: 900; letter-spacing: -0.03em; line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.35));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 60px rgba(109, 94, 252, 0.35));
}
.tagline {
  margin-top: 22px; color: var(--ink);
  font-size: clamp(20px, 2.6vw, 30px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25;
}
.lede { max-width: 620px; margin: 20px auto 0; font-size: 16px; }
.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.hero .micro { margin-top: 18px; }

.btn {
  display: inline-block; padding: 12px 26px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; text-decoration: none;
  letter-spacing: 0.01em; transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 32px rgba(109, 94, 252, 0.4);
}
.btn-primary:hover { box-shadow: 0 10px 42px rgba(109, 94, 252, 0.6); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 9px; }
.btn-glass {
  background: var(--glass); color: var(--ink);
  border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.1); }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.4em;
  color: var(--muted); animation: hint-bob 2.2s ease-in-out infinite;
}
@keyframes hint-bob { 0%, 100% { transform: translate(-50%, 0); opacity: 0.7; } 50% { transform: translate(-50%, 6px); opacity: 1; } }

/* mascot floats at the hero's lower right, mid-suburi */
.mascot { position: absolute; bottom: 42px; right: clamp(16px, 8vw, 140px); }
.mascot .swing {
  animation: swing 1.7s cubic-bezier(0.5, 0, 0.3, 1) infinite;
  transform-origin: 16px 22px; transform-box: view-box;
}
@keyframes swing {
  0% { transform: rotate(-78deg); }
  38% { transform: rotate(-78deg); }
  50% { transform: rotate(24deg); }
  66% { transform: rotate(20deg); }
  100% { transform: rotate(-78deg); }
}

/* ---- glass panels ---- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 18px;
}

/* ---- showcase window mock ---- */
.showcase { display: flex; justify-content: center; padding: 0 24px 40px; }
.window-mock { width: min(880px, 100%); overflow: hidden; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); }
.wm-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wm-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.wm-body { display: grid; grid-template-columns: 52px 1fr 200px; min-height: 300px; }
.wm-rail { border-right: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wm-dot { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, 0.08); }
.wm-dot.active { background: var(--grad); }
.wm-chat { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; }
.bubble.user { align-self: flex-end; background: rgba(109, 94, 252, 0.25); border: 1px solid rgba(109, 94, 252, 0.4); color: var(--ink); }
.bubble.ai { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--muted); }
.tool { align-self: flex-start; font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); border: 1px dashed rgba(34, 211, 238, 0.4); border-radius: 8px; padding: 6px 10px; }
.wm-ctx { border-left: 1px solid var(--line); padding: 16px 14px; }
.ctx-h { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; }
.ctx-item { display: flex; justify-content: space-between; font-size: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.ctx-item b { font-weight: 600; }
.ctx-item i { color: var(--muted); font-style: normal; font-family: var(--mono); font-size: 10px; }

/* ---- chapters ---- */
.chapter { max-width: 1080px; margin: 0 auto; padding: 130px 24px; }
.chapter-lede { max-width: 560px; font-size: 16px; margin-bottom: 30px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.card { padding: 22px 20px; transition: transform 0.25s, border-color 0.25s; }
.card:hover { transform: translateY(-4px); border-color: rgba(109, 94, 252, 0.5); }
.card p { font-size: 13.5px; }
.fi { font-size: 22px; }
.ok { color: #4ade80; font-size: 12.5px; font-family: var(--mono); }
.dim { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }

.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.check { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.check li { padding-left: 30px; position: relative; color: var(--ink); font-size: 15px; }
.check li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--accent-2); font-weight: 700;
}
.server-cards { display: flex; flex-direction: column; gap: 12px; }
.sc { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.sc b { min-width: 90px; }
.sc code { margin-left: auto; }

/* ---- download ---- */
.download { text-align: center; }
.download .chapter-lede { margin-left: auto; margin-right: auto; }
.dl-row { display: flex; gap: 16px; justify-content: center; margin: 30px 0 22px; flex-wrap: wrap; }
.dl { padding: 22px 34px; text-decoration: none; color: var(--ink); transition: transform 0.2s, border-color 0.2s; }
.dl:hover { transform: translateY(-4px); border-color: var(--accent); }
.dl-os { font-weight: 700; font-size: 17px; }
.dl-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.download .micro { margin-top: 8px; }

/* ---- footer ---- */
footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 30px 28px; border-top: 1px solid var(--line); flex-wrap: wrap;
  font-size: 13px;
}
footer a { color: var(--muted); text-decoration: none; font-family: var(--mono); font-size: 12px; }
footer a:hover { color: var(--ink); }

/* ---- scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .grid, .grid.four { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .wm-body { grid-template-columns: 52px 1fr; }
  .wm-ctx { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .grid, .grid.two, .grid.four { grid-template-columns: 1fr; }
  .chapter { padding: 90px 20px; }
  .mascot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .mascot .swing, .scroll-hint { animation: none; }
}
