/* ==========================================================================
   Behalf — Marketing & Waitlist Stylesheet
   Editorial minimalism inspired by instinct.com, grounded in Behalf's
   Warm Cream (#F6F1EB), Ripe Cherry (#8C1D2C), and Ink (#231F20) palette.
   ========================================================================== */

:root {
  /* Palette */
  --color-cream: #F6F1EB;
  --color-cream-deep: #EDE5DC;
  --color-cream-border: #DDD3C8;
  --color-cherry: #8C1D2C;
  --color-cherry-hover: #731623;
  --color-cherry-tint: color-mix(in srgb, #8C1D2C 12%, #F6F1EB);
  --color-cherry-tint-hover: color-mix(in srgb, #8C1D2C 22%, #F6F1EB);
  --color-ink: #231F20;
  --color-ink-muted: #625A5B;
  --color-ink-subtle: #968E8F;
  --color-underline: rgba(35, 31, 32, 0.22);

  /* Typography */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing scale */
  --space-xs: 8px;
  --space-sml: 12px;
  --space-reg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-6xl: 64px;

  /* Easing */
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-pop: linear(
    0, 0.011 1.4%, 0.044 2.9%, 0.174 6.1%, 0.562 12.8%,
    0.768 16.9%, 0.922 21.1%, 1.023 25.4%, 1.076 29.8%,
    1.09 34.1%, 1.074 39.4%, 1.015 51.1%, 0.992 59.6%,
    0.993 68.5%, 1.001 82.8%, 1
  );
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-serif);
  min-height: 100dvh;
}

::selection {
  background-color: var(--color-cherry-tint-hover);
  color: var(--color-ink);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-cherry);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Outer Frame & Layout (single-viewport editorial shell)
   ========================================================================== */

.marketing-site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: var(--space-reg);
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xl) var(--space-reg) 0;
}

.site-header__home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-ink);
}

.site-header__mark {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}

.site-header__home:hover .site-header__mark {
  transform: scale(1.04);
}

.site-header__wordmark {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-ink);
}

.site-header__links {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.nav-link {
  position: relative;
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.15em + 1px);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset: -14px -8px;
}

.nav-link:hover {
  text-decoration-color: var(--color-ink);
}

/* ==========================================================================
   Main Editorial Column
   ========================================================================== */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px var(--space-reg) var(--space-xl);
  gap: var(--space-6xl);
}

.home__intro {
  max-width: 41rem;
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.body-semi,
.body-reg {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.34;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}

.body-semi {
  font-weight: 600;
}

.body-reg {
  font-weight: 400;
}

/* Interactive capability phrases with tactile reaction badges */
.home__task {
  position: relative;
  display: inline;
  cursor: default;
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.12em + 1px);
  transition: text-decoration-color 0.15s ease;
}

.home__task:hover,
.home__task.is-active {
  text-decoration-color: var(--color-cherry);
}

.reaction {
  position: fixed;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-cherry);
  color: var(--color-cream);
  display: grid;
  place-items: center;
  pointer-events: none;
  transform-origin: 0% 100%;
  transform: translate(-6px, -48px) scale(0);
  opacity: 0;
  box-shadow: 0 4px 14px rgba(140, 29, 44, 0.18);
  transition: opacity 0.15s ease;
}

.reaction.is-visible {
  opacity: 1;
  animation: reaction-pop 0.48s var(--ease-pop) forwards;
}

.reaction svg {
  width: 18px;
  height: 18px;
  display: block;
}

@keyframes reaction-pop {
  0% {
    transform: translate(-6px, -42px) scale(0.35);
  }
  100% {
    transform: translate(-6px, -50px) scale(1);
  }
}

/* ==========================================================================
   Primary CTA (Brush-stroke highlight + chevron)
   ========================================================================== */

.home__cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  cursor: pointer;
  text-decoration: none;
}

.cta__label {
  position: relative;
  z-index: 1;
  padding: 0 2px;
}

.cta__label::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -2px 0.08em -2px;
  height: 0.44em;
  background-color: var(--color-cherry-tint);
  border-radius: 999px 12px 999px 14px;
  transform: rotate(-0.6deg);
  transition: background-color 0.18s ease;
  clip-path: inset(0 100% 0 0);
}

