/* moto - one dark theme, five accents, and nothing that needs a build step. */

:root {
  --page: #100e0d;
  --panel: #191513;
  --panel2: #221d1a;
  --line: #2e2823;
  --line2: #3d352e;
  --ink: #f5efe8;
  --mute: #a1948a;
  --faint: #6d635b;
  --accent: #ff7a3d;
  --accent2: #ffb056;
  --on-accent: #1b0f07;
  --gold: #ffc65c;
  --good: #6dd39a;
  --bad: #ff7b72;
  --radius: 16px;
}

body[data-accent="forest"] { --accent: #47ca8b; --accent2: #93e6bb; --on-accent: #06210f; }
body[data-accent="ocean"]  { --accent: #4aa5ff; --accent2: #8fcdff; --on-accent: #04182e; }
body[data-accent="violet"] { --accent: #9b82ff; --accent2: #c6b5ff; --on-accent: #150a2e; }
body[data-accent="rose"]   { --accent: #ff6f9c; --accent2: #ffa9c4; --on-accent: #2d0616; }

* { box-sizing: border-box; }

/* Author display rules would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.view { display: none; }
body[data-view="landing"] #landingView,
body[data-view="auth"] #authView,
body[data-view="app"] #appView { display: block; }
body[data-view="boot"] #bootView { display: grid; }

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; }

.mute { color: var(--mute); }
.small { font-size: .88rem; }
.fine { font-size: .78rem; color: var(--faint); line-height: 1.5; }
.center { text-align: center; }
.spacer { flex: 1; }
.problem { color: var(--bad); font-size: .85rem; min-height: 1.2em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ── controls ───────────────────────────────────────────────────── */

button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: .6rem 1.05rem;
  background: var(--accent); color: var(--on-accent);
  transition: filter .15s, background .15s, color .15s, border-color .15s;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: default; }
button.big { padding: .8rem 1.5rem; font-size: 1.02rem; border-radius: 12px; }
button.wide { width: 100%; }

button.ghost { background: transparent; color: var(--mute); border-color: var(--line2); }
button.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--mute); filter: none; }

button.tiny { padding: .28rem .6rem; font-size: .78rem; font-weight: 500; border-radius: 8px; }

input, select, textarea {
  width: 100%; font: inherit; color: inherit;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 10px; padding: .65rem .8rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
textarea { resize: vertical; min-height: 3.4rem; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: right 1rem center, right .72rem center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

label { display: grid; gap: .3rem; font-size: .82rem; color: var(--mute); }

.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; text-decoration: none; display: inline-block; }
.logo::after { content: "·"; color: var(--accent); margin-left: .1em; }

/* ── boot ───────────────────────────────────────────────────────── */

.boot { place-items: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── landing ────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 68rem; margin: 0 auto; padding: 1rem 1.25rem;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(16,14,13,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.navlinks { display: flex; gap: 1.4rem; font-size: .9rem; margin-right: auto; }
.navlinks a { color: var(--mute); text-decoration: none; }
.navlinks a:hover { color: var(--ink); }
.navacts { display: flex; gap: .5rem; }

.hero {
  max-width: 68rem; margin: 0 auto; padding: 4rem 1.25rem 3rem;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
}
.pill {
  display: inline-block; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent2); border: 1px solid var(--line2); border-radius: 999px;
  padding: .3rem .8rem; margin-bottom: 1.4rem;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 800; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 1.2rem 0 1.9rem; font-size: 1.08rem; color: var(--mute); max-width: 34rem; }
.heroActs { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.1rem; }

.heroArt { position: relative; }
.heroArt .glow {
  position: absolute; inset: -18% -12%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 60% 40%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
  filter: blur(18px);
}
.demo { transform: rotate(-1.4deg); }

.band { max-width: 68rem; margin: 0 auto; padding: 3.5rem 1.25rem; scroll-margin-top: 4.5rem; }
.band > h2 { font-size: 1.9rem; margin-bottom: 2rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.step .num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent2); font-weight: 700; font-size: .9rem; margin-bottom: .9rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: .45rem; }
.step p { color: var(--mute); font-size: .92rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feat { border-left: 2px solid var(--line2); padding: .2rem 0 .2rem 1.1rem; }
.feat h3 { font-size: 1rem; margin-bottom: .4rem; }
.feat h3 em { font-style: italic; color: var(--accent2); }
.feat p { color: var(--mute); font-size: .92rem; }

.cta {
  max-width: 68rem; margin: 1rem auto 0; padding: 4rem 1.25rem; text-align: center;
  border-top: 1px solid var(--line);
}
.cta h2 { font-size: 2rem; }
.cta p { color: var(--mute); margin: .6rem 0 1.6rem; }

.foot {
  max-width: 68rem; margin: 0 auto; padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--faint);
}

/* ── auth ───────────────────────────────────────────────────────── */

.authWrap { max-width: 24rem; margin: 0 auto; padding: 4rem 1.25rem; display: grid; gap: 1.2rem; }
.authCard { padding: 1.5rem; display: grid; gap: .9rem; }
.segs { display: flex; gap: .3rem; background: var(--panel2); border-radius: 11px; padding: .25rem; }
.segs button { flex: 1; background: transparent; color: var(--mute); font-size: .88rem; padding: .45rem; border-radius: 8px; }
.segs button.on { background: var(--panel); color: var(--ink); border-color: var(--line2); }
#authForm { display: grid; gap: .8rem; }
#authForm button { margin-top: .2rem; }
.warn { border-top: 1px solid var(--line); padding-top: .9rem; }

/* ── app chrome ─────────────────────────────────────────────────── */

.top { position: sticky; top: 0; z-index: 8; background: rgba(16,14,13,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topInner { max-width: 48rem; margin: 0 auto; padding: .8rem 1.1rem; display: flex; align-items: center; gap: 1rem; }
.topStats { margin-left: auto; display: flex; gap: 1.1rem; font-size: .76rem; color: var(--faint); }
.topStats b { display: block; font-size: .95rem; color: var(--ink); font-weight: 700; line-height: 1.2; }
.topStats .hot b { color: var(--accent); }
.topStats .due b { color: var(--gold); }
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; padding: 0;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: var(--on-accent); font-weight: 800; font-size: .9rem;
}

.wrap { max-width: 48rem; margin: 0 auto; padding: 1.25rem 1.1rem 5rem; }

.todayBar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; }
.todayBar .row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .55rem; }
.todayBar h2 { font-size: .98rem; }
.todayBar .count { font-size: .8rem; color: var(--mute); white-space: nowrap; }
.meter { height: 7px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s ease; }
.todayBar.allDone { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.todayBar.allDone .meter i { background: var(--good); }

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: .2rem; }
.tabs button { background: var(--panel); color: var(--mute); border-color: var(--line); font-size: .82rem; font-weight: 500; padding: .38rem .8rem; white-space: nowrap; }
.tabs button.on { background: var(--panel2); color: var(--ink); border-color: var(--line2); font-weight: 600; }

.addRow { margin-top: 1.25rem; }

/* ── a challenge card ───────────────────────────────────────────── */

.ch { margin-bottom: 1rem; overflow: hidden; }
.ch.hot { border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

.chTop { display: flex; gap: .9rem; padding: 1.1rem 1.1rem .85rem; align-items: center; }

.ring {
  width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; display: grid; place-items: center;
  position: relative; background: conic-gradient(var(--accent) var(--pct), var(--panel2) 0);
}
.ring i {
  position: absolute; inset: 5px; border-radius: 50%; background: var(--panel);
  display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 1.3rem;
}
.ring.cold { background: var(--panel2); }
.ring.cold i { color: var(--faint); }

.chTitle { flex: 1; min-width: 0; }
.chTitle h3 { font-size: 1.06rem; }
.chTitle p { margin-top: .25rem; font-size: .8rem; color: var(--mute); }
.tag {
  display: inline-block; font-size: .66rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--mute); border: 1px solid var(--line2); border-radius: 999px;
  padding: .08rem .5rem; margin-right: .4rem;
}

.chBody { padding: 0 1.1rem 1rem; display: grid; gap: .75rem; }

.strip { display: flex; gap: 3px; }
.strip i { flex: 1; height: 22px; border-radius: 3px; background: var(--panel2); border: 1px solid transparent; }
.strip i.on { background: var(--accent); }
.strip i.now { border-color: var(--ink); }

.stripLegend { display: flex; justify-content: space-between; font-size: .68rem; color: var(--faint); margin-top: .25rem; }

.reward { border-radius: 11px; padding: .65rem .85rem; font-size: .88rem; display: flex; gap: .7rem; align-items: center; justify-content: space-between; background: var(--panel2); border: 1px solid var(--line); }
.reward.hot { background: linear-gradient(100deg, color-mix(in srgb, var(--gold) 16%, transparent), color-mix(in srgb, var(--accent) 10%, transparent)); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.reward b { color: var(--gold); }
.reward button { background: var(--gold); color: #2a1a00; flex: 0 0 auto; }

.idea { background: var(--panel2); border: 1px dashed var(--line2); border-radius: 11px; padding: .65rem .85rem; font-size: .92rem; }
.idea .row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.ideaLabel { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); display: block; }

.done { display: flex; align-items: center; justify-content: space-between; gap: .7rem; background: color-mix(in srgb, var(--good) 10%, transparent); border: 1px solid color-mix(in srgb, var(--good) 32%, transparent); color: var(--good); border-radius: 11px; padding: .6rem .85rem; font-size: .88rem; }

.checkin { display: grid; gap: .5rem; }
.checkin .tools { display: flex; gap: .5rem; align-items: center; }
.checkin .tools button { flex: 0 0 auto; }
.checkin label.file { flex: 1; min-width: 0; font-size: .82rem; color: var(--mute); border: 1px dashed var(--line2); border-radius: 10px; padding: .6rem .75rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.checkin input[type=file] { display: none; }

.proof { display: flex; gap: .4rem; overflow-x: auto; padding-top: .1rem; }
.proof figure { margin: 0; flex: 0 0 74px; }
.proof img { width: 74px; height: 74px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line2); cursor: zoom-in; display: block; }
.proof .nophoto { width: 74px; height: 74px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); font-size: .6rem; line-height: 1.35; color: var(--mute); padding: .35rem; overflow: hidden; }
.proof figcaption { font-size: .6rem; color: var(--faint); text-align: center; margin-top: .2rem; }

.chFoot { display: flex; gap: .5rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: .5rem 1.1rem; font-size: .74rem; color: var(--faint); }

.empty { text-align: center; padding: 2.5rem 1.2rem; }
.empty b { display: block; font-size: 1.1rem; margin-bottom: .4rem; }
.empty p { color: var(--mute); font-size: .92rem; max-width: 26rem; margin: 0 auto 1.2rem; }
.seeds { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }

/* ── dialogs, lightbox, toasts ──────────────────────────────────── */

dialog {
  border: 1px solid var(--line2); border-radius: var(--radius); padding: 0;
  background: var(--panel); color: var(--ink); width: min(26rem, calc(100vw - 2rem));
}
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: .85rem; padding: 1.4rem; }
dialog h2 { font-size: 1.15rem; }
.dlgActs { display: flex; gap: .5rem; align-items: center; margin-top: .2rem; }
.dlgActs button { flex: 0 0 auto; }

