@import url("/assets/fonts/google-sans.css");
:root {
  /* palette in OKLCH (perceptual) — values computed from the original hex, visually identical */
  --bg: oklch(0.187 0.025 214);          /* oklch(0.187 0.025 214.476) */
  --bg-deep: oklch(0.135 0.017 210);     /* oklch(0.135 0.017 210.139) */
  --text: oklch(0.971 0.004 220);        /* oklch(0.971 0.003 219.533) */
  --muted: oklch(0.676 0.020 222);       /* oklch(0.675 0.02 222.287) */
  --accent: oklch(0.801 0.128 202.5);    /* oklch(0.801 0.128 202.525) */
  --accent-strong: oklch(0.86 0.128 202.5); /* hover — one tonal step up */
  --cta: oklch(0.554 0.093 209.458);                        /* deep teal — legible with white text (4.6:1) */
  --cta-hover: oklch(0.628 0.105 206.454);
  --card: oklch(1 0 0 / 0.035);
  --hairline: oklch(1 0 0 / 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; background: var(--bg-deep); }

/* Page-anchored gradient: teal glow pooled at the bottom of the whole document,
   fading up to near-black at the top. Lives on `body` (full page height) rather
   than a fixed pseudo so it spans the entire scroll, not just the viewport. */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh;
  background: radial-gradient(135% 52% at 50% 100%, oklch(0.269 0.043 229.335) 0%, oklch(0.197 0.027 221.959) 34%, var(--bg-deep) 68%) no-repeat;
  color: var(--text);
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: oklch(0.194 0.028 212.05); }

.nobr { white-space: nowrap; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Screen-reader-only text */
.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 — visible only on focus */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: oklch(0.194 0.028 212.05);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: translateY(0); outline-offset: 2px; }

main { width: 100%; isolation: isolate; }

/* ---- Type ---- */
h1 {
  font-size: clamp(40px, 7vw, 62px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 20px;
  max-width: 13ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(26px, 3.6vw, 37px);
  font-weight: 500;
  letter-spacing: -0.006em;
  line-height: 1.14;
  margin-bottom: 15px;
  max-width: 16ch;
  text-wrap: balance;
}
.lede {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 300;
  letter-spacing: -0.003em;
  color: oklch(0.872 0.012 217.553);
  max-width: 34ch;
  text-wrap: pretty;
}

/* ---- App Store badge button ---- */
.badge {
  display: inline-block;
  margin-top: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}
.badge img { display: block; height: 54px; width: auto; }
.badge:hover { transform: translateY(-1px); }
.badge:active { transform: scale(0.96); opacity: 0.92; }

/* App Store rating (real: 4.8 from 34 ratings) */
.rating {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 300;
  color: oklch(0.872 0.012 217.553);
  letter-spacing: 0.1px;
}
.rating .stars {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
}
.rating-text { font-variant-numeric: tabular-nums; }

.note {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
}

/* ---- Header: brand lockup (left) + Get (right) ---- */
.brand {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand-name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.get-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 22px;
  background: var(--cta);
  color: oklch(1 0 0);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.get-btn:hover { transform: translateY(-1px); background: var(--cta-hover); }
.get-btn:active { transform: scale(0.96); }

/* ---- Sticky morph ---- */
.scrolly-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.steps { min-width: 0; }
.step {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}
.step h2 { max-width: 14ch; }
.step p {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 300;
  letter-spacing: -0.003em;
  color: oklch(0.872 0.012 217.553);
  max-width: 32ch;
  text-wrap: pretty;
}
.step-visual { display: block; margin-top: 30px; }
.step-visual img { display: block; max-width: 100%; width: 244px; height: auto; }
.js-ready .step-visual { display: none; }

/* Hero = act 1 of the pinned sequence */
.hero-step { min-height: 80vh; }
.hero-step h1 { margin-bottom: 20px; }
.hero-step .lede {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 300;
  letter-spacing: -0.003em;
  color: oklch(0.872 0.012 217.553);
  max-width: 34ch;
  text-wrap: pretty;
}
.hero-step .badge { margin-top: 30px; }
.hero-step .rating { margin-top: 16px; }
.hero-step .note { font-size: 14px; font-weight: 300; color: var(--muted); margin-top: 10px; }

.visual {
  display: none;
}
.js-ready .visual {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.visual-stage {
  position: relative;
  width: 286px;
  aspect-ratio: 589 / 1655;
  filter: drop-shadow(0 36px 70px oklch(0 0 0 / 0.55));
}
/* base layer always opaque so the page background never shows between screens;
   each screen cross-dissolves in place, no movement */
.visual-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.visual-stage img.on { opacity: 1; }

/* Captions + dots are only used by the mobile pinned morph */
.visual-captions { display: none; }
.visual-dots { display: none; }

/* ---- At home on iOS ---- */
.ios {
  max-width: 1040px;
  margin: 0 auto;
  padding: 112px 24px 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.ios-grid {
  margin-top: 52px;
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 40px;
}
/* four across on big screens */
@media (min-width: 920px) {
  .ios-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: none;
    gap: 30px;
  }
}
.ios-card {
  padding: 22px 0;
  text-align: left;
}
/* fixed-height icon slot so a non-square logo (Widgets) causes no layout shift */
.ios-ic {
  display: flex;
  align-items: center;
  height: 52px;
  margin-bottom: 16px;
}
.ios-ic img {
  height: 48px;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.3), 0 0 0 0.5px oklch(1 0 0 / 0.06);
}
.ios-ic img.logo-wide {
  height: auto;
  width: 78px;
  border-radius: 0;
  box-shadow: none;
}
.ios-card h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.004em;
  margin-bottom: 6px;
}
.ios-card p {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: -0.002em;
  color: var(--muted);
  text-wrap: pretty;
  max-width: 34ch;
}

/* ---- Close ---- */
.close {
  max-width: 1040px;
  margin: 0 auto;
  padding: 112px 24px 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* ---- Legal / privacy page ---- */
.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}
.legal h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  max-width: none;
  text-wrap: balance;
}
.legal .updated {
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
  margin-bottom: 34px;
}
.legal p {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  color: oklch(0.872 0.012 217.553);
  margin-bottom: 18px;
  max-width: none;
  text-wrap: pretty;
}
.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal-back { margin-top: 36px; font-size: 15px; }

