/* Lovlet website. Same look as the app's "Papper" theme (light) and "Midnatt" (dark mode).
   Fonts are served from this site: no requests to Google or anyone else. */

@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/fraunces-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 700; font-display: swap; src: url("/fonts/caveat-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #F4EEE3;
  --surface: #FFFDF8;
  --surface-high: #EDE4D6;
  --border: #DCCFBD;
  --text: #2A2220;
  --muted: #6B5E58;
  --faint: #8F8178;
  --accent: #7A3245;
  --accent-text: #7A3245;
  --on-accent: #FFFDF8;
  --note: #FCE9A8;
  --tape: rgba(233, 196, 106, 0.6);
  --shadow: rgba(74, 52, 40, 0.16);
  --line: rgba(122, 50, 69, 0.07);
  --photo-a: #E9B9A4;
  --photo-b: #C97B6B;
  --photo-c: #7A3245;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

/* Dark: "Papper by night", the same colours as the app (apps/app/src/theme/themes.ts).
   Follows the device unless the visitor picks Light or Dark (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110F;
    --surface: #221A17;
    --surface-high: #2C221E;
    --border: #3B2E29;
    --text: #F3EADF;
    --muted: #BCA99C;
    --faint: #8E7D72;
    --accent: #D46A82;
    --accent-text: #E89AAB;
    --on-accent: #17110F;
    --note: #3A3020;
    --tape: rgba(233, 196, 106, 0.35);
    --shadow: rgba(0, 0, 0, 0.45);
    --line: rgba(232, 154, 171, 0.05);
    --photo-a: #4A2F2A;
    --photo-b: #7A4048;
    --photo-c: #D46A82;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17110F;
  --surface: #221A17;
  --surface-high: #2C221E;
  --border: #3B2E29;
  --text: #F3EADF;
  --muted: #BCA99C;
  --faint: #8E7D72;
  --accent: #D46A82;
  --accent-text: #E89AAB;
  --on-accent: #17110F;
  --note: #3A3020;
  --tape: rgba(233, 196, 106, 0.35);
  --shadow: rgba(0, 0, 0, 0.45);
  --line: rgba(232, 154, 171, 0.05);
  --photo-a: #4A2F2A;
  --photo-b: #7A4048;
  --photo-c: #D46A82;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  /* Faint ruled lines, like the app's notebook paper. */
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--line) 31px, var(--line) 32px);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 22px/1 var(--serif); letter-spacing: -0.01em; }
.brand svg { width: 22px; height: auto; }
.nav { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 15px; font-weight: 500; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.header-right { display: flex; align-items: center; gap: clamp(12px, 3vw, 24px); }

/* Light / Auto / Dark */
.mode { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-high); border: 1px solid var(--border); }
.mode button { appearance: none; border: 0; background: transparent; color: var(--faint); width: 30px; height: 26px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out); }
.mode button:hover { color: var(--text); }
.mode button[aria-pressed="true"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px var(--shadow); }
.mode svg { width: 15px; height: 15px; }
body, .card, .badge { transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s var(--ease-out); }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 7vw, 88px) 0 clamp(56px, 9vw, 120px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--accent-text); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; opacity: 0.6; }
h1 {
  margin: 0;
  font: 600 clamp(46px, 7.4vw, 88px)/0.98 var(--serif);
  letter-spacing: -0.035em;
  font-variation-settings: "SOFT" 50;
}
h1 .line { display: block; }
h1 .accent { position: relative; display: inline-block; color: var(--accent-text); font-family: var(--hand); font-weight: 700; font-size: 1.12em; letter-spacing: -0.01em; line-height: 1; padding-right: 0.08em; }
h1 .scribble { position: absolute; left: -2%; right: -4%; bottom: -0.2em; width: 106%; height: 0.32em; overflow: visible; }
h1 .scribble path { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; opacity: 0.55; }
.lead { margin: 26px 0 0; max-width: 34ch; color: var(--muted); font-size: clamp(18px, 1.9vw, 21px); line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 34px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px 13px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
  box-shadow: 0 10px 24px -12px var(--shadow);
}
.badge svg { width: 20px; height: 20px; }
.badge small { display: block; font-weight: 500; font-size: 11px; opacity: 0.7; letter-spacing: 0.02em; }
.cta-note { color: var(--faint); font-size: 14px; }

/* ---------- The scrapbook collage ---------- */
.collage { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1 / 1.3; margin-left: auto; }
.collage > * { position: absolute; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 18px 40px -22px var(--shadow), 0 2px 6px -2px var(--shadow);
}
.tape { position: absolute; width: 74px; height: 22px; background: var(--tape); top: -11px; left: 50%; transform: translateX(-50%) rotate(-3deg); border-radius: 2px; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tape { mix-blend-mode: normal; } }
:root[data-theme="dark"] .tape { mix-blend-mode: normal; }

