/* ============================================================
   DanaExperts — site chrome (Dark Cinematic v1)
   Import after ds/tokens. Shared by all pages.
   ============================================================ */

html { scroll-behavior: smooth; }
body { overflow-x: hidden; background: var(--void); }

/* Fixed hero wash + film grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: var(--grad-hero);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------------- NAV ---------------- */
.dx-nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-nav); width: calc(100% - 32px); max-width: 1160px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 8px 12px 8px 22px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.9); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(12,20,64,.08); box-shadow: 0 16px 50px -24px rgba(0,0,0,.7);
  transition: transform var(--d-base) var(--e-out), opacity var(--d-base) var(--e-out), box-shadow var(--d-base) var(--e-out);
}
/* hidden after scrolling down — slides up out of view; revealed on hover near the top */
.dx-nav.hidden { transform: translateX(-50%) translateY(-180%); opacity: 0; pointer-events: none; }
.dx-nav .brand { display: inline-flex; align-items: center; transition: opacity var(--d-fast) var(--e-out); }
.dx-nav .brand:hover { opacity: .82; }
.dx-nav .brand img { height: 30px; width: auto; display: block; }
.nav-links { display: flex; gap: 24px; font-size: var(--fs-sm); font-weight: 600; }
.nav-links a { position: relative; color: #29334f; transition: color var(--d-fast) var(--e-out); padding: 4px 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-fast) var(--e-out);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { transform: scaleX(1); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; gap: 2px; font-family: var(--font-mono); font-size: var(--fs-xs); }
.lang-switch button {
  background: transparent; border: none; color: #6b7492; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: 700; padding: 6px 7px; border-radius: var(--r-pill);
  transition: color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
}
.lang-switch button:hover { color: #1a2f5e; }
.lang-switch button.on { color: var(--accent); background: rgba(43,83,227,.12); }
.nav-burger { display: none; }

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-sm);
  border-radius: var(--r-pill); padding: 13px 26px; cursor: pointer; border: 1px solid transparent;
  color: #fff; text-decoration: none; white-space: nowrap;
  transition: transform var(--d-fast) var(--e-spring), box-shadow var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
  will-change: transform;
}
.btn-primary { background: var(--grad-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow-accent); }
.btn-ghost { background: transparent; border-color: var(--ink-600); color: var(--paper-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--paper); background: var(--glass-bg); }
.btn-sm { padding: 10px 20px; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: translateY(0); }
.btn .arr { font-family: var(--font-mono); font-weight: 500; transition: transform var(--d-fast) var(--e-out); }
.btn:hover .arr { transform: translateX(4px); }

/* ---------------- TYPOGRAPHY HELPERS ---------------- */
.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--accent); font-weight: 700;
}
.eyebrow.cyan { color: var(--cyan); }
.display {
  font-family: var(--font-display); font-weight: 900;
  letter-spacing: var(--tracking-display); line-height: var(--lh-tight);
}
.grad-text {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: var(--fs-lead); color: var(--paper-dim); max-width: 56ch; text-wrap: pretty; }
.mono { font-family: var(--font-mono); }

/* ---------------- LAYOUT ---------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); width: 100%; }
/* screen-reader-only label (used by the services deck progress buttons) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.section { position: relative; padding-block: var(--section-y); z-index: var(--z-content); }
.section-head { margin-bottom: var(--sp-7); }
.section-head h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); letter-spacing: var(--tracking-display); margin-top: 12px; }
.section-head .lead { margin-top: 16px; }
.rule { height: 1px; background: var(--grad-line); border: none; margin: 0; }

/* ---------------- CARDS ---------------- */
.dx-card {
  background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--r-lg);
  padding: var(--sp-6); position: relative;
  transition: transform var(--d-base) var(--e-out), box-shadow var(--d-base) var(--e-out), border-color var(--d-base) var(--e-out);
}
.dx-card:hover { transform: translateY(-4px); box-shadow: var(--glow-soft); border-color: rgba(140,160,220,.3); }
.dx-card h3 { font-size: var(--fs-h3); font-weight: 700; margin-top: 10px; }
.dx-card p { color: var(--paper-dim); font-size: var(--fs-body); margin: 12px 0 0; text-wrap: pretty; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-5); }
.tag {
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--paper-dim);
  border: 1px solid var(--ink-600); border-radius: var(--r-pill); padding: 5px 12px;
}

/* glass variant */
.glass {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
}

/* ---------------- STATS ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-6); }
.stat { border-top: 1px solid var(--ink-600); padding-top: var(--sp-4); }
.stat b {
  display: block; font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem); line-height: 1; color: var(--paper);
}
.stat b .suf { color: var(--accent-2); }
.stat span { display: block; margin-top: 8px; color: var(--paper-mute); font-size: var(--fs-sm); font-weight: 600; }

/* ---------------- MARQUEE ---------------- */
.marquee { overflow: hidden; position: relative; padding-block: var(--sp-6); border-block: 1px solid var(--ink-600); }
.marquee-track { display: flex; gap: clamp(48px, 7vw, 110px); width: max-content; align-items: center; animation: mq 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
/* Client logos are dark-on-transparent artwork, so a plain brightness lift left the
   black ones (hu.ma.ne, knowit) invisible on the dark ground. Inverting the luminance
   after grayscale turns every mark into a legible light monochrome; hover restores
   the true brand colours. */
.marquee img {
  height: clamp(44px, 4.2vw, 62px); width: auto; opacity: .95;
  filter: grayscale(1) invert(1) brightness(1.15);
  transition: opacity var(--d-fast) var(--e-out), filter var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.marquee img:hover { opacity: 1; filter: none; transform: scale(1.06); }

/* ---------------- FORMS ---------------- */
.field { display: block; margin-bottom: var(--sp-5); }
.field span {
  display: block; font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--paper-mute); margin-bottom: 8px; font-weight: 700;
}
.field input, .field textarea, .field select {
  width: 100%; background: var(--ink-700); border: 1px solid var(--ink-600); border-radius: var(--r-md);
  color: var(--paper); font-family: var(--font-sans); font-size: var(--fs-body); padding: 14px 18px;
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,110,246,.18);
}
.field input::placeholder, .field textarea::placeholder { color: var(--paper-mute); }
.field textarea { resize: vertical; min-height: 130px; }

