/* ─── Design Tokens ───────────────────────────────────────────────────────── */

:root {
  --bg:       #FAF9F7;
  --text:     #1A1A1A;
  --text-2:   #3D3D3D;
  --muted:    #888888;
  --border:   #E2E2E2;
  --accent:   #5CC8FF;
  --accent-h: #4AB8EF;
  --max-w:    580px;
  --radius:   12px;
  --font:     'DM Sans', system-ui, sans-serif;
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── App shell ───────────────────────────────────────────────────────────── */

#app {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ─── Screen transitions ──────────────────────────────────────────────────── */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 200ms ease;
}

.screen-enter   { opacity: 0; }
.screen-visible { opacity: 1; }
.screen-exit    { opacity: 0; pointer-events: none; }

/* ─── Page layout ─────────────────────────────────────────────────────────── */

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem;
}

.content-wrap {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem 0 2rem;
}

/* ─── Landing page ────────────────────────────────────────────────────────── */

@keyframes landing-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.landing-fade {
  animation: landing-fade 500ms ease-out forwards;
}

.landing-page .content-wrap {
  justify-content: flex-start;
  padding-top: 18vh;
  padding-bottom: 0;
}

.landing-page .headline {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.75rem; /* 28px */
}

.landing-page .subline {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.8;
  letter-spacing: 0.01em;
  max-width: 520px;
  margin-bottom: 1.75rem; /* 28px to divider */
}

/* ─── Decorative divider ──────────────────────────────────────────────────── */

.section-divider {
  width: 40px;
  height: 1px;
  background: #D4D4D4;
  border: none;
  margin: 0 auto 1.75rem; /* 28px to context lines */
}

/* ─── Context lines ───────────────────────────────────────────────────────── */

.landing-page .context-line {
  font-size: 0.95rem;
  font-weight: 400;
  color: #888888;
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 0.375rem; /* 6px gap between lines */
  letter-spacing: 0.02em;
}

.landing-page .context-line-2 {
  margin-bottom: 3rem; /* 48px gap before input */
}

/* ─── Typography (non-landing screens) ───────────────────────────────────── */

