@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Unbounded:wght@400;600;700&display=swap');

:root {
  --bg-ink: #0b0d14;
  --bg-deep: #0f1424;
  --bg-glass: rgba(15, 20, 36, 0.72);
  --bg-card: rgba(20, 26, 46, 0.72);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(255, 255, 255, 0.2);
  --text-primary: #f6f7fb;
  --text-muted: rgba(246, 247, 251, 0.68);
  --accent: #7df9ff;
  --accent-strong: #4df5a7;
  --accent-warm: #ff8bd2;
  --shadow-lg: 0 30px 70px rgba(6, 8, 20, 0.55);
  --shadow-md: 0 18px 40px rgba(6, 8, 20, 0.4);
  --shadow-sm: 0 10px 24px rgba(6, 8, 20, 0.35);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
  text-align: center;
  background-image: radial-gradient(circle at top, rgba(125, 249, 255, 0.25), transparent 48%),
    radial-gradient(circle at 20% 20%, rgba(255, 139, 210, 0.25), transparent 40%),
    linear-gradient(160deg, rgba(11, 13, 20, 0.95), rgba(15, 20, 36, 0.95));
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(77, 245, 167, 0.15), transparent 45%);
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.h2,
h2 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.h4,
h4 {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

a,
a:hover,
a:focus {
  color: inherit;
  text-decoration: none;
}

.logo {
  height: 100px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

#login,
#loggedin {
  display: none;
  margin: 0 8%;
}

.text-overflow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: min(500px, 80vw);
}

.flex-container {
  display: flex;
  color: var(--text-primary);
}

.container,
.container-fluid,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

#content-wrap {
  padding-bottom: 2.5rem;
}

.navbar {
  background: rgba(9, 12, 22, 0.75) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.navbar-brand {
  margin-left: 0.4rem;
}

.navbar .nav-link {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--accent);
}

.hidden {
  display: none;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 60vh;
  margin: 6vh auto 4vh;
  padding: clamp(28px, 6vw, 56px);
  width: min(1050px, 92vw);
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.home-content {
  max-width: 720px;
}

.timeframes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 18px 0 10px;
}

#top-tracks-ShortTerm,
#top-tracks-MediumTerm,
#top-tracks-LongTerm {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
  padding-top: 32px;
  justify-items: center;
}

@media (min-width: 901px) {
  #top-tracks-ShortTerm .cd:nth-last-child(2),
  #top-tracks-MediumTerm .cd:nth-last-child(2),
  #top-tracks-LongTerm .cd:nth-last-child(2) {
    grid-column: 2 / span 2;
  }

  #top-tracks-ShortTerm .cd:last-child,
  #top-tracks-MediumTerm .cd:last-child,
  #top-tracks-LongTerm .cd:last-child {
    grid-column: 4 / span 2;
  }
}

@keyframes wiggle {
  0%,
  7% {
    transform: rotateZ(0);
  }
  15% {
    transform: rotateZ(-12deg);
  }
  20% {
    transform: rotateZ(9deg);
  }
  25% {
    transform: rotateZ(-8deg);
  }
  30% {
    transform: rotateZ(5deg);
  }
  35% {
    transform: rotateZ(-3deg);
  }
  40%,
  100% {
    transform: rotateZ(0);
  }
}

.cd {
  width: min(280px, 90vw);
  margin: 0 auto;
  padding: 18px 16px 6px;
  text-align: center;
  grid-column: span 2;
}

.cd > div {
  padding-top: 14px;
}

.album-link {
  width: 240px;
  height: 240px;
  margin: 0 auto 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  transition: transform 0.25s ease;
  position: relative;
  overflow: visible;
}

.album-link:hover {
  animation: wiggle 3s linear infinite;
}

.album-link::before {
  content: "";
  position: absolute;
  width: 115%;
  height: 110%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%);
  background-image: url("/case.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 0;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.45));
}

.album-link::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 115%;
  height: 110%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%);
  background-image: url("/case.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.3;
  border-radius: 8px;
  z-index: 2;
  pointer-events: none;
}

.img2 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.98;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
  display: block;
  transform: translate(14px, 8px);
}

.album-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(125, 249, 255, 0.1));
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}

