/* ============================================================
   Cedar Equity Ventures — Coming Soon
   Palette: Orange #E65416 · Beige #D8D6C9 · Off-White #F5F5F5
            Grey #52555A · Dark Charcoal #303236
   Type: Archivo (variable — weight + width axes)
   ============================================================ */

/* Archivo — variable font (weight 100–900, width 62.5%–125%),
   self-hosted. SIL Open Font License. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
  src: url("../assets/fonts/archivo-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
  src: url("../assets/fonts/archivo-variable-italic.woff2") format("woff2");
}

:root {
  --orange: #e65416;
  --orange-bright: #ff6a24;
  --beige: #d8d6c9;
  --offwhite: #f5f5f5;
  --grey: #52555a;
  --charcoal: #303236;
  --ink: #17181a;
  --ink-deep: #101112;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

html {
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--offwhite);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

/* ---------- Background layers ---------- */

.bg,
.bg > div {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg__base {
  background:
    radial-gradient(120% 90% at 50% 30%, var(--charcoal) 0%, var(--ink) 55%, var(--ink-deep) 100%);
}

/* Faint beige bloom, top-right — a nod to the brand gradient */
.bg__beige-glow {
  background: radial-gradient(45% 40% at 86% 4%, rgba(216, 214, 201, 0.1), transparent 70%);
}

/* A restrained ember at the bottom edge */
.bg__ember {
  background: radial-gradient(
    70% 50% at 50% 108%,
    rgba(230, 84, 22, 0.26) 0%,
    rgba(230, 84, 22, 0.1) 40%,
    transparent 72%
  );
  animation: ember-breathe 9s ease-in-out infinite;
}

.bg__ember--core {
  background: radial-gradient(
    32% 22% at 50% 106%,
    rgba(255, 122, 46, 0.24) 0%,
    rgba(230, 84, 22, 0.08) 55%,
    transparent 75%
  );
  animation-duration: 7s;
  animation-delay: -2.2s;
}

@keyframes ember-breathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* ---------- Canvas / scrim / grain ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.8s ease 0.15s;
}

#scene.is-ready {
  opacity: 1;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 50% 52%, rgba(13, 14, 15, 0.3), transparent 72%),
    radial-gradient(140% 120% at 50% 50%, transparent 60%, rgba(10, 11, 12, 0.4) 100%);
}

/* ---------- Page frame ---------- */

.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: clamp(1.1rem, 2.6vw, 2.2rem) clamp(1.2rem, 3.4vw, 3rem) 0;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  animation: fade-down 0.9s var(--ease-out) 0.2s backwards;
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo {
  display: inline-block;
  text-decoration: none;
}

/* The brand logo file, used as-is — no recreation, no animation */
.logo__img {
  display: block;
  height: clamp(60px, 6.2vw, 80px);
  width: auto;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.motion-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(216, 214, 201, 0.45);
  border-radius: 50%;
  background: rgba(23, 24, 26, 0.35);
  color: var(--beige);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.motion-toggle:hover {
  border-color: var(--orange-bright);
  color: var(--offwhite);
}

.motion-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.motion-toggle__play {
  display: none;
}

body.motion-paused .motion-toggle__pause {
  display: none;
}

body.motion-paused .motion-toggle__play {
  display: block;
}

/* Pause every CSS animation when the user pauses motion (WCAG 2.2.2) */
body.motion-paused *,
body.motion-paused *::before,
body.motion-paused *::after {
  animation-play-state: paused !important;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.4rem;
  font-size: 0.74rem;
  font-weight: 480;
  letter-spacing: 0.1em;
  color: rgba(216, 214, 201, 0.78);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange-bright);
  box-shadow: 0 0 10px 1px rgba(255, 106, 36, 0.9);
  animation: dot-pulse 1.8s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

/* ---------- Hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(1rem, 2.4vh, 1.6rem);
  padding: 1rem 0;
  min-height: 0;
}

.reveal {
  animation: rise 1s var(--ease-out) var(--d, 0s) backwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: clamp(0.68rem, 1vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-indent: 0.14em; /* balances tracking on the last glyph */
  color: var(--orange-bright);
}

.headline {
  font-size: clamp(2.9rem, 7.4vw, 6.2rem);
  font-weight: 300;
  font-stretch: 102%;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--offwhite);
  text-wrap: balance;
}

.headline__dot {
  color: var(--orange-bright);
  font-weight: 400;
}

.tagline {
  max-width: 34em;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 380;
  line-height: 1.65;
  color: var(--beige);
}

/* ---------- Signup form ---------- */

.signup {
  width: min(30rem, 100%);
  margin-top: clamp(0.2rem, 1.4vh, 0.9rem);
}

.hp {
  display: none;
}

