/* Cortex-IT — responsive stylesheet */

:root {
  --bg: #0e1420;
  --bg-alt: #131c2c;
  --surface: #1a2438;
  --text: #e8edf5;
  --text-dim: #9fb0c8;
  --accent: #4da3ff;
  --accent-strong: #2f7fe0;
  --border: #26344e;
  --radius: 14px;
  --max: 1100px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.container.narrow { max-width: 780px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; color: var(--accent); }
p { margin: 0 0 1em; color: var(--text-dim); }
li { color: var(--text-dim); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14, 20, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; position: relative;
}
.brand { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0;
}
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; margin: 5px 0;
  background: var(--text); border-radius: 2px;
}

/* Hero */
.hero {
  padding: 4rem 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(77, 163, 255, 0.14), transparent 55%),
    var(--bg);
}
.hero-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center;
}
.hero-text p { font-size: 1.15rem; }
.hero-img { border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  display: inline-block; padding: 0.75rem 1.5rem; border-radius: 999px;
  font-weight: 600; transition: transform 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn.primary { background: var(--accent-strong); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.ghost { border: 1px solid var(--border); color: var(--text); }

/* Sections */
.section { padding: 4.5rem 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section.page { min-height: 60vh; }

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.split img { border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.35); }
.service { margin-bottom: 4rem; }
.service:last-child { margin-bottom: 0; }
.service.reverse img { order: -1; }
.service ul { padding-left: 1.2rem; }
.service li { margin-bottom: 0.6rem; }
.service strong { color: var(--text); }

.feature-list { display: grid; gap: 1.25rem; }
.feature h3 { margin-bottom: 0.2em; }
.feature p { margin: 0; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
}
.card p { margin: 0; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem; margin: 3.5rem 0; text-align: center;
}
.stat-value {
  display: block; font-size: 2.6rem; font-weight: 700; color: var(--accent);
}
.stat-label { color: var(--text-dim); }

.contact-cta { text-align: center; margin-top: 2rem; }
.contact-cta p { font-size: 1.15rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 2.5rem 0;
  background: var(--bg-alt); color: var(--text-dim); font-size: 0.95rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.footer-links { display: flex; gap: 1.5rem; align-items: start; }

/* Chat widget */
.chat-fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent-strong); color: #fff; font-size: 1.4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chat-panel {
  position: fixed; right: 1.25rem; bottom: 5.5rem; z-index: 200;
  width: min(360px, calc(100vw - 2.5rem)); height: 440px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.chat-header {
  padding: 0.9rem 1.2rem; font-weight: 600;
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-msg {
  max-width: 85%; padding: 0.55rem 0.9rem; border-radius: 12px; font-size: 0.95rem;
}
.chat-msg.user { align-self: flex-end; background: var(--accent-strong); color: #fff; }
.chat-msg.bot { align-self: flex-start; background: var(--bg-alt); color: var(--text); }
.chat-input {
  display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1; padding: 0.6rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.chat-input button {
  padding: 0.6rem 1.1rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent-strong); color: #fff; font-weight: 600;
}
.chat-input button:disabled { opacity: 0.5; cursor: default; }

/* Mobile */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 0.5rem 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 0.9rem 1.5rem; }

  .hero { padding: 2.5rem 0; }
  .hero-grid, .split { grid-template-columns: 1fr; gap: 1.75rem; }
  .service.reverse img { order: 0; }
  .section { padding: 3rem 0; }
}
