/* Public landing page for KiCraft (see web._render_landing + kc_landing.js).
   Dark-theme tokens mirror the global palette in kicraft.server.theme:
     bg #0b0f14 . panel #12171f . border #232c38
     brand #4ade80 (circuit-green) . accent #22d3ee (cyan, gradient partner)
     text #e8eef5 . muted #9aa7b5 / #657085
   Everything is scoped under .kc-landing so it never leaks into the auth cards. */

.kc-landing {
  --kc-bg: #0b0f14;
  --kc-panel: #12171f;
  --kc-border: #232c38;
  --kc-brand: #4ade80;
  --kc-accent: #22d3ee;
  --kc-text: #e8eef5;
  --kc-muted: #9aa7b5;
  --kc-dim: #657085;
  color: var(--kc-text);
  font-family: var(--kc-font-sans, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  line-height: 1.55;
  overflow-x: hidden;
}

.kc-landing a { text-decoration: none; color: inherit; }
.kc-landing section { position: relative; }

/* Centered content column, generous gutters, capped width. */
.kc-wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- top nav: sticky, translucent, blurs the page behind it ---------------- */
.kc-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 17, 32, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--kc-border);
}
.kc-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.kc-brand { display: flex; align-items: baseline; gap: 10px; }
.kc-brand .kc-logo { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.kc-brand .kc-tag { font-size: 0.8rem; color: var(--kc-muted); }
.kc-nav-actions { display: flex; align-items: center; gap: 14px; }

/* ---- buttons -------------------------------------------------------------- */
.kc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
              border-color 0.2s ease;
  white-space: nowrap;
}
.kc-btn-primary {
  color: #0b0f14;
  background: linear-gradient(135deg, var(--kc-brand), var(--kc-accent));
  box-shadow: 0 8px 24px -8px rgba(74, 222, 128, 0.6);
}
.kc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(45, 212, 191, 0.75);
}
.kc-btn-ghost {
  color: var(--kc-text);
  border: 1px solid var(--kc-border);
  background: rgba(255, 255, 255, 0.02);
}
.kc-btn-ghost:hover { border-color: var(--kc-brand); color: #fff; }
.kc-btn-lg { font-size: 1.05rem; padding: 14px 26px; }
.kc-nav-signin { font-size: 0.92rem; color: var(--kc-muted); font-weight: 600; }
.kc-nav-signin:hover { color: #fff; }

/* ---- hero ----------------------------------------------------------------- */
.kc-hero { padding: 70px 0 56px; }
.kc-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.kc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kc-brand);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
}
.kc-h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 20px 0 0;
}
.kc-grad {
  background: linear-gradient(110deg, var(--kc-brand) 10%, var(--kc-accent) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kc-sub {
  font-size: 1.12rem;
  color: var(--kc-muted);
  margin: 18px 0 0;
  max-width: 33em;
}
.kc-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.kc-trust { margin-top: 14px; font-size: 0.86rem; color: var(--kc-dim); }
.kc-trust b { color: var(--kc-muted); font-weight: 600; }

/* Faux prompt console: the typewriter types example briefs into it. */
.kc-console {
  margin-top: 26px;
  background: #08090d;
  border: 1px solid var(--kc-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.92rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.kc-console-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.kc-console-bar i {
  width: 11px; height: 11px; border-radius: 50%; display: inline-block;
  background: #2e3a49;
}
.kc-console-bar i:nth-child(1) { background: #ef4444aa; }
.kc-console-bar i:nth-child(2) { background: #f59e0baa; }
.kc-console-bar i:nth-child(3) { background: #22c55eaa; }
/* Reserve room for the longest brief (it wraps to ~3 lines) so the console is a
   fixed size: as the typewriter cycles briefs the box never resizes and the page
   below never shifts. The brief wraps and stays fully readable; shorter briefs
   just leave blank space below, like a real terminal. */
.kc-console-line {
  color: var(--kc-text);
  min-height: 4.65em;          /* ~3 wrapped lines at the console line-height */
}
.kc-console-line .kc-prompt { color: var(--kc-brand); margin-right: 8px; }
@media (max-width: 440px) {
  .kc-console-line { min-height: 6.2em; }   /* narrow phones wrap to ~4 lines */
}
.kc-caret {
  display: inline-block;
  width: 8px;
  background: var(--kc-brand);
  margin-left: 2px;
  animation: kc-blink 1.05s steps(1) infinite;
}
@keyframes kc-blink { 50% { opacity: 0; } }

/* Hero board: the featured 3D render, floating with a violet glow. */
.kc-hero-art { position: relative; display: flex; justify-content: center; }
.kc-hero-art::before {
  content: "";
  position: absolute;
  inset: -6% -2% 6% -2%;
  background: radial-gradient(60% 55% at 50% 45%,
              rgba(45, 212, 191, 0.32), transparent 70%);
  filter: blur(14px);
  z-index: 0;
}
.kc-board {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.55));
  animation: kc-float 7s ease-in-out infinite;
}
@keyframes kc-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-0.4deg); }
}

/* Interactive 3D board models (<model-viewer>). The board floats on a
   transparent canvas and the rendered PNG is its poster, so the swap from
   poster to the live, orbitable model is seamless. */
.kc-model, .kc-model-hero { background: transparent; --poster-color: transparent; }
.kc-model::part(default-progress-bar) { opacity: 0; }
.kc-hero-art .kc-model-hero {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.55));
  cursor: grab;
}
.kc-hero-art .kc-model-hero:active { cursor: grabbing; }
.kc-sample-art .kc-model {
  width: 100%;
  height: 184px;
  pointer-events: none; /* the whole card is one link; the model is decorative */
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
}