/* ---------------- REVEALS ---------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out); }
.reveal[data-reveal="left"]  { transform: translateX(-40px); }
.reveal[data-reveal="right"] { transform: translateX(40px); }
.reveal[data-reveal="scale"] { transform: scale(.92) translateY(20px); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- PAGE HERO (subpages) ---------------- */
.page-hero { position: relative; padding: calc(120px + var(--sp-8)) 0 var(--sp-8); z-index: var(--z-content); }
.page-hero h1 { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-h1); letter-spacing: var(--tracking-display); line-height: var(--lh-tight); margin-top: 14px; max-width: 18ch; }
.page-hero .lead { margin-top: 22px; }

/* ---------------- FOOTER ---------------- */
.dx-footer { position: relative; z-index: var(--z-content); border-top: 1px solid var(--ink-600); margin-top: var(--section-y); }
.dx-footer .top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-7); padding-block: var(--sp-8); }
.dx-footer h4 { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--accent-2); margin-bottom: var(--sp-4); }
.dx-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dx-footer ul a { color: var(--paper); opacity: .85; font-size: var(--fs-sm); transition: color var(--d-fast) var(--e-out), opacity var(--d-fast) var(--e-out); }
.dx-footer ul a:hover { color: var(--paper); opacity: 1; }
.dx-footer .brandline { font-weight: 800; font-size: var(--fs-h3); color: var(--paper); }
.dx-footer .brandline span { color: var(--accent); }
.dx-footer .foot-logo { display: inline-flex; transition: opacity var(--d-fast) var(--e-out); }
.dx-footer .foot-logo:hover { opacity: .82; }
.dx-footer .foot-logo img { height: 34px; width: auto; display: block; }
.dx-footer .foot-social { display: flex; gap: 12px; margin-top: 20px; }
.dx-footer .foot-social a {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--ink-600); color: var(--paper-dim);
  transition: color var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.dx-footer .foot-social a:hover { color: #fff; border-color: var(--accent); background: var(--accent); transform: translateY(-2px); }
.dx-footer .tagline { color: var(--paper-dim); font-size: var(--fs-sm); margin-top: 10px; max-width: 30ch; }
.dx-footer .bottom {
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  padding-block: var(--sp-5) var(--sp-7); border-top: 1px solid var(--ink-600);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--paper-dim);
}

/* ---------------- CUSTOM CURSOR (fine pointers) ---------------- */
@media (pointer: fine) {
  .dx-cursor { position: fixed; z-index: var(--z-cursor); pointer-events: none; top: 0; left: 0; }
  .dx-cursor .dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); transform: translate(-50%,-50%); }
  .dx-cursor .ring {
    position: absolute; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(110,155,255,.5); transform: translate(-50%,-50%);
    transition: width .2s var(--e-out), height .2s var(--e-out), border-color .2s var(--e-out);
  }
  .dx-cursor.hover .ring { width: 52px; height: 52px; border-color: var(--cyan); }
}

/* ---------------- FIXED 3D CANVAS ---------------- */
.fx-canvas { position: fixed; inset: 0; z-index: var(--z-canvas); pointer-events: none; }
body[data-fx="off"] .fx-canvas { display: none; }

/* ---------------- SCROLL PROGRESS ---------------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0%; background: var(--grad-cyan); z-index: calc(var(--z-nav) + 1); }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: var(--sp-4);
    background: rgba(255,255,255,.97); border: 1px solid rgba(12,20,64,.1); border-radius: var(--r-lg);
    box-shadow: 0 20px 50px -20px rgba(0,0,0,.55); display: none;
  }
  .nav-links a { padding: 12px 14px; border-radius: var(--r-sm); }
  .nav-links a:hover { background: rgba(43,83,227,.08); }
  .dx-nav.open .nav-links { display: flex; }
  .nav-burger {
    display: inline-flex; flex-direction: column; gap: 5px; background: transparent;
    border: none; cursor: pointer; padding: 10px;
  }
  .nav-burger i { display: block; width: 20px; height: 2px; background: #1a2f5e; border-radius: 2px; }
  .dx-footer .top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .dx-footer .top { grid-template-columns: 1fr; }
  .lang-switch { display: none; }
  /* Stats stack into a zig-zag on phones: 82+ and 100% hang off the left edge,
     10+ and 98% off the right, so the eye travels down the column instead of
     reading four identical left-aligned rows. */
  .stat-row { grid-template-columns: 1fr; gap: var(--sp-5); }
  .stat { width: 76%; }
  .stat:nth-child(even) { margin-left: auto; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
