:root {
  --ink: #fff7ec;
  --muted: rgba(255, 247, 236, .72);
  --glass: rgba(20, 8, 40, .42);
  --edge: rgba(255, 255, 255, .18);
  --focus-x: 38%;          /* keeps the surfer in frame on tall phones */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #1a0b3a;
  color: var(--ink);
  font: 16px/1.5 "Space Grotesk", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#trip, #sky, #wave {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
}
#trip { z-index: 0; display: block; }

#sky {
  z-index: 2;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Ccircle cx='22' cy='22' r='18' fill='none' stroke='white' stroke-width='2' stroke-dasharray='4 4'/%3E%3C/svg%3E") 22 22, crosshair;
  transition: opacity 1.2s ease;
}
#sky.gone { opacity: 0; pointer-events: none; }

#wave {
  z-index: 3;
  object-fit: cover;
  object-position: var(--focus-x) 50%;
  pointer-events: none;
}

/* ---------- card under the sky ---------- */
.card {
  position: fixed; z-index: 1;
  top: max(4vh, env(safe-area-inset-top)); right: 4vw;
  width: min(540px, 92vw);
  text-align: right;
  padding: 1.4rem 1.4rem 1.2rem;
  border-radius: 24px;
  background: rgba(14, 6, 30, .5);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}
body.revealed .card { z-index: 4; }

.name {
  margin: 0;
  font: 800 clamp(2.6rem, 6.4vw, 5.4rem)/.95 "Bricolage Grotesque", system-ui, sans-serif;
  letter-spacing: -.035em;
  white-space: nowrap;
  color: #fff7ec;
  text-shadow: .045em .045em 0 #ff4fb8, .09em .09em 0 #6b2bd9, 0 0 40px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: flex-end; gap: .2em;
}
/* profile picture: a circle sized with the name, with the same pink/purple offset as the letters */
.pfp {
  position: relative; overflow: hidden;
  flex: none; width: .9em; height: .9em; border-radius: 50%;
  box-shadow: 0 0 0 .035em #fff7ec, .045em .045em 0 .035em #ff4fb8, .09em .09em 0 .035em #6b2bd9;
  margin-right: .06em;
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.name:hover .pfp { transform: rotate(-8deg) scale(1.04); }
/* two pictures stacked: the calm one normally, the glitchy one fades in when you take the tab */
.pfp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 3s ease; }
.pfp .pfp-calm { z-index: 1; }
body.acid .pfp .pfp-calm { opacity: 0; }

.tag { margin: .7rem 0 1.2rem; color: var(--muted); font-size: clamp(.95rem, 1.6vw, 1.1rem); }

.links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}
.link {
  --c: #fff;
  display: flex; align-items: center; gap: .7rem;
  padding: .75rem .9rem;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.link:hover, .link:focus-visible {
  transform: translateY(-3px) rotate(-.6deg);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 10px 40px -10px var(--c);
  outline: none;
}
.link img, .link svg { width: 22px; height: 22px; flex: none; filter: invert(1); }
.link svg { filter: none; fill: var(--c); }
.link img.logo { filter: none; }   /* full-colour logos (GambleFinance dice) */
.link span { display: flex; flex-direction: column; min-width: 0; }
.link small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link.feature { grid-column: 1 / -1; padding: 1rem 1.1rem; }
.link.feature svg { width: 30px; height: 30px; }
.link.feature b { font-size: 1.15rem; }
.link.wide { grid-column: span 2; }
#discord small { font-size: .68rem; letter-spacing: -.01em; }
.link b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.caption { margin: 1rem 0 0; font-size: .78rem; color: var(--muted); }
.caption a { color: var(--ink); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; z-index: 5; left: 50%; bottom: max(3vh, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: .6rem; align-items: center;
  transition: opacity .6s;
}
body.revealed .hud { opacity: 0; pointer-events: none; }
.hint {
  margin: 0; padding: .55rem 1rem; border-radius: 999px;
  background: rgba(0, 0, 0, .45); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  letter-spacing: .2em; text-transform: lowercase; font-size: .85rem; white-space: nowrap;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .55; } }
.skip, .again {
  border: 1px solid var(--edge); background: rgba(0, 0, 0, .45); color: var(--ink);
  border-radius: 999px; padding: .55rem 1rem; font: inherit; font-size: .85rem; cursor: pointer;
}
.again {
  position: fixed; z-index: 5; left: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  width: 42px; height: 42px; padding: 0; font-size: 1.2rem;
  opacity: 0; pointer-events: none; transition: opacity .6s;
}
body.revealed .again { opacity: .7; pointer-events: auto; }
.again:hover { opacity: 1; }

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .card { top: max(2vh, env(safe-area-inset-top)); right: 3vw; left: 3vw; width: auto; text-align: center; padding: 1rem; }
  .name { font-size: clamp(2.2rem, 11.5vw, 3.2rem); justify-content: center; }
  .tag { margin: .5rem 0 .9rem; font-size: .9rem; }
  /* phones: four across, icon over the label, so twelve tiles fit in three short rows */
  .links { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
  .link { flex-direction: column; justify-content: center; text-align: center; padding: .5rem .2rem .45rem; gap: .3rem; font-size: .7rem; border-radius: 13px; }
  .link span { align-items: center; max-width: 100%; }
  .link img, .link svg { width: 18px; height: 18px; }
  .link.feature, .link.wide { flex-direction: row; text-align: left; }
  .link.feature { padding: .7rem .9rem; }
  .link.feature span { align-items: flex-start; }
  .link.feature svg { width: 26px; height: 26px; }
  .link.wide { gap: .5rem; }
  #discord small { display: none; }
  .now { margin-top: .6rem; padding: .4rem; }
  .now img { width: 40px; height: 40px; }
  .caption { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .card { top: 2vh; width: min(520px, 56vw); }
  .name { font-size: 2.8rem; }
  .tag { margin-bottom: .6rem; }
  .links { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
  .link { padding: .45rem .6rem; }
  .link.feature small, .caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hint { animation: none; }
}

/* ---------- now playing ---------- */
.now {
  display: flex; align-items: center; gap: .8rem; margin-top: .9rem; padding: .55rem;
  border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--edge);
  color: var(--ink); text-decoration: none; text-align: left;
}
.now[hidden] { display: none; }
.now img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.now > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.now small { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #7afcff; }
.now small.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .4em; border-radius: 50%; background: #ff4fb8; animation: breathe 1.2s infinite; }
.now b, .now span span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now span span { color: var(--muted); font-size: .85rem; }

/* ---------- album tooltip ---------- */
.tip {
  position: fixed; z-index: 6; pointer-events: none; transform: translate(-50%, calc(-100% - 18px));
  padding: .45rem .75rem; border-radius: 10px; background: rgba(10, 4, 24, .85); border: 1px solid var(--edge);
  font-size: .85rem; white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
}
.tip small { color: #7afcff; margin-right: .4em; }
