/* Papela site. Tokens mirror the app's design spec (docs/design.md, ui/theme/Tokens.kt).
   Layout: a calm paper page; the app itself (a live chat screen) is the hero, the privacy fact is the one dark pine band. */
@font-face {
  font-family: "Rubik";
  src: url("fonts/rubik.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --paper: #FAF8F4;
  --canvas: #F2EEE6;
  --raised: #FFFFFF;
  --sunken: #EEEBE4;
  --ink: #1A1D1B;
  --ink-muted: #57615B;
  --ink-subtle: #646D67;
  --accent: #1E6A50;
  --accent-container: #1E6A50;
  --on-accent: #FFFFFF;
  --accent-soft: #E1EEE6;
  --bubble: #D3EADA;
  --bubble-ink: #13201A;
  --bubble-meta: #4A6457;
  --bubble-accent: #1E6A50;
  --chip: rgba(255, 255, 255, .88);
  --divider: #E7E3DA;
  --snooze: #93590A;
  --snooze-soft: #F6E7CC;
  --archive: #1E6A50;
  --archive-soft: #D5E9DC;
  --band: #14493A;
  --band-2: #1E6A50;
  --band-ink: #F1FBF5;
  --band-muted: #B9DCC9;
  --shadow-soft: 0 1px 2px rgba(26, 29, 27, .06), 0 4px 14px rgba(26, 29, 27, .06);
  --shadow-float: 0 2px 6px rgba(26, 29, 27, .08), 0 18px 48px rgba(20, 73, 58, .16);
  --phone-frame: #1A1D1B;

  --font: "Rubik", "Segoe UI", "Arial Hebrew", system-ui, sans-serif;
  --step-display: clamp(2.4rem, 1.6rem + 3.4vw, 4.1rem);
  --step-h2: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  --step-h3: 1.2rem;
  --step-lead: clamp(1.08rem, 1rem + .35vw, 1.25rem);
  --step-body: 1rem;
  --step-small: .875rem;
  --radius-card: 20px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111413; --canvas: #0C0F0E; --raised: #1A1E1C; --sunken: #1C211F;
    --ink: #E9EDEA; --ink-muted: #A5AFA9; --ink-subtle: #8C958F;
    --accent: #7CCFA4; --accent-container: #2F7F5F; --on-accent: #F1FBF5; --accent-soft: #1B2E25;
    --bubble: #1F3A2E; --bubble-ink: #E6EFE9; --bubble-meta: #9BBBAA; --bubble-accent: #8FD8B2;
    --chip: rgba(26, 30, 28, .92); --divider: #232826;
    --snooze: #E2A64B; --snooze-soft: #33281A; --archive: #7CCFA4; --archive-soft: #1B2E25;
    --band: #0F2A21; --band-2: #17402F; --band-ink: #E6EFE9; --band-muted: #9BBBAA;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    --shadow-float: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .5);
    --phone-frame: #2A302D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111413; --canvas: #0C0F0E; --raised: #1A1E1C; --sunken: #1C211F;
  --ink: #E9EDEA; --ink-muted: #A5AFA9; --ink-subtle: #8C958F;
  --accent: #7CCFA4; --accent-container: #2F7F5F; --on-accent: #F1FBF5; --accent-soft: #1B2E25;
  --bubble: #1F3A2E; --bubble-ink: #E6EFE9; --bubble-meta: #9BBBAA; --bubble-accent: #8FD8B2;
  --chip: rgba(26, 30, 28, .92); --divider: #232826;
  --snooze: #E2A64B; --snooze-soft: #33281A; --archive: #7CCFA4; --archive-soft: #1B2E25;
  --band: #0F2A21; --band-2: #17402F; --band-ink: #E6EFE9; --band-muted: #9BBBAA;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-float: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .5);
  --phone-frame: #2A302D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 21; background: var(--paper);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.25rem; }
.brand img { width: 34px; height: 34px; display: block; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a:not(.btn) { color: var(--ink-muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px;
  font: 500 1rem/1 var(--font);
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent-container); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-container) 88%, #000); }
.btn-quiet { color: var(--accent); background: var(--accent-soft); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .92rem; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Hero */
.hero { padding-block: 40px 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 500; font-size: .95rem; letter-spacing: .01em;
  margin-bottom: 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: var(--step-display); line-height: 1.08; font-weight: 600; max-width: 13ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: var(--step-lead); color: var(--ink-muted); line-height: 1.65; max-width: 46ch; margin-top: 22px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.fine { color: var(--ink-subtle); font-size: var(--step-small); margin-top: 18px; }

/* Phone */
.phone-stage { display: flex; justify-content: center; position: relative; }
.phone-stage::before {
  content: ""; position: absolute; inset: 8% -4% 4%;
  background: radial-gradient(60% 55% at 50% 50%, var(--accent-soft), transparent 70%);
  z-index: 0;
}
.phone {
  position: relative; z-index: 1;
  width: 100%; max-width: 340px;
  aspect-ratio: 9 / 18.6;
  border-radius: 46px;
  padding: 10px;
  background: var(--phone-frame);
  box-shadow: var(--shadow-float);
}
.screen {
  height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--canvas);
  display: flex; flex-direction: column;
  font-size: 15px; line-height: 1.45;
}
.statusbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px 4px; background: var(--paper); font-size: 12px; font-weight: 500; color: var(--ink); direction: ltr; }
.statusbar .icons { display: flex; gap: 5px; align-items: center; }
.statusbar .icons i { display: block; width: 14px; height: 9px; border-radius: 2px; background: var(--ink); opacity: .85; }
.statusbar .icons i:first-child { width: 10px; border-radius: 50% 50% 2px 2px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; background: var(--paper); border-bottom: 1px solid var(--divider); }
.topbar .back { width: 22px; height: 22px; color: var(--ink); flex: none; transform: scaleX(-1); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: #E3D9F0; color: #4B3A6B;
  font-weight: 500; font-size: 14px;
}
:root[data-theme="dark"] .avatar { background: #2D2640; color: #CFC3EA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: #2D2640; color: #CFC3EA; } }
.who { flex: 1; min-width: 0; }
.who b { display: block; font-weight: 500; font-size: 16px; line-height: 1.2; }
.who span { font-size: 12px; color: var(--ink-subtle); }
.topbar .act { width: 22px; height: 22px; color: var(--accent); flex: none; }

.thread { flex: 1; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; justify-content: flex-end; }
.chip { align-self: center; background: var(--chip); color: var(--ink-muted); font-size: 11.5px; font-weight: 500; letter-spacing: .03em; padding: 3px 12px; border-radius: 999px; margin-block: 8px 6px; box-shadow: 0 0 0 1px var(--divider); }
.bubble {
  align-self: flex-end;           /* RTL: end = left, the "sender" side */
  max-width: 80%;
  background: var(--bubble); color: var(--bubble-ink);
  padding: 7px 11px 6px;
  border-radius: 18px;
  border-end-end-radius: 6px; border-start-end-radius: 6px;
}
.bubble.first { border-start-end-radius: 18px; }
.bubble.last { border-end-end-radius: 4px; }
.bubble.solo { border-radius: 18px; border-end-end-radius: 4px; }
.bubble .t { display: inline; }
.bubble time { float: left; margin: 7px 10px 0 0; font-size: 11px; color: var(--bubble-meta); direction: ltr; }
.bubble .ret { display: flex; align-items: center; gap: 4px; color: var(--bubble-accent); font-size: 11.5px; font-weight: 500; margin-bottom: 2px; }
.bubble .ret svg { width: 13px; height: 13px; }
.bubble.arrive { animation: arrive .7s cubic-bezier(.2, .8, .2, 1) .5s both; }
@keyframes arrive { from { transform: translateY(14px) scale(.96); opacity: .35; } to { transform: none; opacity: 1; } }

.inputbar { display: flex; gap: 8px; align-items: center; padding: 8px 10px 14px; }
.inputbar .field { flex: 1; min-height: 42px; border-radius: 24px; background: var(--raised); box-shadow: var(--shadow-soft); color: var(--ink-subtle); display: flex; align-items: center; padding: 0 16px; font-size: 14.5px; }
.inputbar .send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-container); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.inputbar .send svg { width: 19px; height: 19px; transform: scaleX(-1); }

/* Sections */
section { scroll-margin-top: 80px; }
.section { padding-block: 88px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: var(--step-h2); line-height: 1.15; font-weight: 600; }
.section-head p { color: var(--ink-muted); font-size: var(--step-lead); margin-top: 14px; }

/* Steps: a real sequence, so numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--divider); padding-top: 20px; }
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: .95rem; margin-bottom: 16px;
}
.steps h3 { font-size: var(--step-h3); font-weight: 500; margin-bottom: 6px; }
.steps p { color: var(--ink-muted); }

/* Feature rows */
.features { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature {
  background: var(--raised);
  border-radius: var(--radius-card);
  padding: 28px;
  display: grid; grid-template-rows: auto 1fr; gap: 24px;
  min-width: 0;
}
.feature.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; align-items: center; gap: 40px; }
.feature h3 { font-size: 1.35rem; font-weight: 500; line-height: 1.3; margin-bottom: 8px; }
.feature p { color: var(--ink-muted); }
.demo { background: var(--canvas); border-radius: 16px; padding: 18px; min-width: 0; }

/* Snooze sheet demo */
.sheet { background: var(--paper); border-radius: 20px 20px 14px 14px; padding: 10px 14px 14px; box-shadow: var(--shadow-soft); max-width: 360px; margin-inline: auto; }
.sheet .handle { width: 36px; height: 4px; border-radius: 4px; background: var(--divider); margin: 0 auto 12px; }
.sheet .label { font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--ink-subtle); margin: 0 4px 8px; }
.group { background: var(--raised); border-radius: 16px; overflow: hidden; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; }
.opt + .opt { border-top: 1px solid var(--divider); }
.opt svg { width: 20px; height: 20px; color: var(--snooze); flex: none; }
.opt span { flex: 1; }
.opt time { color: var(--ink-subtle); font-variant-numeric: tabular-nums; font-size: 14px; direction: ltr; }
.opt.on { background: var(--snooze-soft); }
.opt.on time { color: var(--snooze); font-weight: 500; }

/* Swipe demo */
.swipe { position: relative; border-radius: 16px; overflow: hidden; background: var(--archive-soft); }
.swipe .under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-inline: 20px; color: var(--archive); gap: 8px; font-weight: 500; font-size: 14px; }
.swipe .under svg { width: 22px; height: 22px; }
.swipe .row { position: relative; display: flex; justify-content: flex-end; align-items: center; background: var(--canvas); padding: 14px 12px; transform: translateX(30%); animation: swipe 5s ease-in-out 1s infinite; }
@keyframes swipe { 0%, 15% { transform: translateX(0); } 35%, 70% { transform: translateX(30%); } 90%, 100% { transform: translateX(0); } }
.swipe .row .avatar { width: 40px; height: 40px; background: #D6E6EE; color: #2D5466; }
.swipe .row b { display: block; font-weight: 500; font-size: 15px; }
.swipe .row small { color: var(--ink-muted); font-size: 13px; }

/* Call / WhatsApp demo */
.contact-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pill-act { display: inline-flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 999px; padding: 10px 16px; font-size: 14.5px; font-weight: 500; color: var(--ink); box-shadow: var(--shadow-soft); }
.pill-act svg { width: 18px; height: 18px; color: var(--accent); }

/* Lock-screen demo */
.lock { background: linear-gradient(160deg, #24302B, #121816); border-radius: 16px; padding: 22px 16px 18px; color: #EEF2EF; }
.lock .clock { text-align: center; font-size: 34px; font-weight: 300; letter-spacing: .02em; direction: ltr; }
.lock .date { text-align: center; font-size: 12px; opacity: .7; margin-bottom: 16px; }
.notif { background: rgba(255, 255, 255, .12); border-radius: 16px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.notif img { width: 26px; height: 26px; border-radius: 7px; }
.notif b { display: block; font-size: 13px; font-weight: 500; }
.notif span { font-size: 12.5px; opacity: .8; }

/* Privacy band */
.band { background: linear-gradient(150deg, var(--band-2), var(--band)); color: var(--band-ink); }
.band .wrap { padding-block: 88px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.band h2 { font-size: var(--step-h2); line-height: 1.15; font-weight: 600; }
.band .big { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); line-height: 1.5; color: var(--band-muted); margin-top: 16px; max-width: 34ch; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-radius: var(--radius-card); overflow: hidden; }
.facts li { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: rgba(255, 255, 255, .07); }
.facts svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--band-muted); }
.facts b { display: block; font-weight: 500; }
.facts span { color: var(--band-muted); font-size: .95rem; }
.band a { color: var(--band-ink); }

/* Closing CTA */
.closing { text-align: center; }
.closing .wrap { padding-block: 96px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.closing img { width: 72px; height: 72px; }
.closing h2 { font-size: var(--step-h2); font-weight: 600; }
.closing p { color: var(--ink-muted); max-width: 44ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--divider); }
.site-footer .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--ink-subtle); font-size: var(--step-small); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Legal pages */
.legal { padding-block: 48px 88px; }
.legal article { max-width: 68ch; }
.legal h1 { font-size: var(--step-h2); font-weight: 600; line-height: 1.15; }
.legal .updated { color: var(--ink-subtle); font-size: var(--step-small); margin-top: 10px; }
.legal .summary { background: var(--accent-soft); border-radius: 16px; padding: 20px 22px; margin-top: 28px; }
.legal .summary p + p { margin-top: 8px; }
.legal h2 { font-size: 1.25rem; font-weight: 500; margin-top: 40px; margin-bottom: 10px; }
.legal p, .legal li { color: var(--ink); }
.legal p + p { margin-top: 12px; }
.legal ul { padding-inline-start: 1.25em; margin: 10px 0 0; display: grid; gap: 8px; }
.legal .lang { margin-top: 16px; font-size: var(--step-small); }
.legal .placeholder { background: var(--snooze-soft); color: var(--snooze); padding: 1px 6px; border-radius: 6px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .band .wrap, .feature.wide { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 24px 56px; }
  .hero-grid { gap: 48px; }
  .phone { max-width: 300px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .feature.wide { gap: 24px; }
}
@media (max-width: 640px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: 64px; }
  .band .wrap { padding-block: 64px; }
  .nav-links .hide-sm { display: none; }
  .feature { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .swipe .row { transform: translateX(30%); }
}

/* Theme demo: two fixed mini canvases, one per theme, independent of the viewer's theme */
.demo-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.mini { border-radius: 14px; padding: 28px 12px; display: flex; justify-content: center; }
.mini .bubble { align-self: center; max-width: 100%; font-size: 15px; }
.mini.light { background: #F2EEE6; }
.mini.light .bubble { background: #D3EADA; color: #13201A; }
.mini.light .bubble time { color: #4A6457; }
.mini.dark { background: #0C0F0E; box-shadow: inset 0 0 0 1px #232826; }
.mini.dark .bubble { background: #1F3A2E; color: #E6EFE9; }
.mini.dark .bubble time { color: #9BBBAA; }
.demo-themes, .feature .demo { align-self: stretch; }
