:root {
  color-scheme: light;
  --paper: #fffaf0;
  --paper-soft: #f7edda;
  --warm: #d8bf93;
  --sand: #c9aa73;
  --gold: #a77a2e;
  --gold-deep: #7c551c;
  --ink: #2e241b;
  --muted: #6f6254;
  --line: rgba(105, 77, 42, 0.24);
  --blue: #415d66;
  --sage: #617263;
  --shadow: rgba(58, 40, 18, 0.18);
  --hero-x: 50%;
  --hero-y: 50%;
  --progress: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px) 0 0 / 78px 78px,
    linear-gradient(180deg, rgba(124, 85, 28, 0.06), transparent 260px),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.75;
}

body[dir="rtl"] {
  font-family: "Segoe UI", Arial, sans-serif;
}

body[dir="ltr"] {
  font-family: Georgia, "Times New Roman", serif;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 50;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  position: relative;
  overflow: hidden;
}

.progress-rail {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: 4px;
  height: 100vh;
  z-index: 30;
  background: rgba(124, 85, 28, 0.12);
}

.progress-rail::after {
  content: "";
  display: block;
  width: 100%;
  height: calc(var(--progress) * 100%);
  background: linear-gradient(180deg, #f7d79a, var(--gold), var(--blue));
  transform-origin: top;
}

.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 34px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
  border-bottom: 1px solid rgba(124, 85, 28, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(167, 122, 46, 0.28);
  box-shadow: 0 8px 24px rgba(124, 85, 28, 0.13);
}

.brand span {
  display: grid;
  gap: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  padding: 9px 12px;
  border-radius: 999px;
  color: rgba(46, 36, 27, 0.78);
  font-size: 0.92rem;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(167, 122, 46, 0.12);
  color: var(--ink);
  outline: none;
}

.nav .lang {
  color: var(--gold-deep);
  border: 1px solid rgba(167, 122, 46, 0.34);
}

.language-nav {
  margin-inline-start: auto;
}

.language-nav .lang {
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(124, 85, 28, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
}

.hero {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 96px 18px 34px;
  isolation: isolate;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 241, 210, 0.88), rgba(247, 237, 218, 0.48) 36%, rgba(255, 250, 240, 0.96) 72%),
    linear-gradient(180deg, #fffdf7 0%, var(--paper) 100%);
  transform: translate3d(calc((var(--hero-x) - 50%) * -0.035), calc((var(--hero-y) - 50%) * -0.025), 0) scale(1.03);
  transition: transform 160ms linear;
}

body[dir="rtl"] .hero::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 241, 210, 0.88), rgba(247, 237, 218, 0.48) 36%, rgba(255, 250, 240, 0.96) 72%),
    linear-gradient(180deg, #fffdf7 0%, var(--paper) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at var(--hero-x) var(--hero-y), rgba(255, 237, 196, 0.32), transparent 230px),
    linear-gradient(180deg, rgba(255, 250, 240, 0) 72%, var(--paper) 100%);
  pointer-events: none;
}

.hero-cover-frame {
  position: relative;
  width: min(48vw, 560px);
  max-width: min(92vw, 560px);
  animation: cover-breathe 8s ease-in-out infinite;
  filter: drop-shadow(0 26px 42px rgba(92, 60, 22, 0.18));
}

.hero-cover-he {
  width: min(48vw, 560px, calc((100svh - 132px) * 0.6666));
}

.hero-cover-en {
  width: min(48vw, 560px, calc((100svh - 132px) * 0.6952));
}

.hero-cover {
  width: 100%;
  height: auto;
  max-height: calc(100svh - 132px);
  object-fit: contain;
  border-radius: 2px;
}

.hero-cover-button {
  position: absolute;
  left: 50%;
  z-index: 3;
  width: auto;
  min-width: 180px;
  max-width: 72%;
  margin: 0;
  padding: 10px 22px;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(46, 36, 27, 0.22);
  transform: translateX(-50%);
}

body[dir="rtl"] .hero-cover-button {
  transform: translateX(-50%);
}

.hero-cover-he .hero-cover-button {
  top: 67.3%;
}

.hero-cover-en .hero-cover-button {
  top: 65.3%;
}

.hero-content {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
}

body[dir="rtl"] .hero-content {
  margin-inline-start: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--gold-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.08;
}

body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3 {
  font-family: Georgia, "Times New Roman", "Segoe UI", serif;
}

h1 {
  font-size: 4.7rem;
  max-width: 10ch;
}

