/* ───────────────────────────────
   SCORPEX Site Styles (Unified)
   ─────────────────────────────── */
:root {
  --bg: #0b0f12;
  --panel: #11161c;
  --muted: #8a98a8;
  --text: #e9eef5;
  --accent: #3ba0ff;
  --accent-2: #2b7bd9;
  --card: #0f141a;
  --border: #1a2230;
}

/* Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
:root { color-scheme: dark; }
html {
  height: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Base — flat background, smooth corner glows */
body{
  margin:0;
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Ubuntu,Cantarell,Noto Sans,sans-serif;
  background:#0b0f12;          
  position:relative;
  min-height:100dvh;
  overflow-x:hidden;
  z-index:0;
}

/* subtle grain */
body::before{
  content:"";
  position:fixed; inset:0; pointer-events:none;
  opacity:.02;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 64 64'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:320px 320px;
  mix-blend-mode:normal;
  z-index:0;
}

/* Corner glow overlay */
body::after{
  content:"";
  position:fixed;
  inset:-25% -20% -25% -20%;
  pointer-events:none;
  z-index:0;

  /* top-right & bottom-left soft blue glows */
  background:
    radial-gradient(900px 700px at 115% -10%,
      rgba(59,160,255,0.22) 0%,
      rgba(59,160,255,0.05) 45%,
      transparent 80%) no-repeat,
    radial-gradient(900px 700px at -15% 120%,
      rgba(59,160,255,0.18) 0%,
      rgba(59,160,255,0.05) 45%,
      transparent 80%) no-repeat;

  filter: blur(42px);
  opacity:.85;
}

/* Links and layout */
a { color: #bcd3f0; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Navigation ------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .3px; }
.brand img { width: 28px; height: 28px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; margin-left: 16px; }
.nav a.active, .nav a:hover { color: var(--text); }

/* Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 72px 0 84px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#223043 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: .08;
  -webkit-mask: radial-gradient(70% 70% at 65% 42%, #000 55%, rgba(0,0,0,.5) 75%, transparent 100%);
          mask: radial-gradient(70% 70% at 65% 42%, #000 55%, rgba(0,0,0,.5) 75%, transparent 100%);
}

/* Typography ------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  margin: 0 0 16px;
}
h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; }
h2 { font-size: clamp(24px, 3.5vw, 36px); margin-bottom: 20px; }
p.lead {
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 19px);
  max-width: 60ch;
  margin: 0 0 28px;
}

/* Buttons ---------------------------------------------------------- */
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: linear-gradient(180deg,#121a24,#0e151d);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .2px;
  transition: filter .15s ease, transform .02s ease, box-shadow .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,160,255,.25);
}

/* Cards ------------------------------------------------------------ */
.card, .preview {
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg,#0f151c,#0b1016);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.02);
  padding: 16px;
  margin-top: 16px;
}
.card h3 { margin: 0 0 8px; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}
.preview img {
  max-width: 240px;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.45));
}

/* Contact Form ----------------------------------------------------- */
.form .input,
.form .textarea,
input.input,
textarea.textarea {
  width: 100%;
  color: var(--text);
  background: #0d1319;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form .input:focus-visible,
.form .textarea:focus-visible,
input.input:focus-visible,
textarea.textarea:focus-visible {
  border-color: #2a5ea5;
  box-shadow: 0 0 0 3px rgba(59,160,255,.18);
}
.form .input:focus,
.form .textarea:focus,
input.input:focus,
textarea.textarea:focus {
  box-shadow: none;
}
.form--contact {
  display: grid;
  grid-template-columns: 160px minmax(0,1fr);
  column-gap: 16px;
  row-gap: 14px;
  max-width: 720px;
}
.form--contact label {
  align-self: start;
  padding-top: 10px;
  font-weight: 600;
  color: #d7e2ee;
}
.input { height: 44px; line-height: 44px; }
.textarea { height: 160px; resize: none; }
.form--contact .actions {
  grid-column: 2;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Divider under page titles --------------------------------------- */
.page-title {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 32px;
}
.page-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: clamp(200px, 38vw, 600px);
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(59,160,255,1) 0%,
    rgba(59,160,255,0.5) 30%,
    rgba(59,160,255,0.15) 55%,
    rgba(59,160,255,0.03) 70%,
    rgba(59,160,255,0) 80%
  );
  opacity: 0.95;
}

/* Footer ----------------------------------------------------------- */
.footer {
  color: #90a2b6;
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px 0;
  font-size: 14px;
}

/* Responsive ------------------------------------------------------- */
@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; gap: 28px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 640px) {
  .form--contact { grid-template-columns: 1fr; }
  .form--contact .actions { grid-column: 1; }
}
/* iOS/Safari fallback for performance */
@media (max-width: 1024px) {
  body { background-attachment: scroll, scroll, scroll; }
}

/* Accessibility ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
