:root {
  --ink: #2c2418;
  --ink-soft: #6b5d4a;
  --cream: #f3ead7;
  --sage: #5f7a4a;
  --sage-deep: #435334;
  --night-ink: #e8e0d4;
  --radius-sheet: 28px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: #c48a6a;
  overflow-x: hidden;
}

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

/* Full-bleed room — phone sits on top (Cat on Chair style) */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #c48a6a;
}

body[data-mood="night"] .scene {
  background: #2a2a45;
}

.scene__fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Bias toward the arched window so the phone frames it */
  object-position: 68% 42%;
  transition: opacity 0.9s ease;
}

.scene__fill--night {
  opacity: 0;
}

body[data-mood="night"] .scene__fill--night {
  opacity: 1;
}

body[data-mood="night"] .scene__fill--day {
  opacity: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.icon-btn,
.mood-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(44, 36, 24, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.3s ease;
}

.icon-btn:hover,
.mood-toggle:hover {
  transform: scale(1.04);
}

.mood-toggle {
  position: relative;
  font-size: 1.15rem;
  line-height: 1;
}

.mood-toggle__moon {
  position: absolute;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.mood-toggle__sun {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body[data-mood="night"] .mood-toggle {
  background: rgba(36, 40, 58, 0.82);
  color: var(--night-ink);
}

body[data-mood="night"] .mood-toggle__sun {
  opacity: 0;
  transform: scale(0.6);
}

body[data-mood="night"] .mood-toggle__moon {
  opacity: 1;
  transform: scale(1);
}

/* Copy left · phone over window right */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(15rem, 32vw) 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(4.5rem, 8vh, 6rem) clamp(1.5rem, 5vw, 4rem) 2.5rem;
}

.hero__phone {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding-right: clamp(0.5rem, 2vw, 1.5rem);
  animation: float-in 0.9s ease 0.08s both;
}

.phone {
  position: relative;
  width: min(36vw, 340px);
  max-width: 100%;
  aspect-ratio: 357 / 753;
  /* Outline sitting on the continuous room */
  filter: drop-shadow(0 14px 28px rgba(44, 36, 24, 0.28))
    drop-shadow(0 3px 8px rgba(44, 36, 24, 0.16));
}

.hero__copy {
  max-width: 24rem;
  justify-self: start;
  animation: float-in 0.9s ease both;
  /* Direct on background — no frosted card */
}

.hero__mark {
  width: 52px;
  height: auto;
  margin-bottom: 0.45rem;
  filter: drop-shadow(0 3px 8px rgba(44, 36, 24, 0.18));
}

.hero__brand {
  margin: 0;
  font-family: "Jua", sans-serif;
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
  text-shadow:
    0 1px 0 rgba(255, 253, 248, 0.55),
    0 2px 18px rgba(243, 234, 215, 0.7);
}

.hero__line {
  margin: 0.85rem 0 1.35rem;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink);
  max-width: 22rem;
  text-shadow:
    0 1px 0 rgba(255, 253, 248, 0.5),
    0 2px 14px rgba(243, 234, 215, 0.65);
}

body[data-mood="night"] .hero__brand {
  color: var(--night-ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

body[data-mood="night"] .hero__line {
  color: rgba(232, 224, 212, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero__cta {
  display: inline-block;
  filter: drop-shadow(0 8px 16px rgba(44, 36, 24, 0.22));
  transition: transform 0.2s ease;
}

.hero__cta:hover {
  transform: translateY(-2px);
}

.hero__cta img {
  width: min(180px, 55vw);
  height: auto;
}

/* Transparent — the full-bleed room shows through the frame */
.phone__screen {
  position: absolute;
  inset: 2.6% 6.2% 2.5% 6.2%;
  border-radius: 14% / 7%;
  overflow: hidden;
  background: transparent;
}

.phone__ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(44, 36, 24, 0.18) 0%,
    rgba(44, 36, 24, 0.05) 32%,
    transparent 52%
  );
}

/* Focus top bar — Ambient + Music */
.phone__topbar {
  position: absolute;
  top: 5.5%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 7%;
  z-index: 2;
  pointer-events: none;
}

.phone__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: "Jua", sans-serif;
  font-size: clamp(0.62rem, 1.35vw, 0.78rem);
  color: #fffef8;
  text-shadow: 0 1px 6px rgba(44, 36, 24, 0.35);
  white-space: nowrap;
}

.phone__nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--sage);
  color: var(--cream);
  font-size: 0.58rem;
  line-height: 1;
  text-shadow: none;
}

.phone__nav-icon {
  flex-shrink: 0;
  width: 0.72rem;
  height: 0.72rem;
}

/* Height-based spacer — % padding is width-relative in CSS */
.phone__sky {
  flex: 0 0 30%;
  width: 100%;
  pointer-events: none;
}

.phone__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.phone__timer {
  font-family: "Jua", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: #fffef8;
  text-shadow: 0 2px 12px rgba(44, 36, 24, 0.35);
  letter-spacing: 0.02em;
  line-height: 1;
  animation: breathe 4.5s ease-in-out infinite;
}

.phone__label {
  margin-top: 0.3rem;
  font-family: "Jua", sans-serif;
  font-size: 1rem;
  color: rgba(255, 254, 248, 0.95);
  text-shadow: 0 1px 8px rgba(44, 36, 24, 0.3);
}

/* Matches FocusModeView prayerLabel capsule */
.phone__prayer {
  margin-top: 0.65rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  font-weight: 600;
  color: rgba(255, 254, 248, 0.92);
  text-shadow: 0 1px 6px rgba(44, 36, 24, 0.28);
  padding: 0.28rem 0.9rem;
  border: 1.5px solid rgba(255, 254, 248, 0.55);
  border-radius: 999px;
  max-width: 78%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 254, 248, 0.12);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.phone__prayer:hover {
  background: rgba(255, 254, 248, 0.22);
}

