/* Ona — landing v1
   Brand tokens mirrored from ~/.claude-pepe/repos/ona/src/local/public/styles/tokens.css */

/* ── Self-hosted fonts ─────────────────────────────
   Archivo + Fraunces (SIL Open Font License). Self-hosted so we don't
   send user IP to fonts.gstatic.com on every page view — keeps us out
   of the third-party-request GDPR conversation entirely.
   Archivo is a variable font: one file serves weights 400-700.
   Fraunces is requested at weight 600 only (the single display weight
   used across the site); add more weights here if needed later.
   ZH glyphs fall back to system fonts (these families don't ship CJK). */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-normal-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-normal-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-normal-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-normal-latin-ext.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-italic-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-italic-latin-ext.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cream: #f1ecdf;
  --paper: #fbf8f1;
  --ink: #141d2a;
  --cobalt: #2d44d9;
  --tomato: #e84a2f;
  --mustard: #f2c94c;

  /* WhatsApp palette (subtle, not exact) */
  --wa-header: #075E54;
  --wa-bg: #ECE5DD;
  --wa-bubble-user: #DCF8C6;
  --wa-bubble-ona: #FFFFFF;
  --wa-input-bg: #F0F0F0;

  --radius-card: 14px;
  --radius-stamp: 18px;
  --stamp: 3px 3px 0 0 var(--ink);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --total-cycle: 32s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ───────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  max-width: 1240px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  height: 64px;
  width: auto;
  display: block;
}
@media (max-width: 720px) {
  .brand-logo { height: 52px; }
}
.lang select {
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 26px 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23141d2a'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ── Hero layout ───────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 28px 80px;
  align-items: center;
  min-height: calc(100vh - 80px);
}

.hero-copy { max-width: 540px; }

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 20px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--mustard);
  padding: 4px 14px 6px;
  border-radius: var(--radius-stamp);
  box-shadow: var(--stamp);
}
.eyebrow em { font-style: italic; }
.dot {
  width: 10px;
  height: 10px;
  background: var(--tomato);
  border-radius: 50%;
  margin-left: 4px;
  display: inline-block;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
h1 .wa { color: var(--cobalt); }

.sub {
  font-size: 19px;
  color: var(--ink);
  opacity: 0.78;
  margin: 0 0 32px;
  max-width: 460px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366; /* WhatsApp green — semantic, not on-brand */
  color: white;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  padding: 14px 22px;
  border-radius: 12px;
  box-shadow: var(--stamp);
  transition: transform 0.12s ease;
  text-decoration: none;
}
.cta:hover { transform: translate(-1px, -1px); text-decoration: none; }
.cta:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 0 var(--ink); }

.phone-line {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.65;
}
.phone-num { font-weight: 700; color: var(--ink); opacity: 1; }

.trust {
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.6;
}
.trust strong { color: var(--cobalt); font-weight: 700; opacity: 1; }

/* ── Demo: iPhone frame ────────────────────────── */
.hero-demo {
  display: flex;
  justify-content: center;
}

.phone {
  --phone-w: 320px;
  --phone-h: 660px;
  position: relative;
}
.phone-bezel {
  width: var(--phone-w);
  height: var(--phone-h);
  background: #1a1a1a;
  border-radius: 46px;
  padding: 12px;
  position: relative;
  box-shadow:
    0 30px 60px rgba(20, 29, 42, 0.18),
    0 8px 20px rgba(20, 29, 42, 0.10),
    inset 0 0 0 1.5px #2a2a2a;
}
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 22px;
  background: #1a1a1a;
  border-radius: 0 0 14px 14px;
  z-index: 4;
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--wa-bg);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── WhatsApp UI ───────────────────────────────── */
.wa-statusbar {
  background: var(--wa-header);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  padding: 8px 22px 4px;
  letter-spacing: 0.2px;
}
.wa-header {
  background: var(--wa-header);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 10px;
}
.wa-back { font-size: 22px; opacity: 0.9; }
.wa-avatar { width: 36px; height: 36px; border-radius: 50%; }
.wa-meta { flex: 1; line-height: 1.15; }
.wa-meta strong { display: block; font-size: 15px; font-weight: 600; }
.wa-meta small { font-size: 11px; opacity: 0.85; }
.wa-actions { display: flex; gap: 14px; opacity: 0.85; font-size: 14px; }

.wa-chat-bg {
  flex: 1;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.3), transparent 50%),
    var(--wa-bg);
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
  /* Hide scrollbar — chat scrolls naturally as messages accumulate. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wa-chat-bg::-webkit-scrollbar { display: none; }
.wa-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px;
  min-height: 100%;
  /* JS appends bubbles as needed; native scroll keeps the latest in view. */
}

/* Bubbles. Hidden initial state; .shown class triggers fade-in. JS appends
   bubbles as needed and adds .shown after a forced reflow. */
.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.35;
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  word-wrap: break-word;
  transition: opacity 280ms cubic-bezier(0.2, 0.8, 0.3, 1),
              transform 280ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.bubble.shown { opacity: 1; transform: translateY(0); }
