/* Cwtch marketing site. Tokens mirror design-system.md (the app palette). */

:root {
  /* Brand */
  --terracotta: #D67F48;
  --terracotta-deep: #8C491A;
  --sage: #8FA073;
  --cream: #F5EAD8;
  --ink: #201E1D;

  /* Neutrals */
  --text: #1A1A1A;
  --text-muted: #60605C;
  --text-faint: #9A9A96;
  --hairline: #EAEAE6;
  --surface: #FFFFFF;
  --surface-subtle: #F9F9F6;

  /* Derived */
  --cream-line: #E9DAC1;

  /* Type */
  --font-display: "Caprasimo", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --fs-lede: clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem);
  --fs-h1: clamp(3rem, 2.2rem + 3.6vw, 4.75rem);
  --fs-h2: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  --fs-h3: 1.125rem;

  /* Layout */
  --prose: 40rem;
  --wide: 67.5rem;
  --gutter: 1.5rem;
  --band-pad: clamp(4rem, 3rem + 4vw, 6rem);
  --radius: 1.25rem;
  --header-h: 4.25rem;
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, blockquote, figure { margin: 0; }
a { color: inherit; }
strong { font-weight: 600; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--surface);
  padding: 0.5rem 1rem; border-radius: 0.5rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

/* Layout */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.prose { max-width: calc(var(--prose) + 2 * var(--gutter)); }
.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

.band { padding-block: var(--band-pad); }
.band-cream { background: var(--cream); }
section[id] { scroll-margin-top: var(--header-h); }

.prose > * + * { margin-top: 1.1em; }
.container + .container { margin-top: 2.5rem; }

/* Type */
h1, h2, .wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--terracotta-deep);
  letter-spacing: -0.005em;
}
h1 { font-size: var(--fs-h1); line-height: 1.08; }
h2 { font-size: var(--fs-h2); line-height: 1.12; margin-bottom: 0.4em; }
h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: 0.55em;
  border-radius: 3px;
  background: var(--terracotta);
}
h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.lede { font-size: var(--fs-lede); line-height: 1.5; }
.lede-sm { font-size: 1.125em; line-height: 1.5; }
.kicker { font-size: 1.2em; line-height: 1.45; color: var(--terracotta-deep); }
.kicker-centre { text-align: center; }
.emphasis { font-size: 1.05em; }

.dot-list { display: grid; gap: 0.55rem; }
.dot-list li { position: relative; padding-left: 1.6rem; }
.dot-list li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--sage);
}

/* Buttons & links */
.button {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  background: var(--terracotta-deep);
  color: var(--surface);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.button:hover { background: #733B14; transform: translateY(-1px); }
.button-small { padding: 0.6rem 1.1rem; font-size: 0.9375rem; }

.text-link {
  font-weight: 600;
  color: var(--terracotta-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--terracotta);
  padding-bottom: 1px;
}
.text-link:hover { color: var(--ink); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.brand img { width: 2rem; height: 2rem; }
.brand .wordmark { font-size: 1.75rem; line-height: 1; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav ul { display: flex; gap: 1.5rem; }
.site-nav ul a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav ul a:hover { color: var(--text); }
.site-nav ul a[aria-current="true"] { color: var(--terracotta-deep); border-bottom-color: var(--terracotta); }

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute;
  left: 50%;
  width: 1.375rem;
  height: 2px;
  margin-left: -0.6875rem;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bar { top: 50%; margin-top: -1px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; margin-left: 0; }
.nav-toggle-bar::before { transform: translateY(-7px); }
.nav-toggle-bar::after { transform: translateY(7px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(45deg); background: var(--ink); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: rotate(-45deg); background: var(--ink); }

@media (max-width: 60rem) {
  .site-nav ul { gap: 1rem; }
  .site-nav { gap: 1.25rem; }
}

@media (max-width: 45rem) {
  .js .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
  }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: block;
    padding-block: 0.75rem;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--hairline);
  }
  .site-nav ul a[aria-current="true"] { border-bottom-color: var(--hairline); }
  .site-nav .button { text-align: center; }
  /* Without JS the nav can't toggle, so show it in flow. */
  html:not(.js) .site-header { position: static; }
  html:not(.js) .header-inner { height: auto; flex-wrap: wrap; padding-block: 0.75rem; }
  html:not(.js) .site-nav { position: static; padding: 0; border: 0; width: 100%; }
}

/* Hero */
.hero {
  padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(4rem, 3rem + 4vw, 6rem);
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgb(245 234 216 / 0.7), transparent 70%),
    var(--surface);
}
.hero-grid {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero-copy > * + * { margin-top: 1.1rem; }
.hero-copy h1 { margin-bottom: 1.75rem; }
.hero-copy .button { margin-top: 2rem; }
.trust { font-size: 0.9375rem; color: var(--text-muted); }
.hero-mark img { width: min(100%, 26rem); margin-inline: auto; }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
  .hero-mark img { width: 9rem; margin-inline: 0 auto; margin-block: -1.5rem -1rem; }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.band-cream .card { border-color: var(--cream-line); }
.card h3 + p { margin-top: 0.4rem; color: var(--text-muted); }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.topic-grid .card h3::before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 0.5rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terracotta) 0 50%, var(--sage) 50% 100%);
}
@media (max-width: 60rem) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .topic-grid { grid-template-columns: 1fr; } }

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.principle-grid .card { background: var(--surface-subtle); padding: 1.75rem; }
.principle-grid h3 { font-size: 1.1875rem; }
.icon {
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  padding: 0.45rem;
  border-radius: 50%;
  background: var(--cream);
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 52rem) { .principle-grid { grid-template-columns: 1fr; } }

