/* Palettale web site — tokens mirror the app (Models/Theme.swift, DesignSystem/DS.swift). */
:root {
  --bg: #FBF5EC;          /* cream paper */
  --paper: #FFFDF9;       /* cards */
  --ink: #3E2F2A;         /* cocoa text */
  --ink-soft: #7A6A62;    /* darker than the app's 8C7B72 for AA contrast on cream */
  --tint: #EC7A5C;        /* peach coral */
  --tint-ink: #C4553A;    /* coral dark enough for text */
  --tint-soft: #FBE0D6;
  --blush: #F6B8BE;
  --butter: #F6D58E;
  --sage: #A9C6A1;
  --sky: #A8CBE6;
  --lavender: #C9B8E8;
  --peach: #F7C2A2;
  --line: rgba(62, 47, 42, 0.10);
  --shadow: 0 12px 32px rgba(107, 74, 58, 0.10), 0 2px 6px rgba(107, 74, 58, 0.06);
  --aurora-1: #F6D7CB;
  --aurora-2: #E9DCF4;
  --aurora-3: #DCE8F2;

  --s-xxs: 4px; --s-xs: 8px; --s-s: 12px; --s-m: 16px; --s-l: 24px; --s-xl: 32px; --s-xxl: 48px;
  --r-s: 10px; --r-m: 16px; --r-l: 22px; --r-xl: 30px;

  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1815;
    --paper: #2B221E;
    --ink: #F6ECE2;
    --ink-soft: #C9B8AD;
    --tint-ink: #F49A80;
    --tint-soft: #4A2E25;
    --line: rgba(246, 236, 226, 0.12);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
    --aurora-1: #4A2E25;
    --aurora-2: #362C45;
    --aurora-3: #23333F;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tint-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--s-s); font-weight: 800; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--s-m); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Ambient pastel blobs, echoing AuroraBackground.swift */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(60px); opacity: 0.55; animation: drift 24s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--aurora-1); top: -25vmax; left: 10vw; }
.aurora span:nth-child(2) { background: var(--aurora-2); top: 20vh; left: -30vmax; animation-delay: -8s; }
.aurora span:nth-child(3) { background: var(--aurora-3); bottom: -30vmax; right: -15vmax; animation-delay: -16s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s-m); min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 46px; }
.nav { display: flex; align-items: center; gap: var(--s-xs); }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--tint-soft); }
.nav a[aria-current="page"] { color: var(--tint-ink); background: var(--tint-soft); }
.nav .lang { border: 1.5px solid var(--line); }
.menu-btn {
  display: none; background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px;
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 68px; left: 16px; right: 16px; flex-direction: column; align-items: stretch;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-xs); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; }
}

