/* ---------------------------------------------------------------------------
   hergelim.benbasha.com — dark-first web identity for הרגלים (Hergelim).
   Dark-FIRST (the app skews dark; widgets live on wallpapers), with a light
   variant via prefers-color-scheme. Tokens mirror docs/DESIGN-TOKENS.md
   (screen #12141A, accent #3FCF8E green, 3×3 dot-grid mark). Heebo for he + en.
   Same page skeleton as the yamim/shemot fleet sites (sticky header, two-col
   hero, feature grid, final CTA, footer) + shared legal-doc. No /e/ receiver.
--------------------------------------------------------------------------- */

:root {
  /* Dark is primary (DESIGN-TOKENS.md). */
  --bg: #0B0C11;
  --screen: #12141A;
  --surface: #1B1E27;
  --surface-alt: #242835;
  --ink: #EFF1F6;
  --ink-soft: #A2A8B8;
  --ink-faint: #6B7183;
  --accent: #3FCF8E;
  --accent-bright: #6FE0A8;
  --accent-soft: rgba(63, 207, 142, 0.13);
  --line: rgba(255, 255, 255, 0.06);
  --chip-border: rgba(63, 207, 142, 0.28);
  --tile-empty: #232733;
  --on-accent: #0B0C11;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.5);

  --font: 'Heebo', system-ui, -apple-system, sans-serif;
  --radius-card: 22px;
  --radius-button: 16px;
  --content: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F6F9;
    --screen: #12141A;
    --surface: #FFFFFF;
    --surface-alt: #EAEDF2;
    --ink: #1B1E27;
    --ink-soft: #5B6272;
    --ink-faint: #99A0AF;
    --accent: #2FB877;
    --accent-bright: #1E9E5E;
    --accent-soft: #E1F5EC;
    --line: #E6E9EF;
    --chip-border: #BFE7D2;
    --tile-empty: #E2E6EC;
    --on-accent: #FFFFFF;

    --shadow-soft: 0 8px 24px rgba(20, 30, 25, 0.08);
    --shadow-lift: 0 16px 40px rgba(20, 30, 25, 0.14);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Tabular numerals everywhere — streak counts must not shift (DESIGN-TOKENS). */
.num { font-variant-numeric: tabular-nums; }

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.4px;
  margin: 0;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------- brand --------------------------------- */
/* App-icon mark — a 3×3 streak-grid: lit cells (col-row>=0) glow green, the
   rest sit dark. Consistent app-icon look in both themes (DESIGN-TOKENS §Key). */

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--screen);
  border-radius: 11px;
  width: 40px;
  height: 40px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px rgba(63, 207, 142, 0.28);
}

.mark svg { width: 60%; height: 60%; }

.mark-lg {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft), 0 0 44px rgba(63, 207, 142, 0.35);
}

/* --------------------------------- header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand .mark { width: 38px; height: 38px; }

.brand strong {
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -0.5px;
}

.header-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 600;
}

.header-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.header-nav a:hover { color: var(--accent); }

/* ----------------------------- store badges ------------------------------ */

.store-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  height: 54px;
  padding: 0 20px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid transparent;
}

.store-badge svg { width: 24px; height: 24px; flex: none; }

.store-badge .badge-copy { display: flex; flex-direction: column; line-height: 1.1; }
.store-badge .badge-copy small { font-size: 11px; font-weight: 500; opacity: 0.8; }
.store-badge .badge-copy strong { font-size: 17px; font-weight: 700; }

/* Pre-launch: badge visible but marked "בקרוב" and inert. */
.store-badge.soon { pointer-events: none; opacity: 0.9; }

.store-badge.soon::after {
  content: 'בקרוב';
  position: absolute;
  top: -9px;
  inset-inline-end: -8px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 10px;
}

body[dir='ltr'] .store-badge.soon::after { content: 'Soon'; }

/* --------------------------------- hero ---------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 70px;
}

/* Soft green glow behind the hero. */
.hero::before {
  content: '';
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 640px;
  background: radial-gradient(60% 60% at 70% 0%, rgba(63, 207, 142, 0.2), transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.hero-copy > * {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-soft);
}

.hero-kicker .mark { width: 30px; height: 30px; border-radius: 9px; }

.hero h1 {
  font-size: clamp(40px, 6.4vw, 66px);
  margin: 18px 0 16px;
}

.hero h1 mark {
  background: transparent;
  color: var(--accent-bright);
}

.hero-lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 32em;
  margin: 0 0 26px;
}

.hero-note {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 16px 0 0;
}

/* -------------------------- hero home-screen mock ------------------------ */
/* Always dark — the app skews dark, so the phone reads as a real device even
   under the light web theme. Colors hardcoded (not theme vars) on purpose. */