/* Two perspectives */
.perspectives {
  max-width: calc(52rem + 2 * var(--gutter));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.perspective {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
}
.perspective-you { background: rgb(214 127 72 / 0.08); border-top: 4px solid var(--terracotta); }
.perspective-partner { background: rgb(143 160 115 / 0.12); border-top: 4px solid var(--sage); }
.perspective figcaption { font-size: 0.9375rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.perspective blockquote { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem); line-height: 1.35; color: var(--ink); }
@media (max-width: 40rem) { .perspectives { grid-template-columns: 1fr; } }

/* Closing CTA */
.closing {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  text-align: center;
}
.closing-inner { position: relative; }
.closing h2::after { margin-inline: auto; }
.closing .button { margin-top: 2rem; }
.closing-mark {
  position: absolute;
  width: 40rem;
  max-width: none;
  right: -12rem;
  bottom: -14rem;
  opacity: 0.1;
  pointer-events: none;
}
@media (max-width: 40rem) {
  .closing-mark { width: 22rem; right: -9rem; bottom: -9rem; opacity: 0.08; }
}
.signoff { margin-top: 3.5rem; }
.signoff > * + * { margin-top: 0.4rem; }
.wordmark-lg { font-size: 2.25rem; line-height: 1.1; }

/* Footer */
.site-footer {
  padding-block: 3.5rem 2.5rem;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.footer-brand .brand .wordmark { font-size: 1.5rem; }
.footer-brand p { margin-top: 0.6rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; }
.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}
.footer-legal .disclaimer { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-muted); max-width: 44rem; }

/* Scroll reveal (only with JS and when motion is OK) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal > .container {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .js .reveal.is-visible > .container { opacity: 1; transform: none; }
}

/* Legal pages (terms, privacy) */
.legal-hero {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem) clamp(2rem, 1.5rem + 2vw, 3rem);
  background:
    radial-gradient(60rem 30rem at 85% 0%, rgb(245 234 216 / 0.7), transparent 70%),
    var(--surface);
}
.legal-hero h1 { font-size: clamp(2.5rem, 2rem + 2.4vw, 3.75rem); }
.legal-hero .updated { margin-top: 1rem; font-size: 0.9375rem; color: var(--text-muted); }
.legal { padding-block: 0 var(--band-pad); }
.legal h2 { font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); margin-top: 2.75rem; margin-bottom: 0; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin-top: 2rem; font-size: 1.1875rem; }
.legal h2 + *, .legal h3 + * { margin-top: 0.9rem; }
.legal .dot-list { gap: 0.4rem; }
.legal a:not(.button) { color: var(--terracotta-deep); text-underline-offset: 2px; }
.legal a:not(.button):hover { color: var(--ink); }
.legal-callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--cream);
  border-left: 4px solid var(--terracotta);
}
.legal-part { padding-top: 2.5rem; border-top: 1px solid var(--hairline); margin-top: 3rem; }

/* Support page FAQ */
.support-fallback { font-size: 0.9375rem; color: var(--text-muted); }
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  position: relative;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--terracotta-deep);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--terracotta-deep); }
.faq details > p { margin: 0 0 1.25rem; }
.support-more { margin-top: 2rem; }

/* Pricing and beta spots */
.pricing-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.price-card { padding: 1.75rem; display: flex; flex-direction: column; align-items: flex-start; }
.price { margin-top: 0.4rem; font-family: var(--font-display); font-size: 2.5rem; color: var(--terracotta-deep); }
.price span { font-family: var(--font-ui); font-size: 1rem; color: var(--text-muted); }
.price-note { margin: 0.25rem 0 1rem; color: var(--text-muted); }
.price-card .dot-list { margin-bottom: 1.5rem; }
.price-card .button { margin-top: auto; }
.price-card-featured { border-top: 4px solid var(--terracotta); transform: scale(1.1); position: relative; z-index: 1; box-shadow: 0 0 24px 4px rgba(214, 127, 72, 0.35), 0 0 6px rgba(32, 30, 29, 0.15); }
.price-badge { margin-bottom: 0.5rem; padding: 0.2rem 0.75rem; border-radius: 999px; background: var(--cream); color: var(--terracotta-deep); font-size: 0.875rem; font-weight: 600; }
.button-disabled { background: var(--hairline); color: var(--text-muted); cursor: default; pointer-events: none; }
.spots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.5rem; max-width: 40rem; margin: 0 auto; }
.spots .spot { width: 100%; height: auto; }
.spots .spot.is-open { opacity: 0.18; filter: grayscale(1); }
@media (max-width: 52rem) { .pricing-grid { grid-template-columns: 1fr; gap: 1rem; } .price-card-featured { transform: none; } }
@media (max-width: 40rem) { .spots { grid-template-columns: repeat(5, 1fr); } }
.spots-cta { text-align: center; }
