/* ═══════════════════════════════════════════════════════════════════════════
   Aswell — styles.css
   Sections:
     TOKENS → RESET → BASE → FOCUS → SKIP LINK → BUTTONS → NAV
     → HERO → SERVICES → ABOUT → CONTACT → FOOTER
     → SCROLL-TO-TOP → SCROLL PROGRESS → ANIMATIONS
     → DARK MODE → THEME TOGGLE → RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */


/* === TOKENS ================================================================ */

:root {
  /* Brand */
  --color-navy:     #102445;
  --color-teal:     #00d89e;
  --color-blue:     #1775d2;

  /* Neutrals */
  --color-bg:       #f9fafb;
  --color-white:    #ffffff;
  --color-gray-900: #111827;
  --color-gray-700: #374151;
  --color-gray-600: #4b5563;
  --color-gray-400: #9ca3af;
  --color-gray-200: #e5e7eb;
  --color-gray-100: #f3f4f6;

  /* Semantic */
  --color-error:    #dc2626;
  --color-error-bg: rgba(220, 38, 38, 0.06);

  /* Dark mode raw palette */
  --color-dark-bg:       #0d0d0d;
  --color-dark-surface:  #161616;
  --color-dark-elevated: #1f1f1f;
  --color-dark-border:   #2a2a2a;
  --color-dark-text:     #f0f0f0;
  --color-dark-muted:    #888888;
  --color-dark-accent:   #ffffff;

  /* Semantic theme tokens — light defaults */
  --bg:        var(--color-bg);
  --surface:   var(--color-white);
  --border:    var(--color-gray-200);
  --fg:        var(--color-gray-700);
  --fg-strong: var(--color-navy);
  --fg-muted:  var(--color-gray-600);
  --input-bg:  var(--color-white);

  /* Typography */
  --font:         'Inter', -apple-system, sans-serif;
  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      1.25rem;
  --text-2xl:     1.5rem;
  --text-3xl:     1.875rem;
  --text-4xl:     2.25rem;
  --text-5xl:     3rem;
  --text-6xl:     3.75rem;
  --leading-tight:   1.2;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* Spacing (4-point) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Borders */
  --radius-sm:   4px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow:    0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);

  /* Layout */
  --container:  1120px;
  --section-y:  var(--sp-24);
  --section-x:  var(--sp-8);
  --nav-height: 64px;
}


/* === RESET ================================================================= */

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

html { scroll-behavior: smooth; }

img, svg { display: block; }

ul { list-style: none; }

button { font-family: var(--font); }


/* === BASE ================================================================== */

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  color: var(--fg-strong);
  font-weight: 800;
}

a { color: inherit; text-decoration: none; }

p { max-width: 65ch; }

/* Offset anchor targets so fixed nav doesn't cover headings */
section {
  scroll-margin-top: var(--nav-height);
}


/* === FOCUS ================================================================= */

/*
  A single global rule for keyboard-focus visibility.
  border-radius: inherit picks up the shape of buttons/inputs automatically.
*/
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* === UTILITIES ============================================================= */

/* Visually hidden but readable by screen readers */
.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;
}


/* === SKIP LINK ============================================================= */

/*
  Visually hidden until focused; slides down from top for keyboard users.
  Defined in critical CSS too to prevent FOUC, but detailed styles live here.
*/
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  padding: 0.75rem 1.5rem;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  z-index: 9999;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}


/* === BUTTONS =============================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.75rem 1.5rem;
  min-height: 44px;        /* WCAG touch target */
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease,
              transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
}

/* Primary: dark fill → lifts with shadow on hover */
.btn--primary {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn--primary:hover {
  background: #0d1e38;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 36, 69, 0.30);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Ghost: transparent text-link with underline (hero only) */
.btn--ghost {
  background: transparent;
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 0;
  padding-right: 0;
  box-shadow: none;
}

.btn--ghost:hover {
  color: var(--color-teal);
  text-decoration-color: var(--color-teal);
  transform: none;
  box-shadow: none;
}

/* Nav CTA pill */
.btn--nav {
  padding: 0.5rem 1.125rem;
  min-height: 36px;
  font-size: var(--text-xs);
  background: var(--color-teal);
  color: var(--color-navy);
  font-weight: 700;
}

.btn--nav:hover {
  background: #00c48e;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 216, 158, 0.30);
}

.btn--full { width: 100%; }


/* === NAV =================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* .is-scrolled added by JS once window.scrollY > 20 */
.site-nav.is-scrolled {
  background: rgba(16, 36, 69, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--section-x);
}

.nav-logo {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.02em;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-logo:hover {
  color: var(--color-teal);
}

/* Nav links list */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

/* Nav link with underline-from-left micro-interaction (CSS only) */
.nav-link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  padding-bottom: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-teal);
  border-radius: 1px;
  transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--color-white);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle between hamburger / close icons via aria-expanded */
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }


