/* ============================================================
   KUCHUANG YIDE — precision-industrial visual system.
   Dark, engineered, premium. System fonts only (zero webfont
   requests). All textures are CSS-generated (zero image bytes).
   ============================================================ */

:root {
  /* brand */
  --brand: #2f6df6;        /* electric engineering blue */
  --brand-deep: #0b1f4b;
  --accent: #ff8a1e;       /* energy orange — precise accents only */

  /* dark surfaces (layered like machined steel) */
  --bg: #070b14;
  --bg-2: #0b1220;
  --card: #0f1729;
  --card-2: #131d33;
  --line: rgba(148, 172, 214, 0.14);
  --line-strong: rgba(148, 172, 214, 0.28);

  /* ink */
  --ink: #eaf0fb;
  --muted: #8ea0c0;
  --faint: #5a6a88;

  --ok: #34d399;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset,
                 0 20px 50px -30px rgba(0,0,0,0.8);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 109, 246, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 138, 30, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 24px; }

/* engineering micro-grid backdrop — pure CSS */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 172, 214, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 172, 214, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.logo {
  font-weight: 800; letter-spacing: 0.10em; font-size: 17px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.logo a { color: inherit; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #6ea0ff 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 4px 14px -4px rgba(47, 109, 246, 0.6);
}
.logo span.word { color: var(--brand); }
.header-note {
  font-size: 12px; color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 88px;
  padding: 36px 0 48px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(11, 18, 32, 0.6));
  font-size: 14px; color: #a9b8d6;
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 10px; font-weight: 700;
}
.site-footer ul { list-style: none; }
.site-footer li { padding: 2px 0; }

/* ---------- home hero ---------- */
.hero { text-align: center; padding: 88px 24px 40px; position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 16px; margin-bottom: 26px;
  background: rgba(15, 23, 41, 0.6);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero h1 {
  font-size: clamp(30px, 5.4vw, 52px);
  font-weight: 800; line-height: 1.14; letter-spacing: -0.015em;
  background: linear-gradient(180deg, #ffffff 20%, #b9c8e8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub { color: var(--muted); margin: 22px auto 0; font-size: clamp(15px, 2.2vw, 18px); max-width: 640px; }
.hero .sub b { color: var(--ink); font-weight: 600; }

.net-chip {
  display: inline-block; margin-top: 22px; font-size: 12.5px; color: var(--muted);
  background: rgba(15, 23, 41, 0.7); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; letter-spacing: 0.02em;
}

.hero-cta {
  display: flex; gap: 12px; justify-content: center; margin-top: 34px;
  flex-wrap: wrap;
}
.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  margin: 40px auto 0; padding: 18px 22px; max-width: 760px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted); letter-spacing: 0.02em;
}
.trust-strip span { display: inline-flex; align-items: center; gap: 7px; }
.trust-strip span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand); opacity: 0.8;
}

