/* Crosy — coming soon
   Brand tokens are the only colors used on this page. */

:root {
  --crosy-color-cobalt: #2743ee;
  --crosy-color-cobalt-soft: #eef1fe;
  --crosy-color-ink: #131c2e;
  --crosy-color-shell: #0c1220;
  --crosy-color-shell-text-bright: #eef1f8;

  --crosy-color-brand-navy: #032155;
  --crosy-color-brand-mint: #46e3c3;
  --crosy-color-brand-violet: #4d4dff;

  --crosy-font-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --crosy-font-body: 'Instrument Sans', system-ui, sans-serif;

  /* Mark paint. --mark-face must equal the surface the mark sits on. */
  --surface: #ffffff;
  --mark-body: var(--crosy-color-brand-navy);
  --mark-face: var(--surface);
  --mark-mint: var(--crosy-color-brand-mint);
  --mark-check: var(--crosy-color-brand-violet);

  --text: var(--crosy-color-ink);
  --text-muted: color-mix(in srgb, var(--crosy-color-ink) 62%, var(--surface));

  /* One scale drives the whole lockup: the mark and its gap are set in em. */
  --wordmark-size: clamp(3.25rem, 1.75rem + 6vw, 6.75rem);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: var(--crosy-font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--crosy-color-cobalt-soft);
  color: var(--crosy-color-cobalt);
}

/* ---------- Layout: one centered composition ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-top: max(clamp(3rem, 10vh, 6rem), env(safe-area-inset-top));
  padding-bottom: max(clamp(3rem, 10vh, 6rem), env(safe-area-inset-bottom));
}

.wave-field {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Soft brand wash. Kept at the edges so the surface directly behind the
   face plate stays pure white and the plate reads as part of the page. */
.wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      70vmax 60vmax at 8% 4%,
      color-mix(in srgb, var(--crosy-color-brand-mint) 22%, transparent) 0%,
      transparent 60%
    ),
    radial-gradient(
      70vmax 60vmax at 94% 96%,
      color-mix(in srgb, var(--crosy-color-brand-violet) 16%, transparent) 0%,
      transparent 60%
    ),
    radial-gradient(
      55vmax 45vmax at 96% 10%,
      color-mix(in srgb, var(--crosy-color-cobalt) 8%, transparent) 0%,
      transparent 60%
    );
}

/* ---------- Lockup: mark + wordmark ---------- */

.lockup {
  display: flex;
  align-items: center;
  gap: 0.24em;
  margin: 0;
  font-family: var(--crosy-font-display);
  font-size: var(--wordmark-size);
  font-weight: 700;
  font-variation-settings: 'opsz' 96;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--crosy-color-brand-navy);
  max-width: 100%;
}

.mark {
  display: block;
  height: 1.22em;
  width: auto;
  flex: none;
  overflow: visible;
}

.wordmark {
  display: block;
  /* Bricolage's cap-height sits slightly high; nudge to optical center of the mark. */
  padding-top: 0.06em;
}

/* ---------- Copy ---------- */

.headline {
  margin: clamp(2rem, 6vh, 3.25rem) 0 0;
  font-family: var(--crosy-font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  font-weight: 600;
  font-variation-settings: 'opsz' 48;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lede {
  margin: 0.875rem 0 0;
  max-width: 34ch;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: balance;
}

@media (max-width: 30rem) {
  :root {
    --wordmark-size: clamp(2.75rem, 15.5vw, 4rem);
  }

  .hero {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .lockup {
    gap: 0.18em;
    font-size: min(4rem, 15.5vw);
  }

  .headline {
    margin-top: clamp(1.5rem, 5vh, 2.25rem);
  }

  .lede {
    max-width: 31ch;
  }
}

@media (max-height: 32rem) and (orientation: landscape) {
  :root {
    --wordmark-size: clamp(2.5rem, 15vh, 3.75rem);
  }

  .hero {
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .headline {
    margin-top: 0.875rem;
  }

  .lede {
    margin-top: 0.5rem;
    max-width: 46ch;
    line-height: 1.4;
  }
}

.contact {
  margin: clamp(1.75rem, 5vh, 2.75rem) 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.contact a {
  color: var(--crosy-color-cobalt);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--crosy-color-cobalt) 40%, transparent);
  border-radius: 0.25rem;
  transition: text-decoration-color 160ms ease;
}

.contact a:hover {
  text-decoration-color: var(--crosy-color-cobalt);
}

.contact a:focus-visible {
  outline: 2px solid var(--crosy-color-cobalt);
  outline-offset: 3px;
  text-decoration: none;
}

/* ---------- Motion ---------- */

/* 1. Continuous idle: the whole mark bobs. Amplitude scales with the lockup. */
.mark {
  animation: float 3.8s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.09em);
  }
}

/* 2a. Detail: the antenna tip breathes in mint. */
.mark-antenna {
  transform-box: fill-box;
  transform-origin: center;
  animation: antenna 2.6s ease-in-out infinite;
}

@keyframes antenna {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 color-mix(in srgb, var(--mark-mint) 0%, transparent));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--mark-mint) 90%, transparent));
  }
}

/* 2b. Detail: the check draws itself once on load, then fills and settles
   into the exact artwork. pathLength="1" on the path normalizes the dash. */
.mark-check {
  stroke: var(--mark-check);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill-opacity: 0;
  animation:
    check-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards,
    check-fill 0.45s ease-out 1.35s forwards;
}

@keyframes check-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes check-fill {
  from {
    fill-opacity: 0;
    stroke-opacity: 1;
  }
  to {
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}

/* 3. One page-load sequence: lockup first, then the copy follows. */
.lockup,
.headline,
.lede,
.contact {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.headline { animation-delay: 0.18s; }
.lede { animation-delay: 0.28s; }
.contact { animation-delay: 0.4s; }

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

@media (prefers-reduced-motion: reduce) {
  .mark,
  .mark-antenna,
  .mark-check,
  .lockup,
  .headline,
  .lede,
  .contact {
    animation: none;
  }

  .mark-check {
    fill-opacity: 1;
    stroke: none;
  }

  .mark-antenna {
    transform: none;
    filter: none;
  }

  .contact a {
    transition: none;
  }
}