.accents { border: 0; padding: 0; margin: 0; }
.accents legend { font-size: .82rem; color: var(--mute); padding: 0 0 .35rem; }
#accentRow { display: flex; gap: .5rem; }
.swatch { width: 30px; height: 30px; border-radius: 50%; padding: 0; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: grid; place-items: center; z-index: 30; padding: 1.5rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

.toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 40; display: grid; gap: .5rem; width: min(24rem, calc(100vw - 2rem)); }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-radius: 11px; padding: .65rem .9rem; font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: rise .2s ease; }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }
.toast.win { border-color: color-mix(in srgb, var(--good) 50%, transparent); color: var(--good); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── narrow ─────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2.5rem; }
  .steps, .grid { grid-template-columns: 1fr; }
  .navlinks { display: none; }
  .nav { gap: .8rem; }
  .nav .logo { margin-right: auto; }
}

@media (max-width: 480px) {
  .topStats .best { display: none; }
  .topInner { gap: .7rem; }
  .hero { padding-top: 2rem; }
  .heroActs button { width: 100%; }
  .chTop { gap: .75rem; padding: .9rem .9rem .7rem; }
  .chBody { padding: 0 .9rem .9rem; }
  .chFoot { padding: .5rem .9rem; }
  .ring { width: 54px; height: 54px; flex-basis: 54px; }
  .ring i { font-size: 1.1rem; }
  .strip i { height: 18px; }
  .foot { flex-direction: column; gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
