/* Start page: "The Hatch Sheet". Builds on styles.css, theme.css and sketch.css. */

:root {
  --error: #c62828;
  --focus-ring: 0 0 0 4px rgba(255, 90, 31, 0.18);
}
:root[data-theme="dark"] {
  --error: #ff8a80;
  --focus-ring: 0 0 0 4px rgba(255, 107, 53, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --error: #ff8a80;
    --focus-ring: 0 0 0 4px rgba(255, 107, 53, 0.25);
  }
}

body.start { overflow-x: clip; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.start fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.start legend { padding: 0; }
.start legend:focus { outline: none; }

/* ---------- layout ---------- */
.start-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) var(--gutter);
}
.start-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "form" "proof";
}
.start-intro { grid-area: intro; position: relative; }
.start-form-col { grid-area: form; min-width: 0; }
.start-proof { grid-area: proof; display: grid; gap: 1.75rem; }

@media (min-width: 900px) {
  .start-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "intro form" "proof form";
    column-gap: clamp(2rem, 5vw, 5rem);
    row-gap: 2rem;
    align-items: start;
  }
}

.start-title {
  margin: 0.6rem 0 1.1rem;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.start-title em { color: var(--accent); padding-right: 0.04em; }
.start-sub { max-width: 46ch; font-size: var(--text-body); color: var(--muted); }

.start-note {
  display: none;
  right: 0;
  bottom: -3.5rem;
  font-size: 1.35rem;
  --tilt: -4deg;
}
@media (min-width: 900px) {
  .start-note { display: inline-flex; }
}

/* ---------- proof column ---------- */
.proof { display: grid; gap: 0.7rem; }
.proof li { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 1rem; }
.proof .i { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; color: var(--live); stroke-width: 2.2; }
@media (min-width: 900px) {
  .proof { margin-top: 2.25rem; }
}

.work-strip { display: flex; padding: 0.5rem 0 0.5rem 14px; }
.work-strip li { margin-left: -14px; }
.work-strip img {
  display: block;
  box-sizing: border-box;
  width: 96px;
  height: 72px;
  object-fit: cover;
  border: 4px solid var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.work-strip li:nth-child(1) { rotate: -4deg; }
.work-strip li:nth-child(2) { rotate: 3deg; }
.work-strip li:nth-child(3) { rotate: -2deg; }
.work-strip li:nth-child(4) { rotate: 4deg; }

.start-founder { display: flex; align-items: center; gap: 0.85rem; }
.start-founder__photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.start-founder p { display: grid; gap: 0.1rem; }
.start-founder span { color: var(--muted); font-size: var(--text-sm); }

/* ---------- the sheet ---------- */
.sheet {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: 22px;
  background-color: var(--card);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: var(--shadow-card);
}
.sheet::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  translate: -50% 0;
  rotate: -3deg;
  border-radius: 2px;
  background: var(--yolk);
  opacity: 0.75;
  pointer-events: none;
}
@media (max-width: 479px) {
  .sheet::before { display: none; }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .sheet { rotate: -0.5deg; transition: rotate var(--duration-normal) var(--ease-out-expo); }
  .sheet:focus-within { rotate: 0deg; }
}

.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.progress__text { font-size: var(--text-sm); color: var(--muted); }
.progress__bar { display: flex; gap: 4px; margin-top: 0.45rem; }
.progress__bar span { width: 28px; height: 4px; border-radius: 2px; background: var(--line); transition: background-color var(--duration-normal); }
.progress__bar .is-on { background: var(--accent); }

.start-egg { flex: none; overflow: visible; }
.start-egg__shell { fill: var(--card); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.start-egg__crack {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 500ms var(--ease-out-expo);
}
.sheet[data-step="2"] .start-egg__crack--a,
.sheet[data-step="3"] .start-egg__crack { stroke-dashoffset: 0; }
.sheet[data-step="3"] .start-egg__crack--b { transition-delay: 120ms; }
.sheet[data-step="3"] .start-egg__crack--c { transition-delay: 240ms; }

/* ---------- steps ---------- */
.step > legend {
  display: block;
  width: 100%;
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hint { margin-bottom: 0.9rem; color: var(--muted); font-size: var(--text-sm); }
.group { margin-top: 1.25rem; }
.group__legend { display: block; margin-bottom: 0.6rem; font-size: 0.95rem; font-weight: 500; }
.step > .chips { margin-top: 0.25rem; }

.step.is-leaving-fwd { animation: step-out-left 200ms ease-in both; }
.step.is-entering-fwd { animation: step-in-right var(--duration-normal) var(--ease-out-expo) both; }
.step.is-leaving-back { animation: step-out-right 200ms ease-in both; }
.step.is-entering-back { animation: step-in-left var(--duration-normal) var(--ease-out-expo) both; }
@keyframes step-out-left { to { opacity: 0; transform: translateX(-16px); } }
@keyframes step-in-right { from { opacity: 0; transform: translateX(16px); } }
@keyframes step-out-right { to { opacity: 0; transform: translateX(16px); } }
@keyframes step-in-left { from { opacity: 0; transform: translateX(-16px); } }

.step__nav { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1.75rem; }
.step__nav--end { justify-content: flex-end; }
.step__nav .btn { min-height: 48px; justify-content: center; }
.btn--submit { flex: 1; }
@media (min-width: 560px) {
  .btn--submit { flex: 0 1 auto; }
}
.btn__egg { fill: var(--yolk); stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: start-spin 700ms linear infinite;
}
.is-sending .btn__spinner { display: inline-block; }
.is-sending .btn__egg { display: none; }
.btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.btn:disabled:hover { background: var(--ink); }
@keyframes start-spin { to { transform: rotate(360deg); } }
.privacy { margin-top: 0.9rem; color: var(--muted); font-size: 0.8rem; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  transition: transform var(--duration-fast) var(--ease-out-expo), box-shadow var(--duration-fast), background-color var(--duration-fast), color var(--duration-fast);
}
.chip:hover span { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 40%, transparent); }
.chip input:checked + span { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); animation: chip-pop var(--duration-fast) var(--ease-spring); }
.chip input:checked + span::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--yolk);
  flex: none;
}
.chip input:focus-visible + span { box-shadow: inset 0 0 0 1.5px var(--accent), var(--focus-ring); }
@keyframes chip-pop { from { transform: scale(0.96); } to { transform: scale(1); } }

