/* Cosy website. Light theme only. Tokens are the app's (ui/theme/Color.kt: the rose rebrand of direction A "Soft and
   editorial"; the names are the first palette's, so --plum is the rose primary).
   Marigold, honey and blush are fills behind ink text, never text colours (they fail contrast on light grounds). */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fff7f5;
  --card: #ffffff;
  --mist: #fce9ec;
  --line: #f3dbe0;
  --ink: #3b1a24;
  --ink2: #765560;
  --plum: #b8325c;
  --plum-deep: #962347;
  --marigold: #ffbd3e;
  --honey: #ffe4aa;
  --blush: #ff8e9c;
  --blush-soft: #ffdde3;
  --leaf: #3f7f5b;
  --leaf-soft: #e2f0e7;
  --head: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 72rem;
  --read: 44rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 {
  font-family: var(--head);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
a { color: var(--plum); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--plum-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 6px; }
strong { font-weight: 700; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 1rem; color: #fff; }

/* Header */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; flex: none;
  color: var(--plum); text-decoration: none;
  font-family: var(--head); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1;
}
.brand:hover { color: var(--plum); }
.brand img { width: 2.4rem; height: 2.4rem; }
.brand .dot { color: var(--marigold); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.1rem; }
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-block; padding: 0.45rem 0.7rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--mist); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }

/* The store button: a plain rose pill, the app's PrimaryButton. */
.play {
  display: inline-flex; align-items: center; gap: 0.7rem;
  min-height: 3.5rem; padding: 0.55rem 1.6rem 0.55rem 1.25rem; border-radius: 999px;
  background: var(--plum); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.play:hover { background: var(--plum-deep); color: #fff; transform: translateY(-1px); }
.play:focus-visible { outline-color: var(--ink); }
.play svg { width: 1.35rem; height: 1.35rem; flex: none; }
/* Plain text under the Play button for the store not live yet: no badge, no link. */
.soon { margin: 0.8rem 0 0; color: var(--ink2); font-size: 0.95rem; font-weight: 600; }

/* Landing: hero */
.hero { padding: 1.5rem 0 3rem; overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem; align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 0.4em; max-width: 9.5em;
}
.hero .lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--ink2); max-width: 27rem; margin-bottom: 2rem; }

.stage { position: relative; justify-self: center; width: min(100%, 35rem); aspect-ratio: 1 / 1.1; }
.stage .disc {
  position: absolute; left: 4%; width: 92%; top: 14%; aspect-ratio: 1; border-radius: 50%; background: var(--honey);
}
.stage .phone { position: absolute; width: 54%; left: 34%; top: 0; }
.stage .mo { position: absolute; width: 38%; height: auto; left: 0; bottom: 2%; overflow: visible; }

/* A phone: the app's screen in a soft ink frame (status bar cropped from the screenshot). */
.phone {
  padding: 0.45rem; border-radius: 2.2rem; background: var(--ink);
  box-shadow: 0 30px 60px -28px rgba(59, 26, 36, 0.45);
}
.phone img { width: 100%; border-radius: 1.8rem; background: var(--paper); }

/* Landing: the four chapters */
.chapter { padding: 3.5rem 0; }
.chapter .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 4rem; align-items: center;
}
.chapter .copy { max-width: 26rem; }
.chapter.flip .visual { order: 2; }
.chapter h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.06; letter-spacing: -0.025em; margin-bottom: 0.45em; }
.chapter p { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink2); margin: 0; }

.visual { position: relative; display: grid; place-items: center; min-height: 22rem; }
.visual::before {
  content: ""; position: absolute; width: min(88%, 27rem); aspect-ratio: 1; border-radius: 50%;
  background: var(--mist); top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.visual.honey::before { background: var(--honey); }
.visual.blush::before { background: var(--blush-soft); }
.visual.leaf::before { background: var(--leaf-soft); }
.visual .phone { position: relative; width: min(62%, 16.5rem); }
.visual .plate {
  position: relative; width: min(96%, 28rem); border-radius: 1.4rem;
  box-shadow: 0 30px 60px -30px rgba(59, 26, 36, 0.4); transform: rotate(-2deg);
}

/* Landing: the last word */
.closing { padding: 3rem 0 4.5rem; text-align: center; }
.closing .wrap { display: grid; justify-items: center; }
.closing img { width: 5.5rem; height: 5.5rem; margin-bottom: 1.25rem; }
.closing h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1.5rem; }

