@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@1,8..60,500&display=swap");

:root {
  color-scheme: light;
  --bg: #f7faf8;
  --panel: #ffffff;
  --ink: #14211d;
  --muted: #60736d;
  --line: #d9e2de;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --radius: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050505;
  color: #fff;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

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

h1 {
  color: #fff;
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  padding: 0 0.9rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

select option {
  background: #111;
  color: #fff;
}

textarea {
  min-height: 88px;
  padding-top: 0.75rem;
  resize: vertical;
}

.app-header {
  align-items: center;
  background: transparent;
  border-bottom: 0;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
}

.app-main {
  margin: 0 auto;
  max-width: 760px;
  padding: 1.25rem 1rem 3rem;
  position: relative;
  z-index: 1;
}

.app-video-bg,
.app-page-scrim {
  inset: 0;
  position: fixed;
}

.app-video-bg {
  height: 100%;
  object-fit: cover;
  width: 100%;
  z-index: -2;
}

.app-page-scrim {
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.12), transparent 28rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.44) 58%, rgba(0, 0, 0, 0.68));
  z-index: -1;
}

.home-immersive {
  background: #050505;
  color: #fff;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

.home-immersive .app-header {
  display: none;
}

.home-immersive .app-main {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.home-hero {
  color: #fff;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.home-video,
.home-scrim {
  inset: 0;
  position: fixed;
}

.home-video {
  height: 100%;
  object-fit: cover;
  width: 100%;
  z-index: -2;
}

.home-scrim {
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.13), transparent 28rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.6));
  z-index: -1;
}

.home-shell {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.liquid-glass,
.liquid-glass-strong {
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  border: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.liquid-glass {
  backdrop-filter: blur(4px);
}

.liquid-glass-strong {
  backdrop-filter: blur(50px);
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.liquid-glass::before,
.liquid-glass-strong::before {
  border-radius: inherit;
  content: "";
  inset: 0;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1.4px;
  pointer-events: none;
  position: absolute;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}

.liquid-glass::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.15) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.15) 80%,
    rgba(255, 255, 255, 0.45) 100%
  );
}

.liquid-glass-strong::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.2) 80%,
    rgba(255, 255, 255, 0.5) 100%
  );
}

.home-left {
  border-radius: 1.5rem;
  display: grid;
  gap: 1.5rem;
  justify-self: center;
  min-height: calc(100vh - 2rem);
  padding: 1.25rem;
  width: 100%;
}

.home-nav,
.home-center,
.home-actions,
.home-nav-link {
  align-items: center;
  display: flex;
}

.home-nav {
  align-self: start;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 999px;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  padding: 0.45rem;
}

.home-nav-link {
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 600;
  justify-content: center;
  min-height: 36px;
  padding: 0 0.85rem;
  transition: color 180ms ease, transform 180ms ease;
}

.home-nav-link:hover,
.home-cta:hover {
  color: #fff;
  transform: scale(1.05);
}

.home-nav-link:active,
.home-cta:active {
  transform: scale(0.95);
}

.home-center {
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  max-width: 660px;
  padding: 2rem 0 3rem;
  text-align: center;
}

.home-kicker {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 0.7rem;
  text-transform: uppercase;
}

.home-center h1 {
  color: #fff;
  font-size: clamp(5.5rem, 24vw, 13rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.78;
  margin: 0;
  max-width: 780px;
}

.home-center h1 em {
  color: rgba(255, 255, 255, 0.78);
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
}

.home-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.home-cta {
  align-items: center;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  gap: 0.8rem;
  min-height: 54px;
  padding: 0.35rem 0.45rem 0.35rem 1.25rem;
  transition: transform 180ms ease;
}

.cta-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}


.top-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(50px);
  border-radius: 0 0 1.1rem 1.1rem;
  box-shadow:
    -1px 0 0 rgba(255, 255, 255, 0.42),
    1px 0 0 rgba(255, 255, 255, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.42),
    4px 4px 4px rgba(0, 0, 0, 0.05),
    inset 0 -1px 1px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  justify-content: center;
  max-width: min(760px, 100vw);
  padding: 0.18rem;
  position: relative;
  overflow: hidden;
  color: #fff;
  font-size: clamp(0.62rem, 2.45vw, 0.78rem);
  font-weight: 700;
  white-space: nowrap;
}

