:root {
  --bg: #f3eee4;
  --ink: #2a211c;
  --muted: #6d5e55;
  --card: #fffaf3;
  --line: #e4d8c8;
  --accent: #c45c4a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

body {
  min-height: 100vh;
}

.app {
  max-width: 24rem;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.7rem 1rem 1.1rem;
}

html.shot .dock,
html.shot .mode {
  display: none !important;
}

html.shot .app {
  min-height: auto;
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0 0.55rem;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.stages {
  display: flex;
  align-items: center;
  gap: 0.12rem;
}

.stages img {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  opacity: 0.42;
}

.stages img.is-now {
  opacity: 1;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brain-wrap {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.brain-stack {
  position: relative;
  width: min(100%, 220px);
}

.brain-pic {
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.34;
  filter: grayscale(0.32) contrast(0.96) brightness(0.97);
}

.face-pic {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 44%;
  width: 60%;
  height: auto;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
}

.fx {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.fx-noise {
  opacity: 0;
  background: url("img/noise.svg");
  background-size: 140px 140px;
  mix-blend-mode: overlay;
}

.fx-scan {
  opacity: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgb(20 16 14 / 0.16) 3px 4px
  );
}

.brain-stack[data-stage="1"] .fx-noise { opacity: 0.18; }
.brain-stack[data-stage="2"] .fx-noise { opacity: 0.32; }
.brain-stack[data-stage="3"] .fx-noise { opacity: 0.42; }
.brain-stack[data-stage="3"] .brain-pic {
  filter: grayscale(0.32) contrast(0.96) brightness(0.97)
    drop-shadow(1px 0 #c45c4a) drop-shadow(-1px 0 #6a8a8a);
}
.brain-stack[data-stage="4"] .fx-noise { opacity: 0.5; }
.brain-stack[data-stage="4"] .fx-scan { opacity: 0.22; }
.brain-stack[data-stage="4"] .brain-pic {
  filter: grayscale(0.32) contrast(0.96) brightness(0.97)
    drop-shadow(2px 0 #c45c4a) drop-shadow(-2px 0 #5a7a7a);
  animation: melt-jitter 1.15s steps(2) infinite;
}
.brain-stack[data-stage="5"] .fx-noise { opacity: 0.62; }
.brain-stack[data-stage="5"] .fx-scan { opacity: 0.4; }
.brain-stack[data-stage="5"] .brain-pic {
  filter: grayscale(0.32) contrast(0.96) brightness(0.97)
    drop-shadow(3px 0 #c45c4a) drop-shadow(-3px 0 #4a6a6a);
  animation: melt-glitch 0.9s steps(2) infinite;
}
.brain-stack[data-stage="6"] .fx-noise { opacity: 0.78; }
.brain-stack[data-stage="6"] .fx-scan {
  opacity: 0.55;
  animation: melt-scan 2.2s linear infinite;
}
.brain-stack[data-stage="6"] .brain-pic {
  filter: grayscale(0.32) contrast(1.05) brightness(0.97)
    drop-shadow(4px 0 #c45c4a) drop-shadow(-4px 0 #3a5a5a);
  animation: melt-glitch-hard 0.72s steps(2) infinite;
}

@keyframes melt-jitter {
  0%, 100% { transform: none; }
  50% { transform: translate(2px, -1px); }
}

@keyframes melt-glitch {
  0%, 100% { transform: none; }
  25% { transform: translate(-4px, 1px) skewX(-2deg); }
  50% { transform: translate(5px, 0) skewX(2deg); }
  75% { transform: translate(-2px, 2px); }
}

@keyframes melt-glitch-hard {
  0%, 100% { transform: none; opacity: 0.34; }
  20% { transform: translate(6px, -3px) skewX(3deg); opacity: 0.22; }
  40% { transform: translate(-5px, 2px) skewX(-2deg); opacity: 0.34; }
  60% { transform: scale(1.03, 0.97); opacity: 0.4; }
  80% { transform: translate(3px, 3px); opacity: 0.2; }
}

@keyframes melt-scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .brain-stack .brain-pic,
  .brain-stack .fx-scan {
    animation: none;
  }
}

.minutes {
  margin: 0.15rem 0 0;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  text-align: center;
}

.line {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.4;
}

.apps {
  list-style: none;
  width: 100%;
  margin: 1.1rem 0 0;
  padding: 0;
}

.apps li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dock {
  margin-top: 1.1rem;
  width: 100%;
}

.dock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
}

.mode {
  margin: auto 0 0;
  padding-top: 1.2rem;
  text-align: right;
  font-size: 0.8rem;
}

.mode a,
a.ghost {
  color: var(--muted);
  text-decoration: none;
}

input[type="range"] {
  width: 100%;
}

button.ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.2rem 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
