/* ==========================================================================
   Dem Portfolio — shared styles
   ========================================================================== */

@font-face { font-family: "Satoshi"; src: url("/assets/fonts/satoshi-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/assets/fonts/satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/assets/fonts/satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/assets/fonts/satoshi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Expletus Sans"; src: url("/assets/fonts/expletus.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #000;
  --fg: #fff;
  --fg-soft: #e3e3e3;
  --muted: #a1a1a1;
  --muted-2: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.4);
  --card: #0a0a0a;
  --glow-blue: 33, 45, 104;          /* rgb of the signature navy glow */
  --glow-shadow: 0 0 24px rgba(88, 104, 214, 0.45);
  --green: #22c55e;
  --radius: 16px;
  --radius-lg: 24px;
  --font-sans: "Satoshi", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Expletus Sans", "Satoshi", system-ui, sans-serif;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);   /* easeOutQuint — smooth, no overshoot */
  --ease-snap: cubic-bezier(0.25, 1, 0.5, 1);       /* easeOutQuart — for hovers */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --page-pad: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 400; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid #7c8cff; outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--page-pad); }
.display { font-family: var(--font-display); }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 32px;
}
.site-header.is-fixed { position: fixed; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 500; }
.nav > a, .nav-dropdown > button { opacity: 1; transition: opacity .2s; display: inline-flex; align-items: center; gap: 4px; }
.nav > a:hover, .nav-dropdown > button:hover { opacity: .6; }
.nav-dropdown { position: relative; }
.nav-dropdown > button svg { width: 14px; height: 14px; transition: transform .25s var(--ease-out); }
.nav-dropdown.is-open > button { opacity: .6; }
.nav-dropdown.is-open > button svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 10px); left: -24px; min-width: 150px;
  background: #fff; color: #1c1b1f; border-radius: 10px; padding: 10px 16px;
  display: grid; gap: 6px; font-size: 14px; font-weight: 400;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.nav-dropdown.is-open .nav-menu { opacity: 1; visibility: visible; }
.nav-menu a:hover { opacity: .6; }
.social { display: flex; align-items: center; gap: 20px; }
.social a { display: grid; place-items: center; width: 24px; height: 24px; transition: transform .5s var(--ease-snap), opacity .3s; }
.social a:hover { opacity: .75; }
.social svg { width: 24px; height: 24px; }

.back-btn {
  position: fixed; top: 16px; left: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px 0 14px;
  background: #fff; color: #111; border: 1px solid #111; border-radius: 999px;
  font-size: 16px; font-weight: 500;
  transition: transform .5s var(--ease-snap), box-shadow .4s var(--ease-out);
}
.back-btn:hover { box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.back-btn svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Glows / backgrounds
   -------------------------------------------------------------------------- */
.glow-top {
  position: absolute; inset: 0 0 auto 0; height: 700px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 55% at 50% 0%, rgba(var(--glow-blue), 1) 0%, rgba(var(--glow-blue), .55) 38%, rgba(0,0,0,0) 72%);
}
.glow-center {
  position: absolute; left: 50%; top: 50%; width: min(1500px, 160vw); height: 900px; transform: translate(-50%, -50%);
  pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(var(--glow-blue), .95) 0%, rgba(var(--glow-blue), .45) 45%, rgba(0,0,0,0) 100%);
}