.phone__prayer:active {
  transform: scale(0.97);
}

.phone__active-prayer {
  margin-top: 0.65rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-weight: 700;
  color: #fffef8;
  text-shadow: 0 1px 8px rgba(44, 36, 24, 0.35);
  text-align: center;
  max-width: 82%;
  line-height: 1.35;
}

/* SketchedOvalButtonStyle — cream fill + double sage oval */
.phone__start-wrap {
  margin-top: 1.05rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.9rem;
  background: rgba(243, 234, 215, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s ease;
}

.phone__start-wrap:hover {
  transform: scale(1.03);
}

.phone__start-wrap:active {
  transform: scale(0.94);
}

.phone__start-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--sage-deep);
  border-radius: 50%;
  transform: rotate(-2deg);
  pointer-events: none;
}

.phone__start-wrap::after {
  content: "";
  position: absolute;
  inset: -1px -3px 1px;
  border: 1.5px solid rgba(67, 83, 52, 0.55);
  border-radius: 50%;
  transform: rotate(2.5deg) scaleX(1.04) scaleY(0.94);
  pointer-events: none;
}

.phone__start {
  font-family: "Jua", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--sage-deep);
  position: relative;
  z-index: 1;
  line-height: 1;
  pointer-events: none;
}

.phone__session {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.phone__session[hidden],
.phone__start-wrap[hidden],
.phone__prayer[hidden],
.phone__active-prayer[hidden],
.phone__done[hidden],
.phone__label[hidden],
.phone__picker[hidden] {
  display: none !important;
}

.phone__end {
  border: 0;
  background: none;
  padding: 0.2rem 0.4rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 254, 248, 0.9);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-shadow: 0 1px 6px rgba(44, 36, 24, 0.3);
  cursor: pointer;
}

.phone__done {
  margin: 0.85rem 0 0;
  font-family: "Jua", sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: #fffef8;
  text-shadow: 0 1px 8px rgba(44, 36, 24, 0.35);
  text-align: center;
}

.phone[data-focus="running"] .phone__timer,
.phone[data-focus="paused"] .phone__timer {
  animation: none;
}

.phone__plant {
  position: absolute;
  bottom: 2%;
  left: 50%;
  width: 48%;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
  animation: plant-rise 1.1s ease 0.2s both;
  pointer-events: none;
}

.phone__plant--grow {
  animation: plant-grow 0.85s ease both;
}

@keyframes plant-grow {
  from {
    opacity: 0.4;
    transform: translateX(-50%) scale(0.86) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

/* In-phone prayer picker */
.phone__picker {
  position: absolute;
  inset: 8% 6% 18%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: rgba(247, 243, 234, 0.94);
  border-radius: 18px;
  padding: 0.7rem 0.65rem 0.75rem;
  box-shadow: 0 10px 28px rgba(44, 36, 24, 0.28);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.phone__picker[hidden] {
  display: none;
}

.phone__picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: "Jua", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0 0.15rem 0.55rem;
  border-bottom: 1px solid rgba(44, 36, 24, 0.1);
}

.phone__picker-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--sage-deep);
  color: #fffef8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.phone__picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.phone__picker-item {
  border: 1px solid rgba(67, 83, 52, 0.28);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.85);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.phone__picker-item:hover {
  background: #fff;
  border-color: var(--sage-deep);
}

.phone__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Menu sheet */
.sheet[hidden] {
  display: none;
}

.sheet:not([hidden]) {
  display: block;
}

.sheet__backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(30, 28, 24, 0.35);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease;
}

.sheet__panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background-color: #f7f3ea;
  background-image: url("../images/ivory-bg.jpg");
  background-image: url("../images/ivory-bg.webp");
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 0.75rem 1.5rem 1.75rem;
  max-height: min(78vh, 560px);
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(44, 36, 24, 0.18);
  animation: sheet-up 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet__handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #d9d0c0;
  margin: 0.25rem auto 0.75rem;
}

.sheet__x {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  left: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--sage-deep);
  color: #fffef8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.sheet__nav {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin: 2.5rem 0 1.75rem;
  padding-top: 0.25rem;
}

.sheet__nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.55rem;
}

.sheet__section {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.sheet__section--contact {
  margin-bottom: 0;
}

.sheet__label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.sheet__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.sheet__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.sheet__cta {
  position: static;
  flex-shrink: 0;
  background: #435334;
  color: #fffef8;
  text-decoration: none;
  font-family: "Jua", sans-serif;
  font-size: 1.05rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(67, 83, 52, 0.3);
}

.sheet__cta:hover {
  background: #3a472c;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.lang-switch__btn {
  border: 1.5px solid rgba(67, 83, 52, 0.35);
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lang-switch__btn:hover {
  border-color: var(--sage-deep);
}

.lang-switch__btn.is-active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fffef8;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes plant-rise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes circle-draw {
  from {
    opacity: 0;
    transform: rotate(-8deg) scale(0.7);
  }
  to {
    opacity: 0.95;
    transform: rotate(-8deg) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: stretch;
    align-content: end;
    padding-bottom: 2rem;
  }

  .hero__copy {
    order: 2;
    justify-self: start;
    max-width: 100%;
  }

  .hero__phone {
    order: 1;
    justify-content: center;
    padding-right: 0;
    min-height: 54vh;
  }

  .phone {
    width: min(68vw, 340px);
  }
}

@media (max-width: 480px) {
  .phone {
    width: min(78vw, 300px);
  }

  .sheet__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sheet__cta {
    position: static;
    display: inline-flex;
    margin-top: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