.hero-shot {
  position: relative;
  justify-self: center;
  opacity: 0;
  animation: rise 0.8s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.phone {
  width: min(300px, 78vw);
  aspect-ratio: 300 / 640;
  border-radius: 46px;
  padding: 12px;
  background: #05060b;
  box-shadow: var(--shadow-lift), 0 0 60px rgba(63, 207, 142, 0.18);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #12141A;
  color: #EFF1F6;
  display: flex;
  flex-direction: column;
  padding: 28px 15px 16px;
  gap: 12px;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 26px;
  background: #05060b;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

/* today block (24px card) with streak ring 2/3. */
.today-block {
  background: #1B1E27;
  border-radius: 22px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tb-top { display: flex; align-items: center; gap: 12px; }

.tb-ring { position: relative; width: 52px; height: 52px; flex: none; }
.tb-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tb-ring .tb-frac {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #EFF1F6;
}

.tb-title { font-size: 21px; font-weight: 800; color: #EFF1F6; line-height: 1; }
.tb-date { font-size: 12.5px; color: #A2A8B8; margin-top: 5px; }
.tb-sub { font-size: 12.5px; color: #6B7183; }

/* habit list. */
.section-label { font-size: 12px; font-weight: 600; color: #6B7183; margin: 2px 3px -2px; }

.habits-list { display: flex; flex-direction: column; gap: 10px; }

.hcard {
  background: #1B1E27;
  border-radius: 18px;
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.hc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hc-name { font-size: 15px; font-weight: 700; color: var(--c); }

.hc-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hc-check.ring { border: 2px solid var(--c); }
.hc-check.done { background: var(--c); }
.hc-check.done svg { width: 15px; height: 15px; }

.dotgrid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  direction: rtl;
}
.dotgrid i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #232733;
}
.dotgrid i.d2 { background: var(--c); }
.dotgrid i.d1 { background: color-mix(in srgb, var(--c) 45%, transparent); }

.hc-caption { font-size: 11.5px; color: #6B7183; }

/* -------------------------------- features ------------------------------- */

.features { padding: 30px 0 76px; }

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 10px;
  text-align: center;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 auto 40px;
  max-width: 40em;
  font-size: 18px;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 26px 30px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature:hover {
  transform: translateY(-4px);
  border-color: var(--chip-border);
  box-shadow: var(--shadow-lift);
}

.feature .icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 15px;
  margin-bottom: 18px;
}

.feature .icon svg { width: 27px; height: 27px; stroke: var(--accent); fill: none; }

/* dot-grid icon uses filled cells, not strokes. */
.feature .icon.dots svg rect { fill: var(--accent); stroke: none; }

.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

/* ------------------------------- final cta ------------------------------- */

.final-cta {
  text-align: center;
  padding: 8px 0 96px;
}

.final-cta .mark { margin: 0 auto 26px; }

.final-cta h2 {
  font-size: clamp(30px, 4.5vw, 44px);
  margin-bottom: 24px;
  max-width: 16em;
  margin-inline: auto;
}

.final-cta .store-badges { justify-content: center; }

/* --------------------------------- footer -------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  padding: 42px 0 50px;
}

.site-footer .wrap { display: grid; gap: 10px; }

.site-footer a { color: var(--ink); text-decoration-color: var(--line); }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 19px;
  margin-bottom: 8px;
}

.footer-brand .mark { width: 30px; height: 30px; border-radius: 9px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-weight: 600;
}

/* ------------------------------ legal pages ------------------------------ */

.legal-main { padding: 40px 0 80px; }
.legal-main .wrap { max-width: 760px; }

.legal-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
}

.legal-toggle a { padding: 8px 22px; text-decoration: none; color: var(--ink-soft); cursor: pointer; }
.legal-toggle a.active { background: var(--accent); color: var(--on-accent); }

.legal-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 40px 44px;
}

.legal-doc h1 { font-size: 34px; margin-bottom: 4px; }

.legal-doc .effective {
  color: var(--ink-faint);
  font-size: 14px;
  margin: 0 0 24px;
}

.legal-doc h2 {
  font-size: 21px;
  margin: 34px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.legal-doc p, .legal-doc li { color: var(--ink-soft); }
.legal-doc strong { color: var(--ink); }
.legal-doc ul { padding-inline-start: 22px; }

.legal-doc a {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 18px 0 4px;
}

.callout, .callout strong { color: var(--ink); }

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-shot { order: -1; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .legal-doc { padding: 26px 22px 32px; }
  .header-nav { gap: 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-shot { animation: none; opacity: 1; }
}
