/* Taskless palette: monochrome, no accent. Same values as trytaskless.ai. */
:root {
  --paper: #f6f6f4;
  --paper-2: #efefec;
  --card: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #3a3a40;
  --muted: #66666e;
  --line: #e3e3df;
  --line-2: #d3d3ce;
  --night-muted: #a3a3ab;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.2, 1.25, 0.35, 1);

  --gutter: 18px;
  --peek: 12px; /* how far each card behind the top one shows */
  --px: 3px; /* one pixel of the little character */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior: none;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--ink); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 8px;
}
.card-ink :focus-visible { outline-color: #fff; }

/* ───────── Frame ───────── */

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}

/* ───────── Progress ───────── */

.progress {
  display: flex;
  gap: 4px;
  padding: 10px var(--gutter) 0;
}
.progress button {
  flex: 1;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}
.progress button::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: var(--line-2);
  transition: background-color 0.3s var(--ease);
}
.progress button[aria-current='true']::before,
.progress button.is-past::before { background: var(--ink); }

/* ───────── Deck ───────── */

.stage {
  position: relative;
  display: flex;
  align-items: center;
  /* room above the deck for the little character to stand */
  padding: calc(var(--px) * 26 + 10px) var(--gutter) 16px;
}

.deck {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 680px;
}

.card {
  position: absolute;
  inset: 0 0 calc(var(--peek) * 2) 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 28px 50px -30px rgb(0 0 0 / 0.35);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--spring), opacity 0.35s var(--ease);
}
.card::-webkit-scrollbar { display: none; }
.card.is-dragging { transition: none; cursor: grabbing; }
.card.is-top { cursor: grab; }

