/* Direction: HabitFlow — violet→pink motivational tracker, soft rounded cards, pill buttons */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #f6f3fe;
  --surface: #ffffff;
  --surface-2: #efe9fd;
  --border: #e3dbf8;
  --border-strong: #b1adbc;
  --ink: #1d1630;
  --muted: #655d82;
  --accent: #7c3aed;
  --accent-hover: #6931c9;
  --accent-ink: #ffffff;
  --accent-text: #6d28d9;
  --accent-strong: #5b21b6;
  --accent-soft: #ece3ff;
  --accent-border: #bfa0f6;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dbe5e7;
  --success-strong: #116d34;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #eee0e1;
  --warning-strong: #994607;
  --danger: #be123c;
  --danger-ink: #ffffff;
  --danger-soft: #efd8e7;
  --danger-strong: #be123c;
  --chart-1: #7c3aed;
  --chart-2: #ee2096;
  --chart-3: #894201;
  --chart-4: #858b1d;
  --chart-5: #0b6451;
  --chart-6: #0a92c6;

  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.02em;
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-input: 14px;
  --shadow-card: 0 20px 45px -28px rgba(70, 25, 140, 0.5);
  --card-pad: 20px;
  --gradient-hero: linear-gradient(135deg, #7c3aed 0%, #a21caf 48%, #f472b6 100%);
  --x-on-grad: #ffffff;
  --x-done-bg: rgba(34, 197, 94, 0.14);
  --x-done-border: rgba(34, 197, 94, 0.4);
  --x-h1: #7c3aed;
  --x-h2: #ec4899;
  --x-h3: #0ea5e9;
  --x-h4: #10b981;
  --x-h5: #f59e0b;
  --x-h6: #ef4444;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="dark"] {
  --canvas: #0a0514;
  --surface: #231e2c;
  --surface-2: #161220;
  --border: #2c2835;
  --border-strong: #54505b;
  --ink: #f6f3fe;
  --muted: #9894a0;
  --accent: #7c3aed;
  --accent-hover: #9058f0;
  --accent-ink: #ffffff;
  --accent-text: #a171f1;
  --accent-strong: #a171f1;
  --accent-soft: #231144;
  --accent-border: #3d1d76;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #0c201d;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #2f1612;
  --warning-strong: #c57a40;
  --danger: #be123c;
  --danger-ink: #ffffff;
  --danger-soft: #32081d;
  --danger-strong: #d4637e;
  --chart-1: #8242f4;
  --chart-2: #f62c9c;
  --chart-3: #c36208;
  --chart-4: #8b920f;
  --chart-5: #20957a;
  --chart-6: #1c98cd;
}

/* HabitFlow — gradient header, progress ring, pickers, week grid, charts, confetti */

.hero-grad {
  background-image: var(--gradient-hero);
  color: var(--x-on-grad);
}

/* view tabs */
.hf-tab {
  @apply rounded-[var(--radius-btn)] px-3 py-2 text-sm font-semibold text-muted transition;
}
.hf-tab[aria-selected="true"] {
  background-color: var(--accent);
  color: var(--x-on-grad);
}

/* progress ring */
.ring-track { stroke: var(--border); }
.ring-bar {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* habit rows */
.hf-check {
  @apply grid h-12 w-12 shrink-0 place-items-center rounded-full border-2 bg-surface transition;
}
.hf-check[aria-pressed="true"] {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--x-on-grad);
}
.done-row {
  background-color: var(--x-done-bg);
  border-color: var(--x-done-border);
}
.done-row .habit-name {
  text-decoration: line-through;
  opacity: 0.68;
}
.hf-step {
  @apply grid h-9 w-9 place-items-center rounded-full border border-border bg-surface transition;
}
.hf-step:hover { background-color: var(--accent-soft); }

/* dialog pickers */
.hf-emoji {
  @apply grid h-9 w-9 place-items-center rounded-[var(--radius-input)] border border-border bg-surface text-lg transition;
}
.hf-emoji[aria-pressed="true"] {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}
.hf-color {
  @apply h-9 w-9 rounded-full border-2 border-border transition;
}
.hf-color[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--canvas), 0 0 0 5px var(--accent);
}
.hf-day,
.hf-goal {
  @apply rounded-[var(--radius-btn)] border border-border bg-surface px-3 py-2 text-sm font-semibold text-muted transition;
}
.hf-day { @apply h-9 w-9 px-0 text-center; }
.hf-day[aria-pressed="true"],
.hf-goal[aria-pressed="true"] {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent-strong);
}

/* week grid */
.hf-cell {
  @apply grid h-9 w-full place-items-center rounded-[10px] border border-border bg-surface transition;
}
.hf-cell-done {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--x-on-grad);
}
.hf-cell-missed { @apply bg-surface-2 text-muted; }
.hf-cell-off { @apply border-transparent bg-transparent text-muted opacity-50; }
.hf-cell-future { @apply bg-surface text-muted opacity-45; }

/* charts */
.bar-fill {
  @apply w-full rounded-t-lg bg-accent;
  min-height: 4px;
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.heat-cell { @apply h-4 w-4 rounded-[4px] border border-border; }
.mini-bar { @apply h-2 rounded-full bg-accent; transition: width 0.6s ease-out; }

/* motion, toasts, confetti */
.pop { animation: hf-pop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes hf-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.hf-toast {
  @apply rounded-[var(--radius-btn)] border border-border bg-surface px-4 py-3 text-sm font-semibold shadow-[var(--shadow-card)];
  animation: hf-rise 0.3s ease-out;
}
@keyframes hf-rise {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}
.confetti-piece {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 15px;
  border-radius: 3px;
  animation: hf-fall 2.2s linear forwards;
}
@keyframes hf-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { transform: translate3d(0, 106vh, 0) rotate(900deg); }
}
html.reduced-motion .pop,
html.reduced-motion .hf-toast,
html.reduced-motion .confetti-piece { animation: none; }
html.reduced-motion .ring-bar,
html.reduced-motion .bar-fill,
html.reduced-motion .mini-bar { transition: none; }
