/* FilmCDN — Cinematic dark CDN design language */

:root {
  --bg: #0b0b0f;
  --surface: #15151c;
  --ink: #f4f4f6;
  --muted: #9a9aa5;
  --accent: #e11d48;
  --accent2: #f59e0b;

  --surface-2: #1d1d27;
  --border: #272733;
  --accent-soft: rgba(225, 29, 72, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ambient cinematic backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(225, 29, 72, 0.18), transparent 60%),
    radial-gradient(700px 500px at 0% 0%, rgba(245, 158, 11, 0.08), transparent 55%),
    linear-gradient(180deg, #0c0c12 0%, var(--bg) 40%);
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}

a { color: inherit; text-decoration: none; }

p { color: var(--muted); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 15, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand .logo { width: 34px; height: 34px; display: block; }
.brand b { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface); }
.nav-links a.active {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.35);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.97rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #be123c);
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(225, 29, 72, 0.8);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -12px rgba(225, 29, 72, 0.9); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: #fff; }

/* ---------- Sections ---------- */
main { flex: 1 0 auto; }

.section { padding: 76px 0; }
.section-tight { padding: 52px 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 14px;
}

.section-head { max-width: 680px; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; position: relative; }
.hero h1 {
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  margin-bottom: 22px;
  max-width: 14ch;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink);
  opacity: 0.86;
  max-width: 54ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Big numbers (bandwidth) ---------- */
.bignums {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 60px;
}
.bignum {
  background: var(--surface);
  padding: 30px 24px;
}
.bignum .n {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--ink), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bignum .l { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(225, 29, 72, 0.45); }
.card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.card .ico {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  margin-bottom: 18px;
}
.card .ico svg { width: 24px; height: 24px; }

/* Wide feature block */
.wide {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px;
}
.wide h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: 16px; }

.map-art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 40%, rgba(225,29,72,0.35), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(245,158,11,0.25), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,0.03) 22px 23px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,0.03) 22px 23px),
    var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ---------- Pricing ---------- */
.price-grid { grid-template-columns: repeat(3, 1fr); }
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
  position: relative;
}
.plan .tag {
  position: absolute; top: -13px; left: 28px;
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 20px;
}
.plan h3 { font-size: 1.3rem; margin-bottom: 6px; }
.plan .price {
  font-family: var(--font-head); font-weight: 800;
  font-size: 2.6rem; letter-spacing: -0.03em; margin: 12px 0 4px;
}
.plan .price span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; margin: 22px 0 28px; display: flex; flex-direction: column; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); opacity: 0.9; font-size: 0.95rem; }
.plan li svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 3px; color: var(--accent2); }
.plan .btn { margin-top: auto; justify-content: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
th { font-family: var(--font-head); font-weight: 700; color: var(--ink); background: var(--surface-2); }
td { color: var(--muted); }
tr:last-child td { border-bottom: none; }

/* ---------- Status page ---------- */
.status-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.14), var(--surface));
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 38px;
}
.status-banner .dot-big {
  width: 16px; height: 16px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 0 6px rgba(16,185,129,0.2);
  animation: pulse 2.4s infinite;
}
.status-banner h2 { font-size: 1.35rem; }
.status-banner p { margin: 0; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(16,185,129,0.22); }
  50% { box-shadow: 0 0 0 11px rgba(16,185,129,0); }
}

.node-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
.node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.node-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.node-name { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 9px; }
.node-city { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
}
.dot.ok { background: #10b981; box-shadow: 0 0 10px rgba(16,185,129,0.7); }
.dot.warn { background: var(--accent2); box-shadow: 0 0 10px rgba(245,158,11,0.7); }
.dot.down { background: var(--accent); box-shadow: 0 0 10px rgba(225,29,72,0.7); }

.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase;
}
.badge.ok { background: rgba(16,185,129,0.15); color: #34d399; }
.badge.warn { background: rgba(245,158,11,0.15); color: var(--accent2); }
.badge.down { background: var(--accent-soft); color: #fb7185; }

.metric { margin-bottom: 16px; }
.metric:last-child { margin-bottom: 0; }
.metric-head { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 7px; }
.metric-head .lbl { color: var(--muted); }
.metric-head .val { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar {
  height: 8px; border-radius: 6px; background: var(--surface-2);
  overflow: hidden; position: relative;
}
.bar i {
  display: block; height: 100%; border-radius: 6px;
  transition: width 0.7s cubic-bezier(.22,1,.36,1);
}
.bar i.b-bitrate { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bar i.b-uptime { background: linear-gradient(90deg, #10b981, #34d399); }

.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 0.88rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 42px; align-items: start; }
.docs-nav {
  position: sticky; top: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.docs-nav h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.docs-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.docs-nav a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.docs-nav a:hover { color: var(--ink); background: var(--surface-2); }

.doc-block { margin-bottom: 44px; }
.doc-block h2 { font-size: 1.5rem; margin-bottom: 14px; scroll-margin-top: 90px; }
.doc-block h3 { font-size: 1.1rem; margin: 22px 0 10px; }
.doc-block p { margin-bottom: 12px; }
.doc-block ul.list { margin: 12px 0 12px 20px; color: var(--muted); }
.doc-block ul.list li { margin-bottom: 7px; }

pre {
  background: #09090d;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 14px 0;
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.86rem;
  color: #fda4af;
}
pre code { color: #e4e4e8; }
p code, li code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }

/* ---------- Forms (contacts) ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.18s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.form-ok {
  display: none;
  background: rgba(16,185,129,0.14);
  border: 1px solid rgba(16,185,129,0.4);
  color: #34d399;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 600;
}
.form-ok.show { display: block; }

.contact-info .info-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.contact-info .info-item:last-child { border-bottom: none; }
.contact-info .info-item .ico {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--accent-soft);
}
.contact-info .info-item .ico svg { width: 20px; height: 20px; }
.contact-info .info-item b { display: block; font-family: var(--font-head); margin-bottom: 2px; }
.contact-info .info-item a, .contact-info .info-item span { color: var(--muted); }

/* ---------- CTA strip ---------- */
.cta {
  text-align: center;
  background: linear-gradient(135deg, rgba(225,29,72,0.18), rgba(245,158,11,0.1)), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 28px;
}
.cta h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); margin-bottom: 14px; }
.cta p { max-width: 50ch; margin: 0 auto 26px; color: var(--ink); opacity: 0.85; }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: #08080c;
  padding: 54px 0 30px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer-grid p { font-size: 0.92rem; max-width: 36ch; margin-top: 14px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: var(--muted); font-size: 0.93rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  border-top: 1px solid var(--border); padding-top: 22px;
  color: var(--muted); font-size: 0.86rem; flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 20px;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 14px; font-size: 1rem; }
  .burger { display: flex; }

  .bignums { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .price-grid, .node-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .wide { grid-template-columns: 1fr; padding: 30px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .section { padding: 54px 0; }
  .hero { padding: 64px 0 48px; }
  .bignums { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .wide, .form, .cta { padding: 24px; }
  .plan { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
