/*
 * ISOFT local design system
 * Light-only Bluetec language for the public marketing site.
 */

@font-face {
  font-family: 'Cairo';
  src: url('fonts/Cairo-Variable.ttf') format('truetype-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #007bff;
  --blue-soft: #5b84f8;
  --blue-deep: color-mix(in srgb, var(--blue) 74%, var(--charcoal));
  --cyan: #06d2ff;
  --teal: #17a2b8;
  --yellow: #ffd943;
  --charcoal: #212529;
  --gray-700: #343a40;
  --gray-600: #6c757d;
  --gray-300: #ced4da;
  --gray-050: #f8f9fa;
  --white: #ffffff;
  --success: #28a745;
  --success-deep: color-mix(in srgb, var(--success) 70%, var(--charcoal));
  --error: #dc3545;
  --error-deep: color-mix(in srgb, var(--error) 74%, var(--charcoal));
  --container: 1200px;
  --radius: 10px;
  --badge-only-radius: 10px;
  --shadow-1: 0 4px 16px rgba(91, 132, 248, .12);
  --shadow-2: 0 10px 28px rgba(0, 123, 255, .16);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--charcoal);
  background: var(--white);
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: 'slnt' 0;
  font-size: 1rem;
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration-thickness: .08em;
  text-underline-offset: .2em;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* White supplies a 3:1+ focus edge against branded blue surfaces. */
.contact-band :focus-visible,
.blue-surface :focus-visible,
[data-surface="blue"] :focus-visible {
  outline-color: var(--white);
  box-shadow: 0 0 0 2px var(--charcoal);
}

::selection {
  color: var(--charcoal);
  background: var(--yellow);
}

.skip-link {
  position: fixed;
  inset-block-start: -80px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--charcoal);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 16px;
}

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

.section {
  padding-block: 40px;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1,
h2,
h3 {
  color: var(--charcoal);
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-block-end: 20px;
  max-width: 18ch;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -.025em;
}

h2 {
  margin-block-end: 16px;
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 650;
  letter-spacing: -.018em;
}

h3 {
  margin-block-end: 10px;
  font-size: 1.25rem;
  font-weight: 650;
}

p {
  margin-block-end: 16px;
  max-width: 65ch;
  color: var(--gray-700);
  font-size: 1.0625rem;
  font-weight: 400;
}

.eyebrow,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-block-end: 16px;
  padding-inline: 10px;
  border: 1px solid rgba(0, 123, 255, .28);
  border-radius: var(--badge-only-radius);
  color: var(--blue-deep);
  background: rgba(0, 123, 255, .07);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-block-end: 36px;
}

.section-heading > :last-child {
  margin-block-end: 0;
}

.section-heading p {
  font-size: 1.1rem;
  color: var(--gray-600);
}

/* Header and navigation */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  min-height: 72px;
  border-block-end: 1px solid transparent;
  background: transparent;
  transition: background-color 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.site-header.is-scrolled,
.site-header[data-scrolled="true"] {
  border-block-end-color: rgba(206, 212, 218, .72);
  background: var(--white);
  box-shadow: var(--shadow-1);
}

.site-header.is-scrolled .brand,
.site-header[data-scrolled="true"] .brand,
.site-header.is-scrolled .primary-nav a,
.site-header[data-scrolled="true"] .primary-nav a {
  color: var(--charcoal);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  transition: color 300ms ease;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--blue-deep);
  font-size: .875rem;
  letter-spacing: .01em;
  box-shadow: var(--shadow-1);
}

.nav-toggle {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius);
  color: var(--white);
  background: transparent;
  transition: border-color 300ms ease, background 300ms ease, color 300ms ease;
}

.site-header.is-scrolled .nav-toggle,
.site-header[data-scrolled="true"] .nav-toggle {
  border-color: var(--gray-300);
  color: var(--charcoal);
  background: var(--white);
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.nav-toggle-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 10px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.primary-nav {
  display: none;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  color: rgba(255, 255, 255, .85);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: background 180ms ease, color 300ms ease;
}

.primary-nav a:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--white);
}

.site-header.is-scrolled .primary-nav a,
.site-header[data-scrolled="true"] .primary-nav a {
  color: rgba(52, 58, 64, .85);
}