/* ---- Footer ---- */
footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 52px 24px 60px;
  text-align: left;
  border-top: 1px solid var(--hairline);
}
footer p { font-size: 13.5px; font-weight: 300; }
footer .muted { color: var(--muted); margin-top: 5px; }
footer .credit { margin-top: 14px; color: oklch(0.624 0.019 225.358); }
footer .credit a {
  color: oklch(0.778 0.014 221.467);
  text-decoration: none;
  transition: color 0.18s ease;
}
footer .credit a:hover { color: var(--accent-strong); }

/* ---- Modal ---- */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.126 0.015 213.961 / 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: oklch(0.994 0 0);
  color: oklch(0.179 0.015 220.651);
  border-radius: 26px;
  padding: 30px 26px 24px;
  text-align: center;
  box-shadow: 0 30px 90px oklch(0 0 0 / 0.5);
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  filter: blur(3px);
  transition:
    opacity 0.3s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.3s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; }
.modal.is-open .modal-card { opacity: 1; transform: translateY(0) scale(1); filter: none; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: oklch(0.179 0.015 220.651 / 0.06);
  color: oklch(0.444 0.016 219.856);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
/* extend the tap target to 44x44 without changing the visual size */
.modal-close::before {
  content: "";
  position: absolute;
  inset: -7px;
}
.modal-close:hover { background: oklch(0.179 0.015 220.651 / 0.12); }
.modal-close:active { transform: scale(0.94); }

.qr {
  width: 188px;
  height: 188px;
  margin: 4px auto 18px;
  padding: 10px;
  border-radius: 16px;
  background: oklch(1 0 0);
}
.qr img { width: 100%; height: 100%; display: block; }

.modal-card h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
  color: oklch(0.179 0.015 220.651);
  margin-bottom: 5px;
  max-width: none;
}
.modal-card > p {
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.4;
  color: oklch(0.512 0.02 229.337);
  text-wrap: pretty;
  margin: 0 auto;
  max-width: 25ch;
}
.modal-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: oklch(0.545 0.091 205.675);
  text-decoration: none;
}
.modal-link:hover { text-decoration: underline; }

/* dark focus ring on the light modal card (the cyan ring is too faint on white) */
.modal-card :focus-visible { outline-color: oklch(0.179 0.015 220.651); }

/* ---- Mobile: semantic text and static screenshots remain visible ---- */
@media (max-width: 760px) {
  h1 { font-size: clamp(34px, 11vw, 50px); max-width: none; }
  .scrolly-inner { grid-template-columns: 1fr; gap: 0; }
  .step, .hero-step { min-height: 0; padding: 40px 0; }
  .step:not(:first-child) { border-top: 1px solid var(--hairline); }
  .step h2 { max-width: 22ch; }
  .step p, .hero-step .note, .note, .rating { font-size: 16px; }
  .step-visual, .js-ready .step-visual { display: block; width: 100%; margin-top: 24px; }
  .step-visual img { max-width: 100%; width: 220px; height: auto; }
  .visual, .js-ready .visual { display: none; }
  .ios { padding-top: 64px; padding-bottom: 64px; }
  .ios-grid { grid-template-columns: 1fr; margin-top: 24px; gap: 8px; }
  .ios-card p { font-size: 16px; }
  .close { padding-top: 64px; padding-bottom: 64px; }
  footer p { font-size: 16px; }
  .get-btn { min-height: 48px; }
  .guide-links { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .visual-stage img { transition: opacity 0.2s ease; }
  .modal-card { transition: opacity 0.2s ease; transform: none; filter: none; }
  .modal.is-open .modal-card { transform: none; }
  .anim .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity 0.2s ease;
  }
}