/* === HERO ================================================================== */

header {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--sp-24) var(--section-x);
  text-align: center;
  transition: background-color 0.4s ease;
}

header.hero-fallback {
  background:
    radial-gradient(1200px 620px at 18% -8%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(920px 520px at 82% 108%, rgba(0, 216, 158, 0.18), transparent 62%),
    linear-gradient(145deg, var(--color-navy) 0%, var(--color-blue) 55%, var(--color-navy) 100%);
}

/* Canvas injected by script.js — must stay behind hero content */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Lift hero content above canvas (canvas is positioned, so needs explicit z-index) */
header > .hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

header .eyebrow { color: var(--color-teal); }

.hero-content h1 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: var(--sp-10);
  max-width: 52ch;
  margin-inline: auto;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: var(--sp-12);
}

.hero-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.proof-label {
  color: rgba(255, 255, 255, 0.40);
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
}

.chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: 0.04em;
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}


/* === SERVICES ============================================================== */

#services {
  padding: var(--section-y) var(--section-x);
  max-width: var(--container);
  margin-inline: auto;
}

.section-intro {
  margin-bottom: var(--sp-12);
}

.section-intro .eyebrow { color: var(--fg-strong); }

.section-intro h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  letter-spacing: -0.02em;
  margin-top: var(--sp-1);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.service-card {
  background: var(--surface);
  border: 1px solid transparent;        /* transparent at rest — avoids layout shift on hover */
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease,
              border-color 0.25s ease, background-color 0.4s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--border);
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-gray-100);
  color: var(--color-navy);
  flex-shrink: 0;
  transition: background-color 0.4s ease;
}

.service-card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--fg-strong);
}

.service-card > p {
  font-size: var(--text-base);
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  flex: 1;
}

.card-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-teal);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: letter-spacing 0.2s ease;
}

.card-link:hover {
  letter-spacing: 0.02em;
}


/* === ABOUT ================================================================= */

#about {
  padding: var(--section-y) var(--section-x);
  max-width: var(--container);
  margin-inline: auto;
}

.about-text {
  max-width: 600px;
  margin-bottom: var(--sp-12);
}

.about-text .eyebrow { color: var(--fg-strong); }

.about-text h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  letter-spacing: -0.02em;
  margin-top: var(--sp-1);
  margin-bottom: var(--sp-6);
}

.about-text > p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--fg-muted);
}

/* Working principles grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
}

.value-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 2px solid var(--border);
  transition: border-color 0.25s ease;
}

.value-item:hover {
  border-top-color: var(--color-teal);
}

.value-num {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-gray-400);
}

.value-item h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--fg-strong);
  line-height: var(--leading-tight);
}

.value-item > p {
  font-size: var(--text-base);
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
}

/* Accessible teal for light-bg context — overridden by dark mode below */
#about .role,
#services .eyebrow,
.contact-header .eyebrow {
  color: #007a57;   /* #007a57 on white = ~6:1 contrast — passes WCAG AA */
}


/* === CONTACT =============================================================== */

#contact {
  padding: var(--section-y) var(--section-x);
  max-width: var(--container);
  margin-inline: auto;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--sp-16);
  align-items: start;
}

.contact-header h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  letter-spacing: -0.02em;
  margin-top: var(--sp-1);
  margin-bottom: var(--sp-4);
}

.contact-header > p {
  font-size: var(--text-lg);
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
}

/* Form */
.contact-form-wrapper {
  position: relative;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-row label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-strong);
  transition: color 0.4s ease;
}

.field-optional {
  font-weight: 400;
  color: var(--color-gray-400);
}

input, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
              background-color 0.4s ease, color 0.4s ease;
}

input::placeholder, textarea::placeholder { color: var(--color-gray-400); }

input:focus, textarea:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(0, 216, 158, 0.12);
}

textarea { resize: vertical; min-height: 120px; }

/* Error state — no layout shift because .field-error has min-height */
.form-row.has-error input,
.form-row.has-error textarea {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px var(--color-error-bg);
}

.field-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  font-weight: 500;
  min-height: 1.1em;   /* reserves space — prevents layout shift */
  line-height: 1.4;
}

.contact-form .btn--primary {
  margin-top: var(--sp-2);
  padding: 1rem;
  font-size: var(--text-base);
  border-radius: var(--radius);
}

