/* Taskly landing page */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: clamp(32px, 7vw, 96px) clamp(20px, 5vw, 48px) clamp(48px, 8vw, 112px);
}

.hero h1 {
  text-wrap: balance;
  overflow-wrap: break-word;
  font-size: var(--text-display);
  font-weight: var(--weight-heavy);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}

.hero-sub {
  max-width: 34ch;
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-10);
}

.btn-big {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-md);
}

/* The real app on two phones (built from the app's own parts).
   Each screen is laid out at a real phone width (390px), then shrunk by --scale.
   The journal is the main feature, so its phone is bigger and in front. */

.showcase {
  --base: 0.66;
  position: relative;
  height: calc(800px * var(--base) * 1.12 + 40px);
}

.phone {
  position: absolute;
  width: calc(390px * var(--scale) + var(--space-4));
  height: calc(800px * var(--scale) + var(--space-4));
  padding: var(--space-2);
  border-radius: calc(56px * var(--scale) + var(--space-2));
  background: var(--brand-mark);
  box-shadow: var(--shadow-overlay);
}

.phone-screen {
  width: 390px;
  height: 800px;
  overflow: hidden;
  border-radius: 56px;
  background: var(--paper);
  padding: var(--space-12) var(--space-4) var(--space-4);
  transform: scale(var(--scale));
  transform-origin: 0 0;
}

.phone-tasks {
  --scale: calc(var(--base) * 0.82);
  left: 0;
  top: 0;
  z-index: 1;
  transform: rotate(-5deg);
}

.phone-journal {
  --scale: calc(var(--base) * 1.12);
  right: 0;
  top: 24px;
  z-index: 2;
  transform: rotate(2deg);
}

.phone-title {
  margin: 0 0 var(--space-4) var(--space-1);
  font-size: var(--text-2xl);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.phone .notebook .phone-title {
  margin-left: 0;
}

.phone .entry-date {
  position: static;
}

/* the one animation: the first task gets ticked, then highlighted */
.showcase-tick .complete-btn {
  animation: tick 0.25s ease-out 0.8s forwards;
}

.showcase-tick .todo-text {
  padding: 0 var(--space-1);
  background-image: linear-gradient(var(--highlight), var(--highlight));
  background-repeat: no-repeat;
  background-position: 0 60%;
  background-size: 0% 75%;
  animation: highlight 0.5s cubic-bezier(0.3, 0.8, 0.4, 1) 0.95s forwards;
}

@keyframes tick {
  to { background: var(--done-bg); border-color: var(--done-bg); color: var(--done-fg); }
}

@keyframes highlight {
  to { background-size: 100% 75%; color: var(--on-highlight); }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-tick .complete-btn,
  .showcase-tick .todo-text {
    animation-duration: 0s;
    animation-delay: 0s;
  }
}

/* What Taskly does */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 48px) 80px;
  border-top: 2px solid var(--rule);
}

.feature h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

.feature p {
  margin-top: var(--space-2);
  max-width: 32ch;
  color: var(--ink-soft);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .showcase {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }

  .features {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 560px) {
  /* on phones: the two screens a little smaller */
  .showcase {
    --base: 0.52;
  }

  .phone-journal {
    top: 16px;
  }
}

/* in dark mode the phone frames need a lighter edge to stand out */
:root[data-theme="dark"] .phone {
  background: #2f3a75;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .phone {
    background: #2f3a75;
  }
}

/* Coming up (logged in): looks like a phone widget. A card with the next three, then one card per task. */

.upcoming {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: var(--space-6) clamp(20px, 5vw, 48px) 0;
}

.upcoming-title {
  margin-bottom: var(--space-4);
  font-size: var(--text-xl);
  font-weight: var(--weight-heavy);
  letter-spacing: -0.03em;
}

.upcoming-row {
  display: flex;
  gap: var(--space-4);
  margin: 0 calc(-1 * clamp(20px, 5vw, 48px));
  padding: var(--space-1) clamp(20px, 5vw, 48px) var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 clamp(20px, 5vw, 48px);
  scrollbar-width: none;
}

.upcoming-row::-webkit-scrollbar {
  display: none;
}

.upcoming-card {
  flex: none;
  scroll-snap-align: start;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
}

/* the list card: the next three */
.upcoming-list {
  width: min(400px, 84vw);
  padding: var(--space-3) var(--space-3);
}

.upcoming-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm); /* card corner 20px − 12px gap = 8px */
  color: inherit;
  text-decoration: none;
}

.upcoming-item:hover {
  background: var(--paper);
}

.upcoming-item .upcoming-emoji {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tile-soft);
  font-size: var(--text-xl);
  line-height: 1;
}

.upcoming-item .upcoming-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--weight-bold);
}

.upcoming-when {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* one task per card */
.upcoming-one {
  display: flex;
  flex-direction: column;
  width: 172px;
  padding: var(--space-5);
}

.upcoming-one:hover .upcoming-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upcoming-one .upcoming-emoji {
  font-size: 2.25rem;
  line-height: 1;
}

.upcoming-one .upcoming-name {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upcoming-one .upcoming-when {
  margin-top: auto;
}

.upcoming-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: 560px;
  padding: var(--space-5) var(--space-6);
  color: var(--ink-soft);
}
