/* YOFE Energy — brand tokens sampled from the stacked full-colour logo */
:root {
  --green: #318c3c;
  --green-deep: #1f5f2a;
  --orange: #ff8404;
  --ink: #23282b;
  --ink-soft: #5a6166;
  --paper: #fdfdfd;
  --cream: #f6f4ef;
  --line: #e4e2dc;
  --radius: 18px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* ================= PRELOADER ================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(16px, 3vh, 28px);
  padding: max(24px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background: var(--paper);
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader__stage {
  position: relative;
  width: min(100%, 980px);
  min-height: 0;
  display: grid;
  place-items: center;
}
.preloader__video {
  /* auto sizing keeps the element box equal to the frame, so clip-path % map onto the footage */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72vh, 100%);
  /* the clip is rendered on white; multiply melts its edges into the page */
  mix-blend-mode: multiply;
  /* hide the progress line baked into the footage; the battery meter below is the real one */
  clip-path: inset(0 0 12% 0);
  opacity: 0;
  transition: opacity .4s ease;
}
.preloader__video.is-portrait { clip-path: inset(0 0 10% 0); }
.preloader__video.is-playing { opacity: 1; }
.preloader__fallback {
  position: absolute;
  width: min(42vw, 220px);
  opacity: 0;
  transform: scale(.94);
  transition: opacity .6s ease, transform 1.2s var(--ease-out);
}
.preloader.no-video .preloader__fallback { opacity: 1; transform: scale(1); animation: breathe 2.4s ease-in-out infinite; }
.preloader.no-video .preloader__video { display: none; }

@keyframes breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 132, 4, 0)); }
  50% { transform: scale(1.035); filter: drop-shadow(0 8px 24px rgba(49, 140, 60, .25)); }
}

/* battery-style progress meter */
.preloader__meter { width: min(100%, 340px); }
.battery { display: flex; align-items: center; gap: 4px; }
.battery__body {
  flex: 1;
  height: 22px;
  padding: 3px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}
.battery__fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(20% - 3px), var(--paper) calc(20% - 3px) 20%),
    linear-gradient(90deg, var(--green), var(--orange));
  background-size: 100% 100%, 100% 100%;
  transition: width .35s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.battery__fill::after { /* charging shimmer */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.battery__cap { width: 5px; height: 10px; border-radius: 0 3px 3px 0; background: var(--ink); }

.preloader__readout {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.preloader__status { color: var(--ink-soft); transition: opacity .25s ease; }
.preloader__status.is-swapping { opacity: 0; }
.preloader__percent { color: var(--green); font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.preloader__controls { display: flex; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip .ico-speaker { fill: currentColor; stroke: none; }
.chip .ico-waves { display: none; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"] .ico-waves { display: inline; }
.chip[aria-pressed="true"] .ico-mute { display: none; }

/* exit transition: two brand panels sweep across, then the loader fades */
.curtain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.curtain__panel {
  position: absolute;
  inset: -10% -30%;
  transform: translateX(-120%) skewX(-12deg);
}
.curtain__panel--green { background: var(--green); }
.curtain__panel--orange { background: var(--orange); }
.preloader.is-exiting .curtain__panel--orange { animation: sweep .9s var(--ease-out) forwards; }
.preloader.is-exiting .curtain__panel--green { animation: sweep .9s var(--ease-out) .12s forwards; }
@keyframes sweep {
  0% { transform: translateX(-120%) skewX(-12deg); }
  55% { transform: translateX(0) skewX(-12deg); }
  100% { transform: translateX(120%) skewX(-12deg); }
}

/* ================= SITE ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px clamp(16px, 5vw, 64px);
  background: rgba(253, 253, 253, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.topbar__brand small { font-weight: 600; font-size: 10px; letter-spacing: .5em; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .2s var(--ease-out), box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px -10px rgba(255, 132, 4, .7); }
.btn--primary:hover { box-shadow: 0 14px 28px -10px rgba(255, 132, 4, .85); }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 96px) clamp(16px, 5vw, 64px);
}
.eyebrow { margin: 0 0 14px; color: var(--green); font-weight: 700; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.hero h1 span {
  background: linear-gradient(90deg, var(--green), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede { max-width: 52ch; margin: 22px 0 28px; color: var(--ink-soft); font-size: clamp(15px, 1.4vw, 17px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pillars { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 32px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-soft); }
.pillars li { display: flex; align-items: center; gap: 8px; }
.pillars li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pillars li:nth-child(2)::before { background: var(--orange); }
.pillars b { color: var(--ink); }

.showcase { margin: 0; }
.showcase__frame {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 30px 60px -30px rgba(35, 40, 43, .45);
}
.showcase__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1s ease, transform 7s linear;
}
.showcase__slide.is-active { opacity: 1; transform: scale(1); }
.showcase figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.showcase__dots { display: flex; gap: 6px; }
.showcase__dots button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  position: relative;
}
.showcase__dots button::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background .3s;
}
.showcase__dots button[aria-selected="true"]::after { background: var(--orange); }

.options {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(16px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.options h2 { margin: 0 0 32px; max-width: 22ch; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.options__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform .3s var(--ease-out), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: 0 20px 40px -24px rgba(49, 140, 60, .5); }
.card h3 { margin: 0; font-size: 18px; font-weight: 800; text-transform: uppercase; }
.card h3 em { font-style: normal; color: var(--orange); }
.card .card__kw { margin: 14px 0 2px; font-size: 32px; font-weight: 800; color: var(--green); }
.card p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.fineprint { margin: 24px 0 0; font-size: 12px; color: var(--ink-soft); }

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px clamp(16px, 5vw, 64px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.footer img { width: 64px; height: auto; }
.footer p { margin: 0; }
.link-btn { border: 0; background: none; padding: 8px 0; color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* staged entrance after the preloader exits */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .9s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .options__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .options__grid { grid-template-columns: 1fr; }
  .topbar__brand small { display: none; }
  .hero__actions .btn { flex: 1 1 100%; }
}

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