/* Habibi site styles. Every color, radius and type size comes from the tokens below. */

:root {
  --bg: #F2EFE4;
  --surface: #FFFFFF;
  --surface-2: #F3EEE3;
  --ink: #232023;
  --ink-2: #4A4640;
  --ink-3: #5A5550;
  --ink-4: #6B6660;
  --line: #DCD7C8;
  --accent: #A8452E;
  --accent-on-dark: #FFD66E;
  --peach: #FBE6CF;
  --peach-ink: #5A4636;
  --cream-on-dark: #F6F1E7;
  --muted-on-dark: #CFC8BC;
  --chip-line-on-dark: #5A5357;
  --dark-bubble: #3A3438;
  --dark-card: #2E292C;
  --bulb-content: #F3DE8A;
  --bulb-happy: #FFE27A;
  --bulb-sleepy: #C9B98A;
  --avatar-peach: #F7D9CB;
  --avatar-sage: #DCEBDF;
  --avatar-lilac: #E6E0F4;
  --tile-feed: #FBE1DA;
  --tile-feed-ink: #A8452E;
  --tile-sleep: #E4E0F2;
  --tile-sleep-ink: #4E4386;
  --tile-room: #DCEBDF;
  --tile-room-ink: #2F5E46;

  --radius-button: 16px;
  --radius-button-sm: 14px;
  --radius-chip: 999px;
  --radius-card: 24px;
  --radius-card-lg: 28px;
  --radius-row: 22px;
  --radius-bubble: 20px;
  --radius-bubble-tail: 6px;

  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", Inter, system-ui, -apple-system, sans-serif;
  --size-h1: clamp(2.8rem, min(6.4vw, 8.5vh), 5.6rem);
  --size-h2: clamp(2.2rem, 4.6vw, 3.6rem);
  --size-lead: 1.1rem;
  --size-eyebrow: 13px;

  --shadow-soft: 0 1px 2px rgba(35, 32, 35, 0.08);
  --shadow-cta: 0 10px 24px rgba(35, 32, 35, 0.16);
  --shadow-bubble: 0 8px 22px rgba(35, 32, 35, 0.10);

  --pop: hsPop 0.35s ease-out;
  --peek-move: transform 0.45s cubic-bezier(.3, 1.3, .5, 1);
  --content: 1100px;
  --wide: 1360px;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  /* The dark footer always reaches the bottom of the window, even on short pages. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--ink); }
a:hover { color: var(--ink-3); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.band--dark :focus-visible { outline-color: var(--accent-on-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 10px 16px; border-radius: var(--radius-button-sm);
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--bg); }

/* Type */

.eyebrow {
  font-size: var(--size-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow--on-dark { color: var(--accent-on-dark); }
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-h2);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.lead { max-width: 28rem; font-size: var(--size-lead); line-height: 1.6; color: var(--ink-2); }
.lead--on-dark { color: var(--muted-on-dark); }
.lead--peach { color: var(--peach-ink); }

/* Header */

.site-header { position: relative; z-index: 5; }
.site-header--over { position: absolute; top: 0; left: 0; right: 0; }
.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.06em;
  line-height: 1;
  text-decoration: none;
}
.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-button-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

/* Download button */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 26px;
  border-radius: var(--radius-button);
  text-decoration: none;
  text-align: left;
}
.cta--dark { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-cta); }
.cta--dark:hover { color: var(--bg); }
.cta--peach { background: var(--peach); color: var(--ink); }
.cta--peach:hover { color: var(--ink); }
.cta:not([href]) { cursor: default; }
.cta__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.cta__small { font-size: 12px; font-weight: 500; opacity: 0.8; }
.cta__big { font-size: 18px; font-weight: 600; }

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  /* Fits the window: the habibi peeks from the bottom of the first screen. */
  min-height: min(720px, 100vh);
  min-height: min(720px, 100svh);
  background: var(--bg);
}
.hero__copy {
  position: relative;
  z-index: 3;
  padding: 100px 24px 228px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  pointer-events: none;
}
.hero__copy a, .hero__copy button { pointer-events: auto; }
.hero__title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-h1);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero__lead { max-width: 32rem; font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.hero__meta { font-size: 13px; color: var(--ink-3); }
.hero__count { margin-top: -8px; font-size: 14px; font-weight: 600; color: var(--ink-3); }

/* The hiding habibi. Without JS it rests at spot 1; main.js moves it around. */
.peek {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: 170px;
  height: 186px;
  transform: translate(-50%, 32%);
}
.peek.is-moving { transition: var(--peek-move); }
.peek__button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 40%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.peek__button:focus-visible { outline-offset: -6px; }
.peek__img {
  width: 100%;
  height: auto;
  transform-origin: 50% 90%;
  animation: hsWiggle 2.6s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}
.peek-bubble {
  position: absolute;
  z-index: 4;
  left: calc(50% + 20px);
  bottom: 150px;
  width: max-content;
  max-width: min(220px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: var(--radius-bubble);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: var(--shadow-bubble);
  pointer-events: none;
}
.peek-bubble.is-hidden { visibility: hidden; opacity: 0; }
.peek-bubble.is-popping { animation: var(--pop); }

@media (min-width: 640px) {
  .hero { min-height: min(820px, 100vh); min-height: min(820px, 100svh); }
  .hero__copy { padding: clamp(100px, 17vh, 166px) 24px clamp(205px, 26vh, 240px); gap: clamp(14px, 2.2vh, 20px); }
  .peek { width: 260px; height: 284px; }
  .peek-bubble { left: calc(50% + 110px); bottom: 220px; }
}

/* Bands and layouts */

.band { padding: 96px 24px; }
.band--dark { background: var(--ink); color: var(--cream-on-dark); }
.band--rule { border-top: 1px solid var(--line); }
.band--peach { background: var(--peach); }
.band--closing {
  padding: 80px 24px 64px;
  color: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.band--closing .lead { max-width: none; }

.split {
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}
.split__text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split__side { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stack { max-width: var(--content); margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.stack__intro { max-width: 40rem; display: flex; flex-direction: column; gap: 16px; }
.stack__intro .lead { max-width: none; }

/* Bubbles */

.bubble { max-width: 85%; padding: 11px 15px; line-height: 1.45; }
.bubble--you {
  align-self: flex-end;
  max-width: 78%;
  padding: 12px 16px;
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble-tail) var(--radius-bubble);
  background: var(--cream-on-dark);
  color: var(--ink);
}
.bubble--habibi-dark {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) var(--radius-bubble-tail);
  background: var(--dark-bubble);
}
.bubble--you-dark {
  align-self: flex-end;
  max-width: 80%;
  border-radius: 18px 18px var(--radius-bubble-tail) 18px;
  background: var(--ink);
  color: var(--cream-on-dark);
}
.bubble--habibi {
  align-self: flex-start;
  border-radius: 18px 18px 18px var(--radius-bubble-tail);
  background: var(--surface-2);
}
.is-popping { animation: var(--pop); }

/* Talk demo */

.talk { gap: 18px; flex-basis: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--chip-line-on-dark);
  background: transparent;
  color: var(--cream-on-dark);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}
.chip:hover { border-color: var(--cream-on-dark); }
.chip[aria-pressed="true"] { background: var(--cream-on-dark); border-color: var(--cream-on-dark); color: var(--ink); }
.chat-card {
  min-height: 170px;
  padding: 24px;
  border-radius: var(--radius-card-lg);
  background: var(--dark-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}
.chat-card__row { display: flex; gap: 10px; align-items: flex-end; }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 1.45em; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted-on-dark);
  animation: typing 1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

.avatar { flex: none; display: block; border-radius: 50%; overflow: hidden; background: var(--avatar-peach); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.avatar--40 { width: 40px; height: 40px; }
.avatar--54 { width: 54px; height: 54px; }
.avatar--sage { background: var(--avatar-sage); }
.avatar--lilac { background: var(--avatar-lilac); }

/* Memory cards */

.memory-card {
  padding: 22px;
  border-radius: var(--radius-card);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.memory-card__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}
@media (min-width: 900px) {
  .memory-card--offset { margin-left: 32px; }
}
.memory-card.is-waiting { opacity: 0; transform: translateY(16px); }
.memory-card.is-shown { transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.memory-card.is-shown + .memory-card.is-shown { transition-delay: 0.25s; }

/* Care cards */

.care-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.care-card {
  padding: 26px;
  border-radius: var(--radius-card);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.care-card__icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.care-card__icon--feed { background: var(--tile-feed); color: var(--tile-feed-ink); }
.care-card__icon--sleep { background: var(--tile-sleep); color: var(--tile-sleep-ink); }
.care-card__icon--room { background: var(--tile-room); color: var(--tile-room-ink); }
.care-card__title { font-size: 19px; font-weight: 600; line-height: 1.3; }
.care-card__text { line-height: 1.55; color: var(--ink-2); }
.bulbs { height: 46px; display: flex; align-items: center; gap: 14px; padding-left: 4px; }
.bulb { width: 20px; height: 20px; border-radius: 50%; }
.bulb--content { background: radial-gradient(circle at 38% 32%, #FFFDF0, var(--bulb-content)); box-shadow: 0 0 16px 4px rgba(243, 222, 138, 0.55); }
.bulb--happy { background: radial-gradient(circle at 38% 32%, #FFFDF0, var(--bulb-happy)); animation: bHappy 1.1s ease-in-out infinite; box-shadow: 0 0 18px 5px rgba(255, 214, 90, 0.8); }
.bulb--sleepy { background: radial-gradient(circle at 38% 32%, #FFFDF0, var(--bulb-sleepy)); opacity: 0.55; animation: bSleepy 4.5s ease-in-out infinite; box-shadow: 0 0 2px 0 rgba(200, 180, 120, 0.2); }

/* Friends */

.friend {
  padding: 16px 18px;
  border-radius: var(--radius-row);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.friend__who { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; }
.friend__pet { font-weight: 600; }
.friend__owner { font-size: 14px; color: var(--ink-4); }
.friend__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pill:hover { border-color: var(--ink-4); }
.friend__reply {
  flex: 1 1 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1.4;
}
.friend__reply:empty { display: none; }
/* Stand-in body colors until real renders exist: remove the class to drop the filter. */
.temp-recolor--bean { filter: hue-rotate(80deg) saturate(.7); }
.temp-recolor--mochi { filter: hue-rotate(235deg) saturate(.75); }

/* Footer */

/* Dark, like the closing band; on the home page it continues that band as one block. */
.site-footer { padding: 28px 24px 40px; background: var(--ink); font-size: 14px; }
.site-footer__inner { max-width: var(--content); margin: 0 auto; }
.site-footer--joined { padding-top: 0; }
.site-footer--joined .site-footer__inner { padding-top: 24px; border-top: 1px solid var(--dark-bubble); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted-on-dark);
  text-decoration: none;
}
.site-footer a:hover { color: var(--cream-on-dark); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--accent-on-dark); }

/* Text pages (privacy, terms, safety, support) */

.doc { width: 100%; max-width: 680px; margin: 0 auto; padding: 64px 24px 96px; display: flex; flex-direction: column; gap: 20px; }
.doc h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-h2);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.doc h2 { margin-top: 12px; font-size: 1.3rem; font-weight: 600; }
.doc p { font-size: var(--size-lead); line-height: 1.6; color: var(--ink-2); }
.placeholder {
  padding: 20px 22px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--accent) !important;
  font-weight: 600;
}

/* Motion */

@keyframes hsWiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes hsPop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes typing { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes bHappy { 0%, 100% { box-shadow: 0 0 18px 5px rgba(255, 214, 90, 0.8); } 50% { box-shadow: 0 0 28px 9px rgba(255, 214, 90, 1); } }
@keyframes bSleepy { 0%, 100% { box-shadow: 0 0 2px 0 rgba(200, 180, 120, 0.2); } 50% { box-shadow: 0 0 10px 2px rgba(200, 180, 120, 0.35); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .memory-card.is-waiting { opacity: 1; transform: none; }
}