/* Long-form pages */
.page-head { padding: 1.5rem 0 1.5rem; }
.page-head .wrap { max-width: var(--read); }
.page-head h1 { font-size: clamp(2.2rem, 5.4vw, 3.2rem); letter-spacing: -0.025em; margin-bottom: 0.4rem; }
.page-head p { color: var(--ink2); margin: 0; max-width: var(--read); }
.prose { max-width: var(--read); padding-top: 1.5rem; padding-bottom: 4rem; }
.prose h2 { font-size: 1.55rem; margin-top: 2.25rem; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.5rem; margin-bottom: 0.4rem; }
.prose > h2:first-child { margin-top: 0; }
.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.35rem; margin-bottom: 2rem;
}
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; font-family: var(--text); font-weight: 700; letter-spacing: 0; }
.toc ol { margin: 0; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 0.9rem; min-height: 1.9rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--plum); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
}
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.975rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
th { font-weight: 700; background: var(--mist); }
.mail {
  display: inline-block; background: var(--plum); color: #fff; text-decoration: none; font-weight: 700;
  padding: 0.75rem 1.3rem; border-radius: 999px;
}
.mail:hover { background: var(--plum-deep); color: #fff; }
.mail:focus-visible { outline-color: var(--ink); }
.note {
  display: flex; gap: 0.9rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--marigold);
  border-radius: 16px; padding: 1rem 1.25rem; margin: 0 0 1.5rem;
}
.note p { margin: 0; }
.note p + p { margin-top: 0.5rem; }
.note .ic { flex: none; width: 1.6rem; height: 1.6rem; margin-top: 0.1rem; }

details {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 0.75rem;
}
summary {
  cursor: pointer; list-style: none; padding: 1rem 3rem 1rem 1.25rem; position: relative;
  font-weight: 700; font-size: 1.05rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--plum); line-height: 1;
}
details[open] summary::after { content: "\2212"; }
summary:focus-visible { outline-offset: -3px; border-radius: 16px; }
details > div { padding: 0 1.25rem 1rem; }
details > div > :last-child { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--mist); color: var(--ink); padding: 2.25rem 0 2.5rem; font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.site-footer .brand { font-size: 1.4rem; }
.site-footer .brand img { width: 2rem; height: 2rem; }
.site-footer nav { flex: 1 1 24rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
.site-footer li { margin: 0; }
.site-footer a { color: var(--ink); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--plum); text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--plum); text-decoration: underline; }
.site-footer .fine { flex-basis: 100%; margin: 0; color: var(--ink2); font-size: 0.875rem; }

/* Motion: one arrival in the hero, then Mo idles: breathes, blinks, sways his petals and waves his leaf (the groups
   of design/web-v2/tools/mo_inline.py; breath and blink timings are the app's rig). */
@media (prefers-reduced-motion: no-preference) {
  .stage .disc { animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .stage .phone { animation: rise 0.9s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .stage .mo { animation: rise 0.8s 0.38s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .mo .mo-breathe { transform-origin: 100px 200px; animation: moBreathe 3.6s ease-in-out infinite; }
  .mo .mo-blink { transform-origin: 100px 84px; animation: moBlink 5s infinite; }
  .mo .mo-head { transform-origin: 100px 132px; animation: moSway 5.2s ease-in-out 0.4s infinite; }
  .mo .mo-leaf { transform-origin: 72px 150px; animation: moLeaf 3.6s ease-in-out 0.2s infinite; }
  .mo .mo-wave { transform-origin: 130px 148px; animation: moWave 1.5s ease-in-out 3; }
}
@keyframes grow { from { transform: scale(0.86); opacity: 0; } }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }
@keyframes moBreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, 0.982); } }
@keyframes moBlink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(0.08); } }
@keyframes moSway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 70% { transform: rotate(2deg); } }
@keyframes moLeaf { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(7deg); } }
@keyframes moWave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }

@media (max-width: 860px) {
  .hero .wrap, .chapter .wrap { grid-template-columns: minmax(0, 1fr); }
  .chapter.flip .visual { order: 0; }
  .chapter .copy { max-width: 32rem; }
  .chapter { padding: 2.5rem 0; }
  .visual { min-height: 0; padding: 1rem 0; }
}
@media (max-width: 860px) {
  .hero { padding: 0.5rem 0 2rem; }
  .hero .lede { margin-bottom: 1.5rem; }
  .stage { width: min(100%, 26rem); margin-top: 0.5rem; aspect-ratio: 1 / 1.18; }
  .stage .phone { width: 62%; left: 33%; }
  .stage .mo { width: 40%; left: -2%; bottom: 0; }
}
@media (max-width: 480px) {
  .brand { font-size: 1.5rem; }
  .brand img { width: 2.1rem; height: 2.1rem; }
  .site-header .wrap { gap: 0.25rem; }
  .site-nav a { padding: 0.45rem 0.5rem; font-size: 0.9rem; }
  .play { width: 100%; justify-content: center; }
  .soon { text-align: center; }
}
