/* Snapflick website. Colours and fonts follow the app (Theme.swift): warm paper, ink,
   a tangerine accent, SF Rounded headings. Motion follows the app's Motion constants:
   soft springs, a "wave" entrance, nothing that jumps. Everything is plain CSS: no scripts. */

:root {
  --paper: #F6EFE4;
  --surface: #FFFBF5;
  --sunken: #EFE5D6;
  --ink: #2B2320;
  --muted: #7A6E65;
  --accent: #E8702C;
  --accent-ink: #FFFFFF;
  --keep: #3F9E6E;
  --delete: #E0474C;
  --later: #E9A620;
  --star: #F5B301;
  --line: rgba(43, 35, 32, 0.10);
  --shadow: 0 1px 2px rgba(43, 35, 32, 0.06), 0 12px 32px -12px rgba(43, 35, 32, 0.22);

  /* The app's Motion.smooth / Motion.pop / Motion.press, as curves. */
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --press: cubic-bezier(0.3, 0.7, 0.4, 1.4);

  --radius: 22px;
  --page: 1040px;
  --gutter: clamp(18px, 5vw, 40px);
  --tabbar: 0px;

  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1916;
    --surface: #25211D;
    --sunken: #2E2924;
    --ink: #F3EAE0;
    --muted: #A89C90;
    --accent: #FF8A45;
    --accent-ink: #1C1916;
    --keep: #52B883;
    --delete: #F2606A;
    --later: #F0B84A;
    --star: #FFC83D;
    --line: rgba(243, 234, 224, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

/* Cross-page transitions: pages cross-fade, the header and tab bar stay put. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: var(--smooth); }
.top { view-transition-name: header; }
.tabbar { view-transition-name: tabbar; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: var(--tabbar);
}

h1, h2, h3, .brand span, .eyebrow, .stamp {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, sans-serif;
}
h1 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; margin: 0; text-wrap: balance; }
h2 { font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-weight: 700; margin: 0; font-size: 1.05rem; }
p { margin: 0 0 0.9em; text-wrap: pretty; }

a { color: var(--accent); text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* MARK: Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.12rem; margin-right: auto; }
.brand img { border-radius: 9px; transition: transform 0.45s var(--pop); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }

.nav-desktop { display: flex; gap: 6px; }
.nav-desktop a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 7px 14px;
  border-radius: 999px;
  transition: color 0.25s var(--smooth), background-color 0.25s var(--smooth);
}
.nav-desktop a:hover { color: var(--ink); background: var(--sunken); }
.nav-desktop a[aria-current="page"] { color: var(--ink); background: var(--sunken); }

.lang {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: background-color 0.25s var(--smooth), transform 0.3s var(--press);
}
.lang:hover { background: var(--sunken); }
.lang:active { transform: scale(0.94); }

main { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 40px; }

/* MARK: Entrance ("wave", like appearAnimation in the app) */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.rise { animation: rise 0.8s var(--smooth) both; }
.d1 { animation-delay: 0.04s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.2s; }
.d4 { animation-delay: 0.28s; }
.d5 { animation-delay: 0.36s; }

/* Blocks further down appear as they scroll into view, where the browser supports it. */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

/* MARK: Home: hero */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 7vw, 80px);
}
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); margin: 18px 0 28px; max-width: 32em; }

.cta { display: flex; align-items: center; min-height: 52px; }
.badge { display: inline-block; border-radius: 12px; transition: transform 0.35s var(--press), filter 0.25s; }
.badge img { display: block; height: 52px; width: auto; }
.badge:hover { transform: translateY(-2px); }
.badge:active { transform: scale(0.95); }
.soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.97rem;
}
.soon .icon { color: var(--star); }

.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: 0.95rem; }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust .icon { color: var(--keep); width: 1.1em; height: 1.1em; }

/* The card stack: the app's BrandMark, in CSS. The front card swipes right, the KEEP
   stamp shows at the peak, then it settles back; the cards behind breathe. */
