/* ============================================================
   MediaSuite Technologies — shared design system
   Paired with the inline <style type="text/tailwindcss"> token
   mapping in each page's <head> and the Tailwind browser build.
   ============================================================ */

:root {
  --background: #ffffff;
  --foreground: #0b1220;
  --primary: #0f766e;
  --primary-foreground: #ffffff;
  --secondary: #eef4f2;
  --secondary-foreground: #0f172a;
  --muted: #f5f8f7;
  --muted-foreground: #475d63;
  --accent: #d4f3ec;
  --accent-foreground: #0d5b53;
  --card: #ffffff;
  --border: #e3ebe8;
  --ring: #0f766e;
  --glow: rgba(15, 118, 110, 0.16);
  --grid-line: rgba(15, 118, 110, 0.05);
}
.dark {
  --background: #070d0c;
  --foreground: #e7efec;
  --primary: #2dd4bf;
  --primary-foreground: #04231e;
  --secondary: #14231f;
  --secondary-foreground: #e7efec;
  --muted: #0c1513;
  --muted-foreground: #94aba3;
  --accent: #103029;
  --accent-foreground: #7ff0dc;
  --card: #0b1311;
  --border: #1c2b27;
  --ring: #2dd4bf;
  --glow: rgba(45, 212, 191, 0.22);
  --grid-line: rgba(45, 212, 191, 0.07);
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  overflow-x: clip;
}
::selection {
  background: var(--accent);
  color: var(--accent-foreground);
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
}
iconify-icon:not([width]):not([height]) {
  display: inline-block;
  width: 1em;
  height: 1em;
}
:where(a, button, [tabindex], input, textarea, select, iconify-icon[role="button"]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Ambient grid + masks */
.bg-grid {
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
}
.mask-fade {
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 30%, #000 40%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 30%, #000 40%, transparent 75%);
}
.hero-canvas {
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 78%);
}
.glow-ring {
  box-shadow: 0 0 0 1px var(--border), 0 30px 80px -40px var(--glow);
}

/* Buttons — display comes from Tailwind utilities per element so that
   responsive `hidden`/`sm:inline-flex` visibility keeps working. */
.btn {
  font-weight: 500;
  border-radius: 0.7rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s,
    border-color 0.2s, box-shadow 0.3s, color 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 30px -12px var(--glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 40px -14px var(--glow);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 12px 30px -18px var(--glow);
}
.btn-secondary:active {
  transform: translateY(0);
}

/* Icon tiles */
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Spotlight cards */
.spot {
  position: relative;
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.35s;
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    140px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--primary) 55%, transparent),
    transparent 60%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    200px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--primary) 10%, transparent),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: -1;
}
@media (hover: hover) {
  .spot:hover {
    transform: translateY(-4px);
  }
  .spot:hover::before,
  .spot:hover::after {
    opacity: 1;
  }
}

/* Flowing pipeline connectors */
.flow-h {
  background-image: repeating-linear-gradient(90deg, var(--primary) 0 7px, transparent 7px 19px);
  background-size: 19px 100%;
  opacity: 0.5;
  animation: flow-x 0.9s linear infinite;
}
.flow-v {
  background-image: repeating-linear-gradient(180deg, var(--primary) 0 7px, transparent 7px 19px);
  background-size: 100% 19px;
  opacity: 0.5;
  animation: flow-y 0.9s linear infinite;
}
@keyframes flow-x {
  to {
    background-position: 19px 0;
  }
}
@keyframes flow-y {
  to {
    background-position: 0 19px;
  }
}
.node-dot {
  transition: box-shadow 0.5s, border-color 0.5s;
}
.node-live .node-dot {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

/* Floating frame */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.floaty {
  animation: floaty 7s ease-in-out infinite;
}

/* Scroll progress */
#ms-progress {
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* Reveal system — active only with JS + motion allowed */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
  }
  html.js .reveal-l {
    transform: translateX(-28px);
  }
  html.js .reveal-r {
    transform: translateX(28px);
  }
  html.js .reveal-s {
    transform: scale(0.96);
  }
  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: smooth;
  }
}
@media (prefers-reduced-motion: reduce) {
  .floaty,
  .flow-h,
  .flow-v {
    animation: none !important;
  }
  .flow-h,
  .flow-v {
    opacity: 0.35;
  }
}

section {
  scroll-margin-top: 5.5rem;
}

/* Language segmented control (2- or 3-way, same style) */
.lang-btn {
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s, background-color 0.2s;
  color: var(--muted-foreground);
}
.lang-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ============================================================
   Contact modal + form
   ============================================================ */
#ms-contact {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 1.5rem));
  height: fit-content;
  max-height: calc(100dvh - 2rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 0;
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
#ms-contact::backdrop {
  background: rgba(4, 12, 10, 0.55);
  backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  #ms-contact[open] {
    animation: ms-dialog-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #ms-contact[open]::backdrop {
    animation: ms-backdrop-in 0.3s ease-out;
  }
}
@keyframes ms-dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
@keyframes ms-backdrop-in {
  from {
    opacity: 0;
  }
}
.field {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field::placeholder {
  color: var(--muted-foreground);
  opacity: 0.85;
}
.field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.field[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.field-error {
  display: none;
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}
.field-error.show {
  display: block;
}
/* Honeypot — visually and programmatically hidden from humans */
.hp-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
