/* Research landing page. Built from the approved design canvas. */

:root {
  --ground: #fbf8f1;
  --field: #fffdf8;
  --ink: #1d1b33;
  --muted: #4f4c63;
  --line: #cfc6ae;
  --accent: #f7d56b;
  --error: #9b2c1f;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Three-step type scale: small, body, display */
  --text-sm: 0.875rem;
  --text-body: 1.125rem;
  --text-display: clamp(2.5rem, 4.6vw, 4.25rem);
  --text-title: 2.75rem;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--muted);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem;
}

.stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stack--hero {
  max-width: 60rem;
}

.stack--form {
  max-width: 28rem;
}

.stack--thanks {
  max-width: 36rem;
}

.sun {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 1.5rem;
}

.sun--small {
  width: 28px;
  height: 28px;
  margin: 1rem 0 1.25rem;
}

.eyebrow {
  margin: 0 0 1.5rem;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.title {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-title);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 2.5rem;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}

.reassure {
  margin: 1.5rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-body);
  line-height: 1.6;
  text-wrap: balance;
}

.note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: center;
}

/* Hand-drawn underline */
.scribble {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.scribble svg {
  position: absolute;
  left: -2%;
  bottom: -0.32em;
  width: 104%;
  height: 0.5em;
  overflow: visible;
  pointer-events: none;
}

.display .scribble svg {
  bottom: -0.22em;
  height: 0.32em;
}

.scribble path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 2rem;
  border-radius: 999px;
  background: var(--accent);
  border: 1.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  color: var(--ink);
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--ink);
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.button[aria-disabled="true"],
.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button--block {
  width: 100%;
  margin-top: 0.75rem;
}

.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  text-underline-offset: 4px;
}

/* Form */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background-color: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}

.field select {
  padding-right: 2.5rem;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%231D1B33' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--error);
}

.field-error:empty {
  display: none;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-status {
  margin: 0;
  padding: 0.875rem 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--error);
  background: var(--field);
  font-size: 0.9375rem;
  color: var(--error);
  text-align: center;
}

.form-status:empty {
  display: none;
}

/* Spam trap: hidden from people, visible to naive bots */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --text-sm: 0.8125rem;
    --text-body: 1.0625rem;
    --text-display: 2.25rem;
    --text-title: 2rem;
  }

  .page {
    padding: 3rem 1.75rem;
  }

  .page--form {
    align-items: flex-start;
    padding: 1.5rem 1.5rem 2rem;
  }

  .sun {
    width: 28px;
    height: 28px;
    margin-bottom: 1.25rem;
  }

  .sun--small {
    width: 24px;
    height: 24px;
    margin: 0 0 0.875rem;
  }

  .eyebrow {
    margin-bottom: 1rem;
  }

  .display br {
    display: none;
  }

  .display {
    margin-bottom: 1rem;
    line-height: 1.12;
    letter-spacing: -0.01em;
  }

  .title {
    margin-bottom: 0.5rem;
  }

  .lede {
    margin-bottom: 2rem;
  }

  .stack--form .lede {
    margin-bottom: 1.25rem;
  }

  .stack--hero .button {
    align-self: stretch;
  }

  .reassure {
    margin-top: 1.25rem;
  }

  .form {
    gap: 0.875rem;
  }

  .field input,
  .field select {
    min-height: 50px;
  }
}

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