/* Site-wide brand and responsive refinements. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --kgec-navy: #081720;
  --kgec-green: #0b5d45;
  --kgec-slate: #4b5563;
  --kgec-light: #e5e7eb;
}

.container-x {
  max-width: none;
  padding-inline: clamp(1.25rem, 3.5vw, 4.5rem);
}

body, button, input, select, textarea {
  font-family: Inter, system-ui, sans-serif;
}

h1, h2, h3, h4, .h-section, .font-display {
  font-family: Montserrat, Inter, sans-serif;
  font-stretch: normal !important;
  letter-spacing: -.025em;
}

.h-section {
  font-size: clamp(2.3rem, 3.6vw, 3.9rem);
  line-height: 1.08;
  font-weight: 700;
}

header img[alt="Kuwait Green Energy Co."] {
  height: 72px !important;
}

a.group.inline-flex, button.group.inline-flex {
  height: 50px;
  padding-inline: 1.5rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .005em;
}

a.group.inline-flex.h-11, button.group.inline-flex.h-11 {
  height: 44px;
}

main img[src^="/img/"] {
  filter: saturate(.94) contrast(1.035);
}

main img[src="/img/about-team.webp"] {
  filter: brightness(1.07) saturate(.94) contrast(1.035);
}

main section.py-24:not(.home-hero) {
  padding-block: 4.5rem;
}

main > section:first-child:not(.home-hero) h1 {
  font-size: clamp(2.8rem, 5vw, 5.25rem);
  font-weight: 700;
  line-height: 1.04;
}

.home-hero {
  min-height: 100svh;
}

.home-hero > div:nth-child(2) {
  background: linear-gradient(90deg, rgba(6, 19, 27, .92) 0%, rgba(6, 19, 27, .65) 36%, rgba(6, 19, 27, .14) 72%, rgba(6, 19, 27, .04) 100%);
}

.home-hero > div:nth-child(3) {
  opacity: .6;
}

.home-hero h1 {
  max-width: 930px;
  font-size: clamp(2.4rem, 8.8vw, 4.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.home-hero > div:nth-child(4) > div {
  max-width: 610px;
}

@media (min-width: 1024px) {
  .home-hero {
    min-height: clamp(660px, 82svh, 880px);
  }

  .home-hero > div:nth-child(4) {
    padding-top: 7.5rem;
    padding-bottom: 3rem;
  }

  .home-hero h1 {
    font-size: clamp(3.5rem, 4.2vw, 4.75rem);
  }
}

@media (max-width: 639px) {
  .home-hero > div:nth-child(2) {
    background: linear-gradient(90deg, rgba(6, 19, 27, .88), rgba(6, 19, 27, .42)), linear-gradient(0deg, rgba(6, 19, 27, .5), transparent 50%);
  }

  .home-hero > div:nth-child(4) {
    padding-top: 7.5rem;
    padding-bottom: 2.25rem;
  }

  .home-hero h1 {
    font-size: clamp(2.25rem, 8.6vw, 3rem);
  }

  main section.py-24:not(.home-hero) {
    padding-block: 3.75rem;
  }

  .home-hero > div:last-child .container-x > div {
    gap: .5rem;
    padding-block: .9rem;
  }
}

/* Fortimark design credit: a one-line gold signature in the footer bar (no pill). */
.fm-credit {
  --fm-gold: #e9ab0d;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .25rem;
  color: rgba(255, 255, 255, .6);
  text-decoration: none;
}

.fm-credit:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--fm-gold);
  outline-offset: 4px;
}

.fm-credit-mark {
  width: auto;
  height: 22px;
  filter: drop-shadow(0 1px 3px rgba(233, 171, 13, .3));
  transform-origin: 50% 100%;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), filter .4s ease;
}

.fm-credit:hover .fm-credit-mark,
.fm-credit:focus-visible .fm-credit-mark {
  filter: drop-shadow(0 0 8px rgba(233, 171, 13, .7));
  transform: translateY(-2px) rotate(-8deg);
}

.fm-credit-text {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  line-height: 1;
}

.fm-credit-label {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .55);
}