/* ---------- fields ---------- */
.field { display: grid; gap: 0.4rem; margin-top: 1rem; }
.field > label { font-size: 0.95rem; font-weight: 500; }
.req { color: var(--accent); }
.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  height: 52px;
  padding: 0 1rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.field textarea { height: auto; min-height: 96px; padding: 0.85rem 1rem; resize: vertical; line-height: 1.45; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--error); }

.phone {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-sizing: border-box;
  height: 52px;
  padding-left: 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.phone:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.phone:has(input[aria-invalid="true"]) { border-color: var(--error); }
.phone__prefix {
  flex: none;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--card);
  font-size: 0.9rem;
  font-weight: 500;
}
.phone.is-intl { padding-left: 0; }
.phone.is-intl .phone__prefix { display: none; }
.field .phone input { flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0 14px 14px 0; background: transparent; box-shadow: none; }
.field .phone.is-intl input { padding-left: 1rem; }
.field .phone input:focus { border: 0; box-shadow: none; }

.field-error { margin-top: 0.4rem; color: var(--error); font-size: 0.85rem; }
.field .field-error { margin-top: 0; }
.form-error {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--error);
  box-shadow: inset 0 0 0 1.5px var(--error);
  font-size: 0.95rem;
}
.form-error a { margin-left: 0.35rem; font-weight: 600; text-decoration: underline; }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- success ---------- */
.success { display: grid; justify-items: center; gap: 0.9rem; padding: 1rem 0 0.5rem; text-align: center; }
.success[hidden] { display: none; }
.sheet__head[hidden], .form-error[hidden], .field-error[hidden] { display: none; }
.success__title { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.success__title:focus { outline: none; }
.success__text { max-width: 40ch; color: var(--muted); }
.success__actions { display: grid; gap: 0.6rem; width: 100%; margin-top: 0.5rem; }
.success__actions .btn { justify-content: center; min-height: 48px; }
@media (min-width: 560px) {
  .success__actions { display: flex; flex-wrap: wrap; justify-content: center; width: auto; }
}

.hatch { position: relative; width: 140px; height: 170px; }
.hatch__egg { display: block; overflow: visible; }
.hatch__base,
.hatch__cap { fill: var(--card); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.hatch__cap {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translate(0, -9px) rotate(18deg);
  animation: hatch-cap 700ms var(--ease-spring) 250ms backwards;
}
.hatch__chick {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: translateY(-4px);
  animation: hatch-chick 600ms var(--ease-spring) 650ms backwards;
}
.hatch__body { fill: var(--yolk); stroke: var(--ink); stroke-width: 1.5; }
.hatch__eye { fill: var(--ink); }
.hatch__beak { fill: var(--accent); }
@keyframes hatch-cap { from { transform: none; } }
@keyframes hatch-chick { from { transform: translateY(8px) scale(0.6); opacity: 0; } }

.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  animation: confetti 700ms var(--ease-out-expo) 750ms backwards;
}
.confetti i:nth-child(3n + 2) { background: var(--yolk); border-radius: 50%; }
.confetti i:nth-child(3n) { background: var(--blue); }
.confetti i:nth-child(1) { --x: -70px; --y: -60px; }
.confetti i:nth-child(2) { --x: -40px; --y: -95px; }
.confetti i:nth-child(3) { --x: 0; --y: -110px; }
.confetti i:nth-child(4) { --x: 42px; --y: -92px; }
.confetti i:nth-child(5) { --x: 72px; --y: -58px; }
.confetti i:nth-child(6) { --x: 85px; --y: -15px; }
.confetti i:nth-child(7) { --x: -85px; --y: -18px; }
.confetti i:nth-child(8) { --x: 0; --y: -70px; }
@keyframes confetti {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(160deg) scale(1); }
}

/* ---------- rather talk now ---------- */
.talk { margin-top: 2rem; }
.talk__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0.85rem; }
.talk__title { font-size: 1.1rem; font-weight: 600; }
.talk__note { color: var(--accent); font-size: 1.3rem; rotate: -2deg; }
.talk__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  box-sizing: border-box;
  height: 100%;
  padding: 1rem;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out-expo), box-shadow var(--duration-fast);
}
.tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-card); }
.tile svg { width: 22px; height: 22px; margin-bottom: 0.5rem; flex: none; }
.tile__label { font-weight: 500; }
.tile__sub { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.tile--li svg { color: var(--blue); }

/* ---------- footer ---------- */
.start-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.start-footer a { text-decoration: none; }
.start-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .step[class*="is-"],
  .hatch__cap,
  .hatch__chick,
  .chip input:checked + span { animation: none; }
  .start-egg__crack,
  .chip span,
  .tile,
  .progress__bar span { transition: none; }
  .confetti { display: none; }
}

/* The lamp hint would sit on top of the headline on phones. */
@media (max-width: 719px) {
  .start .lamp__hint { display: none; }
}
