/* Single-screen layout: everything fits in the viewport (down to ~360×600) without scrolling.
   Vertical spacing and the logo scale with viewport height (svh = smallest viewport height,
   so mobile browser toolbars never push content off-screen). Very short screens (e.g. phone
   landscape) fall back to normal scrolling rather than clipping content. */
:root {
  --bg: #EEE6D6;
  --ink: #3B2418;
  --ink-soft: rgba(59, 36, 24, 0.72);
  --line: rgba(59, 36, 24, 0.35);
  --error: #8A2A12;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --vh: 1vh;
  --logo-ratio: 2.087; /* cropped logo width / height */
}
@supports (height: 1svh) {
  :root { --vh: 1svh; }
}

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

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

body {
  margin: 0;
  min-height: calc(100 * var(--vh));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1rem, calc(4 * var(--vh)), 3rem) 1.25rem clamp(0.5rem, calc(2 * var(--vh)), 1.5rem);
  text-align: center;
}

/* Hero: logo width is limited by the viewport width AND height. */
.hero__logo { margin: 0; font-size: inherit; line-height: 0; }
.hero__logo img {
  display: block;
  width: 100%;
  max-width: min(640px, calc(26 * var(--vh) * var(--logo-ratio)));
  height: auto;
  margin: 0 auto;
}

.eyebrow,
.signup__heading,
.button,
.footer {
  font-family: var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow {
  margin: clamp(0.9rem, calc(3.5 * var(--vh)), 2.5rem) 0 0;
  font-size: 0.74rem;
  font-weight: 500;
}

/* About */
.about { margin-top: clamp(0.75rem, calc(3 * var(--vh)), 2rem); }

.about__lede {
  margin: 0 auto;
  max-width: 34rem;
  font-size: clamp(1rem, calc(2.3 * var(--vh)), 1.25rem);
  line-height: 1.55;
}

/* Sign-up */
.signup {
  width: 100%;
  margin: clamp(1rem, calc(4 * var(--vh)), 3rem) auto 0;
  max-width: 26rem;
  padding-top: clamp(0.9rem, calc(3.5 * var(--vh)), 2.25rem);
  border-top: 1px solid var(--line);
}

.signup__heading {
  margin: 0 0 clamp(0.7rem, calc(2.2 * var(--vh)), 1.5rem);
  font-size: 0.8rem;
  font-weight: 600;
}

.signup__form { display: grid; gap: clamp(0.5rem, calc(1.4 * var(--vh)), 0.9rem); }

.fields { display: grid; gap: clamp(0.5rem, calc(1.4 * var(--vh)), 0.9rem); }

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-size: 1rem; /* ≥16px stops iOS zooming on focus */
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: var(--ink-soft); opacity: 1; }
input[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }

.button {
  min-height: 2.75rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.button:hover { background: transparent; color: var(--ink); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.status { margin: 0; min-height: 1.5em; font-size: 0.95rem; }
.status:empty { min-height: 0; margin-top: calc(-1 * clamp(0.5rem, calc(1.4 * var(--vh)), 0.9rem)); }
.status[data-state="error"] { color: var(--error); }

.signup__form.is-done .fields,
.signup__form.is-done .button { display: none; }
.signup__form.is-done .status { font-size: 1.1rem; }

/* Honeypot */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.footer {
  padding: clamp(0.6rem, calc(2.5 * var(--vh)), 1.75rem) 1.25rem;
  text-align: center;
  font-size: 0.66rem;
}
.footer p { margin: 0; }
.footer__sep { margin: 0 0.6rem; }
.footer__company { font-weight: 600; }

/* Phones: the description wraps onto more lines, so tighten type and spacing to keep one screen. */
@media (max-width: 639px) {
  .page { padding: clamp(0.75rem, calc(3 * var(--vh)), 2rem) 1.25rem 0.25rem; }
  .hero__logo img { max-width: min(640px, calc(21 * var(--vh) * var(--logo-ratio))); }
  .eyebrow { margin-top: clamp(0.6rem, calc(2.2 * var(--vh)), 1.5rem); font-size: 0.7rem; }
  .about { margin-top: clamp(0.5rem, calc(1.8 * var(--vh)), 1.25rem); }
  .about__lede { font-size: clamp(0.92rem, calc(2.35 * var(--vh)), 1.08rem); line-height: 1.45; }
  .signup { margin-top: clamp(0.7rem, calc(2.6 * var(--vh)), 1.75rem); padding-top: clamp(0.7rem, calc(2.4 * var(--vh)), 1.5rem); }
  .signup__heading { margin-bottom: clamp(0.5rem, calc(1.6 * var(--vh)), 1rem); font-size: 0.74rem; }
  .signup__form, .fields { gap: clamp(0.45rem, calc(1.1 * var(--vh)), 0.7rem); }
  .status:empty { margin-top: calc(-1 * clamp(0.45rem, calc(1.1 * var(--vh)), 0.7rem)); }
  input[type="text"], input[type="email"], .button { min-height: 2.65rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .footer { padding: clamp(0.45rem, calc(1.8 * var(--vh)), 1rem) 1.25rem; }
}

/* Wider screens: name and email side by side. */
@media (min-width: 640px) {
  .signup { max-width: 32rem; }
  .fields { grid-template-columns: 1fr 1.4fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
