/* Coatbook coming-soon. Paper, ink, one terracotta. Three type sizes: headline,
   body 16px, small 13px. Motion resolves in one direction; nothing loops
   faster than 4s; reduced-motion users get the final frame. */

:root {
  --paper: #f7f3ee;
  --ink: #1e3a5f;
  --muted: #3d4a5c;
  --line: #e6dfd6;
  --terra: #c4704b;
  --pill: #9e5636;
  --pill-hover: #8c4a2e;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
.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;
}

/* Ground: paper with a faint drifting dot grid and one warm glow. */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(30, 58, 95, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  animation: drift 80s linear infinite;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: 280px 280px; } }

.glow {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 28% 18%, rgba(196, 112, 75, 0.1), transparent 70%),
    radial-gradient(45% 40% at 82% 88%, rgba(196, 112, 75, 0.05), transparent 70%);
  animation: breathe 18s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}

.masthead { position: relative; z-index: 10; padding: 24px 20px 0; }
.wordmark {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.filters { position: absolute; }

/* Doodles */
.doodles { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
.doodle { position: absolute; display: none; }
.doodle svg, .mobile-doodles svg { display: block; width: 100%; height: auto; overflow: visible; }
.ink { color: var(--ink); }
.doodle-shears { top: 14%; left: 6%; width: 116px; }
.doodle-brush { top: 11%; right: 6%; width: 140px; }
.doodle-bone { bottom: 9%; left: 5%; width: 250px; }
.doodle-corgi { bottom: 9%; right: 6%; width: 132px; }

.bone path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1100ms cubic-bezier(0.3, 0, 0.3, 1) var(--doodle-delay, 0s) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Line boil: three displaced copies of one drawing take turns at 6 fps. */
.boil { animation-duration: 500ms; animation-timing-function: linear; animation-iteration-count: infinite; }
.boil-0 { animation-name: boil-0; }
.boil-1 { animation-name: boil-1; }
.boil-2 { animation-name: boil-2; }
@keyframes boil-0 { 0%, 33.3% { opacity: 1; } 33.4%, 100% { opacity: 0; } }
@keyframes boil-1 { 0%, 33.3% { opacity: 0; } 33.4%, 66.6% { opacity: 1; } 66.7%, 100% { opacity: 0; } }
@keyframes boil-2 { 0%, 66.6% { opacity: 0; } 66.7%, 100% { opacity: 1; } }

/* Resting tilt lives on `rotate`; the float animates `translate` only, so the
   two never collide and reduced-motion users see the tilted pose. */
.float { rotate: var(--tilt, 0deg); animation: float 9s ease-in-out infinite; animation-delay: var(--float-delay, 0s); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

.rise { opacity: 0; animation: rise 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--rise-delay, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Hero */
.hero { position: relative; z-index: 10; display: flex; flex: 1; align-items: center; padding: 40px 20px; }
.column { width: 100%; max-width: 640px; margin: 0 auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .square { display: inline-block; width: 7px; height: 7px; background: var(--ink); }

.headline {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--ink);
}
.mark { position: relative; display: inline-block; }
.highlight {
  position: absolute; z-index: -1;
  left: -0.08em; top: 0.13em; width: calc(100% + 0.16em); height: 0.86em;
  rotate: -1deg;
  clip-path: inset(0 100% 0 0);
  animation: wipe 550ms cubic-bezier(0.4, 0, 0.2, 1) 500ms forwards;
}
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

/* Handwritten word. app.js replaces the text with an SVG whose baseline is
   locked to the serif baseline; until then it is plain text in Caveat. */
.hw { display: inline-block; text-align: center; color: var(--ink); }
.hw svg { display: block; overflow: visible; }
.hw path { transition: none; }

.body { max-width: 540px; margin: 28px auto 0; font-size: 16px; line-height: 1.65; text-wrap: pretty; color: var(--muted); }

.signup { width: 100%; }
.signup[data-state="saved"] .body,
.signup[data-state="saved"] .lead,
.signup[data-state="already"] .body,
.signup[data-state="already"] .lead { display: none; }
.signup[data-state="saved"] .consent,
.signup[data-state="already"] .consent {
  margin: 28px auto 0;
  max-width: 540px;
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
  color: var(--muted);
}
.signup[data-state="invalid"] .consent,
.signup[data-state="failed"] .consent { color: #8c2f1e; }
.signup[data-state="saving"] button { opacity: 0.7; cursor: default; }

.micro { margin: 0; font-size: 13px; color: var(--muted); }
.consent { margin-top: 12px; }
.consent a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(61, 74, 92, 0.4); }

.lead {
  display: flex; align-items: stretch;
  width: 100%; max-width: 420px; margin: 36px auto 0;
  padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.lead input {
  flex: 1; min-width: 0;
  padding: 10px 16px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-radius: 999px;
}
.lead input::placeholder { color: rgba(61, 74, 92, 0.55); }
.lead:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.lead input:focus, .lead button:focus { outline: none; }
.lead button {
  flex-shrink: 0;
  padding: 10px 22px;
  font: inherit; font-size: 16px; font-weight: 500; color: #fff;
  background: var(--pill); border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color 150ms ease-out;
}
.lead button:hover, .lead button:focus-visible { background: var(--pill-hover); }
.lead button[disabled] { opacity: 0.7; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 519px) {
  .lead {
    flex-direction: column;
    padding: 0; gap: 8px;
    background: transparent; border: 0; border-radius: 0;
  }
  .lead:focus-within { outline: none; }
  .lead input {
    width: 100%; padding: 13px 18px;
    background: #fff; border: 1px solid var(--line);
  }
  .lead input:focus-visible,
  .lead button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .lead button { width: 100%; padding: 14px 24px; }
}

.mobile-doodles {
  display: flex; align-items: flex-end; justify-content: space-between;
  width: 100%; max-width: 320px; margin: 48px auto 0; padding: 0 8px;
}
.mobile-doodles .bone { width: 130px; }
.mobile-doodles .corgi { width: 84px; }

.legal { position: relative; z-index: 10; max-width: 640px; margin: 0 auto; padding: 0 20px 24px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); }
.legal p { margin: 0; }
.legal a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(61, 74, 92, 0.4); }
.legal a:hover { color: var(--ink); }

/* Privacy */
.policy-page { min-height: 100dvh; }
.policy { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.policy h1 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.policy .lede { margin: 12px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.policy .lede a { text-decoration: underline; text-underline-offset: 4px; }
.policy [name="termly-embed"] { margin-top: 32px; font-size: 15px; line-height: 1.7; color: var(--muted); }

@media (min-width: 640px) {
  .masthead { padding: 32px 40px 0; }
  .hero { padding: 40px; }
  .headline { font-size: 66px; }
  .legal { padding: 0 20px 32px; }
  .policy { padding: 40px; }
  .policy h1 { font-size: 42px; }
}
@media (min-width: 1024px) {
  .doodle { display: block; }
  .mobile-doodles { display: none; }
  .headline { font-size: 88px; }
  .doodle-bone { bottom: 10%; }
}
@media (min-width: 1280px) {
  .doodle-shears { width: 134px; }
  .doodle-brush { width: 160px; }
  .doodle-bone { width: 300px; }
  .doodle-corgi { width: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .page, .glow, .float { animation: none; }
  .rise { animation: none; opacity: 1; }
  .highlight { animation: none; clip-path: none; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .boil { animation: none; opacity: 0; }
  .boil-0 { opacity: 1; }
}
