/* Hyde: same palette as the app (Views/Components/Theme.swift). */
:root {
  --page: #fafafa;
  --card: #ffffff;
  --text: #0b0b0c;
  --secondary: #666a6b;
  --tertiary: #9fa3a6;
  --blue: #0064d4;
  --blue-soft: #e5f0fd;
  --incoming: #e9eaec;
  --mine: #cbe5fe;
  --mine-text: #101010;
  --fill: #f3f4f5;
  --hairline: #e3e3e3;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px rgba(16, 24, 40, 0.07);
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --secondary: #98989f;
    --tertiary: #636366;
    --blue: #3d8bff;
    --blue-soft: #0f2744;
    --incoming: #262629;
    --mine: #1d3a5e;
    --mine-text: #ffffff;
    --fill: #2c2c2e;
    --hairline: #38383a;
    --shadow: 0 0 0 1px #2a2a2c;
  }
  .phone { background: #1c1c1e; box-shadow: 0 0 0 1px #2c2c2e, 0 30px 80px rgba(61, 139, 255, 0.12); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }

/* Top bar */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 21px/1 var(--rounded); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav nav a { color: var(--secondary); }
.nav nav a:hover { color: var(--text); text-decoration: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--page) !important;
  font-weight: 600;
  font-size: 15px;
}
.pill:hover { text-decoration: none; opacity: 0.88; }
.pill.ghost { background: var(--card); color: var(--text) !important; box-shadow: var(--shadow); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 56px 0 72px;
}
.hero-copy { max-width: 540px; }
.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}
h1 {
  margin: 18px 0 18px;
  font: 700 clamp(48px, 7.4vw, 82px)/1 var(--rounded);
  letter-spacing: -0.03em;
}
.lede { margin: 0 0 30px; color: var(--secondary); font-size: 20px; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.note { color: var(--tertiary); font-size: 14px; }

/* Phone mock: the real chat UI, in HTML */
.phone {
  justify-self: center;
  width: 340px;
  max-width: 100%;
  border-radius: 50px;
  padding: 10px;
  background: #111;
  box-shadow: 0 30px 80px rgba(20, 40, 90, 0.18), 0 8px 20px rgba(0, 0, 0, 0.08);
}
.screen {
  display: flex;
  flex-direction: column;
  height: 640px;
  border-radius: 40px;
  overflow: hidden;
  background: var(--page);
}
.chat-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 0 10px; }
.chat-head img { width: 54px; height: 54px; }
.name-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
}
.thread { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 0 12px 10px; }
.day { align-self: center; margin: 0 0 8px; color: var(--tertiary); font-size: 12px; font-weight: 600; }
.bubble {
  position: relative;
  max-width: 80%;
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 15.5px;
  line-height: 1.35;
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.in { align-self: flex-start; background: var(--incoming); }
.out { align-self: flex-end; background: var(--mine); color: var(--mine-text); }
.gap { margin-top: 10px; }
.react { margin-bottom: 14px; }
.reaction {
  position: absolute;
  left: -8px;
  bottom: -14px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.6) both;
}
.quote {
  margin: 0 0 6px;
  padding: 4px 9px;
  border-left: 3px solid var(--tertiary);
  border-radius: 4px;
  background: color-mix(in srgb, var(--page) 55%, transparent);
  color: var(--secondary);
  font-size: 13px;
}
.typing { display: flex; gap: 4px; padding: 13px 14px; }
.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tertiary);
  animation: dot 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 12px 14px;
  padding: 0 8px 0 14px;
  height: 44px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--tertiary);
  font-size: 15px;
}
.composer span { flex: 1; }
.composer svg { width: 22px; height: 22px; stroke: var(--secondary); }

/* Staggered arrival, like Hyde actually texting. */
.thread > :nth-child(2) { animation-delay: 0.3s; }
.thread > :nth-child(3) { animation-delay: 1.1s; }
.thread > :nth-child(4) { animation-delay: 2.1s; }
.thread > :nth-child(5) { animation-delay: 2.8s; }
.thread > :nth-child(5) .reaction { animation-delay: 3.6s; }
.thread > :nth-child(6) { animation-delay: 4.3s; }
.thread > :nth-child(7) { animation-delay: 5.4s; }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* Features */
.section { padding: 72px 0; }
.section h2 {
  margin: 0 0 10px;
  font: 700 clamp(30px, 4vw, 42px)/1.1 var(--rounded);
  letter-spacing: -0.02em;
}
.section .sub { margin: 0 0 36px; color: var(--secondary); font-size: 19px; max-width: 620px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  padding: 26px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card h3 { margin: 16px 0 6px; font: 650 19px/1.25 var(--rounded); }
.card p { margin: 0; color: var(--secondary); font-size: 16px; }
.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--blue-soft);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Privacy band */
.privacy {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
  padding: 44px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.privacy ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 12px; }
.privacy li { display: flex; gap: 12px; color: var(--secondary); }
.privacy li b { color: var(--text); font-weight: 600; }
.privacy li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--blue); }

/* Footer */
footer { padding: 40px 0 56px; color: var(--tertiary); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-top: 1px solid var(--hairline); padding-top: 24px; }
footer nav { display: flex; gap: 20px; }
footer a { color: var(--secondary); }

/* Long-form pages (privacy, terms, support) */
.doc { width: min(720px, 100% - 40px); margin: 0 auto; padding: 40px 0 24px; }
.doc h1 { font-size: clamp(38px, 6vw, 52px); margin: 0 0 8px; }
.doc .updated { margin: 0 0 32px; color: var(--tertiary); font-size: 15px; }
.doc h2 { margin: 40px 0 10px; font: 700 23px/1.25 var(--rounded); }
.doc h3 { margin: 24px 0 6px; font-size: 17px; }
.doc p, .doc li { color: var(--secondary); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.summary {
  margin: 0 0 8px;
  padding: 22px 26px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.summary ul { margin: 8px 0 0; }
.faq details { padding: 18px 0; border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--tertiary); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 0; }

.center { text-align: center; }
.lost { display: grid; place-items: center; gap: 10px; min-height: 60vh; padding: 40px 20px; text-align: center; }
.lost img { width: 170px; height: 170px; }
.lost h1 { font-size: 40px; margin: 8px 0 0; }
.lost p { margin: 0 0 14px; color: var(--secondary); }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; gap: 44px; }
  .hero-copy { max-width: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .privacy { grid-template-columns: 1fr; padding: 32px 26px; gap: 20px; }
  .privacy img { width: 130px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav nav a:not(.pill) { display: none; }
  .lede { font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .screen { height: 600px; }
}
