/* pixelbits – app ui (subtle, the image is the star) */

:root {
    --step: 18px;              /* timeline spacing per generation */
    --gap: 30px;               /* padding to the viewport edges, always */
    --timeline-h: 84px;
    --info-h: 32px;
    --bottom-h: calc(var(--timeline-h) + var(--info-h) + var(--gap) * 2);
    --ui-bg: var(--bg-light);
    --ui-border: 1px solid hsla(240, 15%, 25%, 0.5);
    --accent: var(--default-purple);
    --accent-2: var(--default-green);
}

html, body {
    height: 100%;
    background: var(--bg-dark);
    color: var(--txt-primary);
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.02em;
    overflow: hidden;
}

body {
    display: grid;
    grid-template-rows: 1fr var(--bottom-h);
    height: 100dvh;
}

/* ── stage ───────────────────────────────────────────────────────────── */

.stage-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap);
    min-height: 0;
    overflow: hidden;
    background: var(--bg-dark);
    border-bottom: 1px solid #000000;
}

/* blurred, darkened copy of the current image, covering the whole area */
.backdrop {
    position: absolute;
    inset: -15%;
    width: 130%;
    height: 130%;
    object-fit: cover;
    filter: blur(40px) brightness(0.35) saturate(1.2);
    pointer-events: none;
}

.stage {
    position: relative;
    z-index: 1;
    width: min(512px, 100vw - var(--gap) * 2, 100dvh - var(--bottom-h) - var(--gap) * 2);
    aspect-ratio: 1 / 1;
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
}
.stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--txt-light);
}
.empty[hidden] { display: none; }

/* ── bottom / info ───────────────────────────────────────────────────── */

.bottom {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--gap);
    background: var(--ui-bg);
    border-top: var(--ui-border);
}

.info {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--info-h);
    color: var(--txt-secondary);
    white-space: nowrap;
    overflow: hidden;
}
.info-day   { color: var(--txt-primary); font-weight: 400; }
.info-file  { color: var(--txt-secondary); overflow: hidden; text-overflow: ellipsis; }
.info-count { margin-left: auto; color: var(--txt-light); }

.brand {
    display: inline-flex;
    width: 22px;
    height: 22px;
    margin-left: 20px;
    color: var(--txt-light);
    text-decoration: none;
    transition: color .3s;
}
.brand:hover { color: var(--txt-secondary); }
.brand svg { width: 100%; height: 100%; display: block; }
.brand svg path { fill: currentColor; }

/* ── timeline ────────────────────────────────────────────────────────── */

.timeline {
    position: relative;
    height: var(--timeline-h);
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.timeline:focus-visible { outline: none; }
.timeline.dragging { cursor: grabbing; }

.track {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    will-change: transform;
}

.tick {
    position: absolute;
    top: 0;
    width: var(--step);
    height: 100%;
    margin-left: calc(var(--step) / -2);
}
/* all ticks share one size; states only change color (no sub-pixel transforms) */
.tick::before {
    content: '';
    position: absolute;
    left: calc(50% - 1px);
    top: 26px;
    width: 3px;
    height: 24px;
    border-radius: 2px;
    background: var(--txt-light);
    transition: background-color .15s;
}
.tick.latest::before   { background: var(--accent); }
.tick.selected::before { background: var(--accent-2); }

.tick-label {
    position: absolute;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--txt-light);
    white-space: nowrap;
    text-transform: uppercase;
}

.cursor {
    position: absolute;
    left: calc(50% - 1px);
    top: 16px;
    width: 3px;
    height: 5px;
    border-radius: 2px;
    background: var(--txt-secondary);
    pointer-events: none;
}
