/* ==========================================================================
   SUNFINA SOLAR — base: design tokens, reset, typography, motion utilities
   Palette is taken from the logo: warm paper, deep cocoa ink, the sun's
   gold → burnt-orange → crimson flame tips. Change colours here only.
   ========================================================================== */

:root {
  /* -- palette ------------------------------------------------------------ */
  --paper:       #FBF6EE;   /* page background (warm off-white) */
  --paper-2:     #F2E9D9;   /* secondary bands */
  --paper-3:     #E9DCC5;   /* pressed / borders on paper-2 */
  --surface:     #FFFFFF;   /* cards */
  --ink:         #241206;   /* headings — deep cocoa */
  --ink-2:       #5B4A3E;   /* body text */
  --ink-3:       #7A6656;   /* muted text (AA on paper + white) */
  --solar:       #F6A24B;   /* sun-gold — buttons, fills */
  --solar-2:     #D1542A;   /* burnt orange */
  --solar-3:     #FFC77E;   /* gold highlight */
  --flare:       #D33A4E;   /* crimson flame tips of the logo sun */
  --accent-text: #A85015;   /* orange for small text on light (5.1:1) */
  --panel-dark:  #1E0803;   /* footer, dark bands, PV-panel art */
  --panel-2:     #2B1209;
  --panel-3:     #3A1B10;
  --cloud:       #FFF9F0;   /* text on dark */
  --silver:      #C9A493;   /* muted text on dark */
  --wa:          #25D366;   /* WhatsApp brand green (button only) */
  --wa-ink:      #0B2E13;

  --line:   rgba(60, 30, 10, .12);
  --line-2: rgba(60, 30, 10, .22);
  --line-d: rgba(255, 220, 190, .12);

  --grad-sun:   linear-gradient(135deg, #FFC77E 0%, #F6A24B 40%, #E8703A 78%, #D1542A 100%);
  --grad-flare: linear-gradient(120deg, #F6A24B 0%, #E8703A 55%, #D33A4E 100%);
  --grad-text:  linear-gradient(100deg, #D1542A 0%, #E8703A 35%, #F6A24B 70%, #D1542A 100%);

  --shadow-sm:   0 1px 2px rgba(36, 18, 6, .06), 0 3px 10px rgba(36, 18, 6, .05);
  --shadow-md:   0 18px 40px -18px rgba(36, 18, 6, .28);
  --shadow-lg:   0 40px 80px -30px rgba(36, 18, 6, .45);
  --shadow-glow: 0 14px 40px -12px rgba(232, 112, 58, .65);

  /* -- type --------------------------------------------------------------- */
  --font-head: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --fs-display: clamp(2.7rem, 1.5rem + 5.4vw, 5.75rem);
  --fs-h1:      clamp(2.35rem, 1.45rem + 4vw, 4.5rem);
  --fs-h2:      clamp(1.9rem, 1.3rem + 2.6vw, 3.25rem);
  --fs-h3:      clamp(1.2rem, 1.06rem + .65vw, 1.55rem);
  --fs-lead:    clamp(1.05rem, .98rem + .4vw, 1.27rem);
  --fs-sm:      .9rem;
  --fs-xs:      .78rem;

  /* -- rhythm ------------------------------------------------------------- */
  --wrap: 1240px;
  --gut:  clamp(1rem, 4vw, 2.5rem);
  --sec:  clamp(4.5rem, 3rem + 7vw, 8.5rem);
  --r-sm: 10px;
  --r:    18px;
  --r-lg: 28px;
  --r-xl: 40px;
  --hdr:  78px;

  /* -- motion ------------------------------------------------------------- */
  --ease:        cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .2s;
  --t:      .45s;
  --t-slow: .9s;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
main { overflow-x: clip; }
body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -.015em; line-height: 1.2; }

p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
address { font-style: normal; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }

::selection { background: var(--solar); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--solar-2);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

/* ==========================================================================
   Utilities
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gut) * 2);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px; left: 1rem;
  z-index: 300;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cloud);
  font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

.ico { width: 1.15em; height: 1.15em; flex: none; }

.sec { position: relative; padding-block: var(--sec); }
.sec--tight { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.sec--paper2 { background: var(--paper-2); }
.sec--white { background: var(--surface); }
.sec--dark {
  background: var(--panel-dark);
  color: var(--silver);
  isolation: isolate;
  overflow: hidden;
}
.sec--dark h2, .sec--dark h3 { color: var(--cloud); }

/* curved hand-off between bands */
.sec--rounded { border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: calc(var(--r-xl) * -1); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 2px;
  border-radius: 2px;
  background: var(--grad-flare);
}
.eyebrow--dark { color: var(--ink); }
.eyebrow--dark::before { background: var(--ink); }
.sec--dark .eyebrow { color: var(--solar); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}
.sec--dark .lead { color: var(--silver); }

.text-grad {
  background: var(--grad-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShine 6s linear infinite;
}
@keyframes textShine { to { background-position: -200% 0; } }

.mono { font-family: var(--font-mono); }

.live-dot {
  position: relative;
  display: inline-block;
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: var(--solar);
  box-shadow: 0 0 0 0 rgba(246, 162, 75, .7);
  animation: livePulse 2.2s ease-out infinite;
}
@keyframes livePulse {
  70%  { box-shadow: 0 0 0 9px rgba(246, 162, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(246, 162, 75, 0); }
}

/* ==========================================================================
   Scroll reveal — content is visible without JS; .js opts into motion.
   data-reveal="up | down | left | right | scale | fade", delay via --d.
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  transition:
    opacity var(--t-slow) var(--ease) var(--d, 0s),
    transform var(--t-slow) var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.js [data-reveal="up"]    { transform: translate3d(0, 34px, 0); }
.js [data-reveal="down"]  { transform: translate3d(0, -24px, 0); }
.js [data-reveal="left"]  { transform: translate3d(40px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(-40px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].is-in   { opacity: 1; transform: none; }
/* on narrow screens sideways slides would poke past the edge — slide up instead */
@media (max-width: 900px) {
  .js [data-reveal="left"]:not(.is-in), .js [data-reveal="right"]:not(.is-in) { transform: translate3d(0, 34px, 0); }
}

/* word-by-word heading reveal (spans rendered server-side by split_words) */
.split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}
.split .w > span { display: inline-block; }
.js .split .w > span {
  transform: translate3d(0, 108%, 0);
  transition: transform 1s var(--ease) calc(var(--wi, 0) * .055s + var(--d, 0s));
}
.js .split.is-in .w > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal], .js .split .w > span { opacity: 1; transform: none; }
}