.hero-question {
  margin: 0;
  color: var(--muted);
  font-size: 1.38rem;
  max-width: 34rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(124, 85, 28, 0.32);
  background: rgba(255, 250, 240, 0.76);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  background: #fffdf6;
  border-color: rgba(124, 85, 28, 0.54);
  outline: none;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #473420;
  border-color: #473420;
}

.hero-cover-button:hover,
.hero-cover-button:focus-visible {
  transform: translateX(-50%) translateY(-2px);
}

.button[aria-disabled="true"] {
  cursor: default;
  color: rgba(46, 36, 27, 0.52);
  border-color: rgba(124, 85, 28, 0.18);
  background: rgba(255, 250, 240, 0.48);
}

.button[aria-disabled="true"]:hover,
.button[aria-disabled="true"]:focus-visible {
  transform: none;
  background: rgba(255, 250, 240, 0.48);
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  inset-inline: 0;
  margin: auto;
  width: 120px;
  color: rgba(46, 36, 27, 0.72);
  text-align: center;
  font-size: 0.82rem;
}

.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 42px;
  margin: 10px auto 0;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: breathe-line 2.8s ease-in-out infinite;
}

main {
  position: relative;
}

.section {
  min-height: 78vh;
  display: grid;
  align-items: center;
  padding: 72px 7vw;
  border-top: 1px solid rgba(124, 85, 28, 0.11);
  scroll-margin-top: 88px;
}

