:root {
  --ink: #173f33;
  --ink-soft: #52665d;
  --leaf: #225b43;
  --leaf-dark: #123d2f;
  --paper: #fffdf6;
  --paper-deep: #f3ead2;
  --gold: #cba83a;
  --coral: #cd624c;
  --line: #c9c7b5;
  --shadow: 0 24px 70px rgba(18, 52, 40, 0.22);
  color: var(--ink);
  background: #dfe8d9;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(225, 235, 218, 0.9), rgba(247, 242, 226, 0.96)),
    url("/assets/live-rooted/course-worlds/garden-foundations/area-4.webp") center / cover fixed;
}

button,
select {
  font: inherit;
}

button,
a,
select {
  outline-offset: 3px;
}

.rooted-book-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid rgba(23, 63, 51, 0.2);
  background: rgba(255, 253, 246, 0.97);
}

.rooted-book-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.rooted-book-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.rooted-book-brand span,
.rooted-book-brand strong,
.rooted-book-brand small {
  display: block;
}

.rooted-book-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.rooted-book-brand small {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.rooted-book-header nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rooted-book-header nav span,
.rooted-book-header nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #fffef9;
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.rooted-book-header nav span {
  border-color: #d9c57a;
  background: #fff5d5;
}

.rooted-book-profile {
  width: min(1440px, calc(100% - 32px));
  margin: 26px auto 56px;
}

.rooted-book-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 26px clamp(20px, 4vw, 48px);
  border: 1px solid rgba(23, 63, 51, 0.22);
  border-radius: 7px 7px 0 0;
  background: rgba(255, 253, 246, 0.96);
}

.rooted-book-intro > div:first-child > span,
.rooted-book-future > div > span {
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rooted-book-intro h1 {
  margin: 7px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
}

.rooted-book-intro p {
  max-width: 800px;
  margin: 0;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

.rooted-book-summary {
  min-width: 170px;
  padding: 15px;
  border-left: 4px solid var(--gold);
  background: #fff5d6;
}

.rooted-book-summary strong,
.rooted-book-summary span,
.rooted-book-summary small {
  display: block;
}

.rooted-book-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.rooted-book-summary span {
  color: #705b25;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rooted-book-summary small {
  margin-top: 6px;
  color: #705b25;
  line-height: 1.35;
}

.rooted-book-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 12px clamp(20px, 4vw, 48px);
  border: 1px solid var(--line);
  border-top: 0;
  background: rgba(249, 246, 235, 0.97);
}

.rooted-book-controls label {
  display: grid;
  gap: 5px;
}

.rooted-book-controls label span,
.rooted-book-position span {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rooted-book-controls select {
  width: min(100%, 420px);
  min-height: 40px;
  padding: 0 34px 0 10px;
  border: 1px solid #aab4a2;
  border-radius: 5px;
  color: var(--ink);
  background: #fffef9;
  font-weight: 800;
}

.rooted-book-position {
  display: grid;
  min-width: 88px;
  gap: 4px;
  text-align: center;
}

.rooted-book-controls button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #b78178;
  border-radius: 5px;
  color: #873c31;
  background: #fff6f2;
  font-weight: 900;
  cursor: pointer;
}

.rooted-book-controls button:disabled {
  border-color: #c9cec5;
  color: #8a938c;
  background: #eef0eb;
  cursor: default;
}

.rooted-book-stage {
  min-height: 740px;
  padding: clamp(24px, 5vw, 68px);
  border: 1px solid rgba(23, 63, 51, 0.22);
  border-top: 0;
  background:
    linear-gradient(rgba(25, 73, 53, 0.77), rgba(13, 52, 38, 0.9)),
    url("/assets/live-rooted/course-worlds/garden-foundations/area-4.webp") center / cover;
  perspective: 1800px;
}

.rooted-book-empty {
  display: grid;
  min-height: 580px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: #fffdf3;
}

.rooted-book-empty[hidden],
.rooted-book[hidden],
.rooted-book-turn-controls[hidden] {
  display: none;
}

.rooted-book-empty i {
  color: #efd77b;
  font-size: 3.5rem;
}

.rooted-book-empty h2,
.rooted-book-empty p {
  margin: 0;
}

.rooted-book-empty h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.rooted-book-empty p {
  max-width: 600px;
  color: #e4ecdf;
  line-height: 1.55;
}

.rooted-book-empty a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 8px;
  padding: 0 15px;
  border-radius: 5px;
  color: var(--leaf-dark);
  background: #f1d976;
  font-weight: 900;
  text-decoration: none;
}

