/* ===========================================================================
   ss-page.css — universal story/conversion layer for ALL pages (2026-06-11)
   Loaded sitewide (except admin). Works with every header system:
   .topbar (homepage/routes), .cp-topbar (content pages), .m-bar (method).

   What it provides:
   1. Minimal header (canonical 3-link nav — driven by ss-page.js)
   2. Page enter/exit transitions
   3. Kinetic h1 word-reveal + scroll-reveal primitives
   4. Bottom scroll progress rail
   5. Universal short lead block (.ssl-block) + sticky mobile CTA
   =========================================================================== */

/* ── 1. Page transitions ───────────────────────────────────────────────── */
@keyframes ssPageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

html.ss-page-ready #app,
html.ss-page-ready main,
html.ss-page-ready .cp-container {
  animation: ssPageIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

html.ss-pt-exit #app,
html.ss-pt-exit main,
html.ss-pt-exit .cp-container {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  animation: none;
}

html.prefers-reduced-motion #app,
html.prefers-reduced-motion main { animation: none !important; transition: none !important; }

/* ── 2. Kinetic h1 ─────────────────────────────────────────────────────── */
.ss-kin { display: inline-block; }
.ss-kin .ss-kw { display: inline-block; overflow: hidden; vertical-align: bottom; }
.ss-kin .ss-kw > span {
  display: inline-block;
  transform: translateY(110%);
  animation: ssKwUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(var(--kw, 0) * 60ms + 120ms);
}

@keyframes ssKwUp { to { transform: translateY(0); } }

html.prefers-reduced-motion .ss-kin .ss-kw > span { transform: none; animation: none; }

/* ── 3. Scroll reveals ─────────────────────────────────────────────────── */
.ss-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--rv, 0) * 70ms);
  will-change: opacity, transform;
}

.ss-reveal.on { opacity: 1; transform: translateY(0); }

html.prefers-reduced-motion .ss-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ── 4. Scroll progress rail (matches homepage) ────────────────────────── */
.ss-rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 99;
  pointer-events: none;
}

