/* Heartstrings website. Same palette and type as the app (src/constants/theme.ts). */

:root {
  --bg: #F2E9DC;
  --card: #FFFAF3;
  --border: #E6D8C5;
  --divider: #F0E6D8;
  --text: #3A2A22;
  --muted: #6F5B4E;
  --faint: #8A7666;
  --accent: #A8423A;
  --accent-strong: #8E3A2D;
  --on-accent: #FFFFFF;
  --string: #B5403A;
  --blush: #F1DCD3;
  --sage: #DDE6D6;
  --sage-ink: #2F4A2B;
  --honey: #F3E3BF;
  --honey-ink: #7A5A1E;
  --lilac: #D8CCE0;
  --lilac-ink: #4A3D55;
  --mist: #D9E0E3;
  --mist-ink: #3F4D53;
  --polaroid: #FFFDF8;
  --shadow: rgba(90, 50, 30, 0.16);

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1714;
    --card: #2A211D;
    --border: #3E322B;
    --divider: #342A24;
    --text: #F4EBE0;
    --muted: #C2AFA0;
    --faint: #A08D7E;
    --accent: #D0705E;
    --accent-strong: #E58C7A;
    --string: #D9605A;
    --blush: #4A2E28;
    --sage: #2E3A2B;
    --sage-ink: #C9DCC3;
    --honey: #4A3D22;
    --honey-ink: #E8CF95;
    --lilac: #463D4D;
    --lilac-ink: #DCD0E4;
    --mist: #3A4144;
    --mist-ink: #D5DDE0;
    --polaroid: #33291F;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #1E1714; --card: #2A211D; --border: #3E322B; --divider: #342A24;
  --text: #F4EBE0; --muted: #C2AFA0; --faint: #A08D7E;
  --accent: #D0705E; --accent-strong: #E58C7A; --string: #D9605A;
  --blush: #4A2E28; --sage: #2E3A2B; --sage-ink: #C9DCC3; --honey: #4A3D22; --honey-ink: #E8CF95;
  --lilac: #463D4D; --lilac-ink: #DCD0E4; --mist: #3A4144; --mist-ink: #D5DDE0;
  --polaroid: #33291F; --shadow: rgba(0, 0, 0, 0.45);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Header and footer */

.site-header { padding: 20px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { width: 32px; height: 32px; flex: none; }
.wordmark { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 24px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 20px; font-weight: 700; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.site-footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--border); color: var(--faint); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--text); }

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 16px; text-decoration: none; border: 0; cursor: pointer;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent); }
.button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.button.secondary:hover { background: var(--blush); color: var(--text); }
.button svg { width: 20px; height: 20px; }
.button[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* Landing */

.hero { position: relative; padding: 48px 0 24px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 68px); letter-spacing: -0.02em; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero .lead { margin-top: 20px; font-size: 20px; color: var(--muted); max-width: 30em; }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .note { margin-top: 14px; font-size: 14px; color: var(--faint); }

/* The red string, with polaroids clipped to it. */
.string-scene { position: relative; aspect-ratio: 4 / 5; }
.string-scene svg.string { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.string-scene path { fill: none; stroke: var(--string); stroke-width: 2.5; stroke-linecap: round; }
.polaroid {
  position: absolute; width: 42%; padding: 8px 8px 30px; background: var(--polaroid);
  border-radius: 4px; box-shadow: 0 10px 28px var(--shadow);
}
.polaroid .shot { aspect-ratio: 1; border-radius: 2px; display: grid; place-items: center; }
.polaroid .shot svg { width: 44%; height: 44%; opacity: 0.85; }
.polaroid .caption { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-family: var(--display); font-style: italic; font-size: 14px; color: var(--muted); }
.polaroid::before { /* the peg */
  content: ''; position: absolute; top: -10px; left: 50%; width: 10px; height: 22px; margin-left: -5px;
  border-radius: 3px; background: var(--honey); border: 1px solid var(--border);
}
.p1 { left: 2%; top: 14%; transform: rotate(-6deg); }
.p1 .shot { background: var(--sage); color: var(--sage-ink); }
.p2 { right: 2%; top: 36%; transform: rotate(5deg); }
.p2 .shot { background: var(--lilac); color: var(--lilac-ink); }
.p3 { left: 18%; top: 62%; transform: rotate(-2deg); }
.p3 .shot { background: var(--honey); color: var(--honey-ink); }

.section { padding: 72px 0 0; }
.section-head { max-width: 36em; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(30px, 4.5vw, 42px); letter-spacing: -0.01em; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 18px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 24px; }
.feature .icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 21px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 16px; }
.tone-blush .icon { background: var(--blush); color: var(--accent-strong); }
.tone-sage .icon { background: var(--sage); color: var(--sage-ink); }
.tone-honey .icon { background: var(--honey); color: var(--honey-ink); }
.tone-lilac .icon { background: var(--lilac); color: var(--lilac-ink); }
.tone-mist .icon { background: var(--mist); color: var(--mist-ink); }

.promise { background: var(--card); border: 1px solid var(--border); border-radius: 28px; padding: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.promise h2 { font-size: clamp(28px, 4vw, 38px); }
.promise ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.promise li { display: flex; gap: 12px; align-items: flex-start; }
.promise li svg { flex: none; width: 22px; height: 22px; margin-top: 3px; color: var(--accent); }

.cta { text-align: center; padding: 96px 0 0; }
.cta h2 { font-size: clamp(32px, 5vw, 48px); }
.cta p { margin: 14px auto 28px; color: var(--muted); max-width: 30em; font-size: 18px; }

/* Long-form pages: privacy, support */

.doc { padding: 32px 0 0; }
.doc h1 { font-size: clamp(36px, 6vw, 52px); letter-spacing: -0.02em; }
.doc .meta { margin-top: 10px; color: var(--faint); font-size: 15px; }
.doc .intro { margin-top: 20px; font-size: 19px; color: var(--muted); }
.doc h2 { font-size: 28px; margin: 48px 0 14px; scroll-margin-top: 24px; }
.doc h3 { font-size: 21px; margin: 28px 0 8px; scroll-margin-top: 24px; }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 22px; margin: 12px 0; }
.doc li + li { margin-top: 8px; }
.doc .callout { margin-top: 24px; background: var(--honey); color: var(--honey-ink); border-radius: 18px; padding: 16px 20px; font-size: 16px; }
.toc { margin-top: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px 22px; }
.toc p { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; margin-top: 4px; }

.table-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--divider); }
th { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; }

