/* Ren + Roa landing page.
   Brand colours and type come from the Ren + Roa brand guidelines. Headings use Fraunces as a
   stand-in for Recoleta (web licence needed): add Recoleta's woff2 and change --font-serif to switch. */

@font-face { font-family: "Fraunces Soft"; src: url("/fonts/fraunces-soft.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --red: #682927;
  --red-deep: #521f1d;
  --cream: #faf9ec;
  --orange: #ef5026;
  --green: #23432a;
  --blue: #cce6f8;
  --ink: var(--red);
  --ink-soft: #7d4b48;
  --line: rgb(104 41 39 / 0.26);
  --field: #fffef6;

  --font-serif: "Fraunces Soft", "Recoleta", Georgia, serif;
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

p, h1 { margin: 0; }

a { color: inherit; }

::selection { background: var(--red); color: var(--cream); }

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

/* ---------- Page: the emblem pattern fills the background, the card sits in the middle ---------- */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow: clip;
  isolation: isolate;
}

.pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* The emblem is shown nearly whole, centred, so its ribbon wraps around the card. */
.pattern-move {
  --size: max(128vmin, 104svh);
  position: absolute;
  left: calc(50% - var(--size) / 2);
  top: calc(50% - var(--size) / 2);
  width: var(--size);
  height: var(--size);
  will-change: transform;
}

.pattern-breathe { position: absolute; inset: 0; }

.pattern-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  fill: var(--red);
  overflow: visible;
}

.pattern-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.card {
  position: relative;
  z-index: 1;
  width: min(100%, 38rem);
  padding: clamp(36px, 6vw, 60px) clamp(22px, 5vw, 56px) clamp(30px, 5vw, 48px);
  background: var(--cream);
  border-radius: clamp(24px, 3vw, 36px);
  box-shadow: 0 1px 0 rgb(104 41 39 / 0.04), 0 30px 70px -30px rgb(60 20 18 / 0.45);
  text-align: center;
}

.brand {
  display: inline-block;
  border-radius: 6px;
  line-height: 0;
}

.brand:focus-visible { outline: 2px solid var(--orange); outline-offset: 6px; }

.wordmark {
  display: block;
  height: clamp(30px, 4.4vw, 40px);
  width: auto;
  fill: var(--red);
}

.eyebrow {
  margin-top: clamp(22px, 3.4vw, 30px);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow .dot { margin: 0 0.7em; }

h1 {
  margin-top: 0.9rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.3rem + 2.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin: 1.1rem auto 0;
  max-width: 26em;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
  text-wrap: pretty;
}

/* ---------- Sign-up form ---------- */

.signup { margin-top: clamp(24px, 3.6vw, 32px); display: grid; text-align: left; }

.signup-form, .signup-done { grid-area: 1 / 1; }

.field {
  display: flex;
  align-items: center;
  padding: 6px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.field:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgb(239 80 38 / 0.22);
}

.field[data-invalid] { border-color: var(--orange); }

.field input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1rem/1 var(--font-sans);
  letter-spacing: 0.01em;
  outline: none;
  border-radius: 999px;
}

.field input::placeholder { color: #a0807d; opacity: 1; }

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 40px var(--field) inset;
  caret-color: var(--ink);
}

.field button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: 46px;
  padding: 0 20px 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font: 500 0.9375rem/1 var(--font-sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.field button:hover { background: var(--red-deep); }

.field button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.field button[disabled] { cursor: progress; }

.arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease-out);
}

.field button:hover .arrow { transform: translateX(3px); }

.field button[disabled] .arrow { animation: nudge 0.9s ease-in-out infinite; }

@keyframes nudge { 50% { transform: translateX(4px); } }

.note {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.note[data-tone="error"] { color: var(--red); font-weight: 400; }

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

.signup-done {
  visibility: hidden;
  opacity: 0;
  align-self: center;
  text-align: center;
  outline: none;
}

.done-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem);
  line-height: 1.2;
}

.done-text { margin-top: 0.4rem; color: var(--ink-soft); }

.signup.is-done .signup-form {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s;
}

.signup.is-done .signup-done {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.6s 0.25s;
}

/* ---------- Entrance + motion (only with JS, and only when motion is welcome) ---------- */

.js .reveal { opacity: 0; transform: translateY(12px); }

.js .is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.js .pattern .pattern-svg { opacity: 0; }
.js .pattern[data-state="drawing"] .pattern-canvas,
.js .pattern[data-state="settling"] .pattern-canvas { display: block; }
.js .pattern[data-state="settling"] .pattern-svg { opacity: 1; transition: opacity 0.5s ease-out; }
.js .pattern[data-state="done"] .pattern-svg { opacity: 1; }

.pattern[data-alive] .pattern-breathe { animation: breathe 16s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-3deg) scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .pattern[data-alive] .pattern-breathe { animation: none; }
  .js .pattern .pattern-svg { opacity: 1; }
  .js .pattern .pattern-canvas { display: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .eyebrow { letter-spacing: 0.16em; }
  .eyebrow span:not(.dot) { display: block; }
  .eyebrow .dot { display: none; }
  .field { flex-direction: column; align-items: stretch; padding: 0; background: none; border: 0; gap: 10px; }
  .field:focus-within { box-shadow: none; }
  .field input {
    flex: none;
    height: 54px;
    padding: 0 20px;
    background: var(--field);
    border: 1px solid var(--line);
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .field input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgb(239 80 38 / 0.22); }
  .field[data-invalid] input { border-color: var(--orange); }
  .field button { height: 54px; }
}

/* ---------- Message pages (thank you, 404) ---------- */

.message-title { margin-top: clamp(26px, 4vw, 34px); }

.back {
  margin-top: clamp(24px, 3.6vw, 32px);
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.25s;
}

.back:hover { background: var(--red-deep); }

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