/* Shared reading content and resource links */
.guide-links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 24px; font-size: 16px; }
.guide-links a { text-underline-offset: 4px; }
.guide { max-width: 1040px; margin: 0 auto; padding: 24px 24px 80px; }
.guide h1 { max-width: 24ch; margin-top: 36px; }
.guide h2, .converter-help h2 { max-width: 35ch; margin-top: 40px; }
.guide h3, .converter-help h3 { margin-top: 24px; margin-bottom: 12px; font-weight: 500; }
.guide p, .guide li, .converter-help p, .converter-help li { font-size: 16px; color: oklch(0.872 0.012 217.553); max-width: 64ch; text-wrap: pretty; }
.guide p, .converter-help p { margin-top: 16px; }
.guide .guide-lede { font-size: 19px; max-width: 48ch; }
.guide ol, .converter-help ol { padding-left: 24px; margin-top: 16px; }
.guide li, .converter-help li { padding-bottom: 12px; }
.converter-help { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.unicode-paleo { font-family: Runic, sans-serif; }
.table-scroll { overflow-x: auto; margin-top: 24px; max-width: 720px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
caption { text-align: left; color: var(--muted); padding-bottom: 12px; }
th, td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--hairline); }
th { font-weight: 500; }
td.unicode-paleo, td[lang="he"] { font-size: 28px; }
table code { font-size: 14px; }
.brand-icon { flex-shrink: 0; }

/* Resource pages share the site's reading layout. */
.guide p, .guide li { line-height: 1.75; }
.guide h1 { text-wrap: pretty; }
.guide th { white-space: nowrap; }
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 28px 0; }
.resource-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--card); color: var(--accent); font: inherit; text-decoration: none; cursor: pointer; }
.resource-button:hover { background: oklch(1 0 0 / 0.08); }
.resource-button[hidden] { display: none; }
.resource-list { margin-top: 32px; }
.resource-list section { border-top: 1px solid var(--hairline); padding-bottom: 28px; }
.guide .source-note { margin-top: 40px; color: var(--muted); }
.home-resources { padding-top: 32px; border-top: 1px solid var(--hairline); }
.print-sheet { max-width: 720px; }
.print-sheet .print-source { color: var(--muted); }
.skip-link { position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100; background: var(--bg-deep); padding: 12px; }
.skip-link:focus { top: 8px; }
[dir="rtl"] .brand, [dir="rtl"] footer, [dir="rtl"] caption, [dir="rtl"] th, [dir="rtl"] td { text-align: start; }
[dir="rtl"] .guide h1 { max-width: 26ch; }
[dir="rtl"] .guide ol { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .guide p { max-width: 64ch; }
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: white !important; color: black !important; color-scheme: light; }
  body:has(.print-sheet) .guide > :not(.print-sheet) { display: none; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; top: 0; left: 0; width: 100%; max-width: none; }
  .print-sheet h2 { color: black; margin: 0 0 8px; font-size: 23px; max-width: none; }
  .print-sheet p { color: black !important; font-size: 11px; line-height: 1.4; max-width: none; margin: 8px 0; }
  .print-sheet .table-scroll { margin-top: 10px; max-width: none; overflow: visible; }
  .print-sheet table { font-size: 11px; }
  .print-sheet caption { font-size: 11px; color: oklch(0.321 0 0); padding-bottom: 6px; }
  .print-sheet th, .print-sheet td { padding: 3px 8px; color: black; border-color: oklch(0.898 0 0); }
  .print-sheet td.unicode-paleo, .print-sheet td[lang="he"] { font-size: 20px; line-height: 1.2; }
  .print-sheet code { font-size: 10px; }
  body:has(.print-sheet) header, body:has(.print-sheet) footer, body:has(.print-sheet) .skip-link { display: none; }
  .guide { padding: 0; }
}

/* Google Sans for Hebrew text; ancient characters retain their script font. */
:lang(he):not(.unicode-paleo) { font-family: "Google Sans", -apple-system, sans-serif; }
