/* =============================================================
   Ebee Solutions — corporate site
   Themed via [data-theme="..."] on <html>.
   Defaults set in <head> before paint to avoid flash.
   ============================================================= */

@font-face {
  font-family: "Quicksand";
  src: url("assets/Quicksand-VariableFont_wght.ttf") format("truetype-variations"),
       url("assets/Quicksand-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* -------- Immutable tokens -------------------------------------- */
:root {
  /* Brand palette (do not edit per theme) */
  --navy-darkest: #010f1a;
  --navy-dark:    #02182b;
  --navy:         #042d4a;
  --navy-mid:     #0a3a5c;
  --navy-lighter: #0d4a74;

  --cyan-electric: #00ffff;
  --cyan-dark:     #00d4d4;
  --cyan-light:    #4dffff;
  --cyan-subtle:   rgba(0, 255, 255, 0.12);
  --cyan-ghost:    rgba(0, 255, 255, 0.06);

  /* Feedback (parity with design system; unused on this page) */
  --color-success: #22c39a;
  --color-warning: #f5a524;
  --color-error:   #f43f5e;
  --color-info:    var(--cyan-light);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Type scale (Quicksand) */
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-base: 16px;
  --fs-md:  18px;
  --fs-lg:  20px;
  --fs-xl:  24px;
  --fs-2xl: 32px;
  --fs-3xl: 40px;
  --fs-4xl: 48px;
  --fs-5xl: 64px;

  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Layout */
  --container-max: 1080px;
  --container-pad: clamp(20px, 4vw, 48px);
  --section-label-col: 200px;
  --section-gap: var(--space-12);
}

/* -------- Theme: Midnight (default) ----------------------------- */
[data-theme="midnight"] {
  --bg-surface:  var(--navy-darkest);
  --bg-base:     var(--navy-dark);
  --bg-elevated: var(--navy);
  --bg-raised:   var(--navy-mid);

  --fg-primary:   #ffffff;
  --fg-secondary: #cbd5e1;
  --fg-muted:     #6b8198;
  --fg-accent:    var(--cyan-electric);

  --accent-subtle: var(--cyan-subtle);
  --accent-ghost:  var(--cyan-ghost);

  --border-subtle: var(--cyan-ghost);
  --border-strong: var(--cyan-subtle);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.50);
  --glow-sm: 0 0 8px  rgba(0, 255, 255, 0.25);
  --glow-md: 0 0 18px rgba(0, 255, 255, 0.30);
  --glow-lg: 0 0 36px rgba(0, 255, 255, 0.35);

  color-scheme: dark;
}

/* -------- Theme: Daylight (light) ------------------------------- */
[data-theme="daylight"] {
  --bg-surface:  #f1f5f9;
  --bg-base:     #ffffff;
  --bg-elevated: #f8fafc;
  --bg-raised:   #eef2f7;

  --fg-primary:   #02182b;
  --fg-secondary: #1e293b;
  --fg-muted:     #64748b;
  --fg-accent:    #0e7490; /* cyan-700 — readable on white */

  --accent-subtle: rgba(14, 116, 144, 0.10);
  --accent-ghost:  rgba(14, 116, 144, 0.05);

  --border-subtle: rgba(2, 24, 43, 0.08);
  --border-strong: rgba(2, 24, 43, 0.16);

  --shadow-sm: 0 1px 2px rgba(2, 24, 43, 0.05);
  --shadow-md: 0 6px 18px rgba(2, 24, 43, 0.08);
  --shadow-lg: 0 16px 40px rgba(2, 24, 43, 0.12);
  --glow-sm: 0 0 8px  rgba(14, 116, 144, 0.15);
  --glow-md: 0 0 18px rgba(14, 116, 144, 0.18);
  --glow-lg: 0 0 36px rgba(14, 116, 144, 0.20);

  color-scheme: light;
}

/* -------- Reset / base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  background: var(--bg-base);
  color: var(--fg-secondary);
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background-color 240ms ease, color 240ms ease;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent-subtle);
  color: var(--fg-primary);
}

:focus-visible {
  outline: 2px solid var(--fg-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-elevated);
  color: var(--fg-primary);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* -------- Layout primitives ------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* -------- Header ------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-base) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 240ms ease, border-color 240ms ease;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--space-6);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--fg-primary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  letter-spacing: 0.01em;
}
.brand__mark { width: 28px; height: 28px; flex: none; }

/* -------- Theme toggle ----------------------------------------- */
.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-elevated);
  color: var(--fg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 240ms ease,
    border-color 240ms ease;
}
.theme-toggle:hover {
  color: var(--fg-accent);
  border-color: var(--border-strong);
}
.theme-toggle__icon { width: 16px; height: 16px; }