.headline {
  font-family: var(--font);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.subline {
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.section-heading {
  font-family: var(--font);
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.task-label {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ─── Input ───────────────────────────────────────────────────────────────── */

.task-input-single {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #E2E2E2;
  border-radius: var(--radius);
  padding: 18px 24px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
}

.task-input-single:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.15);
}

.task-input-single::placeholder {
  color: #BBBBBB;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease, opacity 150ms ease;
  text-align: center;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #1A1A1A;
  box-shadow: 0 2px 12px rgba(92, 200, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(92, 200, 255, 0.3);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid #D4D4D4;
  font-size: 0.9375rem;
  font-weight: 500;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: #BBBBBB;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Landing button */
.landing-page .btn-primary {
  max-width: 440px;
}

/* Tighter button on inner screens */
.breakdown-page .btn-primary,
.breakdown-page .btn-ghost,
.timer-page .btn-primary,
.done-page .btn-primary,
.done-page .btn-ghost {
  font-size: 0.9375rem;
  padding: 14px 28px;
}

.breakdown-page .btn-primary,
.breakdown-page .btn-ghost,
.timer-page .btn-primary,
.done-page .btn-primary {
  max-width: 320px;
}

/* ─── Input group ─────────────────────────────────────────────────────────── */

.landing-page .input-group {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.125rem; /* 18px between input and button */
  text-align: left;
}

/* ─── Error message ───────────────────────────────────────────────────────── */

.error-msg {
  font-size: 0.875rem;
  font-weight: 400;
  color: #7A3020;
  background: #FEF0EC;
  border: 1px solid #F5C9BC;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  line-height: 1.5;
}

/* ─── Loading dots ────────────────────────────────────────────────────────── */

.loading-label {
  display: inline-flex;
  align-items: center;
}

.dots::after {
  content: '';
  display: inline-block;
  animation: dots 1.5s steps(4, end) infinite;
  width: 1.5em;
  text-align: left;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ─── Breakdown: steps list ───────────────────────────────────────────────── */

.breakdown-page .content-wrap {
  text-align: center;
  align-items: center;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 2rem;
  width: 100%;
}

.step-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9375rem 1.0625rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  font-family: var(--font);
}

.step-btn:hover:not(:disabled):not(.selected):not(.dimmed) {
  border-color: var(--accent);
  box-shadow: 0 1px 6px rgba(92, 200, 255, 0.2);
}

.step-btn.selected {
  border-color: var(--accent);
  background: #EEF8FF;
  box-shadow: 0 1px 6px rgba(92, 200, 255, 0.2);
}

.step-btn.dimmed {
  opacity: 0.35;
}

.step-btn:disabled:not(.selected):not(.dimmed) {
  cursor: default;
}

.step-num {
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  background: var(--border);
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  transition: background 150ms ease, color 150ms ease;
}

.step-btn.selected .step-num {
  background: var(--accent);
  color: #1A1A1A;
}

.step-text {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.7;
}

/* ─── Breakdown: single step card ────────────────────────────────────────────*/

.step-card-single {
  width: 100%;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  margin-bottom: 2rem;
  text-align: center;
}

.step-card-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.7;
}

/* ─── Breakdown: confirm & actions ───────────────────────────────────────────*/

.confirm-q {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  max-width: 320px;
}

/* ─── Breakdown: see all steps ───────────────────────────────────────────────*/

.see-all-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-top: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.see-all-toggle:hover {
  color: var(--text);
}

.all-steps-list {
  width: 100%;
  max-width: 480px;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.all-step-item {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius);
}

/* ─── Timer ───────────────────────────────────────────────────────────────── */

.timer-page .content-wrap {
  align-items: center;
  text-align: center;
}

.step-display {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.timer-wrap {
  position: relative;
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  margin-bottom: 2.25rem;
}

.timer-svg {
  width: 100%;
  height: 100%;
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

#timer-ring {
  transition: stroke-dashoffset 900ms linear;
}

/* ─── Timer complete ──────────────────────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Done screen ─────────────────────────────────────────────────────────── */

.done-page .content-wrap {
  align-items: center;
  text-align: center;
}

.done-page .headline {
  margin-bottom: 1.25rem;
}

.done-subline {
  font-size: 1.1rem;
  font-weight: 400;
  color: #6B6B6B;
  line-height: 1.7;
  max-width: 480px;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.done-rule {
  font-size: 0.9rem;
  font-weight: 400;
  color: #9A9590;
  line-height: 1.5;
  max-width: 420px;
  text-align: center;
  margin-bottom: 2rem; /* 32px gap before buttons */
}

.done-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  width: 100%;
  max-width: 320px;
}

/* ─── Soft CTA ────────────────────────────────────────────────────────────── */

.soft-cta {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
}

.soft-cta p {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
}

.soft-cta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.soft-cta a:hover {
  text-decoration: underline;
}

/* ─── Home nav ────────────────────────────────────────────────────────────── */

.home-nav {
  width: 100%;
  padding: 1rem 0 0;
  max-width: var(--max-w);
  align-self: center;
}

.home-nav-link {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: #9A9590;
  cursor: pointer;
  padding: 0;
  transition: color 150ms ease;
}

.home-nav-link:hover {
  color: var(--muted);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  width: 100%;
  max-width: var(--max-w);
  padding: 1.5rem 0;
  text-align: center;
  align-self: center;
  margin-top: auto;
}

.site-footer a {
  font-size: 0.8rem;
  font-weight: 400;
  color: #AAAAAA;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 150ms ease;
}

.site-footer a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.footer-about-link {
  color: #AAAAAA !important;
}

/* ─── Timer: "I did it" button ───────────────────────────────────────────── */

.timer-done-btn {
  margin-top: 1.5rem; /* 24px gap below ring */
  max-width: 220px;
}

/* ─── Checklist screen ────────────────────────────────────────────────────── */

.checklist-page .content-wrap {
  justify-content: flex-start;
  padding-top: 3rem;
  align-items: center;
  text-align: center;
  overflow-y: auto;
}

.reset-page .content-wrap {
  justify-content: flex-start;
  padding-top: 15vh;
  align-items: center;
  text-align: center;
  overflow-y: auto;
}

.checklist-list {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  text-align: left;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}

.checklist-checkbox {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.checklist-step-text {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
}

.checklist-step-text.checked {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #CCCCCC;
}

.checklist-timer-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 0.125rem 0;
  white-space: nowrap;
  transition: opacity 150ms ease;
}

.checklist-timer-btn:hover {
  opacity: 0.75;
}

/* ─── Checklist: congrats state ───────────────────────────────────────────── */

.congrats-line {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1A1A1A;
  text-align: center;
  margin-bottom: 1rem;
}

.congrats-sub {
  font-size: 1rem;
  font-weight: 400;
  color: #6B6B6B;
  text-align: center;
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 1.5rem;
}

.congrats-nudge {
  font-size: 0.9rem;
  font-weight: 400;
  color: #888888;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* ─── Reset screen ────────────────────────────────────────────────────────── */

.reset-sub {
  font-size: 1rem;
  font-weight: 400;
  color: #6B6B6B;
  line-height: 1.7;
  max-width: 480px;
  text-align: center;
  margin-bottom: 1.5rem; /* 24px gap before activities */
}

.reset-activities {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
}

.reset-activity-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
}

.reset-activity-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2);
}

.reset-activity-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.reset-ready-btn {
  max-width: 320px;
  margin-bottom: 0.75rem;
}

.reset-diff-btn {
  max-width: 320px;
  font-size: 0.875rem;
}

/* ─── Nice screen ─────────────────────────────────────────────────────────── */

.nice-page {
  justify-content: center;
  align-items: center;
}

.nice-page .content-wrap {
  justify-content: center;
  align-items: center;
}

@keyframes nice-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

.nice-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  animation: nice-fade-in 300ms ease forwards;
}

/* ─── Checklist: stagger animations ──────────────────────────────────────── */

@keyframes stagger-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-0 {
  animation: stagger-fade-in 300ms ease 0ms both;
}

.stagger-1 {
  animation: stagger-fade-in 300ms ease 2000ms both;
}

.stagger-2 {
  animation: stagger-fade-in 300ms ease 4000ms both;
}

.stagger-3 {
  animation: stagger-fade-in 300ms ease 5500ms both;
}


/* ─── Checklist: pre-done step 0 ──────────────────────────────────────────── */

.checklist-item-done {
  opacity: 0.5;
}

/* ─── Checklist: bottom link ─────────────────────────────────────────────── */

.checklist-bottom-link {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem 0;
  margin-top: 1.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.checklist-bottom-link:hover {
  color: var(--text);
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (min-width: 640px) {
  .content-wrap {
    padding: 4rem 0 2.5rem;
  }

  .landing-page .content-wrap {
    padding-top: 18vh;
    padding-bottom: 0;
  }

  .confirm-actions {
    flex-direction: row;
  }

  .confirm-actions .btn-primary,
  .confirm-actions .btn-ghost {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 480px) {
  .landing-page .headline {
    font-size: 2.75rem;
  }

  .landing-page .subline {
    font-size: 1.05rem;
  }

  .landing-steps {
    flex-direction: column !important;
  }

  .landing-tools {
    flex-direction: column !important;
  }
}

/* ─── Landing page sections (below the fold) ─────────────────────────────── */

.landing-sections {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8rem 1.5rem 2rem;
}

.landing-section {
  margin-bottom: 4rem;
}

.landing-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 1.75rem;
}

.landing-steps {
  display: flex;
  gap: 1.25rem;
}

.landing-step {
  flex: 1;
  text-align: center;
}

.landing-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.landing-step-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.landing-step-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

.landing-story {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2rem;
  text-align: center;
}

.landing-story-text {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.landing-story-text:last-of-type {
  margin-bottom: 0;
}

.landing-story-italic {
  font-style: italic;
  color: var(--muted);
  margin-top: 1.25rem;
}

.landing-tools {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.landing-tool-card {
  flex: 1;
  max-width: 280px;
  padding: 1.25rem 1.25rem;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.landing-tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(92, 200, 255, 0.1);
}

.landing-tool-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
}

.landing-tool-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}
