/* ==========================================================================
   EDM Software — custom styles (layered on top of Tailwind utilities)
   ========================================================================== */

:root {
  --bg: #0a0908;
  --surface: #121110;
  --surface-2: #181716;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #858585;
  --dim: #5c5c5c;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "cv11", "ss01", "ss03";
}

section[id] {
  scroll-margin-top: 72px;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
}
.nav.is-scrolled,
.nav.is-open {
  background: rgba(10, 9, 8, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-color: var(--line);
}
.nav.is-open {
  background: var(--bg);
}

.navlink {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}
.navlink:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.menu-btn .bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.menu-btn .bar + .bar {
  margin-top: 5px;
}
.nav.is-open .menu-btn .bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.nav.is-open .menu-btn .bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-menu a.mobile-link {
  display: block;
  padding: 6px 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s,
    transform 0.2s var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible,
.navlink:focus-visible,
a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 8px;
}
.btn-primary {
  background: #fff;
  color: #0f0f0f;
}
.btn-primary:hover {
  background: #e6e6e6;
}
.btn-ghost {
  color: #fff;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}
.btn-outline {
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}
.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 15px;
}
.btn .arrow {
  transition: transform 0.25s var(--ease);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Entrance + scroll reveal (only when JS is available)
   -------------------------------------------------------------------------- */
@keyframes blur-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.js .hero-in {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  animation: blur-in 1s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}

.js [data-split] {
  visibility: hidden;
}
.js [data-split].is-split {
  visibility: visible;
}
.word {
  display: inline-block;
}
.js .is-split .word {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(6px);
  animation: blur-in 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}

.js .reveal {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  filter: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .hero-in,
  .js .is-split .word,
  .js .reveal {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Pixel dither texture (canvas, driven by main.js)
   -------------------------------------------------------------------------- */
.dither {
  pointer-events: none;
  display: block;
}
.dither--rise {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
}

/* --------------------------------------------------------------------------
   Hero scene — painterly sky + field, built only with CSS/SVG
   -------------------------------------------------------------------------- */
.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 34% 20% at 16% 16%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 26% 14% at 33% 27%, rgba(250, 245, 232, 0.65), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 30% 16% at 70% 12%, rgba(255, 251, 240, 0.75), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 24% 12% at 90% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 70% 28% at 50% 104%, rgba(110, 72, 26, 0.6), rgba(110, 72, 26, 0) 70%),
    linear-gradient(180deg, #6d889e 0%, #9db1bd 26%, #c9cbc1 44%, #bcae86 54%, #cf9f4e 64%, #b88437 80%, #8c632d 100%);
}
.scene__mountains {
  position: absolute;
  inset: 34% 0 auto 0;
  height: 26%;
  width: 100%;
  z-index: 0;
}
/* brush-stroke streaks + fine grain */
.scene::before,
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.scene::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.004 0.07' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.96  0 0 0 0 0.88  0 0 0 0.9 -0.35'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>");
  background-size: cover;
  mix-blend-mode: soft-light;
  opacity: 0.9;
}
.scene::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
}
.scene__content {
  position: relative;
  z-index: 1;
}

/* Light "app window" inside the scene */
.app {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 80px -20px rgba(20, 14, 6, 0.55),
    0 12px 30px -12px rgba(20, 14, 6, 0.35);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  color: rgba(0, 0, 0, 0.6);
}
.side-item.is-active {
  background: rgba(0, 0, 0, 0.055);
  color: #111;
}
.side-item .count {
  margin-left: auto;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.35);
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.7);
  background: #fff;
}
.app table th {
  font-weight: 500;
  color: rgba(0, 0, 0, 0.4);
  font-size: 10px;
}
.app tbody tr {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.app tbody tr.is-selected {
  background: rgba(0, 0, 0, 0.022);
}
.app .check {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  vertical-align: middle;
}
.app tr.is-selected .check {
  background: #111 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 6.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/9px no-repeat;
  border-color: #111;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill--ok {
  background: #e8f6ee;
  color: #1c7a45;
}
.pill--run {
  background: #fff3dc;
  color: #a35f00;
}
.pill--run::before {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.spinner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-top-color: #111;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease),
    transform 0.4s var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--line);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: #cfcfcf;
  font-size: 13px;
}

.pixel {
  shape-rendering: crispEdges;
}

/* Azure partner card glow */
.partner-card {
  background:
    radial-gradient(600px 320px at 0% 0%, rgba(0, 120, 212, 0.2), rgba(0, 120, 212, 0) 65%),
    radial-gradient(500px 300px at 100% 100%, rgba(60, 203, 244, 0.08), rgba(60, 203, 244, 0) 60%),
    var(--surface);
}

/* Highlighted engagement card */
.card--featured {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), var(--surface);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Bullet list with pixel markers */
.pixel-list li {
  position: relative;
  padding-left: 18px;
}
.pixel-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: #fff;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq .plus {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  transition: transform 0.35s var(--ease), color 0.2s, background-color 0.2s;
}
.faq summary:hover .plus {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.faq details[open] .plus {
  transform: rotate(45deg);
  color: #fff;
}
.faq .answer {
  padding: 0 48px 24px 0;
  color: var(--muted);
  line-height: 1.7;
}
