:root {
  --bg: #f4f3f0;
  --ink: #0a0a0a;
  --muted: #8a8a85;
  --line: #d9d8d3;
  --accent: #ff3b00;
  --spin: 64s;
  --img-scale: 1.42;
  --hover-scale: 2.2;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body { position: relative; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(20px, 4vw, 52px);
  pointer-events: none; /* don't let the empty bar swallow clicks */
}
.brand,
.nav-cta { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-decoration: none;
}
.brand-logo-hk {
  display: block;
  height: clamp(26px, 3.2vw, 38px);
  width: auto;
}

.nav-links {
  display: flex;
  gap: clamp(18px, 2.4vw, 40px);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-links a,
.nav-cta {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: opacity .25s;
}
.nav-links a:hover { opacity: .5; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-cta:hover { opacity: .6; }
.nav-cta .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Profile (under logo) ---------- */
.profile {
  position: fixed;
  top: 84px;
  left: clamp(20px, 4vw, 52px);
  z-index: 35;
  max-width: 350px;
}
.profile-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.profile-bio {
  font-size: 12.5px;
  line-height: 1.5;
  color: #55554f;
}

/* ---------- Stage ---------- */
.stage {
  position: absolute;
  inset: 0;
  overflow: visible;
}

/* ---------- Caption (left) ---------- */
.caption {
  position: absolute;
  left: clamp(20px, 4vw, 52px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  max-width: min(30vw, 360px);
  pointer-events: none;
}
.caption-eyebrow {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.caption-type {
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
  text-transform: lowercase;
}
/* default state shows the brand logo in place of the name */
.caption-logo {
  display: block;
  height: clamp(32px, 3.6vw, 48px);
  width: auto;
  max-width: 100%;
}
.caption-desc {
  font-size: 15px;
  line-height: 1.45;
  color: #3a3a38;
  max-width: 300px;
  margin-bottom: 18px;
}
.caption-meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
/* subtle transition when caption text swaps */
.caption-type, .caption-desc, .caption-eyebrow, .caption-meta {
  transition: opacity .18s ease;
}
.caption.swapping .caption-type,
.caption.swapping .caption-desc,
.caption.swapping .caption-eyebrow,
.caption.swapping .caption-meta { opacity: 0; }

/* ---------- Orbit ---------- */
.orbit-wrap {
  position: absolute;
  top: 50%;
  left: 58%;
  width: 1px;
  height: 1px;
}

.orbit {
  position: absolute;
  top: 0; left: 0;
  animation: spin var(--spin) linear infinite;
  will-change: transform;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-rev {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ---------- Brand selector (centre of the orbit) ---------- */
.brand-switch {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.brand-btn {
  position: relative;
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  line-height: 0;
}
.brand-logo {
  display: block;
  height: 22px;
  width: auto;
  opacity: .36;
  filter: grayscale(1);
  transition: opacity .3s ease, filter .3s ease;
}
.brand-btn:hover .brand-logo { opacity: .7; }
.brand-btn.active .brand-logo { opacity: 1; filter: none; }
.brand-btn.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent);
}

.item {
  position: absolute;
  top: 0; left: 0;
  width: calc(var(--w) * var(--img-scale));
  cursor: pointer;
  transform:
    translate(-50%, -50%)
    translate(calc(var(--r) * cos(var(--a))), calc(var(--r) * sin(var(--a))));
}
/* unused slots: kept in flow (visibility) so the rotation stays in sync */
.item.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.media {
  position: relative;
  width: 100%;
  animation: spin-rev var(--spin) linear infinite;
  will-change: transform;
  transition: opacity .3s ease;
}

/* fade while swapping brands */
.orbit.swapping .media { opacity: 0; }

.media img,
.media video {
  display: block;
  width: 100%;
  height: auto;
  /* keep each visual's native ratio — no cropping */
  background: #e4e3de;
  transition: transform .55s cubic-bezier(.16,1,.3,1),
              filter .45s ease,
              opacity .45s ease;
}

/* Hover behaviour: dim + desaturate everything while any item is hovered */
.orbit:hover .media img,
.orbit:hover .media video {
  filter: grayscale(1) contrast(.95);
  opacity: .32;
}
/* lift the whole orbit above the captions/labels while hovering */
.orbit:hover { z-index: 36; }
/* the hovered one pops above its siblings */
.item:hover { z-index: 20; }
.item:hover .media img,
.item:hover .media video {
  filter: none;
  opacity: 1;
  transform: scale(var(--hover-scale));
  box-shadow: 0 40px 100px rgba(0,0,0,.32);
}

/* ---------- Footer ---------- */
.footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px clamp(20px, 4vw, 52px);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50%);
  border: 1.4px solid var(--ink);
}
.footer-tag { color: var(--ink); }
.footer-idx { margin-left: auto; }

/* ---------- Fullscreen preview ---------- */
.preview[hidden] { display: none; }
.preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 8vh 6vw;
  background: rgba(244, 243, 240, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
  animation: preview-in .3s ease;
}
@keyframes preview-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.preview-media {
  max-width: min(1100px, 88vw);
  cursor: default;
}
.preview-media img,
.preview-media video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #e4e3de;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.3);
}
.preview-info {
  text-align: center;
  max-width: 560px;
  cursor: default;
}
.preview-info h2 {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  margin-bottom: 8px;
}
.preview-info p {
  font-size: 14px;
  line-height: 1.5;
  color: #3a3a38;
}
.preview-info p:last-child {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.preview-close {
  position: absolute;
  top: 26px;
  right: clamp(20px, 4vw, 52px);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.preview-close:hover { opacity: .55; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .orbit, .media { animation-duration: 240s; }
}

/* ---------- Responsive ---------- */
/* Tablet */
@media (max-width: 900px) {
  .orbit-wrap { left: 54%; top: 52%; }
  .profile { display: none; }
  .nav-links { display: none; }
}

/* Phone */
@media (max-width: 640px) {
  /* brand selector becomes a compact row pinned under the nav */
  .brand-switch {
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 18px;
    padding: 0 16px;
    z-index: 39;
  }
  .brand-btn { padding: 2px; }
  .brand-btn.active::before { display: none; }
  .brand-logo { height: 17px; }

  /* orbit sits in its own band in the upper area */
  .orbit-wrap { left: 50%; top: 39%; }
  .item { width: calc(var(--w) * 1.02); }
  .item:hover .media img,
  .item:hover .media video { transform: scale(1.5); }

  /* the decorative footer is too busy on a phone */
  .footer { display: none; }

  /* caption anchored at the bottom, centred */
  .caption {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 30px;
    transform: translateX(-50%);
    text-align: center;
    max-width: 90vw;
    z-index: 30;
  }
  .caption-eyebrow { margin-bottom: 12px; }
  .caption-type { margin-bottom: 14px; }
  .caption-logo { height: 30px; margin: 0 auto; }
  .caption-desc {
    margin: 0 auto 10px;
    font-size: 14px;
  }
}