.rooted-book {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(1120px, 100%);
  min-height: 610px;
  margin: 0 auto;
  transform-style: preserve-3d;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.26));
}

.rooted-book::before {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  content: "";
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(74, 55, 31, 0.1), rgba(255, 255, 255, 0.42), rgba(74, 55, 31, 0.16));
  pointer-events: none;
}

.rooted-book-page {
  position: relative;
  min-width: 0;
  padding: clamp(28px, 4vw, 54px);
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 253, 246, 0.96), rgba(250, 245, 230, 0.98)),
    url("/assets/live-rooted/member/member-paper-v1.webp") center / 620px;
}

.rooted-book-page.is-context {
  border-radius: 8px 0 0 8px;
  box-shadow: inset -16px 0 26px rgba(86, 67, 38, 0.08);
  transform-origin: right center;
}

.rooted-book-page.is-reflection {
  border-radius: 0 8px 8px 0;
  box-shadow: inset 16px 0 26px rgba(86, 67, 38, 0.08);
  transform-origin: left center;
}

.rooted-book.is-turning-next .is-reflection {
  animation: rooted-page-next 620ms ease-in-out both;
}

.rooted-book.is-turning-previous .is-context {
  animation: rooted-page-previous 620ms ease-in-out both;
}

@keyframes rooted-page-next {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  50% { transform: rotateY(-88deg); filter: brightness(0.84); }
  100% { transform: rotateY(0deg); filter: brightness(1); }
}

@keyframes rooted-page-previous {
  0% { transform: rotateY(0deg); filter: brightness(1); }
  50% { transform: rotateY(88deg); filter: brightness(0.84); }
  100% { transform: rotateY(0deg); filter: brightness(1); }
}

.rooted-book-page-number {
  position: absolute;
  top: 18px;
  color: #8a7a59;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.8rem;
}

.is-context .rooted-book-page-number {
  left: 22px;
}

.is-reflection .rooted-book-page-number {
  right: 22px;
}