.privacy-mockup {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.spotify-button,
.login-spotify-button,
.takepic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.spotify-button,
.login-spotify-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #061017;
  box-shadow: 0 12px 30px rgba(77, 245, 167, 0.4);
}

.takepic-button {
  background: rgba(6, 10, 22, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-sm);
  margin: 8px 0 18px;
}

.spotify-button:hover,
.spotify-button:focus,
.login-spotify-button:hover,
.login-spotify-button:focus {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(77, 245, 167, 0.55);
  color: #051018;
}

.takepic-button:hover,
.takepic-button:focus {
  transform: translateY(-2px);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

input {
  display: none;
}

label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid transparent;
}

label:hover {
  cursor: pointer;
}

.display {
  display: none;
  margin: auto;
}

[type="radio"]:checked ~ .display {
  display: block;
}

.top-logo {
  margin-bottom: 8px;
}

.about {
  text-align: center;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
}

#capture {
  margin: 26px auto 0;
  padding: clamp(18px, 4vw, 32px);
  box-sizing: border-box;
  padding-bottom: clamp(38px, 6vw, 64px);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

#capture.capture-saving {
  background-color: var(--bg-deep);
}

#capture.capture-saving .album-link .case-base {
  position: absolute;
  width: 115%;
  height: 110%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%);
  background-image: url("/case.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 0;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

#capture.capture-saving .album-link .case-overlay {
  position: absolute;
  inset: 0;
  background-image: url("/case.png");
  background-size: 115% 110%;
  background-position: center;
  opacity: 0.2;
  border-radius: 8px;
  z-index: 2;
  pointer-events: none;
  transform: translate(10px, 8px);
}

#capture h2 {
  margin-top: 6px;
  margin-bottom: 10px;
}

#capture p {
  color: var(--text-primary);
}


.tracks {
  display: block;
  margin: 5vh auto;
  padding: clamp(22px, 4vw, 40px);
  width: min(1200px, 94vw);
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.tracks h2 {
  margin-top: 18px;
}

.pages {
  text-align: center;
  margin: 6vh auto;
  padding: clamp(22px, 4vw, 40px);
  width: min(900px, 92vw);
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

#footer,
#footer2,
#footer3 {
  position: relative;
  margin-top: 48px;
  width: 100%;
  height: auto;
}

#footer > img,
#footer2 > img,
#footer3 > img {
  height: 36px;
  padding-bottom: 10px;
}

#footer > p,
#footer2 > p,
#footer3 > p {
  font-size: 0.85rem;
}

@media only screen and (max-width: 900px) {
  #top-tracks-ShortTerm,
  #top-tracks-MediumTerm,
  #top-tracks-LongTerm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .cd {
    grid-column: span 1;
    width: 100%;
  }

  #top-tracks-ShortTerm .cd:nth-last-child(1):nth-child(odd),
  #top-tracks-MediumTerm .cd:nth-last-child(1):nth-child(odd),
  #top-tracks-LongTerm .cd:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .navbar-brand img.logo {
    height: 34px;
  }

  .logo {
    height: 72px;
  }

  .main,
  .tracks,
  .pages {
    width: 94vw;
    padding: 24px;
    margin: 4vh auto;
  }

  .album-link {
    width: min(44vw, 200px);
    height: min(44vw, 200px);
  }

  .album-link::before,
  .album-link::after {
    width: 108%;
    height: 104%;
  }

  .album-link::after {
    transform: translate(-60px, -55px);
  }

  .img2 {
    transform: translate(5px, 4px);
  }
}

@media only screen and (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  #login,
  #loggedin {
    margin: 0;
  }

  .logo {
    height: 20vw;
  }

  #login > p {
    font-size: 0.9rem;
    margin-top: 3%;
    text-align: justify;
  }

  .main {
    min-height: auto;
    margin: 10% 4%;
  }

  .tracks {
    margin: 10% 4%;
  }

  .spotify-button,
  .login-spotify-button,
  .takepic-button {
    font-size: 0.8rem;
    width: 100%;
    padding: 12px 16px;
  }

  .album-link {
    width: min(40vw, 110px);
    height: min(40vw, 110px);
  }

  p {
    font-size: 0.9rem;
  }

  .img2 {
    width: 100%;
    height: 100%;
  }

  .cd {
    width: 100%;
  }

  .about {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pages {
    margin: 5% auto;
    padding: 18px;
  }
}