.form-reassurance {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  text-align: center;
  letter-spacing: 0.02em;
}

/* === Success state === */

.form-success {
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: var(--sp-8);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* display:flex only when the hidden attribute is removed */
.form-success:not([hidden]) {
  display: flex;
}

.form-success.is-visible {
  opacity: 1;
  transform: none;
}

.form-success h3 {
  font-size: var(--text-2xl);
  color: var(--fg-strong);
  margin-bottom: var(--sp-3);
}

.form-success p {
  font-size: var(--text-base);
  color: var(--fg-muted);
}

/* SVG checkmark draw-on animation */
.checkmark {
  width: 72px;
  height: 72px;
  display: block;
  stroke-width: 2;
  margin: 0 auto var(--sp-8);
}

@keyframes anim-stroke {
  to { stroke-dashoffset: 0; }
}

.checkmark-circle {
  stroke: var(--color-teal);
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: anim-stroke 0.65s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  stroke: var(--color-teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  /* starts after circle finishes */
  animation: anim-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.65s forwards;
}


/* === FOOTER ================================================================ */

footer {
  background: var(--color-navy);
  padding: var(--sp-10) var(--section-x);
  margin-top: var(--sp-8);
  transition: background-color 0.4s ease;
}

.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer-copy {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.40);
  max-width: none;
}

.footer-social {
  display: flex;
  gap: var(--sp-4);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.40);
  transition: color 0.2s ease;
  border-radius: var(--radius-sm);
}

.social-link:hover { color: var(--color-teal); }


/* === SCROLL-TO-TOP ========================================================= */

.scroll-top {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-navy);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  pointer-events: none;
  z-index: 50;
}

/* JS removes `hidden` then adds `.is-visible` after scroll > 400px */
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: #0d1e38;
  transform: translateY(-2px);
}


/* === SCROLL PROGRESS ======================================================= */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  /* Gradient matches the logo's own gradient stops */
  background: linear-gradient(90deg, #37e894, #1775d2);
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s linear;
}


/* === SCROLL-TRIGGERED ANIMATIONS ========================================== */

@keyframes anim-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes anim-scale-up {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/*
  Scoped to users who haven't requested reduced motion.
  For everyone else, .anim elements are always visible.
*/
@media (prefers-reduced-motion: no-preference) {

  .anim { opacity: 0; }

  .anim.is-visible {
    animation: anim-fade-up 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }

  .anim.anim--scale.is-visible {
    animation: anim-scale-up 0.60s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }

  /* Stagger delays — set via JS data-delay attribute */
  .anim[data-delay="1"].is-visible { animation-delay:  80ms; }
  .anim[data-delay="2"].is-visible { animation-delay: 160ms; }
  .anim[data-delay="3"].is-visible { animation-delay: 240ms; }
  .anim[data-delay="4"].is-visible { animation-delay: 320ms; }
  .anim[data-delay="5"].is-visible { animation-delay: 400ms; }

  /* h2 teal accent line expands after heading fades in */
  section h2.anim::after {
    content: '';
    display: block;
    height: 3px;
    width: 0;
    background: var(--color-teal);
    margin-top: 0.6rem;
    border-radius: 2px;
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.38s;
  }

  section h2.is-visible::after {
    width: 2.5rem;
  }

}


/* === DARK MODE ============================================================= */

/*
  Token overrides for dark mode.
  Two selectors cover all cases:
    1. @media: when JS is disabled / no data-theme set by FOUC script
    2. html[data-theme="dark"]: set synchronously by FOUC inline script in <head>
*/

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:        var(--color-dark-bg);
    --surface:   var(--color-dark-elevated);
    --border:    var(--color-dark-border);
    --fg:        var(--color-dark-text);
    --fg-strong: var(--color-dark-accent);
    --fg-muted:  var(--color-dark-muted);
    --input-bg:  var(--color-dark-surface);
  }
}

html[data-theme="dark"] {
  --bg:        var(--color-dark-bg);
  --surface:   var(--color-dark-elevated);
  --border:    var(--color-dark-border);
  --fg:        var(--color-dark-text);
  --fg-strong: var(--color-dark-accent);
  --fg-muted:  var(--color-dark-muted);
  --input-bg:  var(--color-dark-surface);
}

/* ── Dark mode component overrides ── */

/* Hero: slightly deeper than light-mode navy */
html[data-theme="dark"] header,
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) header {
    background-color: #0a0a0a;
  }
}