.rooted-book-kicker {
  display: block;
  color: var(--coral);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rooted-book-date {
  margin: 8px 0 0;
  color: #7b6a49;
  font-size: 0.76rem;
  font-weight: 800;
}

.rooted-book-page h2 {
  margin: 18px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.03;
}

.rooted-book-location {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 900;
}

.rooted-book-detail {
  margin-top: 21px;
  padding-top: 16px;
  border-top: 1px solid #d8d1bd;
}

.rooted-book-detail > span {
  display: block;
  color: var(--coral);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rooted-book-detail p,
.rooted-book-detail blockquote {
  margin: 8px 0 0;
  color: #355346;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
}

.rooted-book-detail blockquote {
  padding-left: 14px;
  border-left: 3px solid var(--gold);
}

.rooted-book-detail strong {
  display: block;
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.rooted-book-response {
  max-height: 255px;
  margin-top: 18px;
  overflow: auto;
  padding-right: 8px;
}

.rooted-book-response p {
  margin: 0 0 0.9em;
  color: #29483b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.7;
}

.rooted-book-empowerment {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  padding: 13px;
  border-left: 4px solid var(--gold);
  background: #fff4c9;
}

.rooted-book-empowerment i {
  flex: 0 0 auto;
  color: #9a7420;
  font-size: 1.25rem;
}

.rooted-book-empowerment p {
  margin: 0;
  color: #5e4a1e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  line-height: 1.5;
}

.rooted-book-detail.is-small {
  margin-top: 14px;
  padding-top: 12px;
}

.rooted-book-detail.is-small p {
  font-size: 0.86rem;
}

.rooted-book-garden {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  color: #326047;
}

.rooted-book-garden i {
  flex: 0 0 auto;
  font-size: 1.25rem;
}

.rooted-book-garden p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.rooted-book-page footer {
  position: absolute;
  right: 42px;
  bottom: 22px;
  left: 42px;
  padding-top: 8px;
  border-top: 1px solid #ddd5c2;
  color: #8a7a59;
  font-size: 0.62rem;
  text-align: center;
}

.rooted-book-turn-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: min(760px, 100%);
  margin: 28px auto 0;
}

.rooted-book-turn-controls button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 5px;
  color: #fffdf5;
  background: rgba(10, 48, 35, 0.72);
  font-weight: 900;
  cursor: pointer;
}

.rooted-book-turn-controls button:first-child {
  justify-self: end;
}

.rooted-book-turn-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.rooted-book-turn-controls span {
  color: #f0dfa2;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.rooted-book-future {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 30px;
  margin-top: 18px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #b9c7b2;
  border-radius: 7px;
  background: rgba(247, 250, 239, 0.97);
}

.rooted-book-future h2 {
  margin: 7px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.rooted-book-future p,
.rooted-book-future li {
  color: var(--ink-soft);
  line-height: 1.55;
}

.rooted-book-future p {
  margin: 0;
}

.rooted-book-future ul {
  margin: 0;
  padding-left: 21px;
}

.rooted-book-future li + li {
  margin-top: 8px;
}

.rooted-book-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 4px solid var(--leaf);
  background: rgba(255, 253, 246, 0.96);
}

.rooted-book-privacy i {
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.rooted-book-privacy p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.rooted-book-delete-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 1px solid #9da99a;
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.rooted-book-delete-dialog::backdrop {
  background: rgba(10, 38, 29, 0.68);
  backdrop-filter: blur(4px);
}

.rooted-book-delete-dialog form {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.rooted-book-delete-dialog form > i {
  color: var(--coral);
  font-size: 2.25rem;
}

.rooted-book-delete-dialog h2,
.rooted-book-delete-dialog p {
  margin: 0;
}

.rooted-book-delete-dialog h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.rooted-book-delete-dialog p {
  color: var(--ink-soft);
  line-height: 1.5;
}

.rooted-book-delete-dialog form > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.rooted-book-delete-dialog button {
  min-height: 42px;
  border: 1px solid var(--leaf);
  border-radius: 5px;
  color: var(--leaf);
  background: #fff;
  font-weight: 900;
}

.rooted-book-delete-dialog button.is-danger {
  border-color: #a94e40;
  color: #fff;
  background: #a94e40;
}

@media (max-width: 820px) {
  .rooted-book-header {
    position: static;
    display: grid;
    padding: 10px 12px;
  }

  .rooted-book-header nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rooted-book-header nav span,
  .rooted-book-header nav a {
    min-width: 0;
    justify-content: center;
    padding: 0 7px;
    font-size: 0.64rem;
    text-align: center;
  }

  .rooted-book-profile {
    width: 100%;
    margin: 0;
  }

  .rooted-book-intro {
    display: grid;
    align-items: start;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .rooted-book-summary {
    width: 100%;
  }

  .rooted-book-controls {
    grid-template-columns: 1fr auto;
    padding: 12px;
    border-right: 0;
    border-left: 0;
  }

  .rooted-book-controls label {
    grid-column: 1 / -1;
  }

  .rooted-book-controls select {
    width: 100%;
  }

  .rooted-book-stage {
    padding: 22px 12px 30px;
    border-right: 0;
    border-left: 0;
  }

  .rooted-book {
    display: block;
    min-height: 0;
    filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.24));
  }

  .rooted-book::before {
    display: none;
  }

  .rooted-book-page {
    min-height: 590px;
    padding: 38px 24px 58px;
  }

  .rooted-book-page.is-context,
  .rooted-book-page.is-reflection {
    border-radius: 7px;
    box-shadow: inset 0 0 22px rgba(86, 67, 38, 0.08);
  }

  .rooted-book-page.is-reflection {
    margin-top: 12px;
  }

  .rooted-book.is-turning-next .is-reflection,
  .rooted-book.is-turning-previous .is-context {
    animation-name: rooted-page-mobile;
  }

  @keyframes rooted-page-mobile {
    0% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(18px); opacity: 0.35; }
    100% { transform: translateX(0); opacity: 1; }
  }

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

  .rooted-book-turn-controls span {
    display: none;
  }

  .rooted-book-turn-controls button:first-child {
    justify-self: stretch;
  }

  .rooted-book-future {
    grid-template-columns: 1fr;
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .rooted-book-privacy {
    margin-top: 0;
  }
}

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