.site-header.is-scrolled .primary-nav a:hover,
.site-header[data-scrolled="true"] .primary-nav a:hover {
  background: var(--gray-050);
  color: var(--blue-deep);
}

.language-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px 8px 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
  backdrop-filter: blur(8px);
}

.language-dropdown:hover {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .15);
}

.language-dropdown[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .18);
}

.language-dropdown-icon {
  transition: transform 200ms ease;
}

.language-dropdown[aria-expanded="true"] .language-dropdown-icon {
  transform: rotate(180deg);
}

.site-header.is-scrolled .language-dropdown,
.site-header[data-scrolled="true"] .language-dropdown {
  border-color: var(--gray-300);
  color: var(--charcoal);
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.site-header.is-scrolled .language-dropdown:hover,
.site-header[data-scrolled="true"] .language-dropdown:hover {
  border-color: var(--blue);
}

.site-header.is-scrolled .language-dropdown[aria-expanded="true"],
.site-header[data-scrolled="true"] .language-dropdown[aria-expanded="true"] {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 123, 255, .15);
}

.language-dropdown-menu {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  padding: 8px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  color: var(--charcoal);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  list-style: none;
  animation: dropdown-fade-in 160ms ease;
  z-index: 10;
}

.language-dropdown-menu[data-open="true"] {
  display: flex;
}

@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-dropdown-menu li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .875rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 150ms ease;
}

.language-dropdown-menu li:hover {
  background: var(--gray-050);
}

.language-dropdown-menu li[aria-selected="true"] {
  background: rgba(0, 123, 255, .08);
  color: var(--blue-deep);
}

.language-dropdown-menu li span {
  font-size: .75rem;
  font-weight: 500;
  color: var(--gray-600);
}

.language-dropdown-menu li[aria-selected="true"] span {
  color: var(--blue);
}

.button,
.nav-toggle,
.primary-nav a {
  min-height: 44px;
}

.button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: transform 180ms ease, opacity 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

.button:active,
.nav-toggle:active,
.primary-nav a:active {
  transform: translateY(1px) scale(.98);
}

.button-primary {
  color: var(--white);
  background: var(--blue-deep);
}

.button-primary:hover {
  color: var(--white);
  background: var(--charcoal);
}

.button-ghost {
  border-color: var(--blue-deep);
  color: var(--blue-deep);
  background: var(--white);
  box-shadow: none;
}

.button-ghost:hover {
  color: var(--charcoal);
  background: var(--yellow);
  border-color: var(--yellow);
}

.button:disabled,
.button[aria-disabled="true"],
.button.is-loading,
.project-form[aria-busy="true"] .button[type="submit"],
#project-form[aria-busy="true"] .button[type="submit"] {
  opacity: .6;
  pointer-events: none;
  box-shadow: none;
}

.button.is-loading,
.button[data-loading="true"] {
  cursor: wait;
}

#products {
  background:
    radial-gradient(ellipse 50% 40% at 20% 50%, rgba(0, 123, 255, .04), transparent),
    var(--gray-050);
  border-block: 1px solid transparent;
  position: relative;
}

#products::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(91, 132, 248, .06) 1px, transparent 0);
  background-size: 32px 32px;
}

#services {
  background:
    radial-gradient(ellipse 40% 30% at 80% 70%, rgba(6, 210, 255, .03), transparent),
    radial-gradient(ellipse 50% 40% at 10% 30%, rgba(0, 123, 255, .03), transparent),
    var(--white);
}

#contact {
  background:
    radial-gradient(ellipse 40% 30% at 70% 20%, rgba(91, 132, 248, .04), transparent),
    radial-gradient(ellipse 30% 40% at 20% 80%, rgba(23, 162, 184, .03), transparent),
    var(--gray-050);
}

/* Hero */

.hero {
  isolation: isolate;
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100dvh;
  margin-inline: 0;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: #030712;
  border-radius: 0;
}

.hero,
.hero h1,
.hero h2,
.hero h3,
.hero p,
.hero .eyebrow,
.hero .badge {
  color: var(--white);
}

.hero .eyebrow,
.hero .badge {
  border-color: rgba(91, 132, 248, .4);
  color: rgba(91, 132, 248, 1);
  background: rgba(91, 132, 248, .1);
}

.starfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(255,255,255,.85), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.3px 1.3px at 10% 80%, rgba(255,255,255,.75), transparent),
    radial-gradient(1px 1px at 70% 85%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.4px 1.4px at 90% 15%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 35% 55%, rgba(91,132,248,.7), transparent),
    radial-gradient(1px 1px at 55% 40%, rgba(6,210,255,.6), transparent),
    radial-gradient(1.2px 1.2px at 25% 65%, rgba(255,217,67,.5), transparent);
  background-size: 300px 300px;
  animation: star-drift 120s linear infinite;
}

@keyframes star-drift {
  to { background-position: 300px 600px; }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(0,123,255,.12), transparent),
    radial-gradient(ellipse 40% 60% at 80% 30%, rgba(6,210,255,.08), transparent);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin-inline: auto;
  width: 100%;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 58ch;
  margin-block-end: 24px;
  color: rgba(255,255,255,.72);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-animate {
  opacity: 0;
  transform: translateY(24px);
  animation: hero-reveal .6s cubic-bezier(.16,1,.3,1) forwards;
}

.hero-animate-0 { animation-delay: .1s; }
.hero-animate-2 { animation-delay: .4s; }
.hero-animate-3 { animation-delay: .55s; }
.hero-animate-4 { animation-delay: .7s; }

@keyframes hero-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.heading-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) scale(.96);
  animation: word-reveal .5s cubic-bezier(.16,1,.3,1) forwards;
  margin-inline-end: .28em;
}

@keyframes word-reveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero .button-ghost {
  border-color: rgba(255,255,255,.35);
  color: var(--white);
  background: rgba(255,255,255,.06);
}

.hero .button-ghost:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.55);
  color: var(--white);
}

.hero-canvas-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.threejs-container {
  width: 100%;
  height: 100%;
}

.threejs-container:active {
  cursor: grabbing;
}

.threejs-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Proof, products, and services */

.product-grid,
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.product-card,
.service-card {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-1);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.product-card:hover,
.product-card:focus-within,
.service-card:hover,
.service-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--blue-soft);
}

.product-card > :last-child,
.service-card > :last-child {
  margin-block-end: 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: auto;
  padding-block-start: 16px;
}

.card-actions .button {
  flex: 1 1 auto;
  min-width: 140px;
}

.product-card .button,
.service-card .button {
  margin-block-start: auto;
}

.product-card-featured {
  border-inline-start: 4px solid var(--blue-soft);
  border-left: 4px solid var(--blue-soft);
  border-right: 1px solid var(--gray-300);
  background: rgba(91, 132, 248, .05);
}

.product-card-featured::before {
  content: "Featured";
  position: absolute;
  inset-block-start: 16px;
  inset-inline-end: 16px;
  padding: 4px 10px;
  border-radius: var(--badge-only-radius);
  background: var(--blue-deep);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-card:not(.product-card-featured):nth-child(3n + 2) {
  border-block-start-color: var(--cyan);
}

.product-card:not(.product-card-featured):nth-child(3n) {
  border-block-start-color: var(--yellow);
}

.product-card:not(.product-card-featured):nth-child(3n + 1) {
  border-block-start-color: var(--blue-soft);
}

.product-category,
.service-card small {
  margin-block-end: 10px;
  color: var(--blue-deep);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.services-layout,
.contact-layout {
  display: grid;
  gap: 32px;
}

.service-card {
  gap: 4px;
}

.service-icon {
  display: grid;
  width: 48px;
  min-height: 48px;
  margin-block-end: 16px;
  place-items: center;
  border-radius: 10px;
  color: var(--blue-deep);
  background: rgba(0, 123, 255, .08);
  transition: background 200ms ease, color 200ms ease;
}

.service-card:hover .service-icon {
  background: var(--blue-deep);
  color: var(--white);
}

/* Contact conversion and form */

.contact-band {
  padding-block: 48px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-deep), color-mix(in srgb, var(--blue) 85%, var(--charcoal)));
  border-radius: 0;
  position: relative;
  overflow: hidden;
}

.contact-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 80% 20%, rgba(6, 210, 255, .12), transparent),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(255, 217, 67, .08), transparent);
  pointer-events: none;
}

.contact-band .container,
.contact-band-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.contact-band h2,
.contact-band p {
  color: var(--white);
}