/* Gold wordmark with a slow sheen, plus an underline that draws in on hover. */
.fm-credit-name {
  position: relative;
  font-family: Montserrat, Inter, sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fm-gold);
  background: linear-gradient(100deg, var(--fm-gold) 0%, var(--fm-gold) 40%, #fff3c4 50%, var(--fm-gold) 60%, var(--fm-gold) 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fm-sheen 6s ease-in-out 2s infinite;
}

.fm-credit-name::after {
  content: '';
  position: absolute;
  left: 0;
  right: .24em;
  bottom: -5px;
  height: 1px;
  background: var(--fm-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.65, 0, .35, 1);
}

.fm-credit:hover .fm-credit-name::after,
.fm-credit:focus-visible .fm-credit-name::after { transform: scaleX(1); }

@keyframes fm-sheen {
  0%, 70% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (min-width: 768px) {
  footer .container-x:has(> .fm-credit) {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  footer .container-x:has(> .fm-credit) > button {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm-credit-mark, .fm-credit-name::after { transition: none; }
  .fm-credit-name { animation: none; }
  .fm-credit:hover .fm-credit-mark { transform: none; }
}

/* Hero stat icons: animate alongside the 30,000 PSI gauge once the intro is done. */
.hero-ico {
  display: inline-flex;
  flex-shrink: 0;
}

.hero-ico svg { overflow: visible; }

.hero-ico-1.is-live svg :is(path, polyline) {
  stroke-dasharray: 72;
  stroke-dashoffset: 72;
  animation: hero-ico-draw 1.4s cubic-bezier(.65, 0, .35, 1) .2s forwards;
}

.hero-ico-1.is-live svg {
  animation: hero-ico-pulse 3.4s ease-in-out 1.8s infinite;
}

.hero-ico-2.is-live svg {
  transform-origin: 50% 50%;
  animation: hero-ico-spin 7s linear infinite;
}

.hero-ico-3.is-live svg {
  transform-origin: 50% 85%;
  animation: hero-ico-ring 3.6s ease-in-out .8s infinite;
}

@keyframes hero-ico-draw { to { stroke-dashoffset: 0; } }

@keyframes hero-ico-pulse {
  0%, 100% { transform: scale(1); filter: none; }
  50% { transform: scale(1.07); filter: drop-shadow(0 0 7px rgba(79, 168, 137, .65)); }
}

@keyframes hero-ico-spin { to { transform: rotate(360deg); } }

@keyframes hero-ico-ring {
  0%, 58%, 100% { transform: rotate(0); }
  64% { transform: rotate(-11deg); }
  70% { transform: rotate(9deg); }
  76% { transform: rotate(-6deg); }
  82% { transform: rotate(4deg); }
  88% { transform: rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ico.is-live svg,
  .hero-ico.is-live svg :is(path, polyline) {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* Keep addresses and emails whole; only break when a single word can't fit. */
.break-all {
  word-break: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1279px) {
  .cond.break-all.text-2xl {
    font-size: clamp(1.05rem, 1.6vw + .7rem, 1.5rem);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .cond.break-all.text-2xl { font-size: 1.25rem; }
}

/* Desktop dropdowns: roomier items, and much less see-through while open. */
.nav-menu-item {
  padding-block: 1rem;
  font-size: 1rem;
}

.nav-menu-panel { background-color: rgb(8 23 32 / .985); }

.nav-bar-open { background-color: rgb(8 23 32 / .97); }

/* Mobile menu groups: keep the page link and plus toggle independently tappable. */
.mobile-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgb(255 255 255 / .08);
}

.mobile-nav-link {
  display: flex;
  min-height: 3.75rem;
  flex: 1;
  align-items: center;
  text-decoration: none;
}

.mobile-nav-toggle {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 999px;
  color: #a6c5b6;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
  border-color: #78a993;
  background: rgb(120 169 147 / .1);
  color: #fff;
}

.mobile-nav-submenu {
  margin: 0;
  padding: .35rem 0 .75rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / .08);
  list-style: none;
}

.mobile-nav-sublink {
  display: block;
  padding: .7rem .5rem;
  color: rgb(255 255 255 / .76);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
}

.mobile-nav-sublink:hover,
.mobile-nav-sublink:focus-visible { color: #a6c5b6; }

/* ---------- Tablet + mobile fixes (Sep 2026 review) ---------- */

/* No sideways page scroll from stray overflow (e.g. decorative SVGs). clip keeps position: sticky working. */
html, body { overflow-x: clip; }

/* Home "Core Services": below desktop, the card grows to fit its text instead of clipping the title. */
@media (max-width: 1279px) {
  .svc-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: auto;
    min-height: 21rem;
  }
  .svc-card > div:last-child { position: relative; }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .svc-card h3 { font-size: 2.25rem; }
}

/* 1024–1279px: show the full desktop menu instead of the hamburger ("Home" hides; the logo links home). */
@media (min-width: 1024px) and (max-width: 1279px) {
  header nav[aria-label="Primary"] { display: flex; gap: 0; }
  header nav[aria-label="Primary"] > div:first-child { display: none; }
  header nav[aria-label="Primary"] a { padding-inline: .6rem; font-size: 14.5px; }
  header button[aria-label="Open menu"],
  header button[aria-label="Close menu"] { display: none; }
  .nav-menu-panel { display: block; }
  .cert-code { font-size: clamp(1.4rem, 2.15vw, 2.25rem); white-space: nowrap; }
  .hero-stats .cond.font-display { font-size: 1.2rem; }
}

/* Hero stat strip on phones: smaller type and icons so "API Certified" fits on one line. */
@media (max-width: 639px) {
  .hero-stats > div { gap: .75rem; }
  .hero-stats .cond.font-display { font-size: 1.05rem; line-height: 1.2; }
  .hero-stats svg { width: 1.9rem; height: 1.9rem; }
}

/* Products tabs on phones: a 2 × 2 grid instead of a strip that hides "Threading". */
@media (max-width: 767px) {
  .prod-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 1.25rem;
  }
  .prod-tabs > button { padding-inline: .75rem; border-radius: .9rem; }
  .prod-tabs .grad-brand { border-radius: .9rem; }
}

/* About: no lone tiles on their own row. */
@media (max-width: 639px) {
  .about-caps > :last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    flex-direction: row;
    padding-block: 1.25rem;
  }
}

@media (max-width: 767px) {
  .about-team > :last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .about-team { grid-template-columns: repeat(6, 1fr); }
  .about-team > * { grid-column: span 2; }
  .about-team > :nth-child(4),
  .about-team > :nth-child(5) { grid-column: span 3; aspect-ratio: 4 / 3; }
}

/* Footer link columns: an accordion on phones, plain headings from 640px up. */
.foot-col__toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: inherit;
  font: inherit;
  text-align: left;
  pointer-events: none;
}

.foot-col__chev { display: none; }

@media (max-width: 639px) {
  footer .grid:has(> .foot-col) { gap: 1.25rem; }
  .foot-col__toggle { padding-block: .35rem; cursor: pointer; pointer-events: auto; }
  .foot-col__chev { display: block; opacity: .7; transition: transform .4s ease; }
  .foot-col.is-open .foot-col__chev { transform: rotate(180deg); }
  .foot-col:not(.is-open) .foot-col__list { display: none; }
}

/* ---------- Industries: restrained stacked cards ---------- */
.ind-card-0,
.ind-card-1,
.ind-card-2,
.ind-card-3 { --acc: #63927f; }

.ind-card {
  border: 1px solid #34434c;
  border-radius: 5px;
  background: #0c1b25;
  box-shadow: 0 18px 42px -34px rgb(0 0 0 / 75%);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.ind-card:hover {
  border-color: #6c8e7f;
  box-shadow: 0 20px 44px -34px rgb(0 0 0 / 85%);
}

.ind-media { border-right: 1px solid #34434c; }
.ind-media img { transition: transform 1.4s cubic-bezier(.16, 1, .3, 1); }
.ind-card:hover .ind-media img { transform: scale(1.05); }

.ind-body { padding: 2rem 1.75rem 2.25rem; }

/* Small brand rule, aligned to the inner edge of the copy. */
.ind-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.75rem;
  width: 38px;
  height: 2px;
  background: var(--acc);
}

.ind-points { margin-top: 1.5rem; }
.ind-card li svg { color: #77a28f; }

/* The original illustrated icons were decorative and competed with the photography.
   Keep the stack's useful index, but let the industry name carry the card. */
.ind-ico {
  display: none;
}

.ind-num {
  color: #a6b2b9;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .13em;
  font-variant-numeric: tabular-nums;
}

/* Sticky stacking only where there's room (≥1024px); normal flow on phones and tablets. */
.ind-slot { margin-bottom: 1.25rem; }

@media (min-width: 1024px) {
  .ind-slot {
    position: sticky;
    height: clamp(430px, 62vh, 540px);
    margin-bottom: 8vh;
  }
  .ind-body { padding: 2.5rem 3rem; }
  .ind-body::before { left: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ind-media img { transition: none; }
}

/* Footer certification marquee: a single calm ticker under its own label. */
.footer-certifications__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: clamp(1.75rem, 3.4vw, 2.75rem);
  text-align: center;
}

.footer-certifications__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  margin: 0 0 1.15rem;
  color: #9bb6a8;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.footer-certifications__label::before,
.footer-certifications__label::after {
  content: '';
  display: block;
  width: clamp(1.5rem, 4vw, 3.25rem);
  height: 1px;
  background: rgb(155 182 168 / .45);
}

.footer-certifications__marquee {
  width: 100%;
  max-width: 92rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.footer-certifications__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: cert-ticker 40s linear infinite;
  will-change: transform;
}

.footer-certifications__marquee:hover .footer-certifications__track { animation-play-state: paused; }

.footer-certifications__set {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4.5rem);
  padding-right: clamp(1.5rem, 4vw, 4.5rem);
}

.footer-certifications__item {
  display: inline-flex;
  align-items: center;
  color: #f3f5f4;
  font-family: Montserrat, Inter, sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2;
  white-space: nowrap;
}

.footer-certifications__item::after {
  content: '';
  display: block;
  width: 1px;
  height: 1.3em;
  margin-inline: clamp(1.2rem, 3vw, 2.8rem);
  background: rgb(155 182 168 / .5);
}

.footer-legal-link { color: inherit; font-size: .85rem; text-decoration: none; }
.footer-legal-link:hover, .footer-legal-link:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: .25em; }

@keyframes cert-ticker {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-certifications__track { animation: none; }
  .footer-certifications__marquee { overflow: visible; mask-image: none; -webkit-mask-image: none; }
  .footer-certifications__track { flex-wrap: wrap; justify-content: center; width: auto; gap: .6rem 0; }
  .footer-certifications__item[aria-hidden="true"] { display: none; }
  .footer-certifications__item:nth-of-type(5)::after { display: none; }
}

/* ---------- Touch devices: comfortable tap targets and no iOS zoom on form fields ---------- */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }

  footer ul a { display: inline-block; padding-block: .55rem; }
  footer ul.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0; }
  footer button.flex.items-center.gap-2 { padding-block: .8rem; }
  .foot-col__toggle { padding-block: .6rem; }

  main a.mt-5.inline-flex.items-center.gap-2,
  main a.text-sm.font-semibold.text-brand-500,
  main a.inline-block.text-sm.font-semibold {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  main nav a, main ol a { display: inline-flex; min-height: 44px; align-items: center; }
  main ol a:first-child { padding-inline: .2rem; }

  .fm-credit { padding-block: .7rem; }
  header nav[aria-label="Primary"] a { min-height: 44px; }
}

/* ---------- Phones ---------- */
@media (max-width: 639px) {
  /* Certifications page: licence cards two-up instead of one long column. */
  .cert-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .cert-grid > * { padding: 1.25rem .75rem; }
  .cert-grid h3 { font-size: 1.05rem; }
  .cert-grid p { font-size: .8rem; }
}

@media (max-width: 479px) {
  /* Inner page titles: two lines instead of three on narrow phones. */
  main > section:first-child:not(.home-hero) h1 { font-size: clamp(2.1rem, 10.4vw, 2.6rem); }
}

/* ---------- Phones: quick-contact bar (assets/mobile-actions.mjs) ---------- */
.kgec-actionbar { display: none; }

@media (max-width: 767px) {
  .kgec-actionbar {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    background: rgb(8 23 32 / .92);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(140%);
    pointer-events: none;
    transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
  }

  .kgec-actionbar.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .kgec-actionbar a {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
  }

  .kgec-actionbar a.is-primary { background: #0b5d45; }
  .kgec-actionbar a:active { transform: scale(.97); }
  .kgec-actionbar svg { width: 18px; height: 18px; flex-shrink: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kgec-actionbar { transition: none; }
}