.signup__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.signup__field {
  width: 100%;
  padding: 0.86rem 1.15rem;
  border: 1px solid rgba(216, 214, 201, 0.45);
  border-radius: 999px;
  background: rgba(23, 24, 26, 0.55);
  color: var(--offwhite);
  font: inherit;
  font-size: 1rem; /* >=16px so iOS Safari doesn't auto-zoom on focus */
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.signup__field:focus {
  border-color: rgba(230, 84, 22, 0.65);
  box-shadow: 0 0 0 1px rgba(230, 84, 22, 0.35);
}

.signup__field::placeholder {
  color: rgba(216, 214, 201, 0.68);
}

.signup__pill {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 1px solid rgba(216, 214, 201, 0.45);
  border-radius: 999px;
  background: rgba(23, 24, 26, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.signup__pill:focus-within {
  border-color: rgba(230, 84, 22, 0.65);
  box-shadow: 0 0 0 1px rgba(230, 84, 22, 0.35), 0 0 42px rgba(230, 84, 22, 0.22);
}

.signup__input {
  flex: 1;
  min-width: 0;
  padding: 0.72rem 0.6rem 0.72rem 1.15rem;
  border: 0;
  background: transparent;
  color: var(--offwhite);
  font: inherit;
  font-size: 1rem; /* >=16px so iOS Safari doesn't auto-zoom on focus */
  outline: none;
}

.signup__input::placeholder {
  color: rgba(216, 214, 201, 0.68);
}

.signup__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}

.signup__btn:hover {
  background: var(--orange-bright);
  box-shadow: 0 0 30px rgba(255, 106, 36, 0.45);
  transform: translateY(-1px);
}

.signup__btn:active {
  transform: translateY(0) scale(0.98);
}

.signup__btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 24, 26, 0.35);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.signup__form.is-loading .signup__btn {
  pointer-events: none;
  opacity: 0.85;
}

.signup__form.is-loading .signup__btn-label {
  display: none;
}

.signup__form.is-loading .signup__btn-spinner {
  display: block;
}

.signup__form.is-error .signup__pill {
  border-color: rgba(255, 96, 60, 0.75);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}

.signup__success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.02rem 1.4rem;
  border: 1px solid rgba(230, 84, 22, 0.5);
  border-radius: 999px;
  background: rgba(230, 84, 22, 0.12);
  color: var(--offwhite);
  font-size: 0.92rem;
  font-weight: 500;
  animation: rise 0.7s var(--ease-out);
}

.signup__success svg {
  width: 19px;
  height: 19px;
  color: var(--orange-bright);
  flex-shrink: 0;
}

.signup__success:focus {
  outline: none; /* focus is programmatic; the pill styling is the indicator */
}

.signup__note {
  margin-top: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(216, 214, 201, 0.78);
}

.signup__note.is-error {
  color: #ff9d7a;
}

/* ---------- Bottom bar ---------- */

.bottombar {
  animation: fade-up 0.9s var(--ease-out) 1.45s backwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.bottombar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.9rem;
  border-top: 1px solid rgba(216, 214, 201, 0.12);
  font-size: 0.72rem;
  font-weight: 450;
  letter-spacing: 0.05em;
  color: rgba(216, 214, 201, 0.72);
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 3px;
}

.signup__input:focus-visible,
.signup__field:focus-visible {
  outline: none; /* pill glow handles it */
}

/* ---------- No-JS ---------- */

.noscript-note {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--beige);
  font-size: 0.75rem;
}

/* ---------- WebGL fallback: static blob ---------- */

body.no-webgl #scene {
  display: none;
}

body.no-webgl .bg__base {
  background:
    radial-gradient(34% 30% at 50% 48%, rgba(230, 84, 22, 0.5), rgba(230, 84, 22, 0.16) 55%, transparent 75%),
    radial-gradient(120% 90% at 50% 30%, var(--charcoal) 0%, var(--ink) 55%, var(--ink-deep) 100%);
}

/* ---------- Responsive ---------- */

@media (max-width: 400px) {
  .eyebrow {
    gap: 0.6rem;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
  }

  .eyebrow__rule {
    display: none;
  }
}

@media (max-width: 640px) {
  .status__text {
    display: none;
  }

  .status {
    padding: 0.5rem;
  }

  .bottombar__meta {
    justify-content: center;
    text-align: center;
  }

  .signup__btn {
    padding: 0.72rem 1.1rem;
  }

  .signup__row {
    grid-template-columns: 1fr;
  }
}

/* Very short viewports (landscape phones): allow scroll so nothing is trapped */
@media (max-height: 540px) {
  html,
  body {
    overflow: auto;
  }

  .page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero {
    padding: 2.2rem 0;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* The scene renders a single static frame — nothing to pause */
  .motion-toggle {
    display: none;
  }
}