.ss-rail-fill {
  height: 100%;
  width: 0;
  background: var(--lime, #cfff00);
  box-shadow: 0 0 12px rgba(207, 255, 0, 0.45);
}

/* ── 5. Universal lead block ───────────────────────────────────────────── */
.ssl-block {
  position: relative;
  background:
    radial-gradient(ellipse 70% 90% at 85% 10%, rgba(207, 255, 0, 0.07), transparent 60%),
    #0b0c0d;
  border-top: 1px solid rgba(243, 240, 232, 0.08);
  padding: 88px 0;
  overflow: hidden;
}

.ssl-inner {
  width: min(1100px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.ssl-kicker {
  margin: 0 0 16px;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime, #cfff00);
  display: flex;
  align-items: center;
  gap: 9px;
}

.ssl-kicker .ssl-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime, #cfff00);
  box-shadow: 0 0 10px rgba(207, 255, 0, 0.8);
  animation: sslBlink 2.4s ease-in-out infinite;
}

@keyframes sslBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ssl-copy h2 {
  margin: 0;
  font-family: var(--sans, "Inter Tight", sans-serif);
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.05em;
  font-weight: 900;
  color: var(--fg-0, #f3f0e8);
}

.ssl-copy h2 em {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--lime, #cfff00);
}

.ssl-sub {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: #a0a5ad;
  max-width: 46ch;
}

.ssl-form {
  background: linear-gradient(155deg, rgba(20, 22, 23, 0.9), rgba(10, 11, 12, 0.85));
  border: 1px solid rgba(207, 255, 0, 0.16);
  border-radius: 24px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.ssl-form textarea,
.ssl-form input {
  width: 100%;
  background: rgba(14, 15, 16, 0.85);
  border: 1px solid rgba(243, 240, 232, 0.14);
  border-radius: 14px;
  color: var(--fg-0, #f3f0e8);
  font-family: var(--sans, "Inter Tight", sans-serif);
  font-size: 15px;
  padding: 14px 16px;
  outline: none;
  resize: none;
  transition: border-color 0.2s ease;
}

.ssl-form textarea:focus,
.ssl-form input:focus { border-color: rgba(207, 255, 0, 0.6); }

.ssl-form ::placeholder { color: #6f7177; }

.ssl-row { display: flex; gap: 10px; }
.ssl-row input { flex: 1 1 auto; min-width: 0; }

.ssl-btn {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  background: var(--lime, #cfff00);
  color: #0e0f10;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 20px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: ssCtaPulse 3.4s ease-in-out infinite;
  white-space: nowrap;
}

.ssl-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(207, 255, 0, 0.5); }

.ssl-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #25d366;
  text-decoration: none;
}

.ssl-wa svg { width: 16px; height: 16px; flex: 0 0 auto; }

.ssl-wa:hover { text-decoration: underline; }

.ssl-note {
  margin: 0;
  font-size: 12px;
  color: #6f7177;
  line-height: 1.5;
}

.ssl-thanks {
  text-align: center;
  padding: 26px 10px;
}

.ssl-thanks .ssl-check {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--lime, #cfff00);
  display: inline-flex; align-items: center; justify-content: center;
  color: #0e0f10; font-size: 24px; font-weight: 900;
  margin-bottom: 14px;
}

.ssl-thanks h3 { margin: 0 0 8px; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.ssl-thanks p { margin: 0; color: #a0a5ad; font-size: 14px; }

@media (max-width: 900px) {
  .ssl-block { padding: 64px 0; }
  .ssl-inner { grid-template-columns: 1fr; gap: 32px; }
  .ssl-row { flex-direction: column; }
  .ssl-btn { width: 100%; }
}

/* ── 6. Sticky mobile CTA (pages without one) ──────────────────────────── */
.ssp-sticky { display: none; }

@media (max-width: 900px) {
  .ssp-sticky {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 95;
    display: flex;
    gap: 10px;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .ssp-sticky.is-hidden { transform: translateY(120%); opacity: 0; pointer-events: none; }

  .ssp-sticky-primary {
    flex: 1 1 auto;
    border: none;
    cursor: pointer;
    background: var(--lime, #cfff00);
    color: #0e0f10;
    font-family: var(--sans, "Inter Tight", sans-serif);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding: 15px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    animation: ssCtaPulse 3.4s ease-in-out infinite;
  }

  .ssp-sticky-wa {
    flex: 0 0 auto;
    width: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(14, 15, 16, 0.92);
    border: 1px solid rgba(37, 211, 102, 0.5);
    color: #25d366;
  }

  .ssp-sticky-wa svg { width: 20px; height: 20px; }
}

/* keyframe shared with ss-ui.css; redefined here so pages that don't load
   ss-ui.css still get the pulse */
@keyframes ssCtaPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(207, 255, 0, 0.26); }
  50% { box-shadow: 0 10px 42px rgba(207, 255, 0, 0.5); }
}

/* ── 7. Minimal header tweaks (nav rewritten by ss-page.js) ────────────── */
.topbar nav a, .cp-nav a { white-space: nowrap; }

/* ── 7b. Route CTA buttons that were never styled (company pages etc.) ── */
a.primary-btn, button.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--lime, #cfff00);
  color: #0e0f10;
  border: none;
  cursor: pointer;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: ssCtaPulse 3.4s ease-in-out infinite;
}

a.primary-btn:hover, button.primary-btn:hover { transform: translateY(-1px); }

a.ghost-btn, button.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--fg-0, #f3f0e8);
  border: 1px solid rgba(243, 240, 232, 0.25);
  cursor: pointer;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

a.ghost-btn:hover, button.ghost-btn:hover {
  border-color: rgba(207, 255, 0, 0.6);
  color: var(--lime, #cfff00);
  background: rgba(207, 255, 0, 0.06);
}

.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Company contact form — match the short-form pattern */
.company-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }

.company-form input,
.company-form textarea,
.company-form select {
  width: 100%;
  background: rgba(14, 15, 16, 0.85);
  border: 1px solid rgba(243, 240, 232, 0.14);
  border-radius: 14px;
  color: var(--fg-0, #f3f0e8);
  font-family: var(--sans, "Inter Tight", sans-serif);
  font-size: 15px;
  padding: 14px 16px;
  outline: none;
  resize: none;
  transition: border-color 0.2s ease;
}

.company-form input:focus,
.company-form textarea:focus { border-color: rgba(207, 255, 0, 0.6); }

.company-form ::placeholder { color: #6f7177; }

/* ── 8. Collapsed optional details on forms (start-a-project etc.) ─────── */
.brief-more { margin: 4px 0 8px; }

.brief-more > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d9097;
  padding: 12px 14px;
  border: 1px dashed rgba(243, 240, 232, 0.18);
  border-radius: 12px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.brief-more > summary::-webkit-details-marker { display: none; }
.brief-more > summary::after { content: " +"; color: var(--lime, #cfff00); }
.brief-more[open] > summary::after { content: " −"; }
.brief-more > summary:hover { color: var(--fg-0, #f3f0e8); border-color: rgba(207, 255, 0, 0.4); }
.brief-more[open] > summary { margin-bottom: 14px; }
