:root {
  --bg: #0b0f17;
  --panel: rgba(18, 27, 43, 0.82);
  --text: #f5f7fb;
  --muted: #b8c3d9;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #58a6ff;
  --accent-2: #9a6bff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --max: 1280px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(88, 166, 255, 0.12), transparent 26%),
    radial-gradient(circle at left center, rgba(154, 107, 255, 0.10), transparent 22%),
    linear-gradient(180deg, #0b0f17 0%, #0d1320 45%, #0a0f18 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.site-shell { min-height: 100vh; overflow-x: hidden; }
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(18px); background: rgba(8, 12, 20, 0.64); border-bottom: 1px solid rgba(255,255,255,0.08); }
.topbar-inner { width: min(calc(100% - 28px), var(--max)); margin: 0 auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-badge { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); box-shadow: 0 12px 30px rgba(88, 166, 255, 0.24); }
.brand-text strong { display: block; font-size: 1rem; }
.brand-text span { display: block; color: var(--muted); font-size: 0.82rem; }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  transition: transform .24s ease, background .24s ease;
}
.nav a:hover, .btn:hover, .card:hover, .gallery-item:hover, .assistant-window:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; }
.container { width: min(calc(100% - 28px), var(--max)); margin: 0 auto; }
.section { padding: 24px 0; }
.section-first { padding-top: 34px; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 3rem); }
.section-subtitle { color: var(--muted); margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.card, .gallery-item, .footer-card, .assistant-window {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card-link { overflow: hidden; display: block; }
.card-link article { height: 100%; }
.card-image { height: 280px; background-size: cover; background-position: center; }
.card-copy { padding: 18px 20px 22px; }
.card-copy h3 { margin: 0; font-size: 1.3rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.gallery-item { overflow: hidden; }
.gallery-thumb { height: 220px; background-size: cover; background-position: center; }
.footer-card { padding: 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.inline-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.page-overlay {
  position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; transition: opacity .24s ease;
}
.page-overlay.active { opacity: 1; pointer-events: auto; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); }
.overlay-panel {
  position: absolute; inset: 18px; background: rgba(10, 14, 24, 0.95); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
}
.overlay-close {
  position: absolute; right: 18px; top: 18px; z-index: 3; width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); color: #fff; cursor: pointer; font-size: 1.2rem;
}
.overlay-body { padding: 0; height: 100%; overflow: hidden; }
.overlay-frame-wrap { width: 100%; height: 100%; background: #fff; }
.overlay-iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.assistant-dock { position: fixed; right: 22px; bottom: 22px; z-index: 90; }
.assistant-toggle {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; color: white; font-size: 1.6rem; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); box-shadow: 0 18px 40px rgba(88, 166, 255, 0.24);
}
.assistant-window {
  width: min(400px, calc(100vw - 24px)); height: 560px; position: absolute; right: 0; bottom: 78px; display: none; overflow: hidden;
}
.assistant-window.active { display: block; }
.assistant-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.assistant-head span { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: white; cursor: pointer; }
.assistant-body { display: flex; flex-direction: column; height: calc(100% - 76px); }
.assistant-messages { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 18px; line-height: 1.5; }
.bubble.bot { background: rgba(255,255,255,0.08); align-self: flex-start; }
.bubble.user { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); align-self: flex-end; }
.assistant-form { padding: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.assistant-input { resize: none; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: white; }
.primary-send { min-width: 88px; }
@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 8px 0; align-items: flex-start; flex-direction: column; }
  .card-grid, .gallery-grid { grid-template-columns: 1fr; }
  .card-image, .gallery-thumb { height: 220px; }
  .overlay-panel { inset: 10px; border-radius: 22px; }
  .assistant-dock { right: 14px; bottom: 14px; }
  .assistant-window { height: min(72vh, 560px); }
  .assistant-form { grid-template-columns: 1fr auto; }
  .primary-send { grid-column: 1 / -1; }
}