/* Ambient page glow blobs (behind sections). */
.kc-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.kc-glow-a { top: -120px; right: -80px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(74,222,128,0.5), transparent 70%); }
.kc-glow-b { top: 380px; left: -140px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(167,139,250,0.42), transparent 70%); }

/* ---- generic section heading ---------------------------------------------- */
.kc-section { padding: 56px 0; }
.kc-kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--kc-accent); text-align: center;
}
.kc-h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800; letter-spacing: -0.02em; text-align: center;
  margin: 8px 0 0;
}
.kc-lead {
  text-align: center; color: var(--kc-muted); font-size: 1.05rem;
  max-width: 40em; margin: 14px auto 0;
}

/* ---- pipeline stepper ----------------------------------------------------- */
/* A 7-stage pipeline. 7 is prime, so any wrapped layout strands one card; we use
   an exact-count grid so every row is full, and let the final stage span its row
   as a deliberate capstone (never a lone, centered orphan). One clean row on wide
   screens; 3-up on tablets; 2-up on phones. */
.kc-pipe {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 36px;
}
.kc-step {
  position: relative;
  background: var(--kc-panel);
  border: 1px solid var(--kc-border);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.kc-step .kc-step-n {
  font-family: ui-monospace, monospace; font-size: 0.72rem; color: var(--kc-dim);
}
.kc-step .kc-step-name { font-weight: 700; margin-top: 4px; font-size: 0.92rem; }
.kc-step .kc-step-d { font-size: 0.8rem; color: var(--kc-muted); margin-top: 4px; }
.kc-step.kc-step-build { border-color: rgba(45, 212, 191, 0.45); }

@media (max-width: 1000px) {
  .kc-pipe { grid-template-columns: repeat(3, 1fr); }   /* 3 + 3 + capstone */
  .kc-step:last-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .kc-pipe { grid-template-columns: repeat(2, 1fr); }   /* 2 + 2 + 2 + capstone */
}

/* ---- feature cards -------------------------------------------------------- */
.kc-grid-4 {
  display: grid; gap: 18px; margin-top: 38px;
  grid-template-columns: repeat(2, 1fr);
}
.kc-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border: 1px solid var(--kc-border);
  border-radius: 14px;
  padding: 22px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
.kc-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 222, 128, 0.45);
  box-shadow: 0 18px 40px -22px rgba(74, 222, 128, 0.55);
}
.kc-card .kc-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(74, 222, 128, 0.12); color: var(--kc-brand);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.kc-card .kc-ic .material-icons { font-size: 22px; }
.kc-card h3 { font-size: 1.06rem; font-weight: 700; margin: 0 0 6px; }
.kc-card p { font-size: 0.92rem; color: var(--kc-muted); margin: 0; }

/* ---- sample gallery ------------------------------------------------------- */
.kc-gallery {
  display: grid; gap: 22px; margin-top: 38px;
  grid-template-columns: repeat(3, 1fr);
}
.kc-sample {
  display: flex; flex-direction: column;
  background: var(--kc-panel);
  border: 1px solid var(--kc-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
.kc-sample:hover {
  transform: translateY(-5px);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 24px 50px -26px rgba(45, 212, 191, 0.7);
}
.kc-sample-art {
  position: relative;
  background:
    radial-gradient(70% 80% at 50% 30%, rgba(74,222,128,0.16), transparent 70%),
    #08090d;
  padding: 20px 18px 8px;
  display: flex; align-items: center; justify-content: center;
  min-height: 168px;
}
.kc-sample-art img {
  width: 100%; max-height: 180px; object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.5));
}
.kc-badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--kc-brand); background: rgba(11,17,32,0.7);
  border: 1px solid rgba(74,222,128,0.3); border-radius: 999px;
  padding: 3px 10px;
}
.kc-sample-body { padding: 16px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.kc-sample-body h3 { font-size: 1.08rem; font-weight: 700; margin: 0; }
.kc-sample-stats { font-size: 0.76rem; color: var(--kc-dim); margin: 6px 0 0;
  font-family: ui-monospace, monospace; }
.kc-sample-body p { font-size: 0.9rem; color: var(--kc-muted); margin: 10px 0 0; }
.kc-sample-prompt {
  margin-top: 12px; font-size: 0.84rem; color: var(--kc-text);
  background: rgba(255,255,255,0.03); border: 1px dashed var(--kc-border);
  border-radius: 8px; padding: 9px 11px; font-style: italic;
}
.kc-sample-cta {
  margin-top: auto; padding-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.92rem; color: var(--kc-brand);
}
.kc-sample-cta .material-icons { font-size: 18px; transition: transform 0.18s ease; }
.kc-sample:hover .kc-sample-cta .material-icons { transform: translateX(4px); }

/* ---- how it works --------------------------------------------------------- */
.kc-steps3 { display: grid; gap: 20px; margin-top: 38px;
  grid-template-columns: repeat(3, 1fr); }
.kc-how {
  background: var(--kc-panel); border: 1px solid var(--kc-border);
  border-radius: 14px; padding: 24px;
}
.kc-how .kc-num {
  font-size: 2rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--kc-brand), var(--kc-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kc-how h3 { font-size: 1.1rem; font-weight: 700; margin: 12px 0 6px; }
.kc-how p { font-size: 0.92rem; color: var(--kc-muted); margin: 0; }

/* ---- final CTA band ------------------------------------------------------- */
.kc-cta-band {
  margin: 18px auto 0;
  text-align: center;
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(124,137,250,0.18), transparent 70%),
    var(--kc-panel);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 20px;
  padding: 48px 28px;
}
.kc-cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin: 0; }
.kc-cta-band p { color: var(--kc-muted); margin: 12px 0 24px; }

