/*
 * Styles for the alifpal.com landing page (index.html) only. The legal pages keep
 * style.css, so changes here can never break the URLs the app and store listings link to.
 *
 * Everything is served from this site because firebase.json's CSP allows only 'self' for
 * styles and fonts: no inline style="" attributes, no Google Fonts. The three .woff2 files
 * in /fonts are Google Fonts downloads (SIL Open Font License), trimmed to the subsets used.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/fonts/noto-sans-arabic-700-arabic.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1c1e22;
  --ink-soft: #3a3d44;
  --muted: #55585f;
  --paper: #faf7f2;
  --white: #ffffff;
  --peach: #f2b49b;
  --sky: #a9cbea;
  --sage: #b9d3a8;
  --butter: #f3d97a;
  --terracotta: #b4532f;
  --olive: #5e7a3a;
  --blue: #2f5a8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Bricolage Grotesque",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

a {
  color: var(--ink);
}

a:hover {
  color: #000000;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Arabic text: a clear modern sans with a tall line height so harakat never collide. */
.ar {
  font-family: "Noto Sans Arabic", sans-serif;
  font-weight: 700;
  line-height: 1.8;
}

/* ---- Header ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* ---- Hero ---- */

/*
 * Layout is mobile-first: one centred column until 900px, then two columns. Fixed
 * breakpoints rather than flex-wrap, because wrapping left tablets with left-aligned
 * text beside a full-width sticker cluster and a hero that disagreed with the rows below.
 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 96px;
  text-align: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 620px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.033em;
}

.highlight {
  display: inline-block;
  padding: 0 10px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 12px;
  transform: rotate(-2deg);
}

.lede {
  margin: 0;
  max-width: 480px;
  font-size: 21px;
  line-height: 1.5;
  color: var(--muted);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Not links yet: the store listings don't exist. Swap each <span> for an <a> when they do. */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
}

.store-badge small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ---- Sticker cluster ---- */

/* A square that scales with its column, so the stickers keep their spacing at any width. */
.stickers {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
}

.jojo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    0 0 0 8px var(--white),
    0 0 0 10px var(--ink);
}

.jojo img {
  width: 110%;
  height: 110%;
  margin-top: 6%;
  object-fit: contain;
}

.sticker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow:
    0 0 0 5px var(--white),
    0 0 0 7px var(--ink);
}

.sticker .ar {
  font-size: 32px;
  line-height: 1.7;
}

.sticker span:last-child {
  margin-top: -4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.sticker-1 {
  left: 4%;
  top: 8%;
  background: var(--peach);
  transform: rotate(-6deg);
}

.sticker-2 {
  left: 60%;
  top: 4%;
  background: var(--sky);
  transform: rotate(5deg);
}

.sticker-3 {
  left: 66%;
  top: 72%;
  background: var(--sage);
  transform: rotate(-4deg);
}

.sticker-4 {
  left: 2%;
  top: 70%;
  background: var(--butter);
  transform: rotate(4deg);
}

.sticker-5 {
  left: 76%;
  top: 40%;
  background: var(--white);
  transform: rotate(7deg);
}

/* ---- Feature rows ---- */

.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 112px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.feature-art {
  display: flex;
  justify-content: center;
}

/* One column: picture first in every row, so the middle row's art moves above its text. */
.feature-reverse .feature-art {
  order: -1;
}

.feature-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.eyebrow {
  font-size: 15px;
  font-weight: 700;
}

.eyebrow-terracotta {
  color: var(--terracotta);
}

.eyebrow-olive {
  color: var(--olive);
}

.eyebrow-blue {
  color: var(--blue);
}

.feature h2 {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 44px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.032em;
}

.feature p {
  margin: 0;
  max-width: 440px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}

.card {
  width: 380px;
  max-width: 100%;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow:
    0 0 0 6px var(--white),
    0 0 0 8px var(--ink);
}

.whiteboard {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: rotate(-2deg);
}

.handwriting {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 30px;
  color: var(--blue);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 26px;
}

.chip-butter {
  background: var(--butter);
}

.chip-sky {
  background: var(--sky);
}

.chip-peach {
  background: var(--peach);
}

.chat {
  width: 380px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  padding: 4px 20px;
  border: 2px solid var(--ink);
  font-size: 26px;
  line-height: 1.9;
}

/* The chat is dir="rtl", so flex-start is the right-hand side. */
.bubble-them {
  align-self: flex-start;
  background: var(--white);
  border-radius: 18px 18px 18px 4px;
  transform: rotate(-1.5deg);
}

.bubble-you {
  align-self: flex-end;
  background: var(--sage);
  border-radius: 18px 18px 4px 18px;
  transform: rotate(1.5deg);
}

.log-post {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: rotate(2deg);
}

.log-user {
  font-size: 15px;
  font-weight: 700;
}

.log-user span {
  font-weight: 500;
  color: var(--muted);
}

.log-post .ar {
  font-size: 30px;
}

.log-meta {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--muted);
}

.log-meta span:last-child {
  font-weight: 700;
  color: var(--terracotta);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 2px solid var(--ink);
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer nav a {
  font-weight: 600;
  text-decoration: none;
}

.site-footer nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---- Two columns: small laptops and up ---- */

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
  }

  .hero-copy {
    align-items: flex-start;
  }

  .store-row {
    justify-content: flex-start;
  }

  .stickers {
    justify-self: center;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
  }

  .feature-reverse .feature-art {
    order: 0;
  }

  .feature-copy {
    align-items: flex-start;
    text-align: left;
  }
}

/* Two columns but a narrow sticker square (about 400px): shrink Jojo and the stickers to fit. */
@media (min-width: 900px) and (max-width: 1199px) {
  .jojo {
    width: 160px;
    height: 160px;
    margin: -80px 0 0 -80px;
  }

  .sticker {
    padding: 4px 14px 8px;
  }

  .sticker .ar {
    font-size: 24px;
  }

  .sticker span:last-child {
    font-size: 12px;
  }
}

/* ---- Phones ---- */

@media (max-width: 560px) {
  /* Links on top, copyright under them, both centred: a left-aligned two-line wrap looked broken. */
  .site-footer .container {
    flex-direction: column-reverse;
    align-items: center;
    gap: 14px;
  }

  .site-footer nav {
    justify-content: center;
  }

  .hero {
    padding-top: 16px;
    padding-bottom: 64px;
  }

  .jojo {
    width: 160px;
    height: 160px;
    margin: -80px 0 0 -80px;
  }

  .sticker {
    padding: 2px 12px 6px;
  }

  .sticker .ar {
    font-size: 22px;
  }

  .sticker span:last-child {
    font-size: 12px;
  }

  .sticker-2 {
    left: 56%;
  }

  .sticker-3 {
    left: 56%;
    top: 76%;
  }

  .sticker-5 {
    left: 72%;
  }

  .features {
    padding-bottom: 80px;
    gap: 64px;
  }

  .feature {
    gap: 32px;
  }
}