.card h2 {
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.card > p { max-width: 40ch; }

.card-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #d6d6db;
}
.card-ink h2 { color: #fff; }

.card-cta { margin-top: auto; width: 100%; }

.fine {
  font-size: 0.8125rem;
  color: var(--night-muted);
}
.fine-dark { color: var(--muted); margin-top: auto; }

/* Opening moment: the deck deals in, then the top card nudges to show it moves. */
.deck.is-dealing .card { transition: none !important; opacity: 0 !important; transform: translateY(40px) scale(0.96) !important; }
.card.is-nudge { animation: nudge 0.9s var(--ease); }
@keyframes nudge {
  30% { transform: translateX(-34px) rotate(-3deg); }
  60% { transform: translateX(8px) rotate(0.6deg); }
}

/* Arrows: desktop only, sitting outside the deck */
.arrow {
  display: none;
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}
.arrow svg { width: 22px; height: 22px; margin: auto; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.arrow:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.arrow:disabled { opacity: 0; pointer-events: none; }
.arrow-prev { left: -64px; }
.arrow-next { right: -64px; }
@media (min-width: 640px) and (hover: hover) {
  .arrow { display: grid; }
}

/* ───────── Keys: every button presses down like a key ───────── */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font: 500 0.9375rem/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s, box-shadow 0.08s, background-color 0.15s;
}
.key:active,
.key.is-pressed { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }

.key-dark { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }
.key-dark:hover { background: #26262a; }

.key-light { background: #fff; border-color: #fff; color: var(--ink); box-shadow: 0 3px 0 #77777f; }
.key-light:active { box-shadow: 0 0 0 #77777f; }

.key svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── Dock ───────── */

.dock {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 var(--gutter) calc(env(safe-area-inset-bottom) + 14px);
}
.dock-save { padding: 0 12px; }
.dock-icon {
  flex-direction: column;
  gap: 3px;
  padding: 0 4px;
  font-size: 0.75rem;
}

/* ───────── Card 1: me ───────── */

/* Photo, name and links stay together as one block, centred in the space above
   the swipe hint, so tall phones don't open a gap between photo and name. */
.card-me { gap: 0; }
.avatar {
  margin-top: auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  object-position: 50% 88%; /* sit the photo higher in the circle so the tee shows */
  background: var(--paper-2);
  filter: brightness(1.14) contrast(1.03);
  pointer-events: none;
}
.name {
  margin-top: 22px;
  color: var(--ink);
  font-size: clamp(2.5rem, 12vw, 3.25rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.role {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 500;
}
.lede { margin-top: 12px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.card-me .socials { margin-bottom: 22px; } /* minimum gap above the swipe hint */
.intro-cta { flex-shrink: 0; margin-bottom: 22px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.08s;
}
.chip:hover { border-color: var(--ink); }
.chip:active { transform: scale(0.96); }

.hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: hint 1.6s var(--ease) infinite;
}
@keyframes hint { 50% { transform: translateX(4px); } }

/* ───────── Card 2: the flow ───────── */

.flow {
  display: grid;
  gap: 6px;
}
.flow li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  grid-template-areas: 'dot title action' 'dot meta action';
  align-items: center;
  column-gap: 10px;
  padding: 9px 10px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s, background-color 0.2s;
}
.flow li::before {
  content: '';
  grid-area: dot;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s;
}
.flow-title {
  grid-area: title;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-meta {
  grid-area: meta;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.flow-kind { font-family: var(--mono); font-size: 0.75rem; }

.flow li.is-working::before { border-color: var(--ink); border-right-color: transparent; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.flow li.is-done { background: var(--paper); }
.flow li.is-done::before {
  border-color: var(--ink);
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.5 2.5L13 6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.flow li.is-done .flow-status { color: var(--ink); }

.flow li.is-waiting { border-color: var(--ink); }
.flow li.is-waiting::before { border-style: dashed; border-color: var(--ink); }
.flow-approve {
  grid-area: action;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.8125rem;
}

.flow-note {
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ───────── Card 3: a month into a day ───────── */

.month {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.month span {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #fff;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.month.is-fast span:not(:first-child) { opacity: 0.12; transform: scale(0.7); }

.month-label { margin-top: auto; color: #fff; font-size: 1.0625rem; }
.month-label strong { font-weight: 600; }

/* ───────── Card 4: steps (a real sequence, so numbered) ───────── */

.steps {
  display: grid;
  gap: 22px;
  counter-reset: step;
  margin-top: 4px;
}
.steps li {
  position: relative;
  padding-left: 42px;
  min-height: 28px;
  font-size: 0.9375rem;
  line-height: 1.4;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -3px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}
.steps strong { color: var(--ink); font-weight: 600; }

/* ───────── Card 5: me, again ───────── */

.facts {
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.facts dt { color: var(--muted); }
.facts dd { color: var(--ink); }

/* ───────── Card 6: book ───────── */

.card-end h2 { font-size: 2.25rem; }
.card-end .facts { margin-top: 8px; }
.end-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.end-links a,
.end-links button {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.end-links a:hover,
.end-links button:hover { color: var(--ink); }

/* ───────── Short screens ───────── */

@media (min-height: 820px) {
  .avatar { width: 148px; height: 148px; }
  .card-me .socials { margin-top: 24px; }
}

@media (max-height: 700px) {
  :root { --px: 2px; }
  .card { padding: 20px 18px 18px; gap: 12px; }
  .card h2 { font-size: 1.5rem; }
  .avatar { width: 84px; height: 84px; }
  .name { margin-top: 16px; }
  .card > p { font-size: 0.9375rem; line-height: 1.45; }
  .flow li { padding-block: 6px; }
  .month { grid-template-columns: repeat(10, 1fr); gap: 5px; }
  .steps { gap: 14px; }
  .key { min-height: 48px; }
}

/* ───────── The little character ───────── */

.buddy {
  --x: 30px;
  --ride: 0px;
  --tilt: 0deg;
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 50;
  margin-bottom: -1px; /* feet on the card's edge, not floating above it */
  transform: translateX(var(--x));
  translate: var(--ride) 0;
  rotate: var(--tilt);
  transform-origin: 50% 100%;
  transition: translate 0.55s var(--spring), rotate 0.55s var(--spring);
  pointer-events: none;
}
.buddy.is-riding { transition: none; }

.buddy-body {
  display: block;
  width: calc(var(--px) * 14);
  height: calc(var(--px) * 26);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.buddy-sprite {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* A soft shadow on the card under his feet */
.buddy::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: calc(var(--px) * 12);
  height: calc(var(--px) * 1.5);
  margin-left: calc(var(--px) * -6);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.14);
  z-index: -1;
}
.buddy.is-hopping::after { animation: buddy-shadow 0.5s var(--ease); }
.buddy.is-dropping::after { animation: buddy-shadow-drop 0.8s 0.25s var(--ease) both; }

.buddy.is-hopping .buddy-body { animation: buddy-hop 0.5s var(--ease); }
.buddy.is-dropping .buddy-body { animation: buddy-drop 0.8s 0.25s both; }

@keyframes buddy-hop {
  40% { transform: translateY(calc(var(--px) * -10)); }
  80% { transform: translateY(0) scaleY(0.92); }
}
@keyframes buddy-drop {
  0% { transform: translateY(-110px); opacity: 0; animation-timing-function: cubic-bezier(0.5, 0, 1, 0.6); }
  10% { opacity: 1; }
  60% { transform: translateY(0) scaleY(0.86); animation-timing-function: var(--ease); }
  78% { transform: translateY(calc(var(--px) * -3)); }
  100% { transform: none; }
}
@keyframes buddy-shadow {
  40% { transform: scale(0.55); opacity: 0.5; }
}
@keyframes buddy-shadow-drop {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
}

/* What he says */
.buddy-say {
  position: absolute;
  left: calc(100% + 8px);
  top: calc(var(--px) * -2);
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.92);
  transform-origin: 0 100%;
  transition: opacity 0.18s, transform 0.25s var(--spring);
  pointer-events: none;
}
.buddy-say::after {
  content: '';
  position: absolute;
  left: -5px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  background: var(--card);
  transform: rotate(45deg);
}
.buddy.is-talking .buddy-say { opacity: 1; transform: none; }

/* Near the right edge the bubble opens to his left */
.buddy.say-left .buddy-say { left: auto; right: calc(100% + 8px); transform-origin: 100% 100%; }
.buddy.say-left .buddy-say::after { left: auto; right: -5px; border: 0; border-right: 1.5px solid var(--ink); border-top: 1.5px solid var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
