/*
 * Gachi landing page.
 * Layout: one quiet screen. A twinklebaby, one line, and the email box,
 * centred on night. Every value comes from tokens.css.
 */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
}

/* ── Character art ─────────────────────────────────────────────────
   The render sits on black. Screen blending drops that black into the
   night behind it, and a soft edge fade hides the image border. In light
   mode, .night gives the art a dark holding shape of its own. */

.night {
  display: block;
  background: var(--art-holder);
  border-radius: var(--radius-sheet);
}

.art {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

.float { animation: float var(--float) var(--ease) infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(var(--space-xs) * -1.25)); }
}

/* ── Top bar: just the logo ──────────────────────────────────────── */

.nav { padding-top: env(safe-area-inset-top, 0px); }

.nav__inner {
  max-width: 1080px;
  margin-inline: auto;
  height: 64px;
  display: flex;
  align-items: center;
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
}

/* The white wordmark always sits on night (guidelines, 02). */
.logo {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xxs) var(--space-sm);
  margin-left: calc(var(--space-sm) * -1);
  background: var(--logo-holder);
  border-radius: var(--radius-pill);
}
.logo img { display: block; width: auto; height: 26px; }

/* ── The one screen ──────────────────────────────────────────────── */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: var(--space-xl) var(--space-xxl);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
}

/* ── The egg, beginning to crack ────────────────────────────────────
   It rocks, a hairline crack draws slowly across the shell, and light
   breathes through it. It never opens: nobody knows who is inside. Every
   swing is about 500ms and eased; nothing snaps. */

.egg-hero {
  width: min(232px, 52vw);
  margin-bottom: var(--space-md);
}

.egg-hero__shell {
  position: relative;
  transform-origin: 50% 92%;
  animation: egg-rock 7s var(--ease) 0.6s infinite;
}

.egg-hero__img {
  display: block;
  width: 100%;
  height: auto;
}

.egg-hero__crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* The crack opens from left to right, slowly. */
  clip-path: inset(-20% 100% -20% 0);
  animation: crack-open 2s var(--ease) 1.5s forwards;
}

.crack-edge__shape { fill: var(--night-glow); fill-opacity: 0.85; }
.crack-seam__shape { fill: var(--night-text); }

/* The light leaking out, breathing once the crack has opened. */
.crack-light__glow { fill: var(--lavender); }
.crack-light { animation: crack-breathe 4s ease-in-out 3.5s infinite; }

@keyframes egg-rock {
  0%, 32%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(-3deg); }
  16% { transform: rotate(2.4deg); }
  24% { transform: rotate(-1deg); }
}

@keyframes crack-open {
  to { clip-path: inset(-20% -5% -20% 0); }
}

@keyframes crack-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.eyebrow {
  margin: 0;
  font-size: var(--type-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--eyebrow);
}

.hero__title {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 34ch;
  font-size: var(--type-lede);
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ── Email form ──────────────────────────────────────────────────── */

.join {
  width: 100%;
  max-width: 440px;
  margin-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.join__field {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-xxs);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color var(--motion-fast) var(--ease);
}
.join__field:focus-within { border-color: var(--lavender); }
.join.is-error .join__field { border-color: var(--danger); }

.join__input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 var(--space-md);
  font: inherit;
  font-size: var(--type-body);
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.join__input::placeholder { color: var(--text-tertiary); }

.join__button {
  flex: none;
  min-height: var(--tap);
  padding: 0 var(--space-lg);
  font: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease);
}
.join__button:hover { opacity: 0.88; }
.join__button:disabled { opacity: 0.6; cursor: default; }

.join__note {
  margin: 0;
  font-size: var(--type-caption);
  color: var(--text-tertiary);
}
.join__note a { color: var(--text-secondary); }
.join.is-error .join__note { color: var(--danger); }

/* Hidden from people; bots fill it in. */
.join__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* After joining, the field gives way to a quiet thank-you. */
.join__done {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  animation: settle var(--motion-slow) var(--ease) both;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 340px) {
  .join__field { flex-direction: column; border-radius: var(--radius-card); }
}

/* ── Footer ──────────────────────────────────────────────────────── */

.footer { padding-block: var(--space-xl) calc(var(--space-xl) + env(safe-area-inset-bottom, 0px)); }

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

.privacy,
.footer__small {
  margin: 0;
  max-width: 60ch;
  font-size: var(--type-caption);
  color: var(--text-tertiary);
}

.footer__small a { color: var(--text-secondary); }

/* ── Privacy page: one readable column ───────────────────────────── */

.doc {
  flex: 1;
  padding-block: var(--space-xl) var(--space-xxl);
}

/* The column lines up under the logo; lines stop at a readable length. */
.doc__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.doc__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-section);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

.doc__inner > * { max-width: 680px; }
.doc .lede { max-width: 680px; }

.doc__meta {
  margin: 0;
  font-size: var(--type-caption);
  color: var(--text-tertiary);
}

.doc__section {
  margin-top: var(--space-md);
  padding: var(--card-padding);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.doc__section h2 {
  margin: 0 0 var(--space-xs);
  font-size: var(--type-title);
  font-weight: 600;
  line-height: 1.25;
}

.doc__section p,
.doc__section ul {
  margin: 0;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.doc__section p + p,
.doc__section p + ul,
.doc__section ul + p { margin-top: var(--space-sm); }
.doc__section ul { padding-left: var(--space-lg); }
.doc__section strong { color: var(--text); font-weight: 600; }

/* Answers still to fill in before launch. Easy to spot, never red. */
.placeholder {
  padding: 0 var(--space-xxs);
  color: var(--eyebrow);
  border: 1px dashed var(--eyebrow);
  border-radius: var(--space-xxs);
}

/* Less motion: the egg rests, already cracked, with its light steady. */
@media (prefers-reduced-motion: reduce) {
  .float,
  .egg-hero__shell,
  .egg-hero__crack,
  .crack-light,
  .join__done { animation: none; }
  .egg-hero__crack { clip-path: none; }
}