/* ---------- hero CTA + stats (Stripe-style proof bar) ---------- */
.hero-cta {
  display: flex; gap: 12px; justify-content: center; margin-top: 34px;
  flex-wrap: wrap;
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 48px auto 0; max-width: 720px;
  background: var(--line); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
}
.stats > div {
  background: var(--bg-2); padding: 20px 12px; text-align: center;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.stats b {
  font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stats span { font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- entry cards ---------- */
.entries {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px; padding: 44px 0 24px;
}
.entry-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px 36px 36px; color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.entry-card::before {  /* machined top edge */
  content: ""; position: absolute; top: 0; left: 36px; right: 36px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.entry-card::after {  /* corner glow */
  content: ""; position: absolute; top: -60px; right: -60px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(47, 109, 246, 0.18), transparent 65%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.entry-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #17223c, var(--card));
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset,
              0 30px 70px -35px rgba(0,0,0,0.9),
              0 0 0 1px rgba(47, 109, 246, 0.15);
}
.entry-card:hover::before, .entry-card:hover::after { opacity: 1; }

.entry-card .emoji {
  width: 52px; height: 52px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: rgba(47, 109, 246, 0.10); border: 1px solid rgba(47, 109, 246, 0.25);
}
.card-index {
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--brand); opacity: 0.85; margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.entry-card h2 { margin: 0 0 10px; font-size: 23px; letter-spacing: -0.01em; }
.card-icon {
  width: 52px; height: 52px; border-radius: 13px; display: block;
  background: rgba(47, 109, 246, 0.08); border: 1px solid rgba(47, 109, 246, 0.25);
}
.entry-card p { color: var(--muted); font-size: 15px; }
.entry-card .go {
  display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 22px;
  font-weight: 600; color: var(--muted); font-size: 14px; letter-spacing: 0.02em;
  align-self: flex-start;
}
.entry-card:hover .go { color: var(--brand); }
.entry-card .go::after { content: "→"; transition: transform 0.3s var(--ease); }
.entry-card:hover .go::after { transform: translateX(5px); }

/* ---------- page bar ---------- */
.page-bar { padding: 52px 0 10px; }
.page-bar h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.01em; }
.page-bar p { color: var(--muted); margin-top: 10px; max-width: 640px; }

/* ---------- overview video ---------- */
.overview-video {
  margin: 26px 0 30px; position: relative;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9),
              0 0 60px -30px rgba(47, 109, 246, 0.4);
}
.overview-video video { display: block; width: 100%; max-height: 440px; object-fit: cover; background: #000; }

/* ---------- chat ---------- */
.chat-shell {
  display: flex; flex-direction: column; height: 62vh; min-height: 400px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-card);
}
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.msg {
  max-width: 82%; padding: 11px 15px; border-radius: 14px;
  font-size: 15px; white-space: pre-wrap; word-break: break-word;
  animation: msg-in 0.3s var(--ease);
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .src {
  display: block; margin-top: 9px; font-size: 11px; color: var(--faint);
  border-top: 1px dashed var(--line); padding-top: 7px;
  letter-spacing: 0.03em;
}
.msg.bot {
  align-self: flex-start; background: rgba(19, 29, 51, 0.85);
  border: 1px solid var(--line); border-bottom-left-radius: 4px;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand), #1d4fd8);
  border-bottom-right-radius: 4px;
  box-shadow: 0 6px 20px -8px rgba(47, 109, 246, 0.55);
}
.msg.fallback { border-left: 3px solid var(--accent); }
.chat-attach { display: flex; align-items: center; gap: 8px; padding: 8px 24px 0; font-size: 12px; color: var(--muted); }
.chat-attach img { height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); }

.chat-input-row { display: flex; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.chat-input-row input[type="file"] { display: none; }
.chat-input {
  flex: 1; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 15px; font-size: 15px; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input::placeholder { color: var(--faint); }
.chat-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.18);
}

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 12px 20px; font-size: 15px;
  font-family: inherit; font-weight: 700; letter-spacing: 0.01em; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #1d4fd8); color: #fff;
  box-shadow: 0 8px 24px -10px rgba(47, 109, 246, 0.7);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.btn.accent {
  background: linear-gradient(135deg, #ff9d3d, var(--accent));
  box-shadow: 0 8px 24px -10px rgba(255, 138, 30, 0.6);
}

.typing { display: inline-flex; gap: 5px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- inquiry fab / modal ---------- */
.inquiry-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  box-shadow: 0 14px 40px -12px rgba(47, 109, 246, 0.8);
}
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-mask.open { display: flex; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 440px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95);
  animation: modal-in 0.3s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin-bottom: 6px; font-size: 20px; letter-spacing: -0.01em; }
.modal .hint { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal label {
  display: block; font-size: 12px; font-weight: 700; margin: 14px 0 6px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.modal input {
  width: 100%; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 11px 13px; font-size: 15px; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.18);
}
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ---------- tour ---------- */
.tour-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin: 24px 0;
}
.tour-btn {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 12px; text-align: center; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.tour-btn:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tour-btn.active {
  border-color: rgba(47, 109, 246, 0.6);
  box-shadow: 0 0 0 1px rgba(47, 109, 246, 0.35),
              0 12px 30px -18px rgba(47, 109, 246, 0.7);
  background: linear-gradient(180deg, rgba(47, 109, 246, 0.14), var(--card));
}
.tour-btn .station-icon { display: block; width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 10px; opacity: 0.92; }
.tour-btn.active .station-icon { opacity: 1; }

.tour-player {
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 10px; border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.tour-player video { display: block; width: 100%; max-height: 460px; min-height: 120px; }
.tour-player:has(video:not([src]), video source[src=""]) { min-height: 0; }
.tour-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-size: 13px; color: var(--muted); margin-bottom: 40px;
}
.tour-meta #tour-title { font-size: 15px; font-weight: 700; color: var(--ink); }

.snapshot-note {
  background: linear-gradient(135deg, rgba(255, 138, 30, 0.10), rgba(255, 138, 30, 0.04));
  border: 1px solid rgba(255, 138, 30, 0.3); border-radius: 13px;
  padding: 15px 20px; font-size: 14px; color: #ffca8f; margin-bottom: 12px;
}

.book-cta {
  margin-top: 12px; padding: 30px; text-align: center; color: var(--muted);
  font-size: 14.5px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(15, 23, 41, 0.5), transparent);
}
.book-cta .btn { margin-top: 16px; }
.book-cta p { margin-top: 12px; }

/* ---------- thank you ---------- */
.thanks { text-align: center; padding: 130px 24px 40px; }
.thanks .emoji {
  width: 76px; height: 76px; border-radius: 20px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 50px -12px rgba(52, 211, 153, 0.5);
}
.thanks h1 { margin: 24px 0 10px; letter-spacing: -0.01em; }
.thanks p { color: var(--muted); margin-bottom: 30px; }

/* ---------- entrance motion (restrained) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero > *, .entries .entry-card, .page-bar > *, .chat-shell {
    animation: rise 0.55s var(--ease) both;
  }
  .entries .entry-card:nth-child(2) { animation-delay: 0.08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ---------- selection / focus-visible ---------- */
::selection { background: rgba(47, 109, 246, 0.35); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 560px) {
  .msg { max-width: 92%; }
  .inquiry-fab { right: 16px; bottom: 16px; }
  .header-note { display: none; }   /* keep header clean on phones */
  .entries { grid-template-columns: 1fr; }
}
