/* Rhyme's landing page and privacy notice. */

@font-face {
  font-family: Newsreader;
  src: url("/fonts/Newsreader.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url("/fonts/Newsreader-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
/* Only downloaded where the visitor's device has no SF Pro. */
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f6efe6;
  --card: #fffdf9;
  --ink: #2a211d;
  --ink-muted: #75655e;
  --rose: #9e4b44;
  --rose-deep: #7a3631;
  --on-rose: #ffffff;
  --rule: #dccfc3;
  --margin: #e2b8ae;
  --pencil: #b9a89a;

  --font-serif: Newsreader, "New York", Georgia, serif;
  --font-sans: -apple-system, "SF Pro Text", Inter, system-ui, sans-serif;

  --gutter: clamp(22px, 5vw, 72px);
  --section-end: clamp(56px, 7vw, 104px);
  --minimum-tap-target: 44px;
  --button-height: 50px;
  --text-box-radius: 6px;
  --polaroid-radius: 6px;
  --photo-radius: 2px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 400;
}

/* The form and its joined card swap with this attribute, and both set their own display. */
[hidden] { display: none !important; }

img { display: block; }

a { color: var(--rose); }
a:hover, a:active { color: var(--rose-deep); }

h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 2px;
}

/* The first tree's ground line runs out to the page edge, so the page clips sideways overflow. */
.page { overflow: hidden; overflow: clip; }

/* Type roles */

.display-large {
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.03;
  letter-spacing: -0.018em;
  font-variation-settings: "opsz" 20;
}
.display {
  font-size: clamp(25px, 2.6vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.006em;
  font-variation-settings: "opsz" 18;
  text-wrap: balance;
}
.headline {
  margin-bottom: 18px;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.13;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 20;
}
.lede {
  max-width: 960px;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.32;
  font-style: italic;
  color: var(--ink-muted);
  font-variation-settings: "opsz" 16;
  text-wrap: balance;
}
.copy {
  font-size: clamp(18px, 1.4vw, 20px);
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
}
.small-print {
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
}
.ruled-label {
  padding: 11px 0 7px;
  border-bottom: 1px solid var(--rule);
  color: var(--rose);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
}

/* Layout: words on one side, a picture on the other, wrapping to one column on phones. */

.pair {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.pair-text { flex: 1 1 480px; min-width: 0; }
.pair-aside { flex: 3 1 560px; min-width: 0; max-width: 820px; margin-left: auto; }
.aside-centred { display: flex; justify-content: center; }
.pair-centred { align-items: center; }
.pair-top { align-items: flex-start; }
.pair-spaced { padding-bottom: var(--section-end); }

.solo {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-bottom: var(--section-end);
}

/* Buttons and links */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--rose);
  color: var(--on-rose);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .button:active { background: var(--rose-deep); color: var(--on-rose); }
.button:disabled { opacity: 0.6; cursor: default; }

.text-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: var(--minimum-tap-target);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  text-decoration: none;
}

/* What Rhyme is */

.hero {
  row-gap: 0;
  align-items: flex-end;
  padding-top: clamp(28px, 3vw, 44px);
}
.hero-text { padding-bottom: clamp(36px, 5vw, 80px); }
.wordmark {
  width: auto;
  height: 30px;
  margin-bottom: clamp(48px, 7vw, 104px);
}
.hero h1 { margin-bottom: 22px; }
.tagline {
  margin-bottom: 24px;
  font-size: 22px;
  line-height: 31px;
  font-style: italic;
  color: var(--ink-muted);
  font-variation-settings: "opsz" 16;
}
.hero-intro { margin-bottom: 12px; }
.hero-where { margin-bottom: 28px; }
/* Crops the sky and everything below the ground, so the ground meets the dark section. */
.hero-tree { overflow: hidden; aspect-ratio: 300 / 251.5; }
.hero-tree img { width: 100%; height: auto; }

/* The problem: the page's only dark section */

.dark { background: var(--ink); color: var(--paper); }
/* On phones the reflection stays above the words, directly under the tree it mirrors. */
.dark-pair {
  flex-wrap: wrap-reverse;
  row-gap: 0;
  align-items: flex-end;
}
.dark-text { padding: clamp(36px, 5vw, 72px) 0 clamp(40px, 5vw, 72px); }
.dark h2 { margin-bottom: clamp(24px, 3vw, 40px); }
.dark-line { margin-bottom: 0.55em; color: var(--pencil); }
.dark-ending { font-style: italic; }
.reflection { width: 100%; height: auto; }

/* How Rhyme solves it */

.relationship { padding-top: clamp(22px, 2.6vw, 36px); }
.relationship h2 { margin-bottom: clamp(20px, 2vw, 28px); }

.note {
  width: 100%;
  max-width: 480px;
  padding: 24px 26px 20px;
  transform: rotate(-1deg);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--text-box-radius);
}
.note-title {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 25px;
}
.note-journal {
  margin-bottom: 10px;
  padding: 0 0 30px 12px;
  border-left: 1px solid var(--margin);
  font-size: 17px;
  line-height: 30px;
  font-style: italic;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--rule) 29px, var(--rule) 30px);
}

.mutual {
  row-gap: 36px;
  padding-bottom: clamp(56px, 6vw, 88px);
}
.stepping-aside { width: 100%; max-width: 440px; }
.stepping-aside img { width: 100%; height: auto; }
.stepping-aside figcaption {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
}

/* A second way to the form, halfway down a long page */

.midway {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter) var(--section-end);
  text-align: center;
}
.midway .tagline { margin-bottom: 0; }

