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

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Poke: airy top, charcoal UI */
  --poke-sky: #d4e8f7;
  --poke-mist: #eef6fc;
  --sky-deep: #a8cce8;
  --poke-text: #1a1a1a;
  --poke-muted: #5c5c5c;
  --poke-btn: #1a1a1a;

  /* Series: warm dark interior */
  --series-amber: #c4956a;
  --series-warm: #3d2e24;
  --series-deep: #14100c;
  --series-text: #f8f6f3;

  --imessage: #34c759;
  --imessage-blue: #0a84ff;
  --radius-pill: 999px;
  --radius-card: 20px;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  font-size: 16px;
  min-height: 100%;
  min-height: 100dvh;
  height: 100%;
  overflow: hidden;
  background: #1a3a4a;
}

:root {
  --page-transition-ms: 850ms;
}

.page-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--page-transition-ms) ease;
}

html.page-pre-enter .page-content {
  opacity: 0;
}

.page-content--enter-start {
  opacity: 0;
}

.page-content--enter-active {
  opacity: 1;
}

body.page-transition-exit .page-content {
  opacity: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--poke-text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.bg {
  position: fixed;
  top: calc(-1 * var(--safe-top));
  right: calc(-1 * var(--safe-right));
  bottom: calc(-1 * var(--safe-bottom));
  left: calc(-1 * var(--safe-left));
  z-index: -2;
  overflow: hidden;
  background: #1a3a4a;
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/images/coast-bg.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.bg-warm {
  position: fixed;
  top: calc(-1 * var(--safe-top));
  right: calc(-1 * var(--safe-right));
  bottom: calc(-1 * var(--safe-bottom));
  left: calc(-1 * var(--safe-left));
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 50% 30%, rgba(0, 0, 0, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.25) 50%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

.header {
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.9rem + var(--safe-top)) calc(clamp(1.25rem, 4vw, 3rem) + var(--safe-right)) 0.9rem calc(clamp(1.25rem, 4vw, 3rem) + var(--safe-left));
  background: transparent;
}

.logo {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  padding: 0;
  overflow: hidden;
}

.hero:not(.waitlist-main) {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-items: center;
  width: 100%;
}

.hero:not(.waitlist-main) .hero-content {
  display: contents;
}

.hero:not(.waitlist-main) .hero-copy {
  grid-row: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(0.25rem, 3vh, 1.5rem) clamp(1.25rem, 4vw, 2rem) 0;
  text-align: center;
}

.hero:not(.waitlist-main) .hero-cta {
  grid-row: 2;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 3.25rem clamp(1.25rem, 4vw, 2rem);
  min-height: 0;
}

.hero:not(.waitlist-main) .hero-phone-clip {
  grid-row: 3;
  width: min(440px, 82vw);
  margin: 0 auto;
  aspect-ratio: 401 / 468;
  height: auto;
  max-height: none;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero-content {
  flex-shrink: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(0.5rem, 3vh, 2rem) clamp(1.25rem, 4vw, 2rem) clamp(1.5rem, 4vh, 2.5rem);
  text-align: center;
}

.hero-copy {
  max-width: 100%;
}

.hero:not(.waitlist-main) h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.25vw, 3.35rem);
}

h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 6vw, 3.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-cta {
  margin-top: clamp(1.25rem, 3vh, 1.75rem);
  text-align: center;
}

.hero-phone-clip {
  flex: 0 0 auto;
  width: min(440px, 82vw);
  margin: 0 auto;
  aspect-ratio: 401 / 468;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: auto;
  pointer-events: none;
}

.hero-phone {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  filter: drop-shadow(0 24px 64px rgba(0, 0, 0, 0.2));
  user-select: none;
  -webkit-user-drag: none;
}

.btn-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--imessage-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(10, 132, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-join--header {
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-join--hero {
  padding: 1.1rem 2.35rem;
  font-size: 1.125rem;
  gap: 0.65rem;
}

.btn-join--hero .imessage-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.btn-join:hover {
  background: #0077ed;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.45);
}

.imessage-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #fff;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 0.75rem calc(clamp(1.25rem, 4vw, 3rem) + var(--safe-right)) calc(0.75rem + var(--safe-bottom)) calc(clamp(1.25rem, 4vw, 3rem) + var(--safe-left));
  font-size: 0.72rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 640px);
  overflow-y: auto;
  padding: 1.75rem;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  color: var(--poke-text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: modal-in 0.28s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--poke-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.modal-panel h2 {
  margin: 0 2rem 0.35rem 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-sub {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--poke-muted);
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field span,
.field legend {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--poke-muted);
}

.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #fff;
  color: var(--poke-text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--series-amber);
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.25);
}

.job-field {
  margin: 0;
  padding: 0;
  border: none;
}

.job-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f5f5f5;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.chip input:checked+span {
  background: rgba(196, 149, 106, 0.2);
  border-color: var(--series-amber);
  color: var(--poke-text);
}

.chip input:focus-visible+span {
  outline: 2px solid var(--series-amber);
  outline-offset: 2px;
}

.form-message {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.form-message[data-tone="error"] {
  color: #c44;
}

.form-message[data-tone="success"] {
  color: #1a7a3a;
}

.btn-submit {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--poke-btn);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.fine-print {
  margin: 0.85rem 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.4);
}

/* Waitlist page — aligned with home hero/header layout */
body.waitlist-page {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

body.waitlist-page .waitlist-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.waitlist-page .waitlist-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.waitlist-page .waitlist-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 1.75rem;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  color: var(--poke-text);
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.12);
  text-align: left;
}

body.waitlist-page .waitlist-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 6vw, 3.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--poke-text);
}

body.waitlist-page .waitlist-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--imessage-blue);
  text-decoration: none;
  text-align: left;
}

.waitlist-back:hover {
  text-decoration: underline;
}

body.waitlist-page .waitlist-sub {
  margin: 0 auto 1.25rem;
  max-width: 26rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.55;
  color: var(--poke-muted);
  text-align: center;
}

body.waitlist-page .waitlist-title {
  text-align: center;
}

.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--imessage-blue);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: #0077ed;
}

.modal-panel--terms {
  display: flex;
  flex-direction: column;
  max-width: min(720px, 96vw);
  max-height: min(90vh, 800px);
  padding: 1.25rem 1.25rem 1rem;
}

.modal-panel--terms h2 {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.terms-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.terms-modal-scroll h1 {
  display: none;
}

.terms-modal-scroll .terms-meta {
  color: var(--poke-muted);
  margin: 0 0 1rem;
}

.terms-modal-scroll h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.terms-modal-scroll p {
  margin: 0 0 0.65rem;
}

@media (max-width: 600px) {

  .hero:not(.waitlist-main) .hero-cta {
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
    min-height: 0;
  }
}

/* Mobile Safari: keep coast image edge-to-edge when browser chrome resizes */
@media (max-width: 600px) {
  .bg,
  .bg-warm {
    min-height: calc(100svh + var(--safe-top) + var(--safe-bottom));
    min-height: calc(100lvh + var(--safe-top) + var(--safe-bottom));
  }

  .bg::before {
    min-height: 100%;
    width: 100%;
    background-size: cover;
  }
}