@font-face {
  font-family: "Pixelify Sans";
  src: url("../assets/fonts/pixelify-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/dm-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #040a18;
  --deep: #081a3a;
  --panel: #0a1c3d;
  --panel-2: #0e2650;
  --line: #1d4378;
  --blue: #1e8fff;
  --ice: #7fdcff;
  --text: #e8f4ff;
  --muted: #a3bbd8;
  --done: #4ff0b0;
  --doing: #ffc24d;
  --todo: #7d94b5;
  --idea: #c9a6ff;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: radial-gradient(ellipse 90% 70% at 50% 38%, #103a78 0%, #081a3a 45%, var(--ink) 100%) fixed var(--ink);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Accueil */

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 18vh;
  text-align: center;
}

.logo-wrap {
  margin: 0;
  width: min(880px, 94vw);
  animation: drop .7s steps(7) both, float 6s ease-in-out .7s infinite;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  transform: translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -6px));
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-48px) scale(.94); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  50% { transform: translateY(-10px); }
}

.tagline {
  margin: 4px 0 30px;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text);
  text-shadow: 0 2px 12px var(--ink);
  animation: rise .5s .35s both;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  animation: rise .5s .5s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Boutons en forme de bloc : la tranche basse s'écrase au clic */

.block {
  --edge: #0a4fae;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 232px;
  padding: 15px 26px;
  border: 0;
  font: 600 1.35rem/1.2 var(--pixel);
  letter-spacing: .02em;
  box-shadow: 0 7px 0 var(--edge), 0 12px 26px rgb(0 0 0 / .45);
  transition: transform .09s steps(2), box-shadow .09s steps(2), filter .15s;
}

.block:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--edge), 0 15px 30px rgb(0 0 0 / .5); filter: brightness(1.1); }
.block:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--edge), 0 3px 8px rgb(0 0 0 / .5); }

.block-primary {
  color: #03234f;
  background:
    linear-gradient(#fff6 0 3px, transparent 3px),
    conic-gradient(from 90deg at 16px 16px, #71d6ff 25%, #5cc8fb 0 50%, #71d6ff 0 75%, #8be0ff 0) 0 0 / 32px 32px;
}

.block-dark {
  --edge: #06142e;
  color: var(--text);
  background: var(--panel-2);
  border: 2px solid var(--line);
  padding-block: 13px;
}

.pulse {
  width: 12px;
  height: 12px;
  background: var(--doing);
  animation: pulse 1.6s steps(4) infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 5px rgb(255 194 77 / .28); }
}

.noscript { margin-top: 24px; max-width: 60ch; color: var(--muted); }

.footer {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 44px 16px 16px;
  font-size: .9rem;
  color: var(--text);
  background: linear-gradient(transparent, var(--ink) 70%);
}

.link {
  padding: 4px 2px;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: inherit;
}
.link:hover { color: var(--ice); }

/* Pop-ups */

.modal {
  width: min(1040px, calc(100% - 32px));
  height: min(88dvh, 920px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--deep);
  color: var(--text);
  box-shadow: 0 10px 0 #051026, 0 30px 80px rgb(0 0 0 / .6);
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: pop .22s steps(5) both;
}

.modal-small { width: min(560px, calc(100% - 32px)); height: fit-content; }

.modal::backdrop {
  background: rgb(2 7 18 / .72);
  backdrop-filter: blur(5px);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px 24px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font: 600 clamp(1.4rem, 3.4vw, 1.9rem)/1.15 var(--pixel);
}

.spark { color: var(--ice); }

.close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  font: 600 1.6rem/1 var(--pixel);
}
.close:hover { background: var(--line); }

.toolbar {
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}

.progress {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
}

.progress i {
  flex: 1;
  height: 10px;
  background: #16335f;
}
.progress i.terminé { background: var(--done); }
.progress i.en-cours { background: var(--doing); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid var(--line);
  background: transparent;
  font-size: .95rem;
  font-weight: 600;
}
.chip:hover { background: var(--panel-2); }
.chip[aria-pressed="true"] { background: var(--panel-2); border-color: var(--ice); }
.chip b { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

.modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  scrollbar-color: var(--line) transparent;
}

.intro {
  margin: 0 0 24px;
  max-width: 76ch;
  color: var(--muted);
}
.intro strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 1.1rem; }

/* Marqueurs de stade : forme et couleur différentes pour rester lisibles sans la couleur */

.mark {
  flex: none;
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
}
.mark.terminé { background: var(--done); }
.mark.terminé::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 10px;
  border: solid #04261a;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(40deg);
}
.mark.en-cours { border: 2px solid var(--doing); background: linear-gradient(90deg, var(--doing) 50%, transparent 50%); }
.mark.à-faire { border: 2px solid var(--todo); }
.mark.idée { border: 2px dashed var(--idea); }
.mark.idée::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--idea);
}

/* Catégories */

.category {
  padding: 18px 20px 20px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 2px solid #15325f;
}

.category-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 12px;
  align-items: center;
  margin-bottom: 14px;
}

.category-head .emoji { grid-row: span 2; font-size: 1.8rem; line-height: 1; }

.category h3 {
  margin: 0;
  font: 600 1.3rem/1.2 var(--pixel);
}

.category-head p {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.count {
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 7px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.items li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .97rem;
}
.items li[hidden] { display: none; }
.items .mark { margin-top: 4px; }
.items li.à-faire,
.items li.idée { color: #c8d8ec; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--line);
  margin: 0 0 14px;
}

.tracking {
  padding: 8px 4px 4px;
  color: var(--muted);
}
.tracking h3 { margin: 12px 0 8px; font: 600 1.3rem/1.2 var(--pixel); color: var(--text); }
.tracking p { margin: 0 0 8px; max-width: 76ch; }
.closing { color: var(--ice); font-weight: 600; margin-top: 16px !important; }

/* Mentions légales */

.legal section + section { margin-top: 22px; }
.legal h3 { margin: 0 0 8px; font: 600 1.2rem/1.2 var(--pixel); color: var(--ice); }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; font-weight: 600; }
.note { margin: 22px 0 0; font-size: .88rem; color: var(--muted); }

@media (max-width: 560px) {
  .hero { padding-bottom: 22vh; }
  .actions { flex-direction: column; width: 100%; max-width: 320px; gap: 18px; }
  .block { width: 100%; }
  .modal { width: calc(100% - 16px); height: calc(100dvh - 24px); }
  .modal-small { height: fit-content; }
  .modal-head { padding-left: 16px; }
  .toolbar { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .category { padding: 14px; }
  .chip { padding: 6px 10px; font-size: .9rem; }
  .category-head { grid-template-columns: auto 1fr; }
  .count { grid-column: 2; grid-row: 3; }
  .items { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
