/* ============================================================
   Sponge Energy — energy, upside down
   Palette drawn from the brand photography: deep night navy,
   sunset amber, warm cream. All original code.
   ============================================================ */

/* Self-hosted variable fonts (SIL Open Font License) */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night: #10122b;
  --night-2: #171a3a;
  --night-3: #1f2350;
  --ink: #f4efe6;
  --ink-dim: #b9b6c9;
  --sun: #ffb454;
  --sun-deep: #ff7847;
  --sun-soft: #ffd166;
  --water: #7fb7ff;
  --line: rgba(244, 239, 230, 0.12);
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --radius: 18px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--sun); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 200;
  background: var(--sun); color: var(--night);
  padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---------- header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--night) 55%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--night) 82%, transparent);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em;
}
.brand-light { color: var(--sun); font-weight: 500; }

.nav-menu {
  display: flex; align-items: center; gap: 0.4rem;
  list-style: none;
}
.nav-menu a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 500; font-size: 0.95rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-menu a:hover { color: var(--ink); background: var(--card); }
.nav-menu .nav-cta {
  color: var(--night); background: var(--sun);
  font-weight: 600; margin-left: 0.35rem;
}
.nav-menu .nav-cta:hover { background: var(--sun-soft); color: var(--night); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  position: relative; z-index: 120;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: ""; display: block; position: absolute; left: 10px;
  width: 24px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s, top 0.25s, opacity 0.2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; left: 0; }