/* ---- footer --------------------------------------------------------------- */
.kc-foot {
  margin-top: 64px; border-top: 1px solid var(--kc-border);
  padding: 28px 0 40px;
}
.kc-foot-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.kc-foot a, .kc-foot span { font-size: 0.84rem; color: var(--kc-dim); }
.kc-foot a:hover { color: var(--kc-muted); }
.kc-foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---- pricing page (see web._render_pricing) -------------------------------- */
.kc-pricing {
  display: grid; gap: 20px; margin-top: 38px;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
.kc-price-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--kc-panel); border: 1px solid var(--kc-border);
  border-radius: 14px; padding: 26px 24px;
}
.kc-price-featured {
  border-color: rgba(45, 212, 191, 0.45);
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(45, 212, 191, 0.14), transparent 70%),
    var(--kc-panel);
  box-shadow: 0 18px 40px -18px rgba(74, 222, 128, 0.35);
}
.kc-price-pop { left: auto; right: 12px; } /* reuses .kc-badge, pinned top-right */
.kc-price-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.kc-price { margin: 10px 0 4px; }
.kc-price-n { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.kc-price-per { font-size: 0.9rem; color: var(--kc-muted); margin-left: 4px; }
.kc-price-feats {
  list-style: none; margin: 14px 0 22px; padding: 0;
  display: flex; flex-direction: column; gap: 9px; flex: 1;
}
.kc-price-feats li {
  font-size: 0.92rem; color: var(--kc-muted);
  padding-left: 24px; position: relative;
}
.kc-price-feats li::before {
  content: "✓"; position: absolute; left: 2px; top: 0;
  color: var(--kc-brand); font-weight: 700;
}
.kc-price-cta { justify-content: center; }
.kc-price-chip {
  display: inline-flex; justify-content: center;
  font-weight: 600; font-size: 0.95rem; color: var(--kc-dim);
  border: 1px dashed var(--kc-border); border-radius: 10px; padding: 11px 20px;
}
.kc-price-fine { font-size: 0.8rem; color: var(--kc-dim); margin-top: 22px; }
.kc-price-error {
  font-size: 0.9rem; color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4); border-radius: 10px;
  background: rgba(248, 113, 113, 0.08); padding: 10px 14px; margin: 16px 0 0;
}
.kc-faq {
  display: grid; gap: 18px; margin-top: 32px;
  grid-template-columns: repeat(2, 1fr);
}
.kc-faq-item {
  background: var(--kc-panel); border: 1px solid var(--kc-border);
  border-radius: 14px; padding: 20px 22px;
}
.kc-faq-item h3 { font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
.kc-faq-item p { font-size: 0.9rem; color: var(--kc-muted); margin: 0; }

/* ---- scroll reveal -------------------------------------------------------- */
.kc-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.kc-reveal.kc-in { opacity: 1; transform: none; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 880px) {
  .kc-hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .kc-hero-art { order: -1; }
  .kc-grid-4 { grid-template-columns: 1fr; }
  .kc-gallery { grid-template-columns: 1fr; }
  .kc-steps3 { grid-template-columns: 1fr; }
  .kc-pricing { grid-template-columns: 1fr; }
  .kc-faq { grid-template-columns: 1fr; }
  .kc-brand .kc-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .kc-board { animation: none; }
  .kc-caret { animation: none; }
  .kc-reveal { opacity: 1; transform: none; transition: none; }
  .kc-btn:hover, .kc-card:hover, .kc-sample:hover { transform: none; }
}
