/* EP Europe, shared styles.
   Palette per EP Corporate Identity Manual (April 2025):
     Primary       #1FA5DE (cyan)        - EP wordmark
                   #92939A (warm grey)   - Energy Partners typemark
     Secondary     #0E3A5A (deep navy)   - master-brand tone
                   #006A77 (teal)        - darker EP companion
                   #009AB1 #40C0F0 #00AB96 #6E8084 (sub-division tints)
   Typography:
     Headers       Montserrat (substitution for Avenir, per bible page 23)
     Body          Source Sans 3 (modern release of Source Sans Pro, per bible page 23)
     Code/eyebrows IBM Plex Mono (utility, not in the bible) */
:root {
  --ink: #0E3A5A;              /* EP deep navy, secondary palette #1 */
  --ink-2: #1A4570;            /* slightly raised navy for surfaces */
  --stone: #FFFFFF;
  --stone-2: #F4F6F8;
  --stone-3: #E6EAEE;
  --steel: #6E8084;            /* secondary palette #10 */
  --steel-2: #92939A;           /* primary palette #2 (Energy Partners typemark grey) */
  --line: #DCE2E8;
  --line-dark: #1A4570;
  --cool: #1FA5DE;             /* primary palette #1, brand EP cyan */
  --cool-ink: #006A77;          /* secondary palette #2, darker companion for hover/contrast */
  --cool-soft: #E5F4FB;         /* light tint of #1FA5DE */
  --brand-blue-deep: #0E3A5A;
  --brand-blue-mid: #006A77;
  --brand-blue: #1FA5DE;
  --brand-blue-light: #40C0F0;
  --brand-green-teal: #00AB96;
  --signal: #00AB96;            /* swap to brand teal-green (was generic #2FBF71) */
  --alert: #E26A3B;

  --fs-display: clamp(36px, 4.4vw, 68px);
  --fs-h1: clamp(40px, 5.2vw, 80px);
  --fs-h2: clamp(32px, 3.4vw, 52px);
  --fs-h3: clamp(22px, 1.8vw, 28px);
  --fs-body: 17px;
  --fs-small: 14px;
  --fs-eyebrow: 12px;

  --radius: 2px;
  --radius-lg: 4px;

  --container: 1360px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  /* Body copy: Source Sans 3 per the brand bible. Headings switch to Montserrat
     via the .display / h1.h1 / h2.h2 / h3.h3 classes below. */
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--stone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ============ A11y utilities ============ */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-main-content link: visible only when focused */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--stone) !important;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: top .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid var(--cool);
  outline-offset: 2px;
}

/* Visible focus indicator on every focusable interactive element. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Dark-section variant has higher contrast against ink. */
.section-dark :where(a, button):focus-visible,
.nav :where(a, button):focus-visible {
  outline-color: var(--cool);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 500;
}

/* Headings use Montserrat (the bible's named substitute for Avenir, page 23). */
.display, h1.h1, h2.h2, h3.h3 {
  font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
  text-transform: uppercase;
}
h1.h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.02; letter-spacing: -0.02em; margin: 0; text-wrap: balance; text-transform: uppercase; }
h2.h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.05; letter-spacing: -0.015em; margin: 0; text-wrap: balance; text-transform: uppercase; }
h3.h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; margin: 0; text-transform: uppercase; }
.lede { font-size: clamp(18px, 1.4vw, 22px); line-height: 1.5; color: var(--ink); max-width: 62ch; text-wrap: pretty; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--stone) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 88px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.brand-logo {
  display: inline-flex; align-items: center;
  height: 72px;
}
.brand-logo img { height: 72px; width: auto; display: block; }
@media (max-width: 760px) {
  .brand-logo, .brand-logo img { height: 56px; }
}
.brand-text { font-size: 14px; letter-spacing: 0.02em; line-height: 1.05; }
.brand-text .eu {
  color: var(--cool);
  font-weight: 700;
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  text-align: center;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--ink);
}

/* Switch to burger nav earlier than the rest of the mobile breakpoint
   because the nav row needs more horizontal room than typical content. */
@media (max-width: 1000px) {
  .nav-links.desktop-links { display: none; }
  .nav-burger {
    display: inline-flex !important;
    margin-left: auto;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    color: var(--ink);
  }
  .nav-burger svg { width: 22px; height: 22px; }
}
.nav-cta,
.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--cool);
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background .2s;
}
.nav-cta:hover,
.nav-links a.nav-cta:hover { background: var(--cool-ink); color: #ffffff !important; }
.nav-cta .dot {
  width: 6px; height: 6px; background: var(--cool); border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--cool) 30%, transparent);
}