/* Show the icon for the *target* theme — clicking switches to it. */
[data-theme="midnight"] .theme-toggle__icon--moon { display: none; }
[data-theme="daylight"] .theme-toggle__icon--sun  { display: none; }

/* -------- Hero -------------------------------------------------- */
.hero {
  padding-top: clamp(var(--space-16), 12vw, 128px);
  padding-bottom: clamp(var(--space-16), 12vw, 128px);
}
.hero__title {
  color: var(--fg-primary);
  font-weight: var(--fw-bold);
  font-size: clamp(var(--fs-2xl), 6vw, var(--fs-5xl));
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.accent { color: var(--fg-accent); }

.hero__lede {
  margin-top: var(--space-8);
  max-width: 52ch;
  color: var(--fg-muted);
  font-size: var(--fs-base);
  line-height: 1.7;
}

/* -------- Section pattern (label | body) ------------------------ */
.section {
  padding-block: clamp(var(--space-12), 8vw, 96px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: 1fr;
  transition: border-color 240ms ease;
}
@media (min-width: 820px) {
  .section {
    grid-template-columns: var(--section-label-col) 1fr;
  }
}

.section__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: var(--space-2);
}

.section__title {
  color: var(--fg-primary);
  font-size: clamp(var(--fs-xl), 3vw, var(--fs-2xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--space-6);
}

.section__body--prose p {
  color: var(--fg-secondary);
  font-size: var(--fs-base);
  line-height: 1.7;
  max-width: 60ch;
}
.section__body--prose p + p { margin-top: var(--space-4); }

.link {
  color: var(--fg-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.link:hover { border-bottom-color: var(--fg-accent); }

/* -------- Product grid ------------------------------------------ */
.product-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
/* Stretch each card to fill its grid cell so all cards in a row match height. */
.product-grid > li { display: grid; }

.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-height: 132px;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease;
}
.product-card:hover {
  background: var(--bg-raised);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow-sm);
}
.product-card:focus-visible { outline-offset: 2px; }

.product-card__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: var(--space-2);
}
.product-card__name {
  color: var(--fg-primary);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
}
.product-card__tag {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.4;
}

/* -------- Inquiries -------------------------------------------- */
.inquiry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 640px) {
  .inquiry-grid { grid-template-columns: 1fr 1fr; gap: var(--space-12); }
}
.inquiry__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}
.inquiry__email {
  display: inline-block;
  color: var(--fg-accent);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
  margin-bottom: var(--space-3);
}
.inquiry__email:hover { border-bottom-color: var(--fg-accent); }
.inquiry__desc {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  max-width: 32ch;
}

/* -------- Footer ----------------------------------------------- */
.site-footer {
  margin-top: var(--space-16);
  padding-block: var(--space-12);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  transition: background-color 240ms ease, border-color 240ms ease;
}
.site-footer__inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--fg-secondary);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.site-footer__inner .brand__mark { width: 20px; height: 20px; margin-top: 2px; }
.site-footer__location,
.site-footer__copy { color: var(--fg-muted); }