.bubble.user {
  align-self: flex-end;
  background: var(--wa-bubble-user);
  border-bottom-right-radius: 4px;
}
.bubble.ona {
  align-self: flex-start;
  background: var(--wa-bubble-ona);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

/* Header "typing…" status (under Ona's name in the WA header). Three dots
   animate independently in a wave to mimic WhatsApp's native typing indicator. */
#wa-status.typing {
  font-style: italic;
  opacity: 0.95;
}
.typing-dot {
  display: inline-block;
  margin-left: 0.5px;
  opacity: 0;
  animation: typing-dot-wave 1.3s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-dot-wave {
  0%, 70%, 100% { opacity: 0; }
  35% { opacity: 1; }
}

/* Ona's URL_BUTTON message — text body + button attached BELOW inside the
   same bubble. Mirrors WhatsApp's interactive message visual grouping. */
.bubble.has-button {
  padding: 0;
  background: var(--wa-bubble-ona);
  max-width: 80%;
  overflow: hidden;
}
.bubble.has-button .bubble-text {
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.35;
}
.bubble.has-button .bubble-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--cobalt);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1px;
  border-top: 1px solid rgba(0,0,0,0.06);
  cursor: default;
}
.bubble.has-button .bubble-button-icon {
  font-size: 11px;
  opacity: 0.75;
}

/* Interactive list (Ona's restaurant suggestions). Hidden by default; JS
   reveals at the configured --start time. */
.wa-list {
  --start: 0s;
  align-self: flex-start;
  background: var(--wa-bubble-ona);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 8px;
  max-width: 86%;
  width: 86%;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
}
.wa-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}
.wa-list-row:last-of-type { border-bottom: none; }
.wa-list-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.wa-list-meta { flex: 1; line-height: 1.2; }
.wa-list-meta strong { display: block; font-size: 13px; font-weight: 600; }
.wa-list-meta small { font-size: 11px; color: #666; }
.wa-list-cta {
  text-align: center;
  color: var(--cobalt);
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  border-top: 1px solid #eee;
  margin-top: 2px;
}

/* WhatsApp input — JS types into #wa-input-content character-by-character */
.wa-input {
  background: var(--wa-input-bg);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.wa-input-icon {
  font-size: 16px;
  opacity: 0.55;
  transition: color 200ms ease, opacity 200ms ease;
  flex-shrink: 0;
}
.wa-input-icon.send {
  color: var(--wa-header);
  opacity: 1;
  font-size: 18px;
  transform: rotate(0deg);
}
.wa-input-text {
  flex: 1;
  background: white;
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 13px;
  color: #222;
  min-height: 16px;
  display: flex;
  align-items: center;
}
.wa-input-text:empty::before,
.wa-input-text:has(#wa-input-content:empty)::before {
  content: 'Message';
  color: #999;
}
#wa-input-content { white-space: pre-wrap; }
.wa-input-caret {
  display: inline-block;
  width: 1.5px;
  height: 14px;
  background: var(--wa-header);
  margin-left: 1px;
  animation: caret-blink 1s infinite steps(2);
  vertical-align: middle;
}
@keyframes caret-blink {
  to { opacity: 0; }
}

/* ── Legal pages (privacy.html / terms.html) ───── */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 48px);
  margin: 0 0 12px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  margin: 32px 0 8px;
}
.legal-page p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 14px;
  color: var(--ink);
}
.legal-stub {
  background: var(--mustard);
  padding: 12px 16px;
  border-radius: var(--radius-card);
  font-style: italic;
  box-shadow: var(--stamp);
  display: inline-block;
}
.legal-back {
  margin-top: 48px;
  font-size: 15px;
}
.legal-back a {
  color: var(--cobalt);
  font-weight: 600;
}

.legal-updated {
  font-size: 13px;
  opacity: 0.55;
  margin: -4px 0 28px;
  letter-spacing: 0.01em;
}
.legal-page ul {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 14px;
  padding-left: 22px;
  color: var(--ink);
}
.legal-page ul li { margin-bottom: 6px; }
.legal-page ul li strong { font-weight: 700; }
.legal-page a {
  color: var(--cobalt);
  font-weight: 600;
  border-bottom: 1px solid rgba(45, 68, 217, 0.25);
}
.legal-page a:hover { border-bottom-color: var(--cobalt); text-decoration: none; }
.legal-page code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(20, 29, 42, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 14px;
}

/* ── Footer ────────────────────────────────────── */
.foot {
  background: var(--paper);
  padding: 40px 28px 28px;
  color: var(--ink);
  border-top: 1.5px solid rgba(20, 29, 42, 0.08);
  margin-top: 40px;
}
.foot-invite {
  max-width: 760px;
  margin: 0 auto 28px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  text-align: center;
}
.foot-invite em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
}
.foot-invite a {
  color: var(--cobalt);
  font-weight: 700;
  border-bottom: 2px solid var(--cobalt);
  text-decoration: none;
  white-space: nowrap;
}
.foot-invite a:hover {
  color: var(--tomato);
  border-bottom-color: var(--tomato);
  text-decoration: none;
}
.foot-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(20, 29, 42, 0.08);
  text-align: center;
}
.foot-bottom small {
  font-size: 14px;
  color: var(--ink);
  opacity: 0.65;
}
.foot-bottom a {
  color: var(--ink);
  opacity: 1;
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 29, 42, 0.18);
}
.foot-bottom a:hover { color: var(--cobalt); border-bottom-color: var(--cobalt); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 24px;
    padding-bottom: 48px;
  }
  .hero-copy { max-width: 100%; }
  h1 { font-size: clamp(30px, 8vw, 44px); }
  .hero-demo { order: 2; }
  .phone { transform: scale(0.92); transform-origin: top center; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-chat,
  .bubble,
  .wa-list,
  .bubble.typing span {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