/* Language toggle */
.lang-toggle {
  position: relative;
  display: inline-block;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius);
  transition: border-color .2s, color .2s, background .2s;
  white-space: nowrap;
  line-height: 1;
}
.lang-btn:hover { border-color: var(--ink); color: var(--ink); }
.lang-btn[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.lang-current { font-weight: 600; }
.lang-toggle.on-dark .lang-btn {
  color: var(--stone);
  border-color: var(--line-dark);
}
.lang-toggle.on-dark .lang-btn:hover,
.lang-toggle.on-dark .lang-btn[aria-expanded="true"] {
  border-color: var(--stone);
  color: var(--stone);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: var(--stone);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(11,27,43,0.10);
  list-style: none;
  margin: 0;
  padding: 4px;
  z-index: 60;
  animation: langMenuIn .14s ease both;
}
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.lang-menu li { display: block; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  border-radius: var(--radius);
  transition: background .15s;
  cursor: pointer;
}
.lang-menu button:hover { background: var(--stone-2); }
.lang-menu button.active { background: var(--stone-2); color: var(--ink); }
.lang-menu .lang-code {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--steel);
  min-width: 22px;
}
.lang-menu button.active .lang-code { color: var(--cool-ink); }
.lang-menu .lang-name { font-weight: 500; }

/* On mobile drawer use a row of pill buttons */
.lang-toggle.compact .lang-btn {
  padding: 10px 14px;
  font-size: 12px;
}
/* Mobile drawer anchors the toggle on the LEFT, so open the menu rightward
   instead of the default right:0 (which would push it off-screen left). */
.lang-toggle.compact .lang-menu { right: auto; left: 0; }

@media (max-width: 760px) {
  .lang-toggle:not(.compact) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--cool); color: #fff; }
.btn-primary:hover { background: var(--cool-ink); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--stone); }
.btn-ghost { color: var(--ink); padding: 8px 0; }
.btn-ghost .arrow { transition: transform .2s; }
.btn-ghost:hover .arrow { transform: translateX(4px); }

/* Sections */
section { padding: clamp(64px, 8vw, 128px) 0; }
.section-dark { background: var(--ink); color: var(--stone); }
.section-dark .eyebrow { color: var(--steel-2); }
.section-dark .lede { color: var(--stone); }
.section-stone2 { background: var(--stone-2); }

/* Section header */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  margin-bottom: 64px;
  align-items: end;
}
.section-head .eyebrow-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.section-head .index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--steel);
}
.section-head .lede { grid-column: 2; }
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 40px; }
  .section-head .lede { grid-column: 1; }
}

/* ============ MOBILE, universal stacking helpers ============
   Inline gridTemplateColumns on JSX components can't be reached by class‑based
   media queries. We tag those grids with data-stack="..." and override here. */
@media (max-width: 760px) {
  /* Stack any 2/3/4-up grid into one column */
  [data-stack="md"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* Collapse to 2 columns at this breakpoint, 1 column further down */
  [data-stack="2"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  /* Stat strips that should keep horizontal scroll vibe but stack at 2 */
  [data-stack="stat"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
  }
  [data-stack="stat"] > * + * {
    border-left: 1px solid var(--line) !important;
  }
  [data-stack="stat"] > *:nth-child(3) {
    border-top: 1px solid var(--line) !important;
    border-left: none !important;
  }
  [data-stack="stat"] > *:nth-child(4) {
    border-top: 1px solid var(--line) !important;
  }

  /* Sections lose their generous top/bottom on mobile */
  section { padding: 56px 0 !important; }

  /* Hide the designer Tweaks panel on mobile */
  .tweaks { display: none !important; }

  /* Nav: bigger tap targets, drop spacing */
  .nav-inner { gap: 16px; height: 64px; }
  .nav-links.desktop-links { display: none; }
  .nav-burger {
    display: inline-flex !important;
    margin-left: auto;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    color: var(--ink);
  }
  .nav-burger svg { width: 22px; height: 22px; }

  /* Mobile drawer */
  .nav-drawer {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--stone);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
    padding: 12px var(--pad) 24px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    z-index: 49;
  }
  .nav-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-drawer a {
    display: block;
    padding: 18px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
  .nav-drawer a.active { color: var(--cool-ink); }
  .nav-drawer .nav-cta {
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    padding: 16px 18px;
    border-bottom: none;
  }

  /* Hero image sits below copy on the homepage; ensure it remains visible
     and at a friendly mobile aspect ratio. */
  [data-hero-art] {
    aspect-ratio: 4/3 !important;
    order: 2 !important;
  }
  [data-hero-grid] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    align-items: start !important;
  }

  /* CSCard, image full-width on top, content below */
  [data-cs-card] {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }
  [data-cs-card] [data-cs-image] {
    order: -1 !important;
    aspect-ratio: 16/10;
    min-height: 0 !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid var(--line);
  }
  [data-cs-card] [data-cs-content] {
    padding: 28px 24px !important;
  }

  /* HowItWorks stepper, switch from 2 col to stacked accordion */
  [data-stepper] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  [data-stepper-panel] {
    min-height: 360px !important;
    padding: 28px !important;
  }

  /* LiveMeter, chart on top, stats below */
  [data-meter-body] {
    grid-template-columns: 1fr !important;
  }
  [data-meter-body] > * {
    border-right: none !important;
    border-bottom: 1px solid var(--line-dark) !important;
  }
  [data-meter-body] > *:last-child { border-bottom: none !important; }

  /* IndustryRow, collapse from 5 cols to a stacked card */
  [data-industry-row] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 20px 0 !important;
    padding-left: 0 !important;
  }
  [data-industry-row] [data-industry-arrow],
  [data-industry-row] [data-industry-num] {
    display: none !important;
  }
  [data-industry-row] [data-industry-name] {
    font-size: 22px !important;
  }

  /* Footer, single column, more breathing room */
  .footer-top { grid-template-columns: 1fr !important; gap: 32px !important; }
  .footer-big { font-size: 26px !important; }
  .footer-bottom { flex-direction: column; gap: 12px; }

  /* Buttons full-width in stacked CTAs */
  [data-cta-stack] { flex-direction: column !important; align-items: stretch !important; }
  [data-cta-stack] .btn { justify-content: center; }

  /* Headlines: tighten max-widths so they don't push to one word per line */
  h1.display, .display { max-width: none !important; }
}