.contact-band h2 {
  margin-block-end: 8px;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
}

.contact-band p {
  margin-block-end: 0;
  max-width: 48ch;
  opacity: .85;
}

.contact-band .container > .button,
.contact-band-inner > .button {
  flex: 0 0 auto;
  color: var(--charcoal);
  background: var(--yellow);
  box-shadow: 0 4px 16px rgba(255, 217, 67, .3);
}

.contact-band .container > .button:hover,
.contact-band-inner > .button:hover {
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 8px 24px rgba(255, 255, 255, .2);
}

.contact-details,
.contact-copy {
  align-self: start;
}

.contact-list {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  position: relative;
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--gray-300);
  transition: border-color 200ms ease;
}

.contact-list li:hover {
  border-color: var(--blue-soft);
}

.contact-list li strong,
.contact-list li span {
  color: var(--charcoal);
}

.contact-list li strong {
  font-size: .875rem;
  margin-block-end: 2px;
  display: inline-block;
}

.contact-list li span {
  display: block;
}

.contact-list a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--blue-deep);
  font-weight: 650;
  transition: color 200ms ease;
}

.contact-list a:hover {
  color: var(--blue);
}

.contact-details a,
.contact-copy a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.project-form,
#project-form {
  display: grid;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-1);
  position: relative;
}

.project-form::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--charcoal);
  font-size: .9375rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, .1);
  outline: none;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--gray-600);
  opacity: .7;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--blue-soft);
}

.field [aria-invalid="true"],
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error-deep);
  box-shadow: inset 4px 0 0 var(--error);
}

.field-error {
  min-height: 1.25em;
  color: var(--error-deep);
  font-size: .875rem;
  font-weight: 650;
}

.field-error:empty {
  display: none;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--gray-700);
  font-size: .9375rem;
  font-weight: 650;
}

.form-status[data-state="loading"],
.form-status.is-loading {
  color: var(--blue-deep);
}

.form-status[data-state="success"],
.form-status.is-success,
.form-status[role="status"].success {
  padding: 10px 12px;
  border-inline-start: 4px solid var(--success);
  color: var(--success-deep);
  background: rgba(40, 167, 69, .08);
}

.form-status[data-state="error"],
.form-status.is-error,
.form-status[role="alert"] {
  padding: 10px 12px;
  border-inline-start: 4px solid var(--error);
  color: var(--error-deep);
  background: rgba(220, 53, 69, .07);
}

.form-status .retry,
.form-status .button-retry {
  min-height: 44px;
  margin-inline-start: 8px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  color: inherit;
  background: var(--white);
  font-weight: 700;
}

/* Footer */

.site-footer {
  padding-block: 48px;
  border-block-start: none;
  color: rgba(255, 255, 255, .8);
  background: linear-gradient(180deg, #0a0e1a 0%, #030712 100%);
  margin-block-start: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.footer-brand,
.footer-column {
  min-width: 0;
}

.footer-brand p {
  max-width: 42ch;
  margin-block-start: 16px;
  margin-block-end: 0;
  font-size: .9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .6);
}

.footer-column h2,
.footer-column h3 {
  margin-block-end: 16px;
  color: rgba(255, 255, 255, .95);
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links,
.social-links,
.legal-links {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links {
  margin-block-start: 20px;
}

.social-links,
.legal-links {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 20px;
}

.footer-links a,
.social-links a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .7);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms ease;
  line-height: 1.4;
}

.footer-links a:hover,
.social-links a:hover {
  color: var(--white);
}

.legal-links a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .5);
  font-size: .8125rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 200ms ease;
  line-height: 1.4;
}

.legal-links a:hover {
  color: rgba(255, 255, 255, .9);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  margin-block-start: 40px;
  padding-block-start: 24px;
  border-block-start: 1px solid rgba(255, 255, 255, .1);
}

.footer-bottom p,
.footer-bottom a {
  margin: 0;
  font-size: .875rem;
  color: rgba(255, 255, 255, .6);
}

.footer-bottom a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .5);
  transition: color 200ms ease;
}

.footer-bottom a:hover {
  color: rgba(255, 255, 255, .9);
}

/* Scroll animations */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card stagger animations */
.product-card.animate-on-scroll,
.service-card.animate-on-scroll {
  transition-delay: calc(var(--card-index, 0) * 0.1s);
}