html[data-theme="dark"] header.hero-fallback {
  background:
    radial-gradient(1200px 620px at 18% -8%, rgba(255, 255, 255, 0.08), transparent 60%),
    radial-gradient(920px 520px at 82% 108%, rgba(255, 255, 255, 0.06), transparent 62%),
    linear-gradient(145deg, #0a0a0a 0%, #161616 55%, #0a0a0a 100%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) header.hero-fallback {
    background:
      radial-gradient(1200px 620px at 18% -8%, rgba(255, 255, 255, 0.08), transparent 60%),
      radial-gradient(920px 520px at 82% 108%, rgba(255, 255, 255, 0.06), transparent 62%),
      linear-gradient(145deg, #0a0a0a 0%, #161616 55%, #0a0a0a 100%);
  }
}

/* Nav scrolled: glass on dark bg */
html[data-theme="dark"] .site-nav.is-scrolled {
  background: rgba(13, 13, 13, 0.94);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .site-nav.is-scrolled {
    background: rgba(13, 13, 13, 0.94);
  }
}

/* Section eyebrows: use accessible teal on dark backgrounds */
html[data-theme="dark"] #about .role,
html[data-theme="dark"] #services .eyebrow,
html[data-theme="dark"] .section-intro .eyebrow,
html[data-theme="dark"] .about-text .eyebrow,
html[data-theme="dark"] .contact-header .eyebrow {
  color: var(--color-teal);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #about .role,
  html:not([data-theme="light"]) #services .eyebrow,
  html:not([data-theme="light"]) .section-intro .eyebrow,
  html:not([data-theme="light"]) .about-text .eyebrow,
  html:not([data-theme="light"]) .contact-header .eyebrow {
    color: var(--color-teal);
  }
}

/* Service icon: subtle tinted bg instead of light gray */
html[data-theme="dark"] .service-icon {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-teal);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .service-icon {
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-teal);
  }
}

/* Service cards: slightly more visible shadow on dark bg */
html[data-theme="dark"] .service-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.50);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .service-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.50);
  }
}

/* Primary button: inverts in dark mode — white bg, navy text */
html[data-theme="dark"] .btn--primary:not(.btn--nav) {
  background: var(--color-dark-accent);
  color: var(--color-navy);
}

html[data-theme="dark"] .btn--primary:not(.btn--nav):hover {
  background: #e0e0e0;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .btn--primary:not(.btn--nav) {
    background: var(--color-dark-accent);
    color: var(--color-navy);
  }
  html:not([data-theme="light"]) .btn--primary:not(.btn--nav):hover {
    background: #e0e0e0;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
  }
}

/* Footer: deeper than page bg */
html[data-theme="dark"] footer {
  background: #0a0a0a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) footer {
    background: #0a0a0a;
  }
}

/* Scroll-to-top: use elevated surface instead of navy */
html[data-theme="dark"] .scroll-top {
  background: var(--color-dark-elevated);
  border: 1px solid var(--color-dark-border);
}

html[data-theme="dark"] .scroll-top:hover {
  background: #2a2a2a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .scroll-top {
    background: var(--color-dark-elevated);
    border: 1px solid var(--color-dark-border);
  }
  html:not([data-theme="light"]) .scroll-top:hover {
    background: #2a2a2a;
  }
}


/* === LANGUAGE TOGGLE ======================================================= */

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 0.625rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.80);
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.2s ease;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.50);
  color: var(--color-white);
  transform: scale(1.06);
}

.lang-toggle:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .lang-toggle {
    height: 44px;
    padding: 0 1rem;
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.06);
  }
}


/* === THEME TOGGLE ========================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-white);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
  html:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
}

/* On mobile the theme toggle sits in the menu dropdown */
@media (max-width: 768px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.06);
  }
}


/* === RESPONSIVE ============================================================ */

@media (max-width: 1024px) {
  .services-grid,
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-y: var(--sp-16);
    --section-x: var(--sp-5);
  }

  /* ── Mobile nav ── */
  .nav-toggle {
    display: flex;
  }

  .nav-inner {
    padding-inline: var(--sp-5);
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    padding-block: 0.75rem;
  }

  .site-nav {
    height: auto;
  }

  .nav-menu {
    display: none;                      /* hidden by default on mobile */
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: var(--sp-4) 0 var(--sp-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--sp-3);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: flex;
    width: 100%;
    padding: var(--sp-3) 0;
    font-size: var(--text-base);
  }

  .nav-menu .btn--nav {
    margin-top: var(--sp-4);
    width: 100%;
    justify-content: center;
  }

  /* ── Mobile layout ── */
  .hero-ctas { gap: var(--sp-4); }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }

  .services-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .scroll-top {
    bottom: var(--sp-5);
    right: var(--sp-5);
  }
}
