/* ── Edoil site — content + chat widget, layered over the canvas animation ── */
:root {
  --bg: #05080c;
  --text: #e8eef6;
  --muted: #93a1b0;
  --accent: #58a6ff;
  --accent-2: #7ee0ff;
  --card: rgba(13, 18, 26, 0.66);
  --card-border: rgba(88, 166, 255, 0.18);
  --ok: #3fb950;
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* animated background lives behind everything */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: var(--bg);
  z-index: 0;
}
/* readability scrim: darker top (for the bar) + gentle vignette, animation still shows */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,8,12,0.72) 0%, rgba(5,8,12,0.30) 18%,
                    rgba(5,8,12,0.30) 60%, rgba(5,8,12,0.78) 100%),
    radial-gradient(120% 60% at 50% 38%, transparent 40%, rgba(5,8,12,0.55) 100%);
}

main { position: relative; z-index: 2; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(5, 8, 12, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(88, 166, 255, 0.10);
}
.brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
}
.nav { display: flex; gap: 20px; margin-left: 8px; flex: 1; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
.nav a:hover { color: var(--text); }
.lang { display: flex; align-items: center; gap: 6px; }
.lang button {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.lang button.active { color: var(--accent); font-weight: 600; }
.lang button:hover { color: var(--text); }
.lang-sep { color: var(--muted); opacity: 0.5; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 22px 60px;
  gap: 18px;
}
.hero-title {
  font-size: clamp(56px, 12vw, 132px);
  margin: 0;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(180deg, #fff 0%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(88, 166, 255, 0.35);
}
.hero-tagline {
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 600;
  margin: 0;
  max-width: 760px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
  max-width: 620px;
  margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,0.7);
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #4a8fe0);
  color: #04121f;
  box-shadow: 0 6px 26px rgba(88, 166, 255, 0.35);
}
.btn.primary:hover { box-shadow: 0 8px 34px rgba(88, 166, 255, 0.5); }
.btn.ghost {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.18);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── sections + cards ────────────────────────────────────────────────── */
.section { max-width: var(--maxw); margin: 0 auto; padding: 70px 22px; }
.section-h { font-size: clamp(28px, 5vw, 40px); text-align: center; margin: 0 0 6px; font-weight: 700; letter-spacing: -0.5px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 38px; max-width: 640px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 26px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card h2 { margin: 0 0 12px; font-size: 26px; }
.card h3 { margin: 10px 0 8px; font-size: 19px; color: var(--text); }
.card p { margin: 0; color: var(--muted); }
.card.narrow { max-width: 800px; margin: 0 auto; }
.card.center { text-align: center; }
.card.accent { border-color: rgba(88, 166, 255, 0.45); box-shadow: 0 0 0 1px rgba(88,166,255,0.15), 0 10px 40px rgba(88,166,255,0.12); }
.cta-card { max-width: 640px; margin: 0 auto; }
.cta-card .btn { margin-top: 16px; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.why { padding: 6px 4px; }
.why h4 { margin: 0 0 6px; font-size: 17px; color: var(--accent); }
.why p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* badges */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.badge.now { background: rgba(63, 185, 80, 0.16); color: #56d364; border: 1px solid rgba(63,185,80,0.4); }
.badge.soon { background: rgba(210, 153, 34, 0.14); color: #e3b341; border: 1px solid rgba(210,153,34,0.4); }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 22px 80px; }

/* ── chat widget ─────────────────────────────────────────────────────── */
#chat-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 50;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #04121f;
  background: linear-gradient(135deg, var(--accent), #4a8fe0);
  box-shadow: 0 8px 30px rgba(88, 166, 255, 0.5);
  transition: transform 0.15s;
}
#chat-fab:hover { transform: scale(1.06); }

#chat-panel {
  position: fixed;
  right: 22px; bottom: 92px;
  z-index: 51;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
#chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(88,166,255,0.12);
  background: rgba(88,166,255,0.06);
}
.chat-header .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chat-header .title { font-weight: 600; font-size: 15px; flex: 1; }
.chat-header .close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.chat-header .close:hover { color: var(--text); }

.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.bot { align-self: flex-start; background: rgba(255,255,255,0.07); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #4a8fe0); color: #04121f; border-bottom-right-radius: 4px; }
.chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(88,166,255,0.12); }
.chat-input-row textarea {
  flex: 1; resize: none; height: 42px; max-height: 120px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--text);
  font: inherit; font-size: 14px;
  padding: 10px 12px;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--accent); }
.chat-input-row button {
  border: none; border-radius: 10px; padding: 0 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #4a8fe0); color: #04121f;
  font: inherit; font-weight: 600;
}
.chat-input-row button:disabled { opacity: 0.5; cursor: default; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .section { padding: 50px 18px; }
  #chat-panel { right: 12px; bottom: 84px; height: calc(100vh - 110px); }
  #chat-fab { right: 16px; bottom: 16px; }
}

/* respect reduced motion: the heavy animation can be distracting */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