/* Here, something grows */

.grow h2 { margin-bottom: clamp(20px, 3vw, 40px); }
.grow-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  column-gap: clamp(40px, 6vw, 88px);
}
/* Subgrid lines both captions up, whatever the height of the picture above each. */
.grow-column {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: clamp(20px, 2vw, 28px);
}
.grow-trees {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grow-trees figure { min-width: 0; }
.grow-trees figcaption {
  padding-top: 10px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 22px;
  font-style: italic;
}
.tree-frame {
  position: relative;
  /* The ratio is for the drawing, with the ground line added beneath it. */
  box-sizing: content-box;
  aspect-ratio: 268 / 252;
  border-bottom: 1px solid var(--ink);
}
.tree-frame img {
  position: absolute;
  left: -6%;
  top: 0;
  width: 112%;
  height: auto;
  clip-path: inset(0 0 16% 0);
}
.tree-frame-first::before {
  content: "";
  position: absolute;
  right: 100%;
  bottom: -1px;
  width: 100vw;
  height: 1px;
  background: var(--ink);
}

.calendar-holder { align-self: end; display: flex; justify-content: center; }
.calendar {
  width: 100%;
  max-width: 440px;
  padding: 18px 22px 14px;
  transform: rotate(1deg);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--text-box-radius);
}
.calendar-month {
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.006em;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  row-gap: 2px;
}
.calendar-weekday {
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}
.calendar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 22px;
}
.calendar-day-free { border: 1.5px solid var(--rose); color: var(--rose); }
.marker-ring, .marker-dot {
  position: absolute;
  left: 50%;
  top: 25px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
}
.marker-ring { border: 1px solid var(--ink-muted); }
.marker-dot { background: var(--rose); }
.calendar-note {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--margin);
}
.calendar-free {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  line-height: 22px;
  font-style: italic;
}
.calendar-when { color: var(--ink-muted); }

@media (max-width: 860px) {
  .grow-grid { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .grow-trees { margin: 0 calc(-1 * var(--gutter)); }
}

/* What you can count on */

.count-on {
  width: 100%;
  max-width: 480px;
  padding-left: 12px;
  border-left: 1px solid var(--margin);
}
.count-on ul { padding: 0; list-style: none; }
.count-on li {
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 18px;
  line-height: 26px;
  font-style: italic;
  text-wrap: pretty;
}

/* Sign-up */

.polaroids {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 430px;
  margin: clamp(30px, 4vw, 48px) auto 12px;
  padding: 0 2%;
}
.polaroid {
  flex: 0 0 54%;
  padding: 3.5% 3.5% 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--polaroid-radius);
}
.polaroid-first { margin-top: 4.2%; transform: rotate(-5deg); }
.polaroid-second { position: relative; margin-left: -8.3%; transform: rotate(4deg); }
.polaroid-photo { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--photo-radius); }
.polaroid-photo img { width: 100%; height: 100%; }
.polaroid-caption {
  padding: 8px 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.3;
  font-style: italic;
}

.join-panel {
  width: 100%;
  max-width: 520px;
  scroll-margin-top: 24px;
}
.join-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--text-box-radius);
  font-family: var(--font-sans);
}
.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 20px;
}
.field input, .field select {
  display: block;
  width: 100%;
  min-height: var(--minimum-tap-target);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--text-box-radius);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
}
.field input { padding: 11px 12px; line-height: 22px; }
/* Safari on a Mac otherwise shrinks these to a small native pill that ignores all of the above. */
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 34px 0 12px;
  background-image: url("/images/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
/* "Choose…" reads as a prompt, not an answer. */
.field select:invalid { color: var(--ink-muted); }
.field-pair { display: flex; flex-wrap: wrap; gap: 14px; }
.field-pair .field { flex: 1 1 180px; min-width: 0; }
.field-error {
  margin-top: 7px;
  color: var(--rose);
  font-size: 13px;
  line-height: 18px;
}
.letter-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--minimum-tap-target);
  font-size: 15px;
  line-height: 20px;
}
.letter-choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--rose);
}
/* Off the page rather than display: none, which some scripts know to skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* Takes no room unless Cloudflare needs someone to tick its box. */
.bot-check:empty { display: none; }
.form-print {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 18px;
}

.joined {
  padding: clamp(26px, 3vw, 40px);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--text-box-radius);
}
/* Focus lands here after joining so screen readers announce it. It can't be activated, so it has no ring. */
.joined h2:focus { outline: none; }
.joined .copy + .copy { margin-top: 14px; }

/* Footer */

.footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 20px;
}
.footer img {
  width: auto;
  height: 24px;
  margin-bottom: 14px;
}

/* The privacy notice */

.plain-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 3vw, 44px) var(--gutter) var(--section-end);
}
/* The wordmark, with the way back to the page opposite it. */
.plain-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.plain-top .wordmark { display: block; margin-bottom: 0; }
.plain-top .text-link { align-self: center; }
.plain-page .copy { margin-bottom: 8px; }
.plain-page .headline { margin-bottom: 8px; }
.notice {
  margin: clamp(24px, 3vw, 36px) 0;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
}
.notice h2 {
  margin: 36px 0 10px;
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.2;
  font-variation-settings: "opsz" 18;
}
.notice p { margin-bottom: 12px; }
.notice ul { margin: 0 0 12px; padding-left: 22px; }
.notice li { margin-bottom: 8px; }
/* The serif has one weight, so emphasis is a colour and not a faked bold. */
.notice strong { font-weight: 400; color: var(--rose-deep); }
