/* Dovrim site stylesheet — landing + legal template + 404.
   Zero external requests: fonts self-hosted at /fonts/. */

/* ---------- Fonts (variable TTFs) ---------- */
@font-face {
  font-family: "Heebo";
  src: url("/fonts/Heebo.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --blue: #2f7bff;
  --blue-deep: #1b5fe0;
  --blue-soft: #eaf1ff;
  --green: #3eaa5f;
  --paper: #f7f8fd;
  --ink: #121a2a;
  --muted: #5a6474;
  --line: #e4e8f2;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(18, 26, 42, 0.05), 0 8px 24px rgba(18, 26, 42, 0.06);
  --shadow-lg: 0 2px 4px rgba(18, 26, 42, 0.06), 0 20px 48px rgba(18, 26, 42, 0.12);
  --font-he: "Heebo", "Segoe UI", sans-serif;
  --font-en: "Plus Jakarta Sans", "Heebo", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-he);
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

img { display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--blue-soft); }

/* ---------- Shared footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 32px 24px 48px;
  font-size: 0.92rem;
  color: var(--muted);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
  margin: 0 auto 12px;
  max-width: 960px;
}
.foot-links a { color: var(--muted); font-weight: 500; }
.foot-links a:hover { color: var(--blue-deep); }
.foot-links .dev { font-family: var(--font-en); }
.site-footer .copy { text-align: center; margin: 0; font-size: 0.85rem; }

/* ---------- Legal header bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 253, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
}
.bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
}
.bar-brand:hover { color: var(--blue-deep); text-decoration: none; }
.bar-brand img { border-radius: 8px; }

/* ---------- Legal document sheet ---------- */
.doc {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 74ch;
  margin: 36px auto 0;
  padding: clamp(28px, 5vw, 56px);
  font-size: 1.02rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}
@media (max-width: 640px) {
  .doc { margin: 12px 8px 0; border-radius: 16px; }
}

/* Per-block direction resolution: base container stays LTR, and every text
   block resolves its own direction from its first strong character — so the
   Hebrew half of a bilingual document renders RTL and the English half LTR
   without touching the markdown source. The embedded <div dir="rtl"> still
   governs marker/border sides and table column order via the inherited
   `direction` property. */
.doc h1, .doc h2, .doc h3, .doc h4,
.doc p, .doc li, .doc th, .doc td, .doc blockquote {
  unicode-bidi: plaintext;
  text-align: start;
}

.doc h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  line-height: 1.25;
  margin: 0.4em 0 0.7em;
  letter-spacing: -0.01em;
}
.doc h2 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 2.4em 0 0.7em;
}
.doc h3 { font-size: 1.1rem; font-weight: 700; margin: 2em 0 0.5em; }
.doc h4 { font-size: 1rem; font-weight: 700; margin: 1.6em 0 0.4em; }

.doc a { text-decoration: underline; text-decoration-color: rgba(47, 123, 255, 0.35); }
.doc a:hover { text-decoration-color: currentColor; }

.doc strong { font-weight: 700; }

.doc ul, .doc ol { padding-inline-start: 1.5em; margin: 0.8em 0; }
.doc li { margin: 0.3em 0; }

.doc hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

.doc blockquote {
  margin: 1.5em 0;
  padding: 12px 18px;
  background: var(--blue-soft);
  border-inline-start: 4px solid var(--blue);
  border-radius: 10px;
}
.doc blockquote p { margin: 0.3em 0; }

.doc code {
  background: var(--blue-soft);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}

/* GFM tables — real styled tables with horizontal overflow on narrow screens */
.doc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.94rem;
  line-height: 1.55;
}
.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  vertical-align: top;
  min-width: 8ch;
}
.doc th { background: var(--blue-soft); font-weight: 700; }
.doc tbody tr:nth-child(even) { background: #fbfcff; }

/* ---------- Landing ---------- */
.home {
  background:
    radial-gradient(1100px 560px at 18% -12%, #dfe9ff 0%, rgba(223, 233, 255, 0) 62%),
    var(--paper);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 32px;
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 104px) 28px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
}
.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  box-shadow: var(--shadow);
}
.brand-he { font-size: 1.7rem; font-weight: 800; }
.brand-en {
  font-family: var(--font-en);
  font-weight: 500;
  color: var(--muted);
  font-size: 1.05rem;
  padding-top: 0.35em;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}
