/* ---------- Fonts (self-hosted, latin subset — covers Spanish) ---------- */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v21-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-v21-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/source-sans-3-v19-latin-600.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
/* The brand palette. Use these; don't hardcode new colors. Gold is for small
   accents only — it does not have the contrast to carry text on cream.
   The app shares the palette: cana-app/tailwind.config.js and
   cana-app/src/constants/theme.ts. */

:root {
  --cream: #f7f2ea;
  --cream-deep: #efe7da;
  --card: #fffdf9;
  --ink: #2a2024;
  --prose: #4b3f44;
  --muted: #6e6267;
  --wine: #7a2e3a;
  --wine-dark: #5f2330;
  --gold: #b08d57;
  --gold-light: #d9be8a; /* used by the app (handle rings); here so the palettes stay in step */
  --line: #e6dccd;
  --field-border: #8c7f85;
  --danger: #a13a30;
  --danger-bg: #fbecea;
  --info-bg: #f3ead9;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --page: 1120px;
}

/* ---------- Base ---------- */

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

html {
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Cormorant has a small x-height, so display sizes run larger than a sans
   would at the same visual weight: 500 for the big lines, 600 once it's small. */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--wine); text-underline-offset: 3px; }
a:hover { color: var(--wine-dark); }

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

/* Author display rules (.button is inline-flex) would otherwise un-hide these. */
[hidden] { display: none !important; }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--cream); }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: var(--page);
  margin: 0 auto;
  padding: 18px 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--wine);
}

/* The logo as the app shows it (its BrandHeader): the glass, drawn in the
   colour of the name beside it, then the name in the medium weight. On a
   phone it is a little smaller and closer set than in the app, because the
   header also holds the Blog link and the language toggle; from 480px it is
   the app's own size: a 24px glass, the name at 24px, 6px between letters. */
.brand-mark {
  flex: none;
  width: 21px;
  height: 21px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1;
  /* Spaced capitals, as in the app. The negative margin takes back the
     tracking after the last letter so the mark sits flush right too. */
  letter-spacing: 0.2em;
  margin-right: -0.2em;
  color: var(--wine);
}

/* The one text link in the header. Pushed right, so it sits by the toggle. */
.header-link {
  margin-left: auto;
  padding: 6px 2px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--prose);
  text-decoration: none;
}

.header-link:hover,
.header-link[aria-current] { color: var(--wine); }

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream-deep);
  font-size: 15px;
  font-weight: 600;
}

.lang-toggle a {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--prose);
  text-decoration: none;
}

.lang-toggle a:hover { color: var(--ink); }

.lang-toggle a[aria-current] {
  background: var(--card);
  color: var(--wine);
  box-shadow: 0 1px 2px rgba(42, 32, 36, 0.12);
}

@media (min-width: 480px) {
  .site-header { gap: 16px; }
  .brand-link { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .wordmark { font-size: 24px; letter-spacing: 0.25em; margin-right: -0.25em; }
  .lang-toggle a { padding: 7px 14px; }
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px 20px 56px;
  display: grid;
  gap: 32px;
}

.hero h1 { font-size: clamp(44px, 12.5vw, 76px); }

.hero-note {
  margin-top: 22px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  font-size: 16px;
  color: var(--muted);
}

/* The painting. On a phone it comes after the store links, so the way to get
   the app is on the first screen; from 960px it sits under the copy, beside
   the card. */
.hero-art { margin: 0; order: 1; }

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 42%;
  border-radius: 18px;
  background: var(--cream-deep);
}

.hero-art figcaption {
  margin-top: 8px;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Signup form ---------- */

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: 0 12px 32px rgba(42, 32, 36, 0.06);
  scroll-margin-top: 16px;
}

.form-card h2 { font-size: 32px; font-weight: 600; margin-bottom: 18px; }

.field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.optional { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="email"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 17px; /* 16px+ keeps iOS from zooming on focus */
  line-height: 1.3;
}

textarea { resize: vertical; min-height: 88px; }

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232a2024' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

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

[aria-invalid="true"]:not(fieldset) { border-color: var(--danger); border-width: 2px; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--wine);
  box-shadow: inset 0 0 0 1px var(--wine);
  background: #fbf3f1;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.choice input,
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--wine);
}

.choice input:focus-visible,
.check input:focus-visible { outline: none; }

/* Two classes: must outrank `.field > label`, which styles field captions. */
.field > label.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--prose);
  cursor: pointer;
}

.check input { margin-top: 2px; }
.check:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

.js .city-field.is-hidden { display: none; }

.field-error {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--danger);
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid #e3b4ae;
  background: var(--danger-bg);
  color: #6f241d;
  font-size: 16px;
  font-weight: 500;
}