@media (min-width: 761px) {
  .nav-burger { display: none; }
  .nav-drawer { display: none; }
}

/* Very small phones, drop two-up grids to single column */
@media (max-width: 480px) {
  [data-stack="2"] {
    grid-template-columns: 1fr !important;
  }
  [data-stack="stat"] {
    grid-template-columns: 1fr !important;
  }
  [data-stack="stat"] > * + * {
    border-left: none !important;
    border-top: 1px solid var(--line) !important;
  }
  /* Tighten section header bottom margin further */
  .section-head { margin-bottom: 28px !important; gap: 16px !important; }
  /* Footer single column always */
  .footer-top { grid-template-columns: 1fr !important; }
}

/* Form inputs must be at least 16px on mobile to prevent iOS zoom-on-focus */
@media (max-width: 760px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Hero stat placeholder / image placeholder */
.img-placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      var(--stone-3) 0 1px,
      transparent 1px 8px
    ),
    var(--stone-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  overflow: hidden;
}
.img-placeholder.dark {
  background:
    repeating-linear-gradient(
      135deg,
      #1E242C 0 1px,
      transparent 1px 8px
    ),
    #151A20;
  border-color: var(--line-dark);
  color: var(--steel-2);
}
.img-placeholder .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
  background: color-mix(in oklab, var(--stone) 86%, transparent);
  padding: 4px 8px;
}
.img-placeholder.dark .tag {
  background: color-mix(in oklab, var(--ink) 70%, transparent);
  color: var(--steel-2);
}

/* Footer
   Background uses EP deep navy #0E3A5A (CI manual page 20, secondary palette #1).
   White text + white EP wordmark per the bible's solid-background guidance (page 9). */
.footer {
  background: var(--ink);
  color: var(--stone);
  padding: 80px 0 40px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-dark);
}
.footer h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--steel-2);
  font-weight: 500;
  margin: 0 0 16px;
}
.footer a { color: var(--stone); opacity: 0.85; font-size: 14px; display: block; padding: 3px 0; }
.footer a:hover { opacity: 1; color: var(--cool); }
.footer-big {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 520px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  font-size: 12px;
  color: var(--steel-2);
  font-family: 'IBM Plex Mono', monospace;
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Utility */
.divider { height: 1px; background: var(--line); margin: 0; }
.divider.dark { background: var(--line-dark); }
.rule-mono {
  display: flex; align-items: center; gap: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel);
}
.rule-mono::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-dark .rule-mono { color: var(--steel-2); }
.section-dark .rule-mono::after { background: var(--line-dark); }

/* Page entrance */
.fade-in { animation: fadeIn .6s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* CaaS "How it works" stepper image panel — crossfade + slow Ken Burns drift */
.stepper-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .9s ease;
  will-change: opacity, transform;
  pointer-events: none;
}
.stepper-img.is-active {
  opacity: 1;
  animation: kenburns 16s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
  .stepper-img.is-active { animation: none; transform: scale(1.02); }
}

/* Tweaks panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px;
  width: 280px;
  background: var(--ink);
  color: var(--stone);
  padding: 16px;
  border-radius: var(--radius-lg);
  z-index: 100;
  font-size: 13px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  display: none;
}
.tweaks.open { display: block; }
.tweaks h5 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--steel-2);
  font-weight: 500;
}
.tweaks .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.tweaks .row label { color: var(--steel-2); font-size: 12px; }
.tweaks select, .tweaks input[type=text] {
  background: var(--ink-2); color: var(--stone); border: 1px solid var(--line-dark);
  padding: 4px 8px; font-size: 12px; border-radius: 2px; font-family: inherit;
}
.tweaks .swatches { display: flex; gap: 6px; }
.tweaks .sw {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-dark); cursor: pointer;
}
.tweaks .sw.active { outline: 2px solid var(--stone); outline-offset: 2px; }
