:root {
  color-scheme: light;
  --ink: #23303a;
  --muted: #66727d;
  --paper: #fbfaf6;
  --mist: #eaf6f4;
  --sea: #8ed6cf;
  --coral: #ff9a8f;
  --lemon: #ffe08a;
  --violet: #b9a7ff;
  --line: rgba(35, 48, 58, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 224, 138, 0.42), transparent 24rem),
    radial-gradient(circle at 82% 12%, rgba(142, 214, 207, 0.42), transparent 22rem),
    linear-gradient(145deg, #fbfaf6 0%, #f1faf7 52%, #fff7f3 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(22rem, 1fr) auto;
  gap: 1rem;
  width: min(1120px, calc(100vw - 2rem));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 max(0.75rem, env(safe-area-inset-bottom));
}

.top-bar,
.dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5.4vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.task-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: min(28rem, 48vw);
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1.5rem 4rem rgba(74, 113, 112, 0.13);
  backdrop-filter: blur(18px);
}

.task-form input {
  font-size: 1rem;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.75rem 0.45rem 0.75rem 1rem;
  color: var(--ink);
  background: transparent;
}

.task-form input::placeholder {
  color: #89949b;
}

.task-form button,
.delete-task {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.task-form button {
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  color: #193735;
  background: var(--sea);
  font-size: 1.45rem;
  box-shadow: 0 0.75rem 1.6rem rgba(68, 159, 151, 0.24);
}

.task-form button:hover,
.delete-task:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.float-stage {
  position: relative;
  overflow: hidden;
  min-height: 24rem;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.28)),
    radial-gradient(circle at 50% 100%, rgba(255, 154, 143, 0.17), transparent 34rem);
  box-shadow: inset 0 0 0 1px rgba(35, 48, 58, 0.05), 0 2rem 7rem rgba(64, 95, 98, 0.14);
}

.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.42;
  pointer-events: none;
  animation: drift 13s ease-in-out infinite alternate;
}

.ambient-one {
  width: 12rem;
  height: 12rem;
  left: 8%;
  top: 16%;
  background: var(--lemon);
}

.ambient-two {
  width: 8rem;
  height: 8rem;
  right: 11%;
  top: 28%;
  background: var(--violet);
  animation-delay: -4s;
}

.ambient-three {
  width: 10rem;
  height: 10rem;
  left: 45%;
  bottom: 10%;
  background: var(--coral);
  animation-delay: -7s;
}

.bubble-field {
  position: relative;
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-bubble {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: min(var(--x), calc(100% - var(--size) - 1rem));
  top: min(var(--y), calc(100% - var(--size) - 1rem));
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 23%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.42) 27%, transparent 28%),
    linear-gradient(145deg, var(--bubble-a), var(--bubble-b));
  box-shadow: 0 1.25rem 3rem rgba(55, 78, 87, 0.16);
  animation: floaty var(--speed) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

.task-bubble.done {
  opacity: 0.54;
  filter: saturate(0.65);
}

.task-toggle {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  padding: 1.25rem;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.task-bubble.done .task-toggle {
  text-decoration: line-through;
  text-decoration-thickness: 0.12em;
}

.delete-task {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  color: rgba(35, 48, 58, 0.72);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 0.5rem 1.2rem rgba(35, 48, 58, 0.1);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.empty-state span {
  display: grid;
  place-items: center;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(35, 48, 58, 0.48);
  font-size: 3rem;
  box-shadow: 0 1.5rem 4rem rgba(64, 95, 98, 0.11);
  animation: floaty 4.8s ease-in-out infinite alternate;
}

.empty-state p {
  max-width: 18rem;
  margin: 0;
}

.empty-state.hidden {
  display: none;
}

.dock {
  color: var(--muted);
}

.dock p {
  margin: 0;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes floaty {
  from {
    transform: translate3d(-0.35rem, 0.45rem, 0) rotate(-1.5deg);
  }
  to {
    transform: translate3d(0.55rem, -1.05rem, 0) rotate(1.5deg);
  }
}

@keyframes drift {
  from {
    transform: translate3d(-1rem, 0.5rem, 0) scale(0.96);
  }
  to {
    transform: translate3d(1.25rem, -1.35rem, 0) scale(1.04);
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    width: min(100vw - 1rem, 44rem);
    padding: max(0.8rem, env(safe-area-inset-top)) 0.5rem max(0.9rem, env(safe-area-inset-bottom));
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .task-form {
    width: 100%;
  }

  .float-stage {
    min-height: 0;
    border-radius: 1.35rem;
  }

  .task-bubble {
    width: min(calc(var(--size) * 0.78), 38vw);
    height: min(calc(var(--size) * 0.78), 38vw);
  }

  .task-toggle {
    padding: 1rem;
    font-size: 0.92rem;
  }

  h1 {
    font-size: clamp(2rem, 13vw, 3.25rem);
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .dock {
    align-items: center;
  }
}

@media (display-mode: standalone) {
  body {
    user-select: none;
  }
}
