/* Stan-style link page + product pages. Breakpoints match Stan: <768 phone, 768–1279 tablet, 1280+ desktop. */
:root {
  --cream: #FFF8EB;
  --purple: #5943EF;
  --purple-hover: #4a35de;
  --ink: #000000;
  --text: #171717;
  --muted: #6E6E73;
  --line: #E7DFCF;
  --field: #FAFAFA;
  --field-line: #DCDCE0;
  --purple-soft: #EFEBFF;
  --shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .06);
  /* Rubik covers Latin, Hebrew, Arabic and Cyrillic, so every language uses the same type. */
  --sans: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans); /* headings: heavier Rubik */
  --rich: var(--sans);
  --accent: var(--sans);
}
/* Letter-spacing breaks the joins between Arabic letters */
:lang(ar) * { letter-spacing: 0 !important; }
:lang(ar) .name, :lang(ar) .p-title, :lang(ar) .rich h2 { line-height: 1.4; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
s { color: var(--muted); font-weight: 400; }

/* ---------- Profile ---------- */
.bg-photo { position: fixed; inset: 0; z-index: -1; }
.bg-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.bg-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.3) 38%, rgba(0,0,0,0) 62%);
}
/* Top padding leaves room for the language picker above the name */
.profile { text-align: center; padding: 80px 20px 16px; color: #fff; }
.avatar { display: none; }
.name { font: 800 40px/1.1 var(--serif); margin: 0; letter-spacing: -.02em; text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.bio { margin: 12px auto 0; max-width: 320px; font: 400 17px/1.45 var(--sans); opacity: .95; text-shadow: 0 1px 10px rgba(0, 0, 0, .4); }
.socials { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.socials a {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .15s ease, background .15s ease;
}
.socials a:hover { transform: translateY(-2px); background: var(--purple); border-color: var(--purple); }
.socials a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.socials svg { width: 18px; height: 18px; }

/* ---------- Home cards ---------- */
.content { padding: 24px 16px 40px; }
.grid { display: flex; flex-direction: column; gap: 24px; max-width: 448px; margin: 0 auto; }
.grid .col { display: flex; flex-direction: column; gap: 24px; flex: 1; min-width: 0; }

.card {
  background: var(--cream);
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, .04);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
}
.card-top { display: grid; grid-template-columns: 80px 1fr; gap: 16px; align-items: start; }
.thumb { width: 80px; height: 80px; border-radius: 14px; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.card-title { font: 700 18px/1.25 var(--sans); color: var(--ink); margin: 2px 0 0; letter-spacing: -.01em; }
.card-desc { font-size: 14.5px; line-height: 1.45; color: var(--muted); margin: 6px 0 0; }
.card-price { margin: 12px 0 0; font: 700 17px/1.2 var(--sans); color: var(--ink); }

/* ---------- Free 1-on-1 card ---------- */
.consult {
  max-width: 448px; margin: 0 auto 24px; padding: 18px;
  border-radius: 22px; border: 1px solid rgba(37, 211, 102, .25);
  background: linear-gradient(180deg, #F2FFF6 0%, var(--cream) 70%);
  box-shadow: var(--shadow);
}
.consult-top { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.consult-avatar { position: relative; width: 64px; height: 64px; }
.consult-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
/* "Online" dot */
.consult-avatar::after {
  content: ""; position: absolute; bottom: 2px; inset-inline-end: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #25D366; border: 2.5px solid #fff;
}
.consult-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #25D366; color: #fff;
  font: 700 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
}
.consult-title { margin: 8px 0 0; font: 800 19px/1.25 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.consult-text { margin: 6px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.btn.btn-wa { background: #25D366; color: #fff; box-shadow: 0 6px 18px rgba(37, 211, 102, .32); }
.btn.btn-wa:hover { background: #1FB958; box-shadow: 0 8px 22px rgba(37, 211, 102, .4); }
.btn.btn-wa:focus-visible { outline-color: #25D366; }
.btn.btn-wa svg { width: 22px; height: 22px; transform: none !important; } /* a logo: never mirrored or nudged */

/* Sticky button: WhatsApp on the home page, buy button on product pages (stickyCopy in store.js) */
.sticky-cta {
  position: fixed; z-index: 45;
  left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 448px; margin: 0 auto;
  transform: translateY(calc(100% + 32px)); opacity: 0;
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), opacity .2s ease;
  pointer-events: none;
}
.sticky-cta.show { transform: none; opacity: 1; pointer-events: auto; }
.sticky-cta .btn { margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 4px 12px rgba(89, 67, 239, .35); }
.sticky-cta .btn-wa { box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 4px 12px rgba(37, 211, 102, .35); }
/* Room at the end of the page so the bar never hides the last card */
body.has-sticky-cta .content { padding-bottom: 104px; } /* body. outweighs the per-page .content padding below */

/* ---------- Guide (product) cards ---------- */
.guides { display: grid; gap: 24px; max-width: 448px; margin: 0 auto 24px; }
.guide {
  display: flex; flex-direction: column;
  background: var(--cream); border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .04);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) {
  .guide:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
  .guide:hover .guide-media img { transform: scale(1.04); }
}
.guide-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #1b1b1f; }
.guide-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.guide-badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding-inline: 9px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font: 600 12.5px/1 var(--sans);
}
.guide-badge svg { width: 14px; height: 14px; color: var(--purple); }
.guide-body { display: flex; flex-direction: column; flex: 1; padding: 20px 20px 18px; }
.guide-title { margin: 0; font: 800 22px/1.2 var(--sans); letter-spacing: -.015em; color: var(--ink); }
.guide-title a { text-decoration: none; }
.guide-desc { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.guide-points { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.guide-points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.4; color: var(--text); }
.guide-points svg {
  width: 22px; height: 22px; padding: 5px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
}
/* Price, button and trust line stay at the bottom, so side-by-side cards line up */
.guide-buy { margin-top: auto; padding-top: 18px; }
.guide-price {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin: 0; padding-top: 16px; border-top: 1px solid var(--line);
  font: 800 30px/1 var(--sans); letter-spacing: -.02em; color: var(--ink);
}
.guide-price s { font-size: 17px; font-weight: 500; }
.guide-price span { font: 500 13.5px/1.2 var(--sans); letter-spacing: 0; color: var(--muted); }
.guide .btn { margin-top: 14px; }
.guide-trust {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 12px 0 0; font-size: 13px; color: var(--muted);
}
.guide-trust svg { width: 13px; height: 13px; color: #2BB24C; flex: none; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; margin-top: 16px; padding: 12px 18px;
  border: 0; border-radius: 12px;
  background: var(--purple); color: #fff;
  font: 600 16px/1.2 var(--sans);
  text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: 0 6px 18px rgba(89, 67, 239, .28);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--purple-hover); box-shadow: 0 8px 22px rgba(89, 67, 239, .36); }
.btn:active { transform: translateY(1px); }
.btn svg { transition: transform .15s ease; }
.btn:hover svg { transform: translateX(3px); }
[dir="rtl"] .btn:hover svg { transform: scaleX(-1) translateX(3px); }
.btn:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.divider { display: flex; justify-content: center; margin: 48px 0 32px; }
.divider span {
  background: var(--cream);
  border-radius: 25px;
  padding: 16px 24px;
  font: 700 18px/1 var(--sans);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(0, 16, 109, .16), 0 0 1px rgba(20, 20, 20, .12);
}

.foot { display: flex; justify-content: center; margin: 56px 0 8px; }
.foot-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; background: #fff;
  font-size: 14px; font-weight: 500; text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}
.foot-pill svg { width: 18px; height: 18px; }

/* ---------- Product page ---------- */
[data-page="product"] .bg-photo, [data-page="story"] .bg-photo, [data-page="notfound"] .bg-photo,
[data-page="product"] .profile, [data-page="story"] .profile, [data-page="notfound"] .profile { display: none; }
[data-page="product"] .content, [data-page="story"] .content, [data-page="notfound"] .content { padding: 0 0 32px; }
.product { max-width: 700px; margin: 0 auto; }
.hero { position: relative; aspect-ratio: 16 / 9; background: #ddd; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.back {
  position: absolute; top: 12px; inset-inline-start: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 248, 235, .48); color: #222;
  backdrop-filter: blur(4px);
}
.back svg { width: 20px; height: 20px; }
[dir="rtl"] .back svg, [dir="rtl"] .btn svg { transform: scaleX(-1); }
.p-body { padding: 20px 16px 0; }
.p-title { font: 700 26px/1.25 var(--serif); color: var(--ink); margin: 0; letter-spacing: -.01em; }
.p-price { font: 600 24px/1.2 var(--sans); color: var(--purple); margin: 16px 0 0; }
.p-price s { font-size: 18px; margin-inline-start: 4px; }
.p-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.rich { font: 400 16px/1.6 var(--rich); color: var(--ink); overflow-wrap: anywhere; }
.rich p { margin: 0 0 16px; }
.rich p:empty { display: none; }
.rich h2 { font: 700 24px/1.2 var(--rich); margin: 24px 0 16px; }
.rich h2:first-child { margin-top: 4px; }
.rich h3 { font: 500 18px/1.35 var(--accent); margin: 0 0 16px; }
.rich ul, .rich ol { margin: 0 0 16px; padding-inline-start: 24px; }
.rich li p { margin: 0 0 8px; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.check input { position: absolute; opacity: 0; pointer-events: none; }

/* Checkout form */
.checkout { display: grid; gap: 16px; }
.checkout-title { font: 700 24px/1.25 var(--serif); color: var(--ink); text-align: center; margin: 8px 0 8px; }
.checkout input[type=text], .checkout input[type=email], .checkout input[type=tel], .checkout textarea, .picker-btn {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--field-line); border-radius: 10px;
  background: var(--field); color: var(--text);
  font: 400 16px var(--sans);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.checkout input::placeholder, .checkout textarea::placeholder { color: #9d9da5; }
.checkout input:hover, .checkout textarea:hover, .picker-btn:hover { border-color: #c2c2c8; }
.checkout input:focus, .checkout textarea:focus, .picker-btn:focus-visible, .picker.open .picker-btn {
  outline: none; border-color: #a3a3ab; background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}
/* Emails are typed left to right, even on Hebrew and Arabic pages */
[dir="rtl"] .checkout input[type=email] { direction: ltr; text-align: right; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; }

/* Custom dropdown (pickerHtml in store.js): neutral, Linear-style menu, no brand colour */
.picker { position: relative; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: start; cursor: pointer; }
.picker-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn svg { width: 16px; height: 16px; flex: none; color: #8a8a93; transition: transform .2s ease; }
.picker.open .picker-btn svg { transform: rotate(180deg); }
.picker-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-start: 0;
  min-width: 100%; max-height: 272px; overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid rgba(0, 0, 0, .08); border-radius: 8px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .02), 0 4px 10px -2px rgba(0, 0, 0, .06), 0 16px 32px -8px rgba(0, 0, 0, .12);
  animation: picker-in .12s ease-out;
}
.picker.up .picker-list { top: auto; bottom: calc(100% + 4px); animation-name: picker-in-up; }
.picker-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 36px; padding: 0 10px; border-radius: 5px;
  font-size: 14px; color: #28282c; white-space: nowrap; cursor: default;
}
@media (pointer: coarse) { .picker-list li { min-height: 44px; font-size: 15px; } }
.picker-list li.active { background: #f1f1f3; }
.picker-list li[aria-selected="true"] { font-weight: 500; color: #111113; }
.picker-list li svg { width: 14px; height: 14px; flex: none; color: #55555c; stroke-width: 2.4; visibility: hidden; }
.picker-list li[aria-selected="true"] svg { visibility: visible; }
@keyframes picker-in { from { opacity: 0; transform: translateY(-2px) scale(.98); } }
@keyframes picker-in-up { from { opacity: 0; transform: translateY(2px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .picker-list { animation: none; } }
.check { position: relative; display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check .box { width: 20px; height: 20px; border: 1.5px solid #555; border-radius: 4px; flex: none; background: #fff; }
.check input:checked + .box { background: var(--purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--purple); }
.check input:focus-visible + .box { outline: 2px solid var(--purple); outline-offset: 2px; }

.btn-buy { font-size: 18px; }

/* Share Your Story page */
.story-head { position: relative; text-align: center; padding: 64px 16px 8px; }
.story-head .back { background: rgba(0, 0, 0, .06); }
.story-head img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; box-shadow: var(--shadow); }
.story-head p { max-width: 460px; margin: 12px auto 0; font: 400 17px/1.5 var(--rich); }
.story-head small { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); }
.story-head .story-photos { font-size: 15px; }
.story-head .story-photos a { color: inherit; font-weight: 700; text-decoration: underline; }
.checkout textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.thanks { text-align: center; padding: 24px 0; }
.thanks p { font: 400 17px/1.5 var(--rich); margin: 0 0 8px; }

/* 404 page (reuses the story page header) */
.story-head .nf-code { margin: 0 0 4px; font: 800 64px/1 var(--serif); letter-spacing: -.03em; color: var(--purple); }
.nf-actions { max-width: 448px; margin: 0 auto; padding-top: 24px; }

/* Error toast */
.toast {
  position: fixed; top: 12px; left: 50%; z-index: 50;
  width: min(370px, calc(100% - 24px));
  transform: translate(-50%, -140%); transition: transform .25s ease;
  display: grid; grid-template-columns: 24px 1fr 24px; gap: 14px; align-items: start;
  background: #0E0E12; color: #fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.show { transform: translate(-50%, 0); }
.toast-icon { color: #F04438; }
.toast svg { width: 24px; height: 24px; display: block; }
.toast strong { display: block; font-size: 16px; }
.toast span { font-size: 14px; color: #c9c9d1; }
.toast button { background: none; border: 0; padding: 0; color: #c9c9d1; cursor: pointer; }

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .bg-photo { display: none; }
  .profile { color: var(--ink); min-height: 0; padding-top: 72px; }
  .avatar { display: block; width: 200px; height: 260px; object-fit: cover; object-position: center 20%; border-radius: 24px; margin: 0 auto 22px; box-shadow: var(--shadow-hover); }
  .name, .bio { text-shadow: none; }
  .bio { font-size: 18px; max-width: 360px; color: var(--muted); }
  .socials a { background: var(--purple); border-color: var(--purple); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .socials a:hover { background: var(--purple-hover); }
  .content { padding: 40px 16px 32px; }
  .grid { flex-direction: row; align-items: flex-start; max-width: 798px; }
  .guides { grid-template-columns: 1fr 1fr; max-width: 798px; margin-bottom: 32px; }
  .consult { max-width: 798px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 20px 22px; }
  .consult .btn-wa { margin-top: 0; width: auto; padding-inline: 22px; }
  .sticky-cta { left: auto; right: auto; inset-inline-end: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: none; }
  .sticky-cta .btn { width: auto; padding-inline: 22px; border-radius: 999px; }
  body.has-sticky-cta .content { padding-bottom: 96px; }
  .divider { margin: 40px 0 32px; }
  .p-body { padding: 20px 20px 0; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1280px) {
  .layout {
    display: grid; grid-template-columns: 1fr 800px; column-gap: 24px;
    max-width: 1600px; margin: 0 auto; padding-inline-end: 22px;
  }
  .avatar { width: 240px; height: 320px; }
  .name { font-size: 46px; }
  .profile {
    position: sticky; top: 0; height: 100vh; padding: 0 16px;
    display: flex; align-items: center; justify-content: center;
  }
  .content { padding: 76px 0 32px; } /* clears the language picker above the cards */
  .grid, .guides, .consult { max-width: none; }
  [data-page="product"] .profile, [data-page="story"] .profile, [data-page="notfound"] .profile { display: flex; }
  [data-page="product"] .content, [data-page="story"] .content, [data-page="notfound"] .content { padding: 18px 0 32px; }
  .product { max-width: 660px; margin: 0; }
}

/* Language picker colours (the component itself is in assets/lang-switch.css): same surface as the cards */
.lang-switch {
  --ls-font: var(--sans);
  --ls-bg: var(--cream);
  --ls-fg: var(--ink);
  --ls-border: rgba(0, 0, 0, .05);
  --ls-shadow: var(--shadow);
  --ls-menu-bg: var(--cream);
  --ls-menu-fg: var(--ink);
  --ls-menu-shadow: var(--shadow-hover);
  --ls-muted: var(--muted);
  --ls-hover: rgba(0, 0, 0, .04);
  --ls-current-bg: rgba(0, 0, 0, .05);
  --ls-accent: var(--ink);
  --ls-ring: var(--ink);
}
/* Over a photo (home on phones, product heroes): frosted dark glass */
[data-page="product"] .lang-switch { --ls-bg: rgba(20, 20, 24, .38); --ls-fg: #fff; --ls-border: rgba(255, 255, 255, .25); --ls-blur: blur(12px); --ls-ring: #fff; }
@media (max-width: 767px) {
  [data-page="index"] .lang-switch { --ls-bg: rgba(20, 20, 24, .38); --ls-fg: #fff; --ls-border: rgba(255, 255, 255, .25); --ls-blur: blur(12px); --ls-ring: #fff; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