.notice-info {
  border-color: #dcc9a6;
  background: var(--info-bg);
  color: var(--ink);
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-turnstile { margin-bottom: 18px; min-height: 65px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  border: 2px solid var(--wine);
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--wine-dark); border-color: var(--wine-dark); color: #fff; }
.button:focus-visible { border-radius: 999px; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }

.button-secondary { background: transparent; color: var(--wine); }
.button-secondary:hover { background: var(--wine); color: #fff; }

/* The line under the consent checkbox, lined up with its text. */
.consent-note {
  margin: 8px 0 0 32px;
  font-size: 14.5px;
  color: var(--muted);
}

.form-note {
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- The app card: the two store links ---------- */

/* Beside the painting on a wide screen, under it on a phone. It holds the
   store links and, only while the waitlist is open, the form under them. */
.hero-side { display: grid; gap: 24px; min-width: 0; }

.app-card h2 { margin-bottom: 8px; }
.app-lede { font-size: 17px; color: var(--ink); }
.app-note { margin: 4px 0 20px; font-size: 15px; color: var(--muted); }

/* Apple's and Google's own badges (img/BADGES.txt has their rules): the two
   at one height, never under 40px, with clear space of a quarter of that
   around each. Large on purpose (the owner's request): on a phone they are
   stacked, one over the other, so each can be as big as a button; from 560px
   they sit side by side. */
.store-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 4px 0;
}
.store-badge { display: inline-flex; border-radius: 10px; }
.store-badge img { display: block; height: 68px; width: auto; }

.store-legal {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.status-stores { max-width: 460px; margin: 24px 0 28px; }

/* ---------- How it works ---------- */

.how,
.faq {
  max-width: var(--page);
  margin: 0 auto;
  padding: 48px 20px;
}

.how { border-top: 1px solid var(--line); }

.how h2,
.faq h2 { font-size: clamp(34px, 8vw, 48px); margin-bottom: 28px; }

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: var(--wine);
}

.step h3 { font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--prose); }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq dl { margin: 0; max-width: 760px; }

.faq-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq-item:first-child { padding-top: 0; }

.faq dt {
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.2;
}

.faq dd { margin: 0; color: var(--prose); }

.faq-cta { margin-top: 28px; }
.faq-cta .button { width: auto; }

/* ---------- Thank-you ---------- */

.thanks,
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.thanks h1,
.legal h1 { font-size: clamp(42px, 10.5vw, 64px); margin-bottom: 16px; }

.thanks h2 { font-size: 30px; font-weight: 600; margin: 36px 0 12px; }

.lead { font-size: 19px; color: var(--prose); }

.next-list { margin: 0; padding-left: 22px; color: var(--prose); }
.next-list li { margin-bottom: 6px; }
.next-list li::marker { color: var(--gold); }

.share-card {
  margin: 36px 0 28px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.share-card h2 { margin-top: 0; }
.share-card p { color: var(--prose); }

.share-url { margin: 14px 0; font-size: 15px !important; color: var(--prose) !important; }

.share-actions { display: grid; gap: 10px; }

.share-status { min-height: 1.5em; margin-top: 10px; font-weight: 600; color: var(--wine) !important; }

.share-rules { margin-top: 8px; font-size: 15px; color: var(--muted) !important; }

/* A place in line: the number set large in the display face, the area beside it. */
.place-card {
  margin: 28px 0 0;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 0 22px 22px 0;
  background: var(--card);
}

.place-card h2 { margin-top: 0; }
.place-card + .share-card { margin-top: 16px; }

.place { margin: 0; color: var(--prose); font-size: 19px; }

.place-number {
  display: block;
  font-family: var(--display);
  font-size: clamp(64px, 18vw, 96px);
  font-weight: 500;
  line-height: 1;
  color: var(--wine);
  font-variant-numeric: lining-nums;
}

.place-count { margin-top: 12px; color: var(--prose); }

.status-note { margin: 0 0 24px; font-size: 15px; color: var(--muted); }
.status-actions { margin: 24px 0 20px; }

/* A section the form links to (the community guidelines) lands clear of the top edge. */
.legal section[id] { scroll-margin-top: 16px; }

/* ---------- Blog ---------- */

.blog,
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.blog h1,
.article h1 { font-size: clamp(38px, 9.5vw, 58px); margin-bottom: 14px; }

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--muted);
}

.breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--field-border); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--wine); }

.article-meta { margin-bottom: 26px; font-size: 15px; color: var(--muted); }

/* Article body. Measure is kept near 68 characters for comfortable reading. */
.prose { font-size: 18.5px; line-height: 1.68; color: var(--prose); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 1.7em; font-size: 31px; font-weight: 600; line-height: 1.15; color: var(--ink); }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--gold); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--gold);
  font-family: var(--display);
  font-size: 23px;
  line-height: 1.4;
  color: var(--ink);
}

