/* Tokens */

:root {
  --bg: #f7f5fb;
  --text-primary: #171321;
  --text-secondary: #6c6479;

  --pink: #ef4577;
  --violet: #7c5cff;
  --indigo: #4c6fff;
  --amber: #ffa64d;

  --button-shadow: 0 16px 32px -12px rgba(124, 92, 255, 0.5);
  --icon-border: rgba(23, 19, 33, 0.12);
  --blob-1: rgba(239, 69, 119, 0.14);
  --blob-2: rgba(76, 111, 255, 0.13);

  --font-display: 'Clash Display', 'General Sans', sans-serif;
  --font-body: 'General Sans', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0913;
    --text-primary: #f4f1fa;
    --text-secondary: #988fa8;

    --pink: #ff5f92;
    --violet: #9583ff;
    --indigo: #7590ff;
    --amber: #ffb870;

    --button-shadow: 0 18px 36px -10px rgba(149, 131, 255, 0.55);
    --icon-border: rgba(255, 255, 255, 0.14);
    --blob-1: rgba(255, 95, 146, 0.13);
    --blob-2: rgba(117, 144, 255, 0.16);
  }
}

/* Base — one screen, no scroll */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

.headline, .subtext {
  -webkit-user-select: text;
  user-select: text;
}

a { text-decoration: none; color: inherit; }
button { font: inherit; border: none; background: none; padding: 0; cursor: pointer; color: inherit; }

img {
  -webkit-user-drag: none;
  user-select: none;
}

.blob {
  position: fixed;
  width: 46vw;
  height: 46vw;
  max-width: 480px;
  max-height: 480px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.blob-a { background: var(--blob-1); left: -14vw; bottom: -18vw; }
.blob-b { background: var(--blob-2); right: -16vw; top: -18vw; }

/* Scene */

.scene {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vh, 14px);
  padding: 20px 24px;
  text-align: center;
}

/* Portrait stage — glow + image + circular visualizer */

.portrait-stage {
  --stage: clamp(180px, 30vh, 220px);
  --r: calc(var(--stage) * 0.31);
  position: relative;
  width: var(--stage);
  height: var(--stage);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: clamp(6px, 2vh, 10px);
  cursor: pointer;
  border-radius: 50%;
}

.portrait-stage:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 8px;
}

/* Soft halo behind the ring. Sits still until real audio gives it a bass level to breathe with. */
.portrait {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 200deg, var(--pink), var(--violet), var(--indigo), var(--amber), var(--pink));
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.portrait-stage:active .portrait {
  transform: scale(0.96);
}

.portrait-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--bg);
}

.visualizer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 1;
}

.v-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pink), var(--violet));
  transform-origin: 50% 0;
  transform: rotate(calc(var(--angle) + 180deg)) translateY(var(--r));
  box-shadow: 0 0 6px rgba(124, 92, 255, 0.3);
  animation: drift 1.1s ease-in-out infinite;
  animation-delay: var(--delay);
}

/* Idle motion before anything is actually playing — reads as "alive" rather than mechanical */
@keyframes drift {
  0%, 100% { height: 4px; }
  50% { height: calc(4px + 24px * var(--amp, 1)); }
}

/* Placeholder pulse for a tap — only runs before the first real playback */
.visualizer.burst .v-bar {
  animation: pulse-burst 0.6s cubic-bezier(.2,.8,.3,1);
  animation-delay: calc(var(--delay) * 0.3);
}

@keyframes pulse-burst {
  0% { height: 4px; }
  35% { height: calc(10px + 30px * var(--amp, 1)); }
  100% { height: 4px; }
}

/* Once real audio is analysing, JS drives height + --level per frame; CSS steps aside on height
   but keeps reacting to --level so louder moments read brighter and more saturated */
.visualizer.reactive .v-bar {
  animation: none;
  filter: brightness(calc(1 + var(--level, 0) * 0.8)) saturate(calc(1 + var(--level, 0) * 0.6));
}

/* Type */

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 4.6vh, 32px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0;
  margin-top: -4px;
}

.accent {
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtext {
  max-width: 380px;
  font-size: clamp(13.5px, 2vh, 15.5px);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* CTA */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 32px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--indigo));
  box-shadow: var(--button-shadow);
  white-space: nowrap;
}

/* Social — expands on tap, collapses if you look away */

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  border-radius: 19px;
  border: 1px solid var(--icon-border);
  color: var(--text-secondary);
  background: transparent;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease;
}

.icon-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-text {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  margin-left: 0;
  transition: opacity 0.3s ease 0.1s,
              max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.icon-link.is-expanded {
  width: auto;
  padding: 0 16px;
  border-color: transparent;
  color: #fff;
}

.icon-link.is-expanded .icon-text {
  opacity: 1;
  max-width: 140px;
  margin-left: 8px;
}

.icon-instagram.is-expanded { background: radial-gradient(circle at 30% 110%, #ffdb73, #ee2a7b 45%, #6228d7 90%); }
.icon-x.is-expanded { background: var(--text-primary); color: var(--bg); }
.icon-mail.is-expanded { background: var(--amber); }
.icon-linkedin.is-expanded { background: #0a66c2; }

/* Motion */

@media (prefers-reduced-motion: reduce) {
  .v-bar { animation: none; height: 8px; }
  .visualizer.burst .v-bar { animation: none; }
}

/* Fit tighter on short viewports */

@media (max-height: 700px) {
  .scene { gap: 8px; padding: 14px 24px; }
  .portrait-stage { --stage: 160px; margin-top: 0; }
  .headline { font-size: 20px; }
}

@media (max-width: 360px) {
  .headline { font-size: 20px; }
  .subtext { font-size: 13px; }
}