.nav-toggle-bar::after { top: 7px; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .js .nav-toggle { display: block; }
  /* the header's backdrop-filter is the containing block for position:fixed,
     so anchor the panel to the header with absolute positioning instead.
     Without JS the panel stays visible so navigation still works. */
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0; z-index: 110;
    flex-direction: column; align-items: stretch; gap: 0.35rem;
    padding: 0.9rem 1.25rem 1.4rem;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    background: color-mix(in srgb, var(--night) 97%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
  }
  .js .nav-menu {
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .js .nav-menu.open { opacity: 1; visibility: visible; transform: none; }
  .nav-menu a {
    display: block; text-align: center;
    font-size: 1.15rem; padding: 0.85rem 1rem;
  }
  .nav-menu .nav-cta { margin: 0.5rem 0 0; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-sky {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(
      to bottom,
      var(--night) 0%,
      #1a1636 34%,
      #3d2044 56%,
      #83354a 72%,
      #d4593f 86%,
      #ff8a4c 100%
    );
}

/* ---- animated hero sun ----
   A zero-size anchor (.sun-stage) fixes the sun on the horizon; every layer
   centres itself on that point. .sun-stage carries the cursor parallax,
   .sun-float carries the entrance + idle drift, and each layer animates its
   own transform on top. The whole system sits inside .hero-sky (behind the
   water), so the sun "sets" into the sea. All motion is opt-in below. */
.sun-stage {
  position: absolute;
  left: var(--sun-x, 76%);
  bottom: var(--sun-y, 28%);
  width: 0; height: 0;
  pointer-events: none;
  transform: translate(var(--sun-px, 0px), var(--sun-py, 0px));
}
.sun-float { position: absolute; left: 0; top: 0; }
.sun-layer {
  position: absolute; left: 0; top: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sun-glow {
  width: clamp(340px, 48vw, 640px); height: clamp(340px, 48vw, 640px);
  background: radial-gradient(circle, rgba(255, 196, 120, 0.6) 0%, rgba(255, 150, 90, 0.3) 32%, rgba(255, 120, 71, 0) 70%);
  opacity: 0.85;
}

.sun-rays, .sun-rays-2 { mix-blend-mode: screen; }
.sun-rays {
  width: clamp(560px, 86vw, 1200px); height: clamp(560px, 86vw, 1200px);
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 210, 140, 0) 0deg, rgba(255, 210, 140, 0.20) 2.5deg,
    rgba(255, 210, 140, 0) 7deg, rgba(255, 210, 140, 0) 14deg);
  -webkit-mask: radial-gradient(circle, transparent 8%, #000 24%, transparent 62%);
          mask: radial-gradient(circle, transparent 8%, #000 24%, transparent 62%);
}
.sun-rays-2 {
  width: clamp(480px, 74vw, 1040px); height: clamp(480px, 74vw, 1040px);
  background: repeating-conic-gradient(from 3deg,
    rgba(255, 236, 196, 0) 0deg, rgba(255, 236, 196, 0.14) 1.2deg,
    rgba(255, 236, 196, 0) 5deg, rgba(255, 236, 196, 0) 9deg);
  -webkit-mask: radial-gradient(circle, transparent 10%, #000 26%, transparent 58%);
          mask: radial-gradient(circle, transparent 10%, #000 26%, transparent 58%);
}

.sun-ring {
  width: clamp(150px, 23vw, 270px); height: clamp(150px, 23vw, 270px);
  border: 2px solid rgba(255, 205, 130, 0.55);
  opacity: 0;
}

.hero-sun {
  width: clamp(150px, 23vw, 270px); height: clamp(150px, 23vw, 270px);
  background: radial-gradient(circle at 50% 42%, #fff6df 0%, var(--sun-soft) 44%, var(--sun-deep) 100%);
  box-shadow: 0 0 55px 10px rgba(255, 180, 84, 0.45), 0 0 130px 40px rgba(255, 120, 71, 0.22);
}

@media (max-width: 860px) {
  .sun-stage { --sun-x: 78%; --sun-y: 24%; }
}

@media (prefers-reduced-motion: no-preference) {
  .sun-float  { animation: sun-rise 1.7s cubic-bezier(0.2, 0.8, 0.2, 1.05) both,
                           sun-drift 15s ease-in-out 1.7s infinite; }
  .sun-glow   { animation: sun-breathe 6.5s ease-in-out infinite; }
  .sun-rays   { will-change: transform; animation: sun-spin 64s linear infinite; }
  .sun-rays-2 { will-change: transform; animation: sun-spin-rev 92s linear infinite; }
  .sun-ring   { animation: sun-emit 6s ease-out infinite; }
  .sun-ring-2 { animation-delay: 2s; }
  .sun-ring-3 { animation-delay: 4s; }

  @keyframes sun-rise {
    0%   { transform: translate(0, 140px); opacity: 0; }
    55%  { opacity: 1; }
    100% { transform: translate(0, 0); opacity: 1; }
  }
  @keyframes sun-drift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(7px, -11px); }
  }
  @keyframes sun-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.8; }
    50%      { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
  }
  @keyframes sun-spin {
    from { transform: translate(-50%, -50%) rotate(0); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
  }
  @keyframes sun-spin-rev {
    from { transform: translate(-50%, -50%) rotate(0); }
    to   { transform: translate(-50%, -50%) rotate(-360deg); }
  }
  @keyframes sun-emit {
    0%   { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
    12%  { opacity: 0.55; }
    100% { transform: translate(-50%, -50%) scale(2.8);  opacity: 0; }
  }
}

.hero-glow {
  position: absolute; left: 50%; bottom: -10%;
  width: 140vw; height: 55%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 138, 76, 0.5), transparent 65%);
}

/* the whole element is flipped to mirror the photo, so the overlay
   gradient and the waterline shimmer are authored upside-down too */
.hero-water {
  position: absolute; inset: auto 0 0 0; z-index: -1;
  height: 24%;
  background:
    linear-gradient(to top, rgba(16, 18, 43, 0.1), rgba(16, 18, 43, 0.92)),
    url("/assets/bottom.jpg") center / cover no-repeat;
  transform: scaleY(-1);
  opacity: 0.85;
}
.hero-water::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.7), transparent);
}

.hero-inner {
  padding: calc(var(--header-h) + 4rem) 0 7rem;
  max-width: 760px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 1.1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

.flip-word {
  display: inline-block;
  background: linear-gradient(180deg, var(--sun-soft), var(--sun-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-dot { color: var(--sun-deep); }

.hero-sub {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: #d9d6e4; /* lighter than --ink-dim: stays >4.5:1 over the sunset bands */
  text-shadow: 0 1px 22px rgba(16, 18, 43, 0.55);
  max-width: 34em;
  margin-bottom: 2.2rem;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--sun-soft), var(--sun-deep));
  color: #2b1503;
  box-shadow: 0 8px 28px rgba(255, 138, 76, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 34px rgba(255, 138, 76, 0.5); transform: translateY(-1px); }
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card);
}
.btn-ghost:hover { background: var(--card-hover); border-color: rgba(244, 239, 230, 0.25); }
.btn-lg { font-size: 1.15rem; padding: 1rem 2.1rem; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 1.6rem;
  transform: translateX(-50%);
  color: var(--ink-dim);
  opacity: 0.8;
}
.scroll-hint:hover { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint { animation: bob 2.4s ease-in-out infinite; }
  @keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(7px); }
  }
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: clamp(4.5rem, 10vw, 7.5rem) 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 1.6rem;
  max-width: 18em;
}
.accent-dot { color: var(--sun-deep); }

.section-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-dim);
  max-width: 46em;
  margin-bottom: 2.5rem;
}

.prose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 2rem 3rem;
  margin-bottom: 3rem;
}
.prose p { color: var(--ink-dim); margin-bottom: 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--ink); font-style: normal; font-weight: 600; }

/* stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}
.stat {
  display: flex; flex-direction: column-reverse; gap: 0.4rem;
  padding: 1.6rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat dd { margin: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--sun-soft), var(--sun-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat dt { font-size: 0.92rem; color: var(--ink-dim); }

/* ---------- flip section ---------- */

.flip-section {
  background:
    radial-gradient(1000px 400px at 85% 0%, rgba(255, 138, 76, 0.07), transparent 70%),
    var(--night-2);
  border-block: 1px solid var(--line);
}

.flip-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.4rem;
  margin-top: 1rem;
}

.flip-card {
  padding: 2rem 1.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.flip-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600;
  display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start;
  margin-bottom: 0.9rem;
}
.flip-card p { color: var(--ink-dim); font-size: 0.98rem; }

.flip-tag {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.09);
  color: var(--ink-dim);
}
.flip-tag-sun { background: rgba(255, 180, 84, 0.16); color: var(--sun); }

.flip-card-new {
  border-color: rgba(255, 180, 84, 0.35);
  background: linear-gradient(180deg, rgba(255, 180, 84, 0.07), rgba(255, 120, 71, 0.03));
}

.flip-diagram {
  display: flex; align-items: center; gap: 0.8rem;
  margin-top: 1.4rem;
  color: var(--ink-dim);
}
.flip-node {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.flip-node-sun { border-color: rgba(255, 180, 84, 0.5); color: var(--sun); }
.flip-arrow { width: 46px; flex: none; color: currentColor; }
.flip-card-new .flip-diagram { color: var(--sun-deep); }

/* ---------- technology ---------- */

.tech-diagram {
  margin: 1rem 0 3rem;
  padding: clamp(1rem, 3vw, 2.5rem);
  background:
    radial-gradient(700px 300px at 12% 20%, rgba(255, 209, 102, 0.06), transparent 60%),
    var(--night-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
}
.tech-diagram-scroll { overflow-x: auto; }
.tech-diagram-scroll:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 4px;
  border-radius: 8px;
}
.tech-diagram svg { min-width: 640px; width: 100%; height: auto; }

.d-label {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  fill: var(--ink);
}
.d-sublabel { font-size: 13.5px; fill: var(--ink-dim); font-family: var(--font-body); }

.d-flow {
  stroke: var(--sun);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 10;
  opacity: 0.9;
}
.d-rays { transform-origin: 110px 90px; }

@media (prefers-reduced-motion: no-preference) {
  .d-flow { animation: flow 1.6s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -13; } }
  .d-rays { animation: spin 40s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .d-cells circle { animation: pulse 2.8s ease-in-out infinite; }
  .d-cells circle:nth-child(2n) { animation-delay: 0.7s; }
  .d-cells circle:nth-child(3n) { animation-delay: 1.4s; }
  @keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1.4rem;
}

.tech-card {
  padding: 1.9rem 1.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.tech-card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 180, 84, 0.3);
  transform: translateY(-3px);
}
.tech-card h3 {
  font-family: var(--font-display);
  font-size: 1.13rem; font-weight: 600;
  margin-bottom: 0.6rem;
}
.tech-card p { color: var(--ink-dim); font-size: 0.96rem; }

.tech-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
  border-radius: 12px;
  color: var(--sun);
  background: rgba(255, 180, 84, 0.12);
  border: 1px solid rgba(255, 180, 84, 0.25);
}
.tech-icon svg { width: 24px; height: 24px; }

/* ---------- contact ---------- */

.contact-section {
  overflow: hidden;
  border-top: 1px solid var(--line);
  text-align: center;
  padding-bottom: clamp(6rem, 14vw, 10rem);
}

.contact-water {
  position: absolute; inset: auto 0 0 0;
  height: 46%;
  background:
    linear-gradient(to bottom, var(--night) 0%, rgba(16, 18, 43, 0.55) 55%, rgba(16, 18, 43, 0.75) 100%),
    url("/assets/bottom.jpg") center / cover no-repeat;
  pointer-events: none;
}

.contact-inner { position: relative; }
.contact-inner .section-title,
.contact-inner .section-lead { margin-inline: auto; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem 0;
  background: #0c0e22;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
}
.brand-footer .brand-name { font-size: 1.05rem; }
.footer-tag { color: var(--ink-dim); font-size: 0.95rem; }
.footer-copy {
  margin-left: auto;
  color: var(--ink-dim); font-size: 0.9rem;
}
.footer-copy a { color: var(--ink-dim); }
.footer-copy a:hover { color: var(--sun); }

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-copy { margin-left: 0; }
}

/* ---------- reveal animations ---------- */

.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .js .reveal.in { opacity: 1; transform: none; }
}