.article-faq,
.article-sources,
.article-more { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }

.article-faq h2,
.article-sources h2,
.article-more h2 { font-size: 30px; font-weight: 600; margin-bottom: 18px; }

.article-faq dl { margin: 0; }
.article-faq dd { margin: 0; color: var(--prose); }
.article-faq dt {
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
}

.article-sources ul { margin: 0; padding-left: 22px; font-size: 16px; color: var(--muted); }
.article-sources li + li { margin-top: 6px; }
.article-sources a { word-break: break-word; }

.article-cards {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.article-card {
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.article-card h2,
.article-card h3 { font-size: 26px; font-weight: 600; line-height: 1.15; }
.article-card h2 a,
.article-card h3 a { color: var(--ink); text-decoration: none; }
.article-card h2 a:hover,
.article-card h3 a:hover { color: var(--wine); text-decoration: underline; }
.article-card p { margin-top: 8px; color: var(--prose); }
.article-card .article-card-meta { font-size: 14.5px; color: var(--muted); }

.cta-card {
  margin-top: 48px;
  padding: 28px 24px;
  border-radius: 22px;
  background: var(--wine);
  color: #fff;
}

.cta-card h2 { font-size: 32px; color: #fff; }
.cta-card p { margin: 10px 0 20px; color: #f3e3e1; }
.cta-card .button { width: auto; background: #fff; border-color: #fff; color: var(--wine); }
.cta-card .button:hover { background: var(--cream); border-color: var(--cream); color: var(--wine-dark); }
.cta-card .button:focus-visible { outline-color: #fff; }

.button-inline { width: auto; }

/* "From the blog", on the home page. */
.home-blog {
  max-width: var(--page);
  margin: 0 auto;
  padding: 48px 20px;
  border-top: 1px solid var(--line);
}

.home-blog h2 { font-size: clamp(34px, 8vw, 48px); }
.home-blog-all { margin-top: 22px; font-weight: 600; }

/* ---------- Legal drafts ---------- */

.draft-banner {
  display: grid;
  gap: 2px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 2px dashed var(--danger);
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: #6f241d;
}

.draft-banner strong { font-size: 17px; letter-spacing: 0.02em; }
.draft-banner span { font-size: 15.5px; }

.effective { margin: -6px 0 18px; font-size: 15.5px; color: var(--muted); }
/* The support page's contact address: the one thing on it people come for. */
.contact-line { margin: 0 0 8px; font-size: 18px; }
.contact-line a { color: var(--wine); font-weight: 600; }

.legal h2 { font-size: 28px; font-weight: 600; margin: 32px 0 10px; }
.legal p { margin-bottom: 12px; color: var(--prose); }
.legal ul { margin: 0 0 12px; padding-left: 22px; color: var(--prose); }
.legal li { margin-bottom: 6px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 20px 40px;
  color: var(--muted);
  font-size: 15.5px;
}

.footer-inner {
  max-width: var(--page);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: flex-end;
  justify-content: space-between;
}

.site-footer .wordmark { font-size: 20px; }
.site-footer .brand-mark { width: 20px; height: 20px; }
.footer-tagline { margin-top: 6px; }
/* Five links do not fit a phone in Spanish, so they wrap onto a second line. */
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-weight: 600; }

.footer-copy {
  max-width: var(--page);
  margin: 20px auto 0;
  font-size: 14.5px;
}

/* ---------- Wider screens ---------- */

@media (min-width: 560px) {
  .form-card { padding: 32px; }
  .store-links { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; }
  .store-badge img { height: 56px; }
  .share-actions { grid-template-columns: repeat(auto-fit, minmax(160px, max-content)); }
  .share-actions .button { width: auto; }
}

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .blog, .article { padding: 40px 32px 96px; }
  .home-blog { padding: 72px 32px; }
  .home-blog .article-cards { grid-template-columns: repeat(3, 1fr); }
  .cta-card { padding: 36px 36px; }
  .site-header { padding: 24px 32px; }
  .how, .faq { padding: 72px 32px; }
  .thanks, .legal { padding: 40px 32px 96px; }
  .site-footer { padding: 40px 32px 48px; }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "copy form"
      "art  form";
    gap: 36px 56px;
    align-items: start;
    padding: 40px 32px 88px;
  }
  .hero-copy { grid-area: copy; padding-top: 24px; }
  .hero-art { grid-area: art; }
  .hero-art img { aspect-ratio: 4 / 3; object-position: 50% 50%; }
  .hero-side { grid-area: form; }
}
