:root {
  color-scheme: light;
  --cream: #fbf6e8;
  --paper: #fffaf0;
  --ink: #243127;
  --muted: #6d776e;
  --sage: #7fa47c;
  --moss: #3f704f;
  --rose: #c47b70;
  --clay: #b86f4b;
  --sky: #9ecbe0;
  --night: #24324b;
  --line: rgba(36, 49, 39, 0.14);
  --shadow: 0 28px 70px rgba(47, 59, 50, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(135deg, rgba(127, 164, 124, 0.18), transparent 42%),
    linear-gradient(315deg, rgba(196, 123, 112, 0.2), transparent 45%),
    var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.prototype-shell {
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(320px, 420px) minmax(240px, 330px);
  align-items: center;
  gap: clamp(22px, 4vw, 58px);
  width: min(1180px, calc(100vw - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 36px 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 52px;
  color: var(--moss);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.kicker,
.app-eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prototype-brief h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  max-width: 9.5ch;
  font-size: clamp(3rem, 4.8vw, 4.6rem);
  font-weight: 500;
  line-height: 0.9;
  overflow-wrap: break-word;
}

.prototype-brief p:last-child,
.prototype-notes p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.phone-frame {
  justify-self: center;
  width: min(100%, 390px);
  padding: 12px;
  border: 1px solid rgba(36, 49, 39, 0.24);
  border-radius: 42px;
  background: #1f2824;
  box-shadow: var(--shadow);
}

.phone-speaker {
  width: 86px;
  height: 5px;
  margin: 8px auto 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.app-screen {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.app-home {
  display: none;
}

.app-home.is-active {
  display: block;
}

.onboarding {
  display: none;
  min-height: 760px;
  background: #171f1b;
  color: #fffaf0;
}

.onboarding.is-active {
  display: flex;
  flex-direction: column;
}

.onboarding-art {
  position: relative;
  height: 420px;
  overflow: hidden;
  background: #101915;
}

.onboarding-art::after {
  position: absolute;
  inset: 34% 0 0;
  background: linear-gradient(transparent, rgba(23, 31, 27, 0.7) 58%, #171f1b);
  content: "";
}

.onboarding-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.onboarding-copy {
  display: grid;
  gap: 14px;
  margin-top: -58px;
  padding: 0 24px 26px;
  position: relative;
  z-index: 2;
}

.onboarding-copy .app-eyebrow {
  color: #e7b47f;
}

.onboarding-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.onboarding-copy p:not(.app-eyebrow) {
  margin: 0;
  color: rgba(255, 250, 240, 0.74);
  font-size: 0.98rem;
  line-height: 1.55;
}

.onboarding-dots {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.onboarding-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.24);
}

.onboarding-dots span.is-active {
  width: 24px;
  background: #e7b47f;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 10px;
  margin-top: 6px;
}

.secondary-button {
  min-height: 48px;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.08);
  color: #fffaf0;
  font-weight: 800;
}

.onboarding .primary-button {
  margin: 0;
  min-height: 48px;
  border-radius: 16px;
  background: #e7b47f;
  color: #172018;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 22px 14px;
}

.app-topbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf8;
  font-size: 1.35rem;
}

.scene-card {
  position: relative;
  height: 238px;
  margin: 0 16px;
  overflow: hidden;
  border-radius: 26px;
  background: #d9e3cf;
}

.scene-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 52%;
  transform: scale(1.02);
}

.scene-weather-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 220ms ease, backdrop-filter 220ms ease;
}

.scene-card[data-weather="rain"] .scene-weather-overlay {
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(236, 247, 255, 0.48) 46% 47%, transparent 47% 100%),
    linear-gradient(115deg, transparent 0 64%, rgba(236, 247, 255, 0.36) 64% 65%, transparent 65% 100%),
    rgba(39, 62, 69, 0.28);
  background-size: 42px 42px, 58px 58px, auto;
  backdrop-filter: saturate(0.84) brightness(0.88);
  animation: imageRain 0.9s linear infinite;
}

.scene-card[data-period="night"] .scene-weather-overlay {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 244, 198, 0.26), transparent 12%),
    rgba(19, 28, 54, 0.5);
  backdrop-filter: saturate(0.78) brightness(0.58);
}

.checkin-card,
.tab-panel {
  margin: 14px 16px 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.86);
}

.checkin-card h3 {
  margin: 8px 0 8px;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.checkin-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.time-chip {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(127, 164, 124, 0.18);
  color: var(--moss);
  font-size: 0.72rem;
  font-weight: 800;
}

.gentle-prompt {
  margin-top: 12px !important;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #4b6f4e !important;
  font-weight: 700;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 14px 16px 0;
  padding: 6px;
  border-radius: 18px;
  background: rgba(36, 49, 39, 0.08);
}

.tab {
  min-width: 0;
  padding: 9px 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tab.is-active {
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(47, 59, 50, 0.12);
}

.tab-panel {
  display: none;
  min-height: 154px;
}

.tab-panel.is-active {
  display: block;
}

.mini-actions,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-actions button,
.shop-grid button,
.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--moss);
  color: #fffdf8;
  font-size: 0.82rem;
  font-weight: 800;
}

.privacy-card,
.goal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(127, 164, 124, 0.12);
}

.privacy-card {
  justify-content: space-between;
}

.privacy-card strong,
.goal-row strong {
  display: block;
  font-size: 0.9rem;
}

.privacy-card span,
.goal-row p,
.shop-note,
.journal-response {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(36, 49, 39, 0.2);
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--moss);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.journal-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fffdf8;
  color: var(--ink);
  line-height: 1.45;
}

.primary-button {
  width: 100%;
  margin-top: 10px;
}

.goal-row {
  margin-top: 0;
  margin-bottom: 9px;
}

.goal-row span {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--moss);
  font-weight: 900;
}

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

.shop-grid button {
  background: #fffdf8;
  color: var(--ink);
  border: 1px solid var(--line);
}

.shop-grid button.is-selected {
  border-color: var(--moss);
  background: rgba(127, 164, 124, 0.16);
  color: var(--moss);
}

.prototype-notes {
  display: grid;
  gap: 16px;
}

.prototype-notes article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
}

.prototype-notes h2 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prototype-notes p {
  margin: 0;
  font-size: 0.9rem;
}

@keyframes imageRain {
  to {
    background-position: 42px 42px, 58px 58px, 0 0;
  }
}

@media (max-width: 980px) {
  .prototype-shell {
    grid-template-columns: 1fr;
    max-width: 470px;
    padding: 28px 0 40px;
  }

  .prototype-brief,
  .prototype-notes {
    order: 2;
  }

  .phone-frame {
    order: 1;
  }

  .back-link {
    margin-bottom: 28px;
  }
}

@media (max-width: 460px) {
  .prototype-shell {
    width: 100%;
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100svh;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .phone-speaker {
    display: none;
  }

  .app-screen {
    min-height: 100svh;
    border-radius: 0;
  }

  .onboarding {
    min-height: 100svh;
  }

  .onboarding-art,
  .onboarding-art img {
    height: 52svh;
  }

  .prototype-brief,
  .prototype-notes {
    padding: 0 20px 24px;
  }
}
