/* Thread Clock — every second of the minute hangs on its own thread */

:root {
  /* script.js reads --ink, --accent and --label from here for the canvas */
  --paper: #faf6f0;
  --ink: #1b1714;
  --accent: #e8452c;
  --label: rgba(27, 23, 20, 0.5);

  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 3vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 20px var(--gutter);
  pointer-events: none;
}
.logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  pointer-events: auto;
}

/* ─────────── Clock ─────────── */

.stage {
  position: fixed;
  inset: 0;
  touch-action: none;
}

.threads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.time {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: flex;
  align-items: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--time, 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

/* Each digit sits in a window and rolls up when it changes */
.slot {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 0.08em 0.01em;
  margin: -0.08em 0;
}
.slot span { display: block; transform: translateY(110%); }
.slot .is-out { position: absolute; inset: 0.08em 0.01em auto; }

.colon {
  margin: 0 0.1em;
  font-size: 0.7em;
  font-weight: 500;
  color: var(--accent);
  translate: 0 -0.06em;
}

/* ─────────── Footer ─────────── */

.foot {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  padding: 20px var(--gutter);
  font-size: 12px;
  color: var(--label);
  pointer-events: none;
}
.foot > :last-child { justify-self: end; }

@media (max-width: 600px) {
  .foot { grid-template-columns: 1fr 1fr; }
  .hint { display: none; }
}
