/* world.claude.do — WorldOS landing page
 *
 * Type: Fraunces for the headline (a variable serif with real optical sizing
 * and enough personality to sit next to an 8-bit crab without either one
 * looking like an accident), system sans for everything else. Self-hosted —
 * the page has no third-party runtime dependency, same rule as GSAP.
 *
 * Colour is taken from the crab, not chosen next to it: the shell #d46f56 is
 * the accent, and the ink is a desaturated navy pulled from the grid so the
 * whole page reads as one drawing.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-var.woff2?v=7234ed860a') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --shell: #d46f56;
  --shell-deep: #b1543e;
  --ink: #26303d;
  --ink-soft: #5b6675;
  --paper: #e4e9f2;
  --rule: #ced6e0;
  --white: #fff;

  --measure: 20ch;
  --pad: clamp(1.25rem, 4vw, 3rem);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
}

body {
  font-family: ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* The grid the parallax pans. Fixed and oversized by two tiles so the shift
   during the walk never exposes an edge. Transformed, never repainted —
   see the note on parallaxTarget in crab-anim.js. */
.grid-layer {
  position: fixed;
  inset: 0;
  left: -90px;
  width: calc(100% + 180px);
  z-index: 0;
  pointer-events: none;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule) 3px, transparent 3px),
    linear-gradient(90deg, var(--rule) 3px, transparent 3px);
  background-size: 45px 45px;
  background-position: 50% 100%;
}

/* ---------------------------------------------------------------- layout */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--pad);
  gap: 1rem;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.masthead .dot {
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--shell);
  align-self: center;
}
.masthead small {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.8rem;
}

/* Always present, never shouting. Pushed to the right of the masthead so the
   wordmark keeps the corner. */
.social {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  align-self: center;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  color: var(--ink-soft);
  transition: color 0.15s, background 0.15s;
}
.social a:hover { color: var(--ink); background: rgba(38, 48, 61, 0.07); }
.social a:focus-visible { outline: 2px solid var(--shell-deep); outline-offset: 2px; }
.social svg { width: 1.15rem; height: 1.15rem; display: block; }

/* Offered after a signup, so it starts hidden and GSAP fades it in. */
.follow-cta {
  margin: 0.7rem 0.2rem 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.follow-cta[hidden] { display: none; }
.follow-cta a {
  color: var(--shell-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(177, 84, 62, 0.3);
}
.follow-cta a:hover { border-bottom-color: var(--shell-deep); }

/* Copy sits left, crab plays across the whole width behind and below it.
   On a wide screen the crab has the right-hand half of the stage to walk
   into, which is why the copy is deliberately narrow. */
.hero-body {
  display: grid;
  align-content: center;
  max-width: 46rem;
}

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 100;
  font-weight: 700;
  font-size: clamp(2.75rem, 8.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}
h1 .turn {
  display: block;
  color: var(--shell-deep);
  font-style: italic;
}

.sub {
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 2rem;
  text-wrap: pretty;
}

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

.signup { max-width: 30rem; }

.field {
  display: flex;
  gap: 0.5rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 0.6rem;
  padding: 0.35rem;
  box-shadow: 0 10px 0 -4px rgba(38, 48, 61, 0.12);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.field:focus-within {
  border-color: var(--shell-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 0 -4px rgba(177, 84, 62, 0.22);
}

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
}
.field input::placeholder { color: #97a1b0; }
.field input:focus { outline: none; }

.field button {
  border: 0;
  border-radius: 0.4rem;
  background: var(--shell);
  color: var(--white);
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.field button:hover { background: var(--shell-deep); }
.field button:active { transform: translateY(1px); }
.field button[disabled] { opacity: 0.55; cursor: default; }

.note {
  margin: 0.85rem 0.2rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 1.3em;
}
.note[data-state='error'] { color: var(--shell-deep); font-weight: 600; }
.note[data-state='ok'] { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ crab */

/* The crab is scenery: it spans the viewport and sits behind the copy, and
   it must never intercept a click meant for the form. */
.crab-mount {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
}
/* Full-bleed width, never height-capped. Capping the height made the SVG
   narrower than the viewport, so its floor band stopped short and read as a
   stray rectangle. Letting it bleed keeps the floor edge-to-edge and puts the
   ground line at a predictable 18.2% up from the bottom at every width.
   The extra height overflows upward into empty sky, which costs nothing. */
.crab-mount svg.crab-stage {
  display: block;
  width: 100%;
  height: auto;
  /* The sticker's drop shadow. One blur for the whole stage, rather than an
     feDropShadow inside #sticker which ran once per filtered group — that
     was costing ~23fps on desktop for an identical result. */
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.16));
}

.hero > * { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ skip */

.skip {
  position: fixed;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 3;
  border: 2px solid var(--rule);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: opacity 0.35s, color 0.15s, border-color 0.15s;
}
.skip:hover { color: var(--ink); border-color: var(--ink-soft); }
.skip[hidden] { display: none; }

/* --------------------------------------------------------------- reveals */

/* Reveals are hidden ONLY once JS has claimed the page. Default-visible is
   the safe direction: no JS, a module that fails to parse, or a slow script
   all leave a readable page instead of a blank one. The head watchdog drops
   .js-ready again if the module never reports in. */
.js-ready .reveal { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .field, .field button, .skip { transition: none; }
}

@media (max-width: 640px) {
  .hero { grid-template-rows: auto auto 1fr; }
  .field { flex-wrap: wrap; }
  .field button { width: 100%; }

  /* No stage scaling or cropping on mobile — Liam: "don't scale mobile at
     all, the original size was good." The crab is simply smaller on a small
     screen, which is correct. */
}