.is-revealed .cta__label::before {
  animation: brush-draw 0.65s var(--ease-out) 0.42s forwards;
}

.cta:hover .cta__label::before,
.cta[aria-expanded="true"] .cta__label::before {
  background-color: var(--color-cherry-tint-hover);
}

.cta__chevron {
  width: 20px;
  height: 20px;
  display: block;
  color: var(--color-cherry);
  transition: transform 0.2s var(--ease-out);
}

.cta:hover .cta__chevron {
  transform: translateX(3px);
}

.cta[aria-expanded="true"] .cta__chevron {
  transform: rotate(90deg);
}

@keyframes brush-draw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ==========================================================================
   Inline Waitlist Panel (Restrained stationery style)
   ========================================================================== */

.waitlist {
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.waitlist[hidden] {
  display: none;
}

.waitlist.is-entering {
  animation: waitlist-in 0.3s var(--ease-out) forwards;
}

@keyframes waitlist-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.waitlist__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.waitlist__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.waitlist__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-ink);
  background-color: #FBF8F4;
  border: 1px solid var(--color-cream-border);
  border-radius: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.waitlist__input::placeholder {
  color: var(--color-ink-subtle);
}

.waitlist__input:focus {
  outline: none;
  border-color: var(--color-cherry);
  background-color: #FFFFFF;
}

.waitlist__submit {
  height: 44px;
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-cream);
  background-color: var(--color-cherry);
  border: 1px solid var(--color-cherry);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.waitlist__submit:hover {
  background-color: var(--color-cherry-hover);
  border-color: var(--color-cherry-hover);
}

.waitlist__submit:active {
  transform: translateY(1px);
}

.waitlist__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.waitlist__note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-ink-muted);
}

.waitlist__status {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-ink);
  padding: 12px 14px;
  background-color: var(--color-cream-deep);
  border-left: 2px solid var(--color-cherry);
  border-radius: 0 6px 6px 0;
}

.waitlist__status--error {
  border-left-color: #B42318;
  color: #7A1A14;
}

.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;
}

/* ==========================================================================
   Footer (Legal Links)
   ========================================================================== */

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px var(--space-2xl);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-ink-muted);
}

.legal-links__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px var(--space-2xl);
}

.legal-links a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.15em + 1px);
  transition: text-decoration-color 0.15s ease;
}

.legal-links a:hover {
  text-decoration-color: var(--color-ink);
}

/* ==========================================================================
   Legal Pages (/privacy-policy, /terms)
   ========================================================================== */

.legal-page {
  min-height: 100dvh;
  padding: 32px var(--space-2xl) 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.back-button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-underline);
  text-underline-offset: 3px;
}

.back-button:hover {
  text-decoration-color: var(--color-ink);
}

.legal {
  max-width: 620px;
}

.legal h1 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.legal__revised {
  margin: 0 0 32px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-ink-muted);
}

.legal h2 {
  margin: 28px 0 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
}

.legal p,
.legal li {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-ink);
}

.legal p {
  margin: 0 0 14px;
}

.legal ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal a {
  color: var(--color-cherry);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Staggered Load Reveal
   ========================================================================== */

.js-reveal {
  opacity: 0;
  transform: translateY(8px);
}

.js-reveal.is-revealed {
  animation: home-reveal 0.55s var(--ease-out) calc(var(--reveal, 0) * 85ms) forwards;
}

@keyframes home-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    transform: none;
  }
  .js-reveal.is-revealed {
    animation: fade-only 0.25s ease forwards;
  }
  .is-revealed .cta__label::before {
    animation: none;
    clip-path: inset(0);
  }
  .reaction.is-visible {
    animation: none;
    transform: translate(-6px, -44px) scale(1);
  }
}

@keyframes fade-only {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (min-width: 80rem) {
  .site-header {
    padding: var(--space-xl) var(--space-xl) 0;
  }

  .home {
    padding: var(--space-6xl) var(--space-xl) var(--space-xl);
  }

  .home__intro {
    gap: 45.6px;
  }

  .legal-page {
    padding: 40px 44px 80px;
  }
}

@media (max-width: 540px) {
  .waitlist__row {
    flex-direction: column;
  }

  .waitlist__submit {
    width: 100%;
  }

  .home__intro {
    gap: 28px;
  }
}
