/* The sentence and the timeline: a light page, a sentence with five empty squares, and a dark timeline below */
:root {
  --paper: #f3f1ec;
  --ink: #161616;
  --muted: #6b6862;
  --panel: #151515;
  --panel-text: #d9d6cf;
  --head: #ff6a3d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: clamp(18px, 3.4vh, 30px) clamp(20px, 4vw, 48px);
}

.brand {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  font-stretch: 112%;
  letter-spacing: -0.03em;
}

.top__line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------------ the sentence */
.statement {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100svh;
  padding: 110px clamp(20px, 5vw, 64px) 90px;
  text-align: center;
}

.statement__text {
  max-width: 21ch;
  margin: 0;
  font-size: clamp(34px, 5.4vw, 84px);
  font-weight: 540;
  font-stretch: 104%;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* where a tile sits in the sentence: an empty square, so the gap stays when the tile has gone */
.slot {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin: 0.1em 0.2em -0.15em;
  border-radius: 0.24em;
  background: rgba(22, 22, 22, 0.06);
}

.statement__hint {
  margin: 44px 0 0;
  color: var(--muted);
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ the timeline */
.editor {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 80px clamp(16px, 4vw, 48px);
}

.timeline {
  position: relative;
  width: min(1180px, 100%);
  padding: 16px clamp(14px, 2vw, 24px) 20px;
  border-radius: 22px;
  background: var(--panel);
  color: var(--panel-text);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.55);
}

.timeline__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  color: #8f8b84;
}

.timeline__code {
  color: var(--panel-text);
  font-variant-numeric: tabular-nums;
}

/* the ruler: a label for every second, a tick every quarter */
.timeline__ruler {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px calc(100% / 24)) left bottom / 100% 5px no-repeat;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 11px;
  color: #77736c;
}

.timeline__track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: clamp(8px, 1.6vw, 18px);
  padding: 16px 0;
}

/* a place in the timeline, and a faint hole when its tile is up in the sentence */
.timeline__home {
  position: relative;
  flex: 1 1 0;
  max-width: 180px;
  aspect-ratio: 1;
  border-radius: 24%;
  background: rgba(255, 255, 255, 0.05);
}

.timeline__head {
  position: absolute;
  top: -30px;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--head);
  pointer-events: none;
}

/* the handle on top of the playhead: a small tab, not a dot */
.timeline__head::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 16px;
  border-radius: 3px 3px 6px 6px;
  background: var(--head);
  transform: translateX(-50%);
}

.timeline__track--audio {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 38px;
  padding: 0 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.timeline__track--audio span {
  flex: 1;
  border-radius: 2px;
  background: #4a4741;
}

/* ------------------------------------------------------------------ the tiles */
.tile {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 24%;
  will-change: transform;
}

.tile__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -10px 22px rgba(0, 0, 0, 0.16),
    0 14px 28px -12px rgba(0, 0, 0, 0.45);
}

.tile__face svg {
  width: 78%;
  height: 78%;
}

.tile--sun .tile__face {
  background: linear-gradient(160deg, #ffb13b, #ff5c2e);
}

.tile--stripes .tile__face {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 9%, transparent 9% 18%),
    linear-gradient(160deg, #5b78ff, #2340e6);
}

.tile--wave .tile__face {
  background: linear-gradient(160deg, #54dcb4, #1c9f7c);
}

.tile--type .tile__face {
  background: linear-gradient(160deg, #fbe57a, #efc92e);
}

.tile__aa {
  color: var(--ink);
  font-size: min(3.4vw, 64px);
  font-weight: 780;
  font-stretch: 110%;
  letter-spacing: -0.05em;
}

.tile--star .tile__face {
  background: linear-gradient(160deg, #c7a9ff, #8a5cff);
}

/* ------------------------------------------------------------------ the end */
.outro {
  display: grid;
  place-items: center;
  min-height: 70svh;
  padding: 60px 24px 120px;
  text-align: center;
}

.outro__text {
  max-width: 24ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.3;
}

@media (min-width: 900px) {
  .slot {
    width: 1.1em;
    height: 1.1em;
    margin: -0.05em 0.2em -0.2em;
  }
}

@media (max-width: 640px) {
  .timeline__bar {
    font-size: 11px;
  }

  .timeline__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeline__ruler {
    font-size: 10px;
  }

  .tile__aa {
    font-size: 5vw;
  }
}