.polaroid { top: 4%; left: 2%; width: 56%; padding: 12px 12px 0; transform: rotate(-5deg); }
.photo { position: relative; aspect-ratio: 1 / 1; border-radius: 3px; overflow: hidden; background: linear-gradient(180deg, var(--photo-a) 0%, var(--photo-b) 70%, var(--photo-c) 100%); }
.photo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.polaroid figcaption { padding: 10px 4px 14px; text-align: center; font: 700 25px/1.1 var(--hand); color: var(--text); }

.stamp { top: 0; right: 2%; width: 40%; aspect-ratio: 1; display: grid; place-items: center; transform: rotate(8deg); }
.stamp-inner {
  width: 100%; height: 100%; border-radius: 50%;
  border: 2px dashed var(--accent); color: var(--accent-text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 14px 30px -20px var(--shadow);
}
.stamp-inner span { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
.stamp-inner strong { font: 600 clamp(30px, 4.4vw, 46px)/1 var(--serif); letter-spacing: -0.03em; }
.stamp-inner em { font: 700 20px/1 var(--hand); font-style: normal; }

.question { bottom: 0; right: 0; width: 66%; z-index: 1; padding: 18px 20px 16px; transform: rotate(2deg); }
.label { display: block; margin-bottom: 8px; color: var(--accent-text); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.question p { margin: 0 0 14px; font: 600 19px/1.3 var(--serif); letter-spacing: -0.01em; }
.answers { display: grid; gap: 8px; }
.answer { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; background: var(--surface-high); font-size: 13.5px; color: var(--muted); }
.answer b { color: var(--text); font-weight: 600; }
.answer .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.answer .dot.lock { background: transparent; border: 1.5px solid var(--faint); color: var(--faint); }
.answer svg { width: 12px; height: 12px; }

.note { top: 60%; left: -1%; width: 38%; padding: 20px 16px 18px; background: var(--note); border-radius: 3px; transform: rotate(-3deg); box-shadow: 0 16px 30px -20px var(--shadow); font: 700 24px/1.1 var(--hand); color: var(--text); }
.note .tape { width: 56px; }
.note small { display: block; margin-top: 6px; font: 500 12px/1.3 var(--sans); color: var(--muted); }

.example-tag { position: absolute; bottom: -30px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- Sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
h2 { margin: 0; font: 600 clamp(34px, 4.6vw, 54px)/1.04 var(--serif); letter-spacing: -0.03em; }
h2 em { white-space: nowrap; padding-right: 0.08em; font-family: var(--hand); font-style: normal; font-weight: 700; color: var(--accent-text); font-size: 1.12em; }
.section-head p { margin: 18px 0 0; color: var(--muted); font-size: 19px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { position: relative; padding: 26px 24px 24px; }
.feature:nth-child(3n + 1) { transform: rotate(-0.6deg); }
.feature:nth-child(3n + 2) { transform: rotate(0.5deg); }
.feature:nth-child(3n) { transform: rotate(-0.3deg); }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 8px; font: 600 22px/1.2 var(--serif); letter-spacing: -0.015em; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.feature .hand { display: block; margin-top: 12px; font: 700 20px/1.1 var(--hand); color: var(--accent-text); }

/* Private section: a sealed letter. */
.private .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.promise { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.promise li { display: flex; gap: 14px; align-items: flex-start; font-size: 17px; }
.promise li svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--accent-text); }
.envelope { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1.45 / 1; }
.envelope .paper { position: absolute; inset: 4% 6% 22%; padding: 22px 24px; transform: rotate(-2deg); }
.envelope .paper p { margin: 0; font: 700 26px/1.25 var(--hand); }
.envelope .paper p + p { margin-top: 10px; font: 400 14px/1.4 var(--sans); color: var(--muted); }
.envelope .pocket { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; border-radius: 10px; background: var(--surface-high); border: 1px solid var(--border); box-shadow: 0 24px 40px -26px var(--shadow); overflow: hidden; }
.envelope .pocket::before, .envelope .pocket::after { content: ""; position: absolute; top: 0; width: 60%; height: 100%; background: linear-gradient(to bottom right, transparent 49.5%, var(--border) 50%, var(--surface-high) 51%); }
.envelope .pocket::before { left: 0; }
.envelope .pocket::after { right: 0; transform: scaleX(-1); }
.seal { position: absolute; left: 50%; bottom: 30%; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 16px -6px var(--shadow), inset 0 -3px 0 rgba(0, 0, 0, 0.12); z-index: 2; }
.seal svg { width: 26px; height: 26px; color: var(--on-accent); }

/* Closing */
.closing { text-align: center; }
.closing .wrap { display: flex; flex-direction: column; align-items: center; }
.closing .logo-big { width: 64px; margin-bottom: 26px; }
.closing p { max-width: 46ch; color: var(--muted); font-size: 19px; margin: 18px 0 30px; }

/* ---------- Footer ---------- */
.site-footer { padding: 36px 0 48px; border-top: 1px solid var(--border); color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Prose (privacy page) ---------- */
.prose { max-width: 720px; padding-top: clamp(24px, 5vw, 56px); padding-bottom: clamp(64px, 9vw, 112px); }
.prose h1 { font-size: clamp(42px, 6vw, 64px); }
.prose .updated { margin: 14px 0 34px; color: var(--faint); font-size: 15px; }
.prose h2 { margin: 52px 0 14px; font-size: clamp(26px, 3.2vw, 32px); }
.prose p, .prose li { color: var(--text); }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent-text); }
.prose .short { padding: 22px 24px; margin: 0 0 8px; }
.prose .short p:last-child { margin-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; background: var(--surface-high); }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- Motion ---------- */
/* Everything starts visible; JS adds .js so content never hides when scripts are off. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .features .feature.reveal.in:nth-child(3n + 1) { transform: rotate(-0.6deg); }
.js .features .feature.reveal.in:nth-child(3n + 2) { transform: rotate(0.5deg); }
.js .features .feature.reveal.in:nth-child(3n) { transform: rotate(-0.3deg); }

/* Logo: ribbon drops in, heart beats. */
@keyframes ribbon-drop { 0% { transform: translateY(-115%); } 62% { transform: translateY(6%); } 82% { transform: translateY(-2%); } 100% { transform: none; } }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 38% { transform: scale(1); } 54% { transform: scale(1.14); } 74% { transform: scale(1); } }
.logo-anim { overflow: hidden; }
.js .logo-anim .ribbon { animation: ribbon-drop 0.9s var(--ease-out) both; }
.js .logo-anim .heart { transform-box: fill-box; transform-origin: center; animation: heart-beat 0.75s ease-out 0.55s both; }

/* Headline lines rise in. */
@keyframes rise { from { opacity: 0; transform: translateY(0.45em); } to { opacity: 1; transform: none; } }
.js h1 .line { animation: rise 0.9s var(--ease-out) both; }
.js h1 .line:nth-child(2) { animation-delay: 0.12s; }
.js .hero .lead { animation: rise 0.9s var(--ease-out) 0.28s both; }
.js .hero .cta-row { animation: rise 0.9s var(--ease-out) 0.4s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.js h1 .scribble path { animation: draw 1.1s var(--ease-out) 0.85s forwards; }
html:not(.js) h1 .scribble path { stroke-dashoffset: 0; }

/* Collage pieces drop onto the page like things into a scrapbook. */
@keyframes drop-in { from { opacity: 0; transform: translateY(-36px) rotate(var(--r-from)) scale(1.04); } to { opacity: 1; transform: rotate(var(--r)); } }
/* "backwards" so the hover lift below still works once a piece has landed. */
.js .collage > .piece { animation: drop-in 0.95s var(--ease-spring) backwards; }
.polaroid { --r: -5deg; --r-from: -11deg; animation-delay: 0.35s !important; }
.stamp { --r: 8deg; --r-from: 20deg; animation-delay: 0.55s !important; }
.note { --r: -3deg; --r-from: 6deg; animation-delay: 0.75s !important; }
.question { --r: 2deg; --r-from: -5deg; animation-delay: 0.95s !important; }
/* Gentle float once settled (pointer devices only, so phones stay calm). */
@media (hover: hover) {
  .collage > .piece { transition: transform 0.6s var(--ease-out); }
  .collage:hover .polaroid { transform: rotate(-6deg) translate(-4px, -4px); }
  .collage:hover .stamp { transform: rotate(10deg) translate(4px, -2px); }
  .collage:hover .note { transform: rotate(-4deg) translate(-4px, 2px); }
  .collage:hover .question { transform: rotate(1deg) translate(3px, 4px); }
}
@keyframes thump { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.12); } 55% { transform: scale(0.98); } }
.js .seal.in svg { animation: thump 0.8s ease-out 0.5s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  h1 .scribble path { stroke-dashoffset: 0; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .hero .wrap, .private .wrap { grid-template-columns: 1fr; }
  .collage { margin: 8px auto 30px; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav a.hide-sm { display: none; }
  .features { grid-template-columns: 1fr; }
  .feature:nth-child(n) { transform: none !important; }
  .collage { max-width: 380px; aspect-ratio: 1 / 1.5; }
  .note { top: 53%; }
  .question { top: 50%; bottom: auto; }
  .seal { bottom: 26%; }
  .question p { font-size: 17px; }
  .note { font-size: 21px; }
  .polaroid figcaption { font-size: 22px; }
  .stamp-inner em { font-size: 17px; }
}