.stack { position: relative; width: min(100%, 340px); aspect-ratio: 200 / 250; justify-self: center; }
.card {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.card.back { background: var(--surface); border: 1px solid var(--line); }
.card.back.two { transform: rotate(-9deg) translate(-7%, 3%) scale(0.92); background: var(--sunken); animation: breathe-two 3.6s var(--smooth) infinite; }
.card.back.one { transform: rotate(-4deg) translate(-3%, 1%) scale(0.96); animation: breathe-one 3.6s var(--smooth) infinite; }
.card.front { overflow: hidden; transform-origin: 50% 110%; animation: swipe 3.6s var(--smooth) infinite; }
.photo { display: block; width: 100%; height: 100%; }
.sky { fill: #F9C38E; }
.sun { fill: #FFF3D6; }
.hill.far { fill: #7FBF8E; }
.hill.near { fill: #4E9E6D; }
@media (prefers-color-scheme: dark) {
  .sky { fill: #D9884F; }
  .sun { fill: #FFE2B0; }
  .hill.far { fill: #4F8F62; }
  .hill.near { fill: #36744F; }
}
.stamp {
  position: absolute;
  top: 9%;
  left: 8%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 3.5px solid var(--keep);
  border-radius: 14px;
  color: var(--keep);
  background: color-mix(in srgb, #FFFFFF 88%, transparent);
  font-weight: 900;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.04em;
  transform: rotate(-14deg) scale(0.7);
  opacity: 0;
  animation: stamp 3.6s var(--smooth) infinite;
}
.stamp .icon { stroke-width: 3; }

@keyframes swipe {
  0%, 12% { transform: none; }
  38%, 52% { transform: translateX(14%) rotate(8deg); }
  78%, 100% { transform: none; }
}
@keyframes stamp {
  0%, 18% { opacity: 0; transform: rotate(-14deg) scale(0.7); }
  38%, 52% { opacity: 1; transform: rotate(-14deg) scale(1); }
  70%, 100% { opacity: 0; transform: rotate(-14deg) scale(0.85); }
}
@keyframes breathe-one {
  0%, 12%, 78%, 100% { transform: rotate(-4deg) translate(-3%, 1%) scale(0.96); }
  38%, 52% { transform: rotate(-2deg) translate(-1%, 0) scale(0.99); }
}
@keyframes breathe-two {
  0%, 12%, 78%, 100% { transform: rotate(-9deg) translate(-7%, 3%) scale(0.92); }
  38%, 52% { transform: rotate(-6deg) translate(-4%, 2%) scale(0.95); }
}

/* MARK: Home: blocks */

.block { padding: clamp(36px, 6vw, 64px) 0; border-top: 1px solid var(--line); }
.block > h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: clamp(22px, 3vw, 36px); }

.gestures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.gesture {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.45s var(--pop), border-color 0.3s var(--smooth);
}
.gesture:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.gesture p { color: var(--muted); margin: 4px 0 0; font-size: 0.97rem; }
.g-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  transition: transform 0.45s var(--pop);
}
.g-icon .icon { width: 24px; height: 24px; stroke-width: 2; }
.gesture:hover .g-icon { transform: translate(var(--nudge-x, 0), var(--nudge-y, 0)); }
.tone-keep { --tone: var(--keep); --nudge-x: 4px; }
.tone-delete { --tone: var(--delete); --nudge-x: -4px; }
.tone-later { --tone: var(--later); --nudge-y: -4px; }
.tone-star { --tone: var(--star); --nudge-y: 4px; }

.collections { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.collections li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.97rem;
  transition: transform 0.45s var(--pop), background-color 0.3s var(--smooth);
}
.collections li:hover { transform: translateY(-2px); background: var(--sunken); }
.collections .icon { color: var(--accent); width: 22px; height: 22px; }

.privacy-band { display: flex; gap: clamp(18px, 3vw, 28px); align-items: flex-start; }
.privacy-band h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 10px; }
.privacy-band p { color: var(--muted); max-width: 36em; }
.band-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  color: var(--keep);
  background: color-mix(in srgb, var(--keep) 14%, transparent);
}
.band-icon .icon { width: 30px; height: 30px; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.more .icon { transition: transform 0.35s var(--pop); }
.more:hover .icon { transform: translateX(4px); }

/* MARK: Documents */

.doc { max-width: 720px; padding-top: clamp(32px, 6vw, 64px); }
.doc h1 { font-size: clamp(1.8rem, 4.6vw, 2.7rem); }
.updated { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }
.doc .lead { font-size: 1.1rem; margin: 18px 0 8px; }
.body h2 { font-size: 1.2rem; margin: 2.2em 0 0.6em; }
.body p, .body li { color: var(--muted); }
.body ul { padding-left: 1.25em; margin: 0 0 1em; }
.body li { margin: 0.35em 0; }
.body li::marker { color: var(--accent); }
.body a { overflow-wrap: anywhere; }

.toc {
  margin: 28px 0 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.toc-title { font-weight: 700; margin-bottom: 8px; font-size: 0.95rem; }
.toc ol { list-style: none; margin: 0; padding: 0; columns: 2 240px; column-gap: 28px; font-size: 0.95rem; }
.toc li { margin: 0.3em 0; break-inside: avoid; }
.toc a { color: var(--muted); transition: color 0.2s var(--smooth); }
.toc a:hover { color: var(--accent); }

/* FAQ: answers open smoothly where the browser can animate to height: auto. */
.faq { margin-top: 28px; display: grid; gap: 10px; }
details {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--smooth);
}
details[open] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
summary::-webkit-details-marker { display: none; }
summary .icon { color: var(--muted); transition: transform 0.45s var(--pop); }
details[open] summary .icon { transform: rotate(180deg); color: var(--accent); }
.answer { padding: 0 20px 6px; }
.answer p { color: var(--muted); }
details::details-content {
  block-size: 0;
  overflow: clip;
  opacity: 0;
  transition: block-size 0.45s var(--smooth), opacity 0.3s var(--smooth), content-visibility 0.45s allow-discrete;
}
details[open]::details-content { block-size: auto; opacity: 1; }

.contact { margin-top: 32px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform 0.35s var(--press), box-shadow 0.3s var(--smooth);
  -webkit-tap-highlight-color: transparent;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: scale(0.95); }
.note { color: var(--muted); font-size: 0.9rem; margin-top: 12px; }

/* MARK: Footer */

.bottom {
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}
.bottom a { color: var(--muted); transition: color 0.2s; }
.bottom a:hover { color: var(--ink); }

/* MARK: Phone: floating tab bar (like the app's statistics bar) */

.tabbar { display: none; }

@media (max-width: 760px) {
  :root { --tabbar: calc(92px + env(safe-area-inset-bottom)); }
  body { font-size: 16px; }
  .nav-desktop { display: none; }
  .bar { padding-top: 10px; padding-bottom: 10px; }

  .tabbar {
    display: flex;
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 440px);
    padding: 6px;
    border-radius: 26px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: saturate(1.6) blur(20px);
    -webkit-backdrop-filter: saturate(1.6) blur(20px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    animation: tabbar-in 0.7s var(--pop) 0.2s both;
  }
  .tabbar a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px 7px;
    border-radius: 20px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.25s var(--smooth), background-color 0.25s var(--smooth), transform 0.3s var(--press);
  }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .icon { width: 23px; height: 23px; }
  .tabbar a:active { transform: scale(0.92); }
  .tabbar a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 28px; gap: 36px; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .cta, .trust { justify-content: center; }
  .stack { width: min(64vw, 260px); grid-row: 1; }
  .gestures { grid-template-columns: 1fr; }
  .collections { grid-template-columns: repeat(2, 1fr); }
  .collections li { padding: 12px 14px; font-size: 0.92rem; }
  .privacy-band { flex-direction: column; }
  .bottom { padding-bottom: 24px; }
}

@keyframes tabbar-in {
  from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%); }
}

/* Respect Reduce Motion: no movement, content simply shows. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .stamp { opacity: 1; transform: rotate(-14deg); }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
