/* ============================================================
   CVN Technologies Inc. — Global Stylesheet
   Dark-first premium enterprise theme · Light mode supported
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --font-display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --nav-h: 76px;
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --maxw: 1200px;
}

/* Dark (default) */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f1d;
  --bg-2: #101424;
  --surface: #131830;
  --surface-2: #171d3a;
  --glass: rgba(15, 19, 36, .72);
  --line: rgba(138, 165, 220, .15);
  --line-strong: rgba(138, 165, 220, .28);
  --text: #e8edf7;
  --muted: #9aa5bf;
  --faint: #6b7691;
  --accent: #5b8ee6;
  --accent-bright: #82b1ff;
  --accent-deep: #1843b5;
  --accent-ink: #0c0f1d;
  --glow: rgba(91, 142, 230, .35);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, .45);
  --hero-orb-1: rgba(40, 90, 220, .38);
  --hero-orb-2: rgba(100, 160, 255, .22);
  --hero-orb-3: rgba(20, 50, 140, .45);
  --dot: rgba(138, 165, 220, .09);
  --texture:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(45, 90, 200, .10), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M56 0H0v56' fill='none' stroke='%238aa5dc' stroke-opacity='0.07' stroke-width='1'/%3E%3C/svg%3E");
}

/* Light */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa;
  --bg-2: #eceff7;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --glass: rgba(250, 251, 254, .8);
  --line: rgba(20, 45, 110, .12);
  --line-strong: rgba(20, 45, 110, .22);
  --text: #0c1530;
  --muted: #49546e;
  --faint: #7d87a0;
  --accent: #1843b5;
  --accent-bright: #2f62d8;
  --accent-deep: #1843b5;
  --accent-ink: #ffffff;
  --glow: rgba(24, 67, 181, .18);
  --card-shadow: 0 6px 24px rgba(15, 35, 90, .08);
  --hero-orb-1: rgba(70, 120, 230, .20);
  --hero-orb-2: rgba(130, 177, 255, .25);
  --hero-orb-3: rgba(24, 67, 181, .14);
  --dot: rgba(20, 45, 110, .08);
  --texture:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(70, 120, 230, .07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M56 0H0v56' fill='none' stroke='%23142d6e' stroke-opacity='0.065' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--texture);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
  overflow-x: clip; /* clip ≠ hidden: doesn't create a scroll container, so IntersectionObserver works */
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -.015em;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }

.container {
  width: min(var(--maxw), 100% - 48px);
  margin-inline: auto;
}

/* ---------- Header / Nav (single bar, no top strip) ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }
.logo-dark { display: block; }
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 9px 14px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--line); }
.nav-links a[aria-current="page"] { color: var(--accent-bright); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .25s var(--ease), background .2s;
}
.theme-toggle:hover { color: var(--accent-bright); border-color: var(--accent); transform: rotate(18deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
.icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 11px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .015em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  /* border-box origin + no-repeat: prevents the gradient tile from repeating
     into the 1px transparent border (bright seam on the right edge) */
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-deep)) border-box;
  background-repeat: no-repeat;
  color: #fff;
  box-shadow: 0 4px 18px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--glow); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: 9px; }

/* Hamburger */
.nav-burger {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  margin: 2.5px auto;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* Mobile panel */
.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  padding: 10px 24px 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 13px 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a[aria-current="page"] { color: var(--accent-bright); }
.mobile-menu .btn { margin-top: 16px; width: 100%; }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 96px 0; position: relative; }
.section-tight { padding: 64px 0; }
.section-alt {
  background-color: var(--bg-2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.6px);
  background-size: 26px 26px;
  border-block: 1px solid var(--line);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 18px;
}
.kicker::before {
  content: "";
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--accent-bright), transparent);
  border-radius: 2px;
}

.section h2 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 700; }
.section-lead { max-width: 620px; color: var(--muted); font-size: 18px; }

.section-head { margin-bottom: 52px; }
.section-head.center { text-align: center; }
.section-head.center .section-lead { margin-inline: auto; }
.section-head.center .kicker::before { display: none; }
.section-head.center .kicker::after { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }

/* ---------- Reveal animations ----------
   Gated on .js-ready (added by main.js immediately on parse).
   Without JS, .reveal elements are visible by default — no invisible content. */
@media (prefers-reduced-motion: no-preference) {
  .js-ready .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
  }
  .js-ready .reveal.in { opacity: 1; transform: none; }
  .js-ready .reveal-d1 { transition-delay: .08s; }
  .js-ready .reveal-d2 { transition-delay: .16s; }
  .js-ready .reveal-d3 { transition-delay: .24s; }
  .js-ready .reveal-d4 { transition-delay: .32s; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background-color: var(--bg-2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.6px);
  background-size: 26px 26px;
  padding: 64px 0 32px;
  font-size: 15px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand img { height: 34px; width: auto; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); max-width: 300px; }
.site-footer h4 {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer-links a { color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--accent-bright); }
.footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--muted); }
.footer-contact a { color: var(--muted); white-space: nowrap; transition: color .2s; }
.footer-contact a:hover { color: var(--accent-bright); }
.footer-contact li { display: flex; gap: 10px; align-items: baseline; }
.footer-contact svg { width: 15px; height: 15px; flex-shrink: 0; translate: 0 2px; color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13.5px;
}
.footer-bottom a { color: var(--faint); }
.footer-bottom a:hover { color: var(--accent-bright); }
.footer-legal { display: flex; gap: 8px; align-items: center; }

/* ---------- Hero (shared inner-page version) ---------- */
.page-hero {
  padding: calc(var(--nav-h) + 88px) 0 72px;
  position: relative;
  overflow: hidden;
}
.page-hero h1 { font-size: clamp(38px, 5.5vw, 60px); font-weight: 800; }
.page-hero .section-lead { font-size: 19px; }
.breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 13.5px; color: var(--faint);
  margin-bottom: 22px;
  font-family: var(--font-display);
  font-weight: 600;
}
.breadcrumb a { color: var(--faint); }
.breadcrumb a:hover { color: var(--accent-bright); }

/* Orbs (usable on any hero) */
.orb-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.orb-1 { width: 560px; height: 560px; background: var(--hero-orb-1); top: -180px; right: -120px; animation: drift1 16s ease-in-out infinite alternate; }
.orb-2 { width: 420px; height: 420px; background: var(--hero-orb-2); bottom: -160px; left: -100px; animation: drift2 20s ease-in-out infinite alternate; }
.orb-3 { width: 360px; height: 360px; background: var(--hero-orb-3); top: 30%; left: 38%; animation: drift3 24s ease-in-out infinite alternate; }

@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-90px, 70px) scale(1.12); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(110px, -60px) scale(1.08); } }
@keyframes drift3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(70px, 90px) scale(1.18); } }

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field label {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--muted);
}
.field label .req { color: var(--accent-bright); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
.field .hint { font-size: 12.5px; color: var(--faint); }

/* ---------- Misc ---------- */
.text-accent { color: var(--accent-bright); }
.nowrap { white-space: nowrap; }

::selection { background: var(--accent-deep); color: #fff; }

/* Scrollbar (subtle, dark-aware) */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav .btn-cta { display: none; }
  .nav-burger { display: grid; margin-left: auto; }
  .nav-actions { margin-left: 0; }
  .nav { gap: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 72px 0; }
}

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .container { width: calc(100% - 36px); }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .brand img { height: 32px; }
  :root { --nav-h: 66px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
