:root {
  --ink: #1f2a26;
  --ink-soft: #4a5a54;
  --mist: #e7eee9;
  --fog: #f4f7f5;
  --sage: #5f7d6e;
  --sage-deep: #3f5a4c;
  --leaf: #8faf9a;
  --wood: #8f5c38;
  --wood-light: #b5794a;
  --warn: #b86b3a;
  --line: rgba(31, 42, 38, 0.1);
  --shadow: 0 18px 50px rgba(31, 42, 38, 0.18);
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d5e4da 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #cfd9d4 0%, transparent 50%),
    linear-gradient(165deg, #edf2ef 0%, #d9e3dc 48%, #c8d5cc 100%);
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
  box-sizing: border-box;
  overflow: hidden;
}

.stage-label {
  text-align: center;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.stage-label .eyebrow {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--sage-deep);
}

.stage-label p {
  margin: 0;
  font-size: 0.92rem;
}

/* Keeps a true 428×926 layout, scaled to fit the viewport */
.phone-shell {
  --phone-w: 428;
  --phone-h: 926;
  --phone-scale: 1;
  width: calc(428px * var(--phone-scale));
  height: calc(926px * var(--phone-scale));
  position: relative;
}

.phone {
  width: 428px;
  height: 926px;
  background: #121816;
  border-radius: 44px;
  padding: 11px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transform: scale(var(--phone-scale));
  transform-origin: top left;
}

.phone-notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 26px;
  background: #0b0f0d;
  border-radius: 18px;
  z-index: 5;
}

.phone-screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: var(--fog);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.screen[hidden] {
  display: none !important;
}

/* HOME / ENTRY */
.screen-entry {
  background: linear-gradient(180deg, #b9cfc4 0%, #d7e4dc 42%, #eef3ef 100%);
  overflow: hidden;
  padding-bottom: 72px;
}

.entry-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 4.25rem 1.5rem 1.35rem;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sage-deep);
  animation: rise 0.7s ease both;
  flex-shrink: 0;
  position: absolute;
  top: 3.75rem;
  left: 0;
  right: 0;
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.25rem;
  width: 100%;
}

.house-scene {
  position: relative;
  width: min(280px, 72%);
  aspect-ratio: 280 / 260;
  height: auto;
  margin: 0 auto;
  flex: 0 1 auto;
  animation: houseIn 0.8s ease 0.15s both;
}

@keyframes houseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.house {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 16px 24px rgba(31, 42, 38, 0.18));
}

.door-btn {
  position: absolute;
  left: 50%;
  top: 45.5%;
  transform: translateX(-50%);
  width: 20%;
  height: 35.5%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 600px;
  z-index: 2;
}

.door-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 10px;
  border: 2px solid rgba(63, 90, 76, 0.45);
  pointer-events: none;
  animation: doorRing 1.8s ease-out infinite;
}