.hero h1 em { font-style: normal; color: var(--blue); }

.tagline-en {
  font-family: var(--font-en);
  font-weight: 400;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 0 0 32px;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: var(--shadow);
  margin: 0;
}
.soon .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(62, 170, 95, 0.4);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 170, 95, 0.4); }
  70% { box-shadow: 0 0 0 9px rgba(62, 170, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 170, 95, 0); }
}

/* The א ↔ A motif — two speech bubbles, echoing the app icon */
.hero-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.bubble {
  display: grid;
  place-items: center;
  width: clamp(110px, 13vw, 158px);
  aspect-ratio: 1;
  font-size: clamp(56px, 6.5vw, 82px);
  line-height: 1;
  user-select: none;
}
.bubble-alef {
  font-weight: 900;
  background: var(--card);
  color: var(--blue);
  border-radius: 34px 34px 10px 34px; /* tail toward the Hebrew side */
  box-shadow: var(--shadow-lg);
  transform: rotate(-6deg) translate(26px, -34px);
  z-index: 1;
}
.bubble-a {
  font-family: var(--font-en);
  font-weight: 800;
  background: var(--blue);
  color: #fff;
  border-radius: 34px 34px 34px 10px; /* tail toward the English side */
  box-shadow: 0 20px 44px rgba(47, 123, 255, 0.35);
  transform: rotate(5deg) translate(-26px, 34px);
}

/* Feature cards */
.features {
  max-width: 1020px;
  margin: 0 auto;
  padding: 24px 28px 8px;
}
.features-title {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 900;
  margin: 0 0 24px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.chip {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin: 0 0 14px;
}
.card h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* Staggered hero reveal (CSS only) */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.r1, .r2, .r3, .r4 { animation: rise 0.65s cubic-bezier(0.22, 0.7, 0.3, 1) both; }
.r2 { animation-delay: 0.09s; }
.r3 { animation-delay: 0.18s; }
.r4 { animation-delay: 0.27s; }
/* Bubbles get their own keyframes so the reveal lands on their rotated resting transform */
.hero-mark .bubble-alef { animation: rise-alef 0.7s cubic-bezier(0.22, 0.7, 0.3, 1) 0.22s both; }
.hero-mark .bubble-a { animation: rise-a 0.7s cubic-bezier(0.22, 0.7, 0.3, 1) 0.34s both; }
@keyframes rise-alef {
  from { opacity: 0; transform: rotate(-6deg) translate(26px, -16px); }
  to { opacity: 1; transform: rotate(-6deg) translate(26px, -34px); }
}
@keyframes rise-a {
  from { opacity: 0; transform: rotate(5deg) translate(-26px, 52px); }
  to { opacity: 1; transform: rotate(5deg) translate(-26px, 34px); }
}

@media (prefers-reduced-motion: reduce) {
  .r1, .r2, .r3, .r4, .hero-mark .bubble-alef, .hero-mark .bubble-a { animation: none; }
  .soon .dot { animation: none; }
  .card { transition: none; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-mark { min-height: 240px; margin-top: 8px; }
}

/* ---------- 404 ---------- */
.notfound main {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}
.notfound .code {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(4.5rem, 16vw, 8rem);
  line-height: 1;
  color: var(--blue);
  margin: 0 0 8px;
}
.notfound h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.notfound .en-line {
  font-family: var(--font-en);
  color: var(--muted);
  margin: 0 0 28px;
}
.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 28px;
  box-shadow: 0 10px 24px rgba(47, 123, 255, 0.3);
  transition: background 0.15s ease;
}
.btn:hover { background: var(--blue-deep); color: #fff; text-decoration: none; }