details.faq { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 0 20px; }
details.faq + details.faq { margin-top: 10px; }
details.faq summary { cursor: pointer; padding: 16px 0; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--accent); }
details.faq[open] summary::after { content: '–'; }
details.faq > div { padding: 0 0 18px; color: var(--muted); }
details.faq > div p + p { margin-top: 10px; }

.contact-card { margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.contact-card p { color: var(--muted); }
.contact-card strong { color: var(--text); display: block; font-size: 19px; }

/* Invite page */

.invite { min-height: 70vh; display: grid; place-items: center; padding: 32px 0; text-align: center; }
.invite .card { background: var(--card); border: 1px solid var(--border); border-radius: 28px; padding: 36px 24px; max-width: 460px; width: 100%; }
.invite h1 { font-size: 34px; }
.invite p { color: var(--muted); margin-top: 10px; }
.code { margin: 24px auto 8px; font-family: var(--display); font-size: 44px; letter-spacing: 0.18em; padding-left: 0.18em; color: var(--accent-strong); }
.invite .actions { display: grid; gap: 10px; margin-top: 24px; }
.invite ol { text-align: left; color: var(--muted); margin: 24px 0 0; padding-left: 22px; font-size: 16px; }
.invite ol li + li { margin-top: 6px; }

/* Phone width */

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .string-scene { max-width: 340px; width: 100%; margin: 0 auto; }
  .features { grid-template-columns: 1fr 1fr; }
  .promise { grid-template-columns: 1fr; padding: 28px 22px; }
  .toc ol { columns: 1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 14px; font-size: 14px; }
  .wordmark { font-size: 21px; }
  .features { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
  .hero .actions .button { width: 100%; }
  .section { padding-top: 56px; }
}

@media (prefers-reduced-motion: no-preference) {
  .string-scene path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.2s ease-out 0.2s forwards; }
  .polaroid { animation: settle 0.9s ease-out both; }
  .p1 { animation-delay: 0.5s; } .p2 { animation-delay: 0.9s; } .p3 { animation-delay: 1.3s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes settle { from { opacity: 0; translate: 0 -14px; } to { opacity: 1; translate: 0 0; } }
}