@keyframes doorRing {
  0% {
    transform: scale(0.92);
    opacity: 0.85;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.door-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(90deg, #7a4f32, #a67248 45%, #8b5e3c);
  box-shadow:
    inset 0 0 0 2px rgba(50, 30, 16, 0.35),
    0 0 0 3px rgba(244, 247, 245, 0.55);
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.door-panel,
.door-panel-lower {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 10px;
  height: 28px;
  border-radius: 3px;
  border: 1.5px solid rgba(50, 30, 16, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
}

.door-panel-lower {
  top: auto;
  bottom: 14px;
  height: 34px;
}

.door-knob {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #e8c27a;
  box-shadow: 0 0 0 1px rgba(80, 50, 20, 0.35);
}

.door-btn:hover .door-face,
.door-btn:focus-visible .door-face {
  transform: rotateY(-12deg);
}

.door-btn.is-open .door-face {
  transform: rotateY(-78deg);
}

.door-hint {
  position: absolute;
  left: 50%;
  bottom: -40px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--sage-deep);
  background: rgba(244, 247, 245, 0.95);
  border: 1px solid rgba(63, 90, 76, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  box-shadow: 0 6px 16px rgba(31, 42, 38, 0.12);
  animation: hintBounce 1.8s ease-in-out infinite;
}

.door-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}

.door-btn.is-open .door-hint,
.door-btn.is-open .door-pulse {
  display: none;
}

.roommate-row {
  margin-top: 0;
  display: flex;
  gap: 0.65rem;
  padding-bottom: 0;
  flex-shrink: 0;
  animation: rise 0.8s ease 0.28s both;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 6px 14px rgba(31, 42, 38, 0.12);
}

.avatar.you {
  width: 52px;
  height: 52px;
  background: var(--sage-deep);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.avatar.a { background: #6a8f9a; }
.avatar.b { background: #8a7a5c; }
.avatar.c { background: #6d7f9a; }
.avatar.d { background: #7a8f6d; }

.avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
  border-width: 1.5px;
  margin-left: -8px;
}

.avatar.tiny:first-child {
  margin-left: 0;
}

/* Snapshot overlay */
.apt-snapshot {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: end center;
  padding: 1.25rem 1.25rem 5.5rem;
  background: rgba(20, 28, 24, 0.28);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.35s ease;
}

.apt-snapshot[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.snapshot-card {
  width: 100%;
  background: rgba(244, 247, 245, 0.97);
  border-radius: 24px;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 20px 40px rgba(20, 28, 24, 0.22);
  transform: translateY(20px);
  animation: slideUp 0.45s ease 0.05s both;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.snapshot-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
}

.snapshot-card h2 {
  margin: 0.35rem 0 1rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.snapshot-list {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.snapshot-list li {
  display: block;
}

.snapshot-list strong {
  display: block;
  font-size: 0.95rem;
}

.snapshot-list p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.primary-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: var(--sage-deep);
  color: #f7faf8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.primary-btn:hover {
  background: #334a3e;
}

.primary-btn:active {
  transform: scale(0.98);
}

.primary-btn.compact {
  width: auto;
  padding: 0.7rem 0.95rem;
  white-space: nowrap;
}

/* APP SCREENS */
.screen-chores,
.screen-supplies {
  background:
    linear-gradient(180deg, #e8f0eb 0%, var(--fog) 28%),
    var(--fog);
  padding-bottom: 72px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3.4rem 1.25rem 0.85rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--sage-deep);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.ghost-btn[aria-expanded="true"] {
  background: var(--sage-deep);
  color: #fff;
  border-color: transparent;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin: 0 1.25rem 0.75rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.progress-card {
  margin: 0 1.25rem 0.85rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.progress-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.progress-meta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--sage-deep);
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(95, 125, 110, 0.16);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage) 0%, var(--sage-deep) 100%);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.seg {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 0.65rem;
  border-radius: 11px;
  cursor: pointer;
}

.seg.is-active {
  background: #fff;
  color: var(--sage-deep);
  box-shadow: 0 4px 12px rgba(31, 42, 38, 0.08);
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 1.25rem 1.25rem;
  scrollbar-width: thin;
}

.chore-block,
.supply-block {
  margin-bottom: 1.25rem;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.block-head h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chore-list,
.supply-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.chore-item,
.supply-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.chore-item.is-mine {
  grid-template-columns: auto 1fr;
  background: #fff;
  border: 1.5px solid rgba(63, 90, 76, 0.28);
  box-shadow: 0 1px 0 rgba(63, 90, 76, 0.04);
}

.chore-item.is-other {
  grid-template-columns: auto 1fr auto;
  background: transparent;
  border: 1px dashed rgba(31, 42, 38, 0.14);
}

.chore-item.is-other:not(:has(.status-pill)) {
  grid-template-columns: auto 1fr;
}

.chore-item.is-done {
  opacity: 0.62;
}

.chore-item.is-done .chore-title {
  text-decoration: line-through;
}

.check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--sage-deep);
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.check::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  background: var(--sage-deep);
  opacity: 0;
  transform: scale(0.6);
  transition: 0.15s ease;
}

.chore-item.is-done .check::after,
.check[aria-pressed="true"]::after {
  opacity: 1;
  transform: scale(1);
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sage-deep);
  background: rgba(95, 125, 110, 0.14);
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
}

.chore-title,
.supply-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.chore-meta,
.supply-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.assignee {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.assignee.you { background: var(--sage-deep); }
.assignee.a { background: #6a8f9a; }
.assignee.b { background: #8a7a5c; }
.assignee.c { background: #6d7f9a; }
.assignee.d { background: #7a8f6d; }

.supply-item.is-needed {
  grid-template-columns: 1fr auto;
  background: #fff;
  border: 1.5px solid rgba(184, 107, 58, 0.28);
  border-left: 4px solid var(--warn);
}

.supply-item.is-stocked {
  grid-template-columns: 1fr;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0.15rem;
  opacity: 1;
}

.supply-item.is-stocked .supply-title {
  font-weight: 500;
  color: var(--ink-soft);
}

.buy-btn {
  border: none;
  background: rgba(184, 107, 58, 0.12);
  color: #8a4d22;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.buy-btn:hover {
  background: rgba(184, 107, 58, 0.2);
}

.supply-item.is-leaving {
  opacity: 0;
  transform: translateX(12px);
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0 1.25rem 0.75rem;
  animation: rise 0.25s ease;
}

.add-form[hidden] {
  display: none !important;
}

.add-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.add-form input:focus {
  outline: 2px solid rgba(95, 125, 110, 0.45);
  outline-offset: 1px;
}

/* Bottom nav */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem 1.1rem;
  background: rgba(244, 247, 245, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.45rem;
  border-radius: 12px;
  cursor: pointer;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
}

.nav-btn.is-active {
  color: var(--sage-deep);
  background: rgba(95, 125, 110, 0.12);
}

@media (max-width: 430px) {
  .stage {
    padding: 0;
  }

  .stage-label {
    display: none;
  }

  .phone-shell {
    --phone-scale: 1;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .phone {
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 0;
    position: relative;
    transform: none;
  }

  .phone-screen {
    border-radius: 0;
  }

  .phone-notch {
    display: none;
  }
}

/* Embedded before/after comparison */
body.is-compare {
  background: #121816;
  min-height: 0;
  height: 926px;
  width: 428px;
  overflow: hidden;
}

body.is-compare .stage {
  height: 926px;
  min-height: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

body.is-compare .stage-label {
  display: none;
}

body.is-compare .phone-shell {
  --phone-scale: 1;
  width: 428px;
  height: 926px;
}