.top-nav::before {
  background: linear-gradient(180deg, transparent 0%, transparent 38%, rgba(255, 255, 255, 0.22) 72%, rgba(255, 255, 255, 0.5) 100%);
  border-radius: inherit;
  content: "";
  inset: 0;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1.4px;
  pointer-events: none;
  position: absolute;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}

.top-nav a,
.nav-logout {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  flex: 1 1 0;
  min-height: 32px;
  min-width: 0;
  overflow: hidden;
  padding: 0.35rem clamp(0.2rem, 1vw, 0.5rem);
  text-overflow: ellipsis;
  transition: color 180ms ease, transform 180ms ease;
}

.top-nav a:hover,
.nav-logout:hover {
  color: #fff;
  transform: scale(1.05);
}

.stack {
  display: grid;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.page-title {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.page-title h1 {
  color: #fff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.72);
}

.stat strong,
.panel strong,
.list-row strong {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.date-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.icon-link,
.secondary-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 0 0.75rem;
}

.panel {
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(50px);
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: #fff;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.panel::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.2) 80%,
    rgba(255, 255, 255, 0.5) 100%
  );
  border-radius: inherit;
  content: "";
  inset: 0;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1.4px;
  pointer-events: none;
  position: absolute;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}

.panel h2,
.habit-group h3 {
  margin: 0 0 0.75rem;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-head h2 {
  margin: 0;
}

.habit-group + .habit-group {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 1rem;
  padding-top: 1rem;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  min-height: 44px;
}

.check-row input,
.day-pills input,
.field input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.metric-grid,
.setup-form,
.edit-row,
.list {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.compact-field input,
.compact-field select {
  min-height: 40px;
}

.field small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.metric-grid .field:has(input[type="checkbox"]) {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 46px;
  padding: 0.65rem 0.8rem;
}

.metric-grid .field:has(input[type="checkbox"]) > span:first-child {
  min-width: 0;
}

.metric-check {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  min-width: 28px;
}

.sticky-save {
  bottom: 1rem;
  position: sticky;
}

.stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 8px;
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
}

.stat span,
.list-row small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 750;
}

.stat strong {
  font-size: 1.5rem;
}

.list-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0;
}

.list-row:last-child {
  border-bottom: 0;
}

.goal-list {
  display: grid;
  gap: 0.7rem;
}

.goal-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
}

.goal-item summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 750;
  gap: 0.75rem;
  justify-content: space-between;
  list-style: none;
  min-height: 48px;
  padding: 0.8rem 0.9rem;
}

.goal-item summary::-webkit-details-marker {
  display: none;
}

.goal-item summary span:last-child {
  color: rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease;
}

.goal-item[open] summary span:last-child {
  transform: rotate(180deg);
}

.goal-edit {
  display: grid;
  gap: 0.75rem;
  padding: 0 0.9rem 0.9rem;
}

.habit-edit-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.9rem;
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.habit-cadence {
  align-content: center;
  display: grid;
  gap: 0.25rem;
}

.habit-cadence span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 750;
}

.habit-cadence strong {
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
}

.habit-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.habit-actions .secondary-button,
.habit-actions .danger-button {
  min-width: 7rem;
}

.task-list {
  display: grid;
  gap: 0.9rem;
}

.search-form {
  display: grid;
  gap: 0.7rem;
  margin: 0.8rem 0 1rem;
}

.journal-list {
  display: grid;
  gap: 0.85rem;
}

.journal-entry {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 0.45rem;
  padding-top: 0.85rem;
}

.journal-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.journal-entry div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.journal-entry strong,
.journal-entry span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.journal-entry p {
  margin: 0;
  white-space: pre-wrap;
}

.journal-entry mark {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  padding: 0 0.15rem;
}

.task-row {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 0.9rem;
}

.task-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.task-row.is-done {
  opacity: 0.72;
}