.section-inner {
  width: min(1120px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 0.72fr 1.15fr 0.78fr;
  gap: 54px;
  align-items: center;
}

body[dir="rtl"] .section-inner {
  grid-template-columns: 0.72fr 1.15fr 0.78fr;
}

.section.no-visual .section-inner,
body[dir="rtl"] .section.no-visual .section-inner {
  grid-template-columns: 0.72fr minmax(0, 1.65fr);
}

.personal-section .section-inner {
  align-items: start;
}

.personal-section {
  min-height: 70vh;
  padding-top: 58px;
}

.section-alt {
  background:
    linear-gradient(180deg, rgba(65, 93, 102, 0.06), transparent 42%),
    rgba(255, 250, 240, 0.68);
}

.section-meta {
  display: grid;
  align-content: start;
  gap: 14px;
}

.number {
  color: rgba(167, 122, 46, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.8rem;
  line-height: 1;
}

.section-kicker {
  color: var(--gold-deep);
  font-size: 0.93rem;
  font-weight: 700;
}

.section h2 {
  font-size: 3.15rem;
}

.section-copy {
  display: grid;
  gap: 14px;
  max-width: 710px;
}

.section-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.16rem;
}

.lead {
  color: var(--ink) !important;
  font-size: 1.32rem !important;
}

.micro-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.micro-list li {
  padding: 11px 0;
  border-top: 1px solid rgba(124, 85, 28, 0.16);
  color: var(--ink);
}

.visual-panel {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.pendulum {
  position: relative;
  width: min(430px, 84vw);
  height: 310px;
  border-bottom: 1px solid rgba(124, 85, 28, 0.22);
}

.pendulum::before {
  content: "";
  position: absolute;
  top: 26px;
  inset-inline: 0;
  margin: auto;
  width: 260px;
  height: 1px;
  background: rgba(65, 93, 102, 0.28);
}

.pendulum-arm {
  position: absolute;
  top: 26px;
  inset-inline: 0;
  margin: auto;
  width: 2px;
  height: 205px;
  background: linear-gradient(180deg, var(--blue), rgba(65, 93, 102, 0.28));
  transform-origin: 50% 0;
  animation: pendulum 5.8s ease-in-out infinite;
}

.pendulum-arm::after {
  content: "";
  position: absolute;
  bottom: -26px;
  inset-inline-start: -26px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff5d8, var(--gold) 52%, var(--gold-deep));
  box-shadow: 0 18px 38px rgba(124, 85, 28, 0.22);
}

.pendulum-labels {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.energy-scale {
  width: min(430px, 84vw);
  display: grid;
  gap: 16px;
}

.scale-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(124, 85, 28, 0.15);
}

body[dir="rtl"] .scale-step {
  grid-template-columns: 1fr 42px;
}

.scale-mark,
.scale-step > span:first-child {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(65, 93, 102, 0.1);
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
}

.scale-step strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.scale-step span:last-child {
  color: var(--muted);
  font-size: 0.96rem;
}

.books {
  padding: 72px 7vw;
  background: #fbf3e5;
  scroll-margin-top: 88px;
}

.books-head {
  width: min(900px, 100%);
  margin: 0 auto 24px;
  text-align: center;
}

.books-head h2 {
  font-size: 3rem;
}

.books-head p {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 720px;
}

.book-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.book-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(124, 85, 28, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 16px 42px rgba(58, 40, 18, 0.07);
}

.book-card .tag {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(65, 93, 102, 0.1);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}

.book-card h3 {
  font-size: 1.28rem;
}

.book-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.book-card a {
  margin-top: auto;
  color: var(--gold-deep);
  font-weight: 700;
}

.about-contact {
  padding: 76px 7vw 56px;
  scroll-margin-top: 88px;
}

.about-grid {
  width: min(790px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  text-align: center;
}

body[dir="rtl"] .about-grid {
  grid-template-columns: 1fr;
}

.about-copy h2 {
  font-size: 2.7rem;
}

.about-copy p {
  color: var(--muted);
  font-size: 1.12rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 24;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(124, 85, 28, 0.28);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.86);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(58, 40, 18, 0.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body[dir="rtl"] .back-top {
  right: auto;
  left: 20px;
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.footer {
  padding: 28px 7vw 44px;
  color: var(--muted);
  border-top: 1px solid rgba(124, 85, 28, 0.12);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.footer-logo {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(167, 122, 46, 0.24);
  box-shadow: 0 12px 28px rgba(124, 85, 28, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes breathe-line {
  0%,
  100% {
    transform: scaleY(0.65);
    opacity: 0.42;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes pendulum {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(18deg);
  }
}

@keyframes cover-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 1040px) {
  .nav {
    position: fixed;
    top: 78px;
    inset-inline: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    background: rgba(255, 250, 240, 0.97);
    border: 1px solid rgba(124, 85, 28, 0.16);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(58, 40, 18, 0.16);
  }

  body.menu-open .nav {
    display: flex;
  }

  .language-nav,
  body.menu-open .language-nav {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav a {
    border-radius: 6px;
  }

  .language-nav a {
    border-radius: 999px;
  }

  .menu-toggle {
    display: none;
    place-items: center;
  }

  .section-inner,
  body[dir="rtl"] .section-inner,
  .about-grid,
  body[dir="rtl"] .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .visual-panel {
    min-height: 300px;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand span {
    font-size: 0.98rem;
  }

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

  .hero {
    padding: 80px 10px 24px;
  }

  .hero-content.reveal {
    opacity: 1;
    transform: none;
  }

  .hero::before,
  body[dir="rtl"] .hero::before {
    background:
      radial-gradient(circle at 50% 43%, rgba(255, 241, 210, 0.9), rgba(247, 237, 218, 0.5) 42%, rgba(255, 250, 240, 0.98) 78%),
      linear-gradient(180deg, #fffdf7 0%, var(--paper) 100%);
  }

  .hero-cover-frame {
    width: min(91vw, 430px);
    max-width: 91vw;
  }

  .hero-cover-he {
    width: min(91vw, 430px, calc((100svh - 106px) * 0.6666));
  }

  .hero-cover-en {
    width: min(91vw, 430px, calc((100svh - 106px) * 0.6952));
  }

  .hero-cover {
    max-height: calc(100svh - 106px);
  }

  .hero-cover-button.button {
    width: auto;
    min-width: 154px;
    max-width: 68%;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.88rem;
  }

  .hero-cover-he .hero-cover-button {
    top: 67.3%;
  }

  .hero-cover-en .hero-cover-button {
    top: 65.6%;
  }

  h1 {
    font-size: 2.58rem;
    max-width: 9ch;
  }

  .hero-question {
    font-size: 1.12rem;
  }

  .actions,
  .contact-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section,
  .books,
  .about-contact {
    padding: 54px 22px;
  }

  .section {
    min-height: auto;
  }

  .personal-section {
    padding-top: 42px;
  }

  .section-inner,
  body[dir="rtl"] .section-inner,
  .about-grid,
  body[dir="rtl"] .about-grid {
    gap: 26px;
  }

  .section.no-visual .section-inner,
  body[dir="rtl"] .section.no-visual .section-inner {
    grid-template-columns: 1fr;
  }

  .section-meta {
    gap: 8px;
  }

  .section-meta .number {
    margin-bottom: 2px;
  }

  .number {
    font-size: 3.4rem;
  }

  .section h2,
  .books-head h2,
  .about-copy h2 {
    font-size: 2.1rem;
  }

  .section-copy p,
  .lead,
  .about-copy p {
    font-size: 1.02rem !important;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .pendulum,
  .energy-scale {
    width: 100%;
  }

  .progress-rail {
    width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