/* Rainbow wordmark (RootView.swift → Wordmark) */
.wordmark { font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; line-height: 1; }
.wordmark span { display: inline-block; text-shadow: 0 0.05em 0 color-mix(in srgb, currentColor 25%, transparent); }
.wordmark span:nth-child(1), .wordmark span:nth-child(9) { color: #EC7A5C; }
.wordmark span:nth-child(2) { color: #F2A65A; }
.wordmark span:nth-child(3) { color: #E2B13C; }
.wordmark span:nth-child(4) { color: #7FB069; }
.wordmark span:nth-child(5) { color: #5BA8A0; }
.wordmark span:nth-child(6) { color: #6C9BD2; }
.wordmark span:nth-child(7) { color: #9B87D0; }
.wordmark span:nth-child(8) { color: #E57FA6; }
.brand .wordmark { font-size: 1.6rem; }

/* Buttons & pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px; border-radius: 999px; font: inherit; font-weight: 800;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform 160ms cubic-bezier(.2,.8,.2,1), box-shadow 160ms;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--tint); color: #fff; box-shadow: 0 8px 20px rgba(236, 122, 92, 0.35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(236, 122, 92, 0.45); }
.btn-soon { background: var(--ink); color: var(--bg); cursor: default; }
.btn-soon small { display: block; font-size: 0.72rem; font-weight: 700; opacity: 0.75; line-height: 1.1; }
.btn-soon span { display: block; line-height: 1.15; text-align: left; }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--tint-soft); color: var(--tint-ink); font-weight: 800; font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 .wordmark { display: block; font-size: 1.15em; margin-bottom: 10px; }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 34ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--s-s); margin: var(--s-l) 0 var(--s-s); }
.hero .fine { color: var(--ink-soft); font-size: 0.92rem; }
.hero-art { position: relative; }
.hero-art .pip-float { position: absolute; width: 150px; left: -48px; bottom: -28px; filter: drop-shadow(0 10px 18px rgba(107,74,58,.18)); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; margin-inline: auto; }
  .hero-art .pip-float { width: 110px; left: -8px; bottom: -24px; }
}

/* iPad frame */
.device {
  background: #241C19; padding: clamp(8px, 1.2vw, 12px); border-radius: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow), 0 30px 60px rgba(107, 74, 58, 0.18);
  transform: rotate(1.5deg);
}
.device img { border-radius: clamp(14px, 2vw, 22px); aspect-ratio: 3 / 4; width: 100%; object-fit: cover; }
.device.tilt-left { transform: rotate(-1.5deg); }
@media (prefers-reduced-motion: no-preference) {
  .device { transition: transform 400ms cubic-bezier(.2,.8,.2,1); }
  .device:hover { transform: rotate(0deg) translateY(-4px); }
}

/* Sections */
section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto var(--s-xxl); }
.section-head p { color: var(--ink-soft); font-size: 1.12rem; }
.section-head .pill { margin-bottom: var(--s-s); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-m); }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: var(--s-l); box-shadow: var(--shadow);
}
.card p { color: var(--ink-soft); margin: 0; }
.icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: var(--s-m);
  color: #3E2F2A;
}
.icon svg { width: 26px; height: 26px; }
.bg-blush { background: var(--blush); } .bg-butter { background: var(--butter); }
.bg-sage { background: var(--sage); } .bg-sky { background: var(--sky); }
.bg-lavender { background: var(--lavender); } .bg-peach { background: var(--peach); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split + .split { margin-top: clamp(64px, 9vw, 120px); }
.split.reverse .split-art { order: -1; }
.split-art { max-width: 480px; justify-self: center; width: 100%; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-art { order: 0; }
}
.split p { color: var(--ink-soft); font-size: 1.1rem; }
.ticks { list-style: none; padding: 0; margin: var(--s-l) 0 0; display: grid; gap: var(--s-s); }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li::before {
  content: ""; flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233E2F2A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s-m); padding: 0; list-style: none; }
.chips li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.92rem; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-m); align-items: stretch; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan .price { font-size: 2.5rem; font-weight: 900; line-height: 1; margin: var(--s-s) 0 4px; }
.plan .price small { font-size: 1rem; font-weight: 700; color: var(--ink-soft); }
.plan .per { color: var(--ink-soft); font-size: 0.95rem; min-height: 1.6em; }
.plan ul { margin: var(--s-m) 0 0; }
.plan.best { border: 2.5px solid var(--tint); }
.plan .flag {
  position: absolute; top: -14px; right: 20px; background: var(--butter); color: #3E2F2A;
  font-weight: 800; font-size: 0.8rem; padding: 4px 12px; border-radius: 999px; transform: rotate(3deg);
}
.price-note { max-width: 680px; margin-inline: auto; text-align: center; color: var(--ink-soft); font-size: 0.92rem; margin-top: var(--s-l); }

/* FAQ */
.faq { max-width: 760px; margin-inline: auto; display: grid; gap: var(--s-s); }
.faq h2 { font-size: 1.5rem; margin: var(--s-l) 0 var(--s-xxs); }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 0 var(--s-l); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 800; padding: 18px 0; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--tint-ink); transition: transform 200ms; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding-bottom: 18px; color: var(--ink-soft); }
.faq details > div p:last-child { margin-bottom: 0; }

/* CTA band */
.cta {
  text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(32px, 6vw, 64px) var(--s-l); box-shadow: var(--shadow);
}
.cta img { width: 120px; margin: 0 auto var(--s-m); }
.cta p { color: var(--ink-soft); }

/* Legal / support pages */
.page-head { padding: clamp(40px, 7vw, 80px) 0 var(--s-l); text-align: center; }
.page-head img { width: 110px; margin: 0 auto var(--s-m); }
.page-head p { color: var(--ink-soft); }
.prose { max-width: 740px; margin-inline: auto; padding-bottom: var(--s-xxl); }
.prose h2 { font-size: 1.5rem; margin-top: var(--s-xl); }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 6px; }
.prose .summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-l); box-shadow: var(--shadow); }
.prose .summary ul { margin: 0; }
.prose .summary h2 { margin-top: 0; }
.muted { color: var(--ink-soft); }
.contact-card { text-align: center; max-width: 560px; margin: 0 auto var(--s-xxl); }
.contact-card .btn { margin-top: var(--s-s); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: var(--s-xl) 0; margin-top: var(--s-xl); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s-m); align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-xs) var(--s-l); }
.site-footer a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--tint-ink); }
.site-footer p { margin: 0; color: var(--ink-soft); }

/* 404 */
.notfound { text-align: center; padding: clamp(64px, 12vw, 140px) 0; }
.notfound img { width: 180px; margin: 0 auto var(--s-l); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora span { animation: none; }
  .device, .device.tilt-left { transform: none; }
}