.task-edit,
.task-create,
.task-review {
  display: grid;
  gap: 0.75rem;
}

.task-body {
  grid-column: 1 / -1;
}

.subitem-list {
  color: rgba(255, 255, 255, 0.82);
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 1.1rem;
}

.dump-text {
  margin: 0;
  white-space: pre-wrap;
}

.large-textarea {
  min-height: 220px;
}

.day-pills {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.day-pills label {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 8px;
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  min-height: 38px;
}

.inline-action {
  display: flex;
  justify-content: flex-end;
}

.seed-panel {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.seed-panel p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
  max-width: 31rem;
}

.tile {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 8px;
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
}

.tile span,
.eyebrow,
.muted {
  color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.muted {
  margin: 0.5rem 0 0;
}

.primary-button,
.link-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.primary-button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  min-height: 48px;
  padding: 0 1rem;
}

.primary-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.link-button {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  padding: 0.5rem;
}

.danger-button {
  background: rgba(180, 35, 24, 0.18);
  color: #fff;
  min-height: 40px;
  padding: 0 0.75rem;
}

.danger-button:hover {
  background: rgba(180, 35, 24, 0.32);
}

.login-body {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.login-panel {
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(50px);
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: #fff;
  max-width: 420px;
  padding: 1.25rem;
  width: 100%;
}

.error {
  color: var(--danger);
  margin: 0;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .top-nav {
    display: flex;
  }

  .home-left {
    min-height: min(680px, calc(100vh - 3rem));
    width: min(720px, 100%);
  }

  .app-header {
    padding-left: max(0.5rem, calc((100vw - 760px) / 2));
    padding-right: max(0.5rem, calc((100vw - 760px) / 2));
  }

  .top-nav {
    max-width: 760px;
    width: 100%;
  }

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

  .metric-grid .field:has(input[type="checkbox"]) {
    grid-column: auto;
  }

  .edit-row {
    grid-template-columns: 1.4fr 1.4fr 0.8fr 0.7fr auto;
  }

  .habit-edit-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .habit-cadence,
  .habit-days {
    grid-column: 1 / -1;
  }

  .task-edit {
    grid-template-columns: 1.8fr 0.9fr 0.6fr 0.8fr auto;
  }

  .task-create,
  .task-review {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-form {
    grid-template-columns: 1fr auto;
  }
}

@media (min-width: 1024px) {
  .home-shell {
    align-items: center;
    padding: 1.5rem;
  }

  .home-left {
    border-radius: 1.8rem;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: min(680px, calc(100vh - 3rem));
    padding: 1.5rem;
    width: min(980px, 100%);
  }

  .home-nav {
    align-self: start;
    display: flex;
    justify-self: center;
    max-width: 760px;
  }

  .home-center {
    align-self: center;
    justify-content: center;
    max-width: none;
    padding: 2rem;
  }

  .home-center h1 {
    font-size: clamp(10rem, 18vw, 16rem);
    line-height: 0.78;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.65rem;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .panel h2 {
    font-size: 1.25rem;
  }

  .page-title {
    align-items: end;
  }

  .app-header {
    padding: 0;
  }

  .top-nav {
    border-radius: 0;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.42);
    max-width: 100vw;
    width: 100%;
  }

  .top-nav::before {
    display: none;
  }

  .panel,
  .login-panel,
  .home-left {
    border-radius: 0;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.42);
  }

  .panel::before,
  .liquid-glass::before,
  .liquid-glass-strong::before {
    display: none;
  }

  .home-shell {
    padding: 0.75rem;
  }

  .home-left {
    min-height: calc(100vh - 1.5rem);
    padding: 1rem;
  }

  .home-nav {
    border-radius: 1.4rem;
    gap: 0.35rem;
  }

  .home-center {
    padding: 2rem 0;
  }

  .home-center h1 {
    font-size: clamp(2.9rem, 18vw, 4rem);
  }

  .day-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .habit-actions {
    align-items: stretch;
    display: grid;
  }

  .habit-actions .secondary-button {
    width: 100%;
  }
}
