:root {
  --ink: #111111;
  --muted: #9a9a9a;
  --bg: #ffffff;
  --head-w: clamp(300px, 58vw, 860px);
  --logo: clamp(82px, 10.5vw, 128px);   /* size of the highlighted logo */
  --cell: clamp(140px, 18vw, 220px);    /* horizontal slot per logo */
  --spring: cubic-bezier(.2, .9, .25, 1.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(18px, 3.4vw, 40px);
  z-index: 20;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.name {
  font-weight: 800;
  font-size: clamp(18px, 2.5vw, 30px);
  line-height: .98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}

.socials {
  display: flex;
  gap: clamp(10px, 1.4vw, 16px);
  align-items: center;
}
.socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  transition: transform .22s var(--spring), background .2s ease, color .2s ease;
}
.socials svg { width: 19px; height: 19px; }
.socials a:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px) scale(1.06);
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bubble {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vh, 36px);
  padding-top: clamp(70px, 12vh, 130px);
  width: 100%;
  z-index: 5;
}

/* ---------- Logo reel (all visible, one highlighted) ---------- */
.reel-viewport {
  width: 100%;
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
          mask: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.reel {
  display: flex;
  align-items: center;
  width: max-content;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.logo {
  flex: 0 0 var(--cell);
  height: var(--logo);
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.logo img {
  width: var(--logo);
  height: var(--logo);
  object-fit: cover;
  border-radius: 22%;
  opacity: .26;
  transform: scale(.6);
  transform-origin: center;
  transition: opacity .4s ease, transform .4s cubic-bezier(.22, .61, .36, 1);
  -webkit-user-drag: none;
  user-select: none;
}
.logo:hover img { opacity: .5; }
.logo.active { cursor: default; }
.logo.active img {
  opacity: 1;
  transform: scale(1);
}
.logo.active.has-link { cursor: pointer; }
.logo.active.has-link:hover img { transform: scale(1.05); opacity: 1; }

/* Tag / label for the highlighted project */
.tag {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 30px;
  max-width: 92vw;
}
.tag-name {
  font-weight: 700;
  font-size: clamp(19px, 2.6vw, 28px);
  letter-spacing: -0.02em;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 3px 10px 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill--live { background: #e7f7ec; color: #15803d; }
.pill--live::before { animation: pulse 1.8s ease-in-out infinite; }
.pill--soon { background: #fff3df; color: #b45309; }
.pill--closed { background: #f0f0f0; color: #8a8a8a; }

.tag-url {
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.tag-url:hover { color: var(--ink); border-color: var(--ink); }
.tag-url[hidden] { display: none; }

/* ---------- Head ---------- */
.head-wrap {
  flex: 0 0 auto;
  align-self: center;
  z-index: 1;
}
.head {
  display: block;
  width: var(--head-w);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Edge nav ---------- */
.edge {
  position: fixed;
  top: 0; bottom: 0;
  width: clamp(64px, 12vw, 140px);
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 15;
}
.edge--left { left: 0; }
.edge--right { right: 0; }
.edge svg { width: 30px; height: 30px; transition: transform .2s var(--spring); }
.stage:hover .edge { opacity: .22; }
.edge:hover { opacity: .85 !important; }
.edge[disabled] { opacity: 0 !important; pointer-events: none; }
.edge--left:hover svg { transform: translateX(-3px); }
.edge--right:hover svg { transform: translateX(3px); }

/* ---------- Hint ---------- */
.hint {
  position: fixed;
  bottom: clamp(16px, 3vh, 30px);
  left: clamp(18px, 3.4vw, 40px);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  animation: rise 1s ease both .4s;
}
.hint .keys { font-weight: 600; color: #6a6a6a; }

/* ---------- Animations ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pill--live::before, .reel, .logo img { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  :root {
    --head-w: clamp(260px, 86vw, 420px);
    --logo: clamp(74px, 22vw, 104px);
    --cell: clamp(120px, 38vw, 168px);
  }
  .topbar { padding: 16px; align-items: center; }
  .name { font-size: 16px; letter-spacing: -0.01em; }
  .socials { gap: 6px; }
  .socials a { width: 32px; height: 32px; }
  .socials svg { width: 17px; height: 17px; }
  .tag-name { font-size: 21px; }
  .hint { font-size: 12px; }
  .hint-tail { display: none; }
  .edge { display: none; }
  .bubble { padding-top: clamp(84px, 16vh, 130px); }
}