/* Contact section items */
.contact-details.animate-on-scroll,
.project-form.animate-on-scroll {
  transition-delay: 0.2s;
}

/* Tablet */

@media (min-width: 577px) {
  .section {
    padding-block: 60px;
  }

  .product-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop */

@media (min-width: 769px) {
  .container {
    width: min(calc(100% - 80px), var(--container));
  }

  .section {
    padding-block: 96px;
  }

  .hero {
    width: 100%;
    min-height: 100dvh;
    padding-block: 48px;
    padding-inline: 40px;
    flex-direction: row;
    justify-content: space-between;
  }

  .hero-copy {
    margin-inline: 0;
  }

  .hero h1 {
    max-width: 24ch;
    font-size: clamp(1.5rem, 3.1vw, 2.5rem);
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-card-featured {
    grid-column: span 2;
    min-height: 300px;
  }

  .services-layout,
  .contact-layout {
    grid-template-columns: .8fr 1.2fr;
    gap: 56px;
  }

  .nav-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 4px;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .footer-grid {
    grid-template-columns: 1.2fr .8fr .8fr;
    gap: 48px;
  }
}

/* Mobile navigation and single-column fallbacks */

@media (max-width: 768px) {
  .hero-canvas-background {
    display: none;
  }

  .primary-nav {
    position: fixed;
    inset: 72px 0 0 0;
    display: none;
    width: 100%;
    padding: 0;
    border: none;
    background: #030712;
    z-index: 40;
    overflow-y: auto;
  }

  .primary-nav[data-open="true"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: slideDown 0.25s ease-out;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .primary-nav a {
    width: 200px;
    padding: 12px 24px;
    border-radius: var(--radius);
    justify-content: center;
    color: rgba(255, 255, 255, .85);
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .primary-nav a:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--white);
  }

  .language-select-wrapper {
    width: 200px;
    margin-top: 16px;
    margin-bottom: 40px;
  }

  .language-dropdown {
    width: 200px;
    justify-content: center;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
  }

  .primary-nav a:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--white);
  }

  .language-dropdown:hover {
    border-color: rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .12);
  }

  .language-dropdown-menu {
    position: absolute;
    inset-inline: auto;
    width: auto;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    border: 1px solid rgba(255, 255, 255, .15);
    margin-top: 4px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero {
    padding: 100px 20px 40px;
    text-align: center;
  }

  .hero-copy {
    padding: 0 10px;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 1rem;
  }

  h1,
  h2,
  h3 {
    text-align: center;
    width: 100%;
  }

  h1 {
    max-width: 100%;
    margin-inline: auto;
  }

  .section-heading {
    text-align: center;
    margin-inline: auto;
  }

  .contact-band .container,
  .contact-band-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-band .button {
    width: 100%;
  }

  .project-form,
  #project-form {
    padding: 20px 16px;
  }

  .service-icon {
    width: 40px;
    height: 40px;
  }
}

/* Directional mirroring for Arabic. */

[dir="rtl"] .header-inner,
[dir="rtl"] .primary-nav,
[dir="rtl"] .hero-actions,
[dir="rtl"] .contact-band .container,
[dir="rtl"] .contact-band-inner,
[dir="rtl"] .footer-bottom {
  direction: rtl;
}

[dir="rtl"] .product-card-featured {
  border-left: 1px solid var(--gray-300);
  border-right: 4px solid var(--blue-soft);
}

[dir="rtl"] .product-card-featured::before {
  inset-inline-end: auto;
  inset-inline-start: 16px;
}

[dir="rtl"] .field [aria-invalid="true"],
[dir="rtl"] .field.has-error input,
[dir="rtl"] .field.has-error select,
[dir="rtl"] .field.has-error textarea {
  box-shadow: inset -4px 0 0 var(--error);
}

[dir="rtl"] .button i,
[dir="rtl"] .primary-nav a i,
[dir="rtl"] .contact-list i {
  transform: scaleX(-1);
}

@media (max-width: 768px) {
  [dir="rtl"] .primary-nav,
  [dir="rtl"] .hero-actions,
  [dir="rtl"] .contact-band .container,
  [dir="rtl"] .contact-band-inner {
    direction: rtl;
  }
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