/* --------------------------------------------------------------------------
   Buttons & chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 24px; border-radius: 6px;
  font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: transform .6s var(--ease-snap), background-color .3s, color .3s, box-shadow .4s var(--ease-out), border-color .3s;
}
.btn:hover { }
.btn:active { transform: translateY(0); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-dark { background: #131313; border: 1px solid #2a2a2a; color: #fff; }
.btn-dark:hover { background: #1d1d1d; border-color: #444; }
.btn-light { background: #fff; color: #111; border: 1px solid #fff; }
.btn-light:hover { box-shadow: 0 8px 24px rgba(255,255,255,.18); }
.btn-outline { border: 1px solid currentColor; }
.btn-ghost { border: 1px solid rgba(255,255,255,.7); background: #111; color: #fff; height: 40px; min-width: 140px; font-size: 15px; font-weight: 400; }
.btn-ghost:hover { background: #fff; color: #111; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 32px; border-radius: 999px;
  background: #fff; color: #1c1b1f; font-size: 16px;
  box-shadow: 0 0 22px 2px rgba(34, 197, 94, .75);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.status-pill .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: ping 1.8s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.8); opacity: 0; } }

/* --------------------------------------------------------------------------
   Tool cards (home + case studies)
   -------------------------------------------------------------------------- */
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 10px; max-width: 1000px; margin: 0 auto; }
.tool {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 14px; border-radius: 8px;
  background: #000; border: 1px solid #2b2b2b;
}
.tool.is-done, .tool:not([data-reveal]) { transition: transform .6s var(--ease-snap), border-color .35s, box-shadow .45s var(--ease-out); }
.tool.is-done:hover, .tool:not([data-reveal]):hover { border-color: #4b56a8; box-shadow: 0 8px 24px rgba(40, 56, 160, .35); }
.tool img, .tool .tool-icon { width: 50px; height: 50px; object-fit: contain; flex: none; border-radius: 10px; }
.tool h3 { font-size: 20px; font-weight: 500; line-height: 28px; }
.tool p { font-size: 16px; line-height: 24px; color: var(--muted); }

/* light variant used on white case-study pages */
.theme-light .tool { background: #fff; border-color: #e5e5e5; color: #111; }
.theme-light .tool p { color: #666; }
.theme-light .tool:hover { border-color: #c9c9d6; box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* --------------------------------------------------------------------------
   Scroll reveal animations (driven by main.js)
   -------------------------------------------------------------------------- */
[data-reveal] { opacity: 0; }
[data-reveal].is-in   { opacity: 1; }
/* Reveal transition wins over component transitions until the entrance finishes
   (main.js adds .is-done), then components' own hover transitions take over. */
[data-reveal]:not(.is-done) { transition: opacity .8s ease var(--delay, 0s) !important; }
[data-reveal].is-done { will-change: auto; }

/* No-JS / reduced-motion fallbacks */
.no-js [data-reveal] { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  [data-parallax] { transform: none !important; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) { :root { --page-pad: 40px; } }
@media (max-width: 809px) {
  :root { --page-pad: 20px; }
  .site-header { padding: 18px 20px; }
  .nav { gap: 14px; font-size: 14px; }
  .social { gap: 14px; }
  .social a, .social svg { width: 20px; height: 20px; }
  .back-btn { top: 12px; left: 12px; height: 36px; font-size: 15px; }
  .tool { padding: 8px 12px 8px 10px; gap: 10px; }
  .tool img, .tool .tool-icon { width: 36px; height: 36px; border-radius: 8px; }
  .tool h3 { font-size: 16px; line-height: 20px; }
  .tool p { font-size: 13px; line-height: 18px; }
}
@media (max-width: 520px) {
  .nav .hide-sm { display: none; }
}

.tool img.cover { object-fit: cover; }
section { overflow-x: clip; }

/* --------------------------------------------------------------------------
   Mobile menu (markup built by main.js) — fade only, no movement
   -------------------------------------------------------------------------- */
.m-bar, .m-menu { display: none; }
@media (max-width: 809px) {
  .site-header .nav, .site-header .social { display: none; }
  .site-header { padding: 0; }
  .m-bar {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 14px 16px 14px 20px; position: relative; z-index: 101;
  }
  .m-brand { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
  .m-toggle {
    display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 16px;
    border-radius: 999px; font-size: 15px; font-weight: 500;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .m-burger { position: relative; width: 16px; height: 10px; }
  .m-burger i { position: absolute; left: 0; right: 0; height: 1.6px; border-radius: 2px; background: currentColor; }
  .m-burger i:first-child { top: 0; } .m-burger i:last-child { bottom: 0; }
  .m-open .m-burger i:first-child { top: 4.2px; transform: rotate(45deg); }
  .m-open .m-burger i:last-child { bottom: 4.2px; transform: rotate(-45deg); }
  .m-open .site-header { position: fixed; z-index: 101; }
  .m-open, .m-open body { overflow: hidden; }

  .m-menu {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 100;
    padding: 96px 24px calc(28px + env(safe-area-inset-bottom));
    background: radial-gradient(90% 50% at 50% 0%, rgba(var(--glow-blue), .9) 0%, rgba(0,0,0,0) 70%), #000;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
    overflow-y: auto;
  }
  .m-open .m-menu { opacity: 1; visibility: visible; }
  .m-links { display: flex; flex-direction: column; }
  .m-link { font-family: var(--font-display); font-size: 34px; line-height: 1.15; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .m-label { margin-top: 32px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .m-sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .m-sublink { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 15px; }
  .m-foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; gap: 20px; }
  .m-cta { width: 100%; height: 50px; border-radius: 999px; }
  .m-social { display: flex; justify-content: center; gap: 28px; }
  .m-social a { display: grid; place-items: center; width: 44px; height: 44px; }
  .m-social svg { width: 24px; height: 24px; }
  .dz-header .nav { padding-left: 0; }
}
@media (max-width: 809px) { .back-btn { top: 14px; left: 16px; height: 40px; } }
