/* ============================================================
   RecordRoll showcase — design tokens pulled directly from the
   Flutter app (capture_page.dart, record_display_body.dart,
   bottom_nav_bar.dart, record_roll_logo.dart, video_player_page.dart)
   ============================================================ */
:root {
  --rr-black: #000000;
  --rr-white: #ffffff;
  --rr-white-80: rgba(255, 255, 255, 0.8);
  --rr-white-60: rgba(255, 255, 255, 0.6);
  --rr-white-40: rgba(255, 255, 255, 0.267);
  --rr-active-blue: #007aff;
  --rr-play-purple: #8972e6;
  --rr-ring-blue: #4fc3f7;
  --rr-chip-bg: #1c1c1c;
  --rr-pill-bg: #2a2a2a;
  --rr-border-ring: rgba(170, 170, 170, 0.33);
  --rr-page-bg: #0a0a0c;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--rr-page-bg);
  color: var(--rr-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

/* ---------- Shared glow behind header + hero ----------
   Changes instantly when a different vinyl is picked (see setGlow()
   in app.js) — no fade, so it never looks different mid-transition
   than it does at rest. */
.glow-wrap {
  position: relative;
  overflow: hidden;
}
.glow-layer {
  position: absolute;
  inset: -15% -10%;
  z-index: 0;
  filter: blur(70px);
  pointer-events: none;
}

/* ---------- Site header ---------- */
.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 8px;
}
.site-logo {
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.5px;
}
.site-logo .cd { font-size: 0.68em; vertical-align: -0.05em; }
.site-tagline {
  font-size: 11px;
  font-weight: 600;
  color: var(--rr-white-60);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 2px 0 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 24px 20px 80px;
}
.hero-grid,
.hero-top {
  position: relative;
  z-index: 1;
}
.hero-top {
  text-align: center;
  margin: 0 auto 56px;
}
.hero-title {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -1.5px;
  line-height: 1.05;
}
.hero-tagline {
  font-size: 22px;
  font-weight: 500;
  color: var(--rr-white-60);
  margin: 0;
}
.hero-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  max-width: 1120px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.hero-text {
  flex: 1 1 320px;
  min-width: 280px;
  text-align: left;
}
.hero-desc {
  color: var(--rr-white-80);
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}
.hero-desc-note {
  font-size: 13px;
  color: var(--rr-white-60);
  margin: 28px 0 0;
}
.hero-visual {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Phone mockup (pure CSS frame) ---------- */
.phone-mockup {
  display: flex;
  justify-content: center;
  margin-bottom: 56px;
}
.phone-frame {
  position: relative;
  width: 300px;
  height: 610px;
  background: linear-gradient(155deg, #7a9cc2, #3a5a7a 45%, #21344a 100%);
  border-radius: 44px;
  padding: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.phone-notch {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 104px;
  height: 22px;
  background: #000;
  border-radius: 12px;
  z-index: 5;
}
.phone-notch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a2a3a;
  box-shadow: 0 0 0 2px #0a1520 inset;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 40px;
  background: #000;
  overflow: hidden;
}

/* ---------- Screen views (capture / result / player) ---------- */
.screen-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.screen-view[hidden] { display: none; }

/* -- capture view -- */
.capture-view { background: #000; }

.rr-logo {
  text-align: center;
  padding-top: 22px;
  flex-shrink: 0;
}
.rr-logo-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
}
.rr-logo-text .cd { font-size: 0.65em; }
.rr-logo-beta {
  color: #8e8e93;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-top: 1px;
}

.capture-circle-wrap {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 70px auto 0;
  flex-shrink: 0;
}
.capture-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #0d0d0f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.capture-circle.has-image { cursor: pointer; }
.capture-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.circle-border {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--rr-border-ring);
  pointer-events: none;
}
.capture-circle-wrap.recognizing .capture-circle {
  animation: rr-spin 2s linear infinite;
}
@keyframes rr-spin {
  to { transform: rotate(360deg); }
}

.pulsing-rings { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.capture-circle-wrap.recognizing .pulsing-rings { opacity: 1; }
.pulsing-rings .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--rr-ring-blue);
  animation: rr-pulse 1.8s ease-out infinite;
  opacity: 0;
}
.pulsing-rings .ring:nth-child(2) { animation-delay: 0.594s; }
.pulsing-rings .ring:nth-child(3) { animation-delay: 1.188s; }
@keyframes rr-pulse {
  0%   { transform: scale(1);    opacity: 0.35; }
  100% { transform: scale(1.55); opacity: 0; }
}

.capture-instruction {
  text-align: center;
  color: var(--rr-white-60);
  font-size: 12px;
  margin-top: 80px;
  padding: 0 24px;
  min-height: 16px;
  flex-shrink: 0;
}
.capture-instruction.recognizing-text { color: rgba(255,255,255,0.8); }

.bottom-nav {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 20px 20px;
  flex-shrink: 0;
}
.glass-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rr-white);
  cursor: not-allowed;
}
.glass-btn svg { width: 18px; height: 18px; }

.capture-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--rr-active-blue);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  padding: 0;
}
.capture-btn:active { transform: scale(0.93); }
.capture-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.capture-btn svg { width: 24px; height: 24px; color: var(--rr-white); }

.capture-btn .spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: var(--rr-white);
  animation: rr-spin 0.8s linear infinite;
  display: none;
}
.capture-btn.loading svg { display: none; }
.capture-btn.loading .spinner { display: block; }

/* -- result / player views -- */
.result-view, .player-view {
  background-size: cover;
  background-position: center;
  background-color: #111;
  justify-content: flex-end;
}
.result-view::before, .player-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0) 0%, rgba(0,0,0,0) 25%,
    rgba(0,0,0,0.7) 55%, rgba(0,0,0,1) 75%);
}
.back-btn {
  position: absolute;
  top: 16px;
  left: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rr-white);
  cursor: pointer;
  z-index: 6;
}
.back-btn svg { width: 16px; height: 16px; }

.result-panel, .player-panel {
  position: relative;
  z-index: 2;
  padding: 0 16px 22px;
}
.result-title-row { display: flex; align-items: center; gap: 12px; }
.result-titles { flex: 1; min-width: 0; }
.result-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-artist {
  font-size: 12px;
  color: var(--rr-white-80);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--rr-play-purple);
  border: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.play-btn svg { width: 18px; height: 18px; color: var(--rr-white); }

.result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}
.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--rr-chip-bg);
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 500;
  color: #a9a9ae;
}
.result-chip svg { width: 10px; height: 10px; }

.discogs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 38px;
  margin-top: 16px;
  background: var(--rr-active-blue);
  border: none;
  border-radius: 10px;
  color: var(--rr-white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.discogs-btn svg { width: 14px; height: 14px; }

/* -- player view — mirrors video_player_page.dart's custom player --
   (waveform scrubber, play/pause/skip-10s, track dots), driven by the
   YouTube IFrame API through a 1x1 hidden host element rather than a
   visible embedded iframe. */
.player-yt-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.player-no-video {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--rr-white-60);
  font-size: 12px;
  padding: 40px 20px;
}
.player-song-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.player-artist {
  font-size: 13px;
  color: var(--rr-white-80);
  margin: 0 0 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-record-name {
  font-size: 11px;
  color: var(--rr-white-60);
  margin: 0 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.waveform-wrap {
  width: 100%;
  height: 36px;
  cursor: pointer;
}
.waveform-wrap canvas { width: 100%; height: 100%; display: block; }
.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--rr-white-60);
  margin-top: 4px;
}
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 14px;
}
.player-seek-btn {
  background: none;
  border: none;
  color: var(--rr-white);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.player-seek-btn svg { width: 22px; height: 22px; }
.player-playpause-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rr-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.player-playpause-btn svg { width: 18px; height: 18px; color: #000; }
.player-playpause-btn .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  animation: rr-spin 0.8s linear infinite;
}
.player-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
}
.player-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.27);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}
.player-dot.active { width: 16px; background: var(--rr-white); }

/* -- inline status / error messages inside the mockup -- */
.screen-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 30px;
  font-size: 13px;
  color: var(--rr-white-80);
  background: rgba(0,0,0,0.55);
  z-index: 10;
}
.screen-message[hidden] { display: none; }
.screen-message button {
  display: block;
  margin: 14px auto 0;
  background: var(--rr-active-blue);
  color: var(--rr-white);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Examples row ---------- */
.examples {
  text-align: left;
  margin-top: 32px;
}
.examples h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--rr-white-80);
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.examples-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
  max-width: 640px;
  margin: 0;
}
.example-cover {
  width: 96px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
}
.example-cover img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.example-cover:hover img { transform: translateY(-2px); }
.example-cover.selected img { border-color: var(--rr-active-blue); }
.example-cover span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--rr-white-60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint {
  margin-top: 28px;
  font-size: 14px;
  color: var(--rr-white-60);
}

@media (max-width: 380px) {
  .phone-frame { width: 260px; height: 528px; border-radius: 44px; }
  .capture-circle-wrap { width: 186px; height: 186px; }
}

/* ---------- Screens showcase (second section) ---------- */
.screens-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 72px 20px 96px;
  text-align: center;
  background: #000000;
}
.screens-inner {
  max-width: 1240px;
  margin: 0 auto;
}
.screens-section h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  margin: 0 0 40px;
  letter-spacing: -0.3px;
}
/* Wraps instead of scrolling — every image always stays fully inside
   the section; on narrower screens rows just wrap sooner. */
.screens-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 4px;
}
.screens-strip img {
  flex: 0 1 auto;
  height: clamp(180px, 22vw, 420px);
  width: auto;
  max-width: 100%;
  border-radius: 18px;
}

/* Narrow screens: one full-width column instead of several small rows. */
@media (max-width: 640px) {
  .screens-strip {
    flex-direction: column;
    align-items: center;
  }
  .screens-strip img {
    height: auto;
    width: 100%;
    max-width: 300px;
  }
}

/* ---------- Upcoming features (third section) ---------- */
.roadmap-section {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 72px 20px 100px;
  text-align: center;
  background: #000000;
}
/* Mirrors whatever glow is currently active in the hero (see setGlow()
   in app.js) — concentrated at the top, fading out. Reads as light
   spilling down from the first section, and changes with it. */
.roadmap-glow {
  position: absolute;
  top: -25%;
  left: -10%;
  right: -10%;
  height: 100%;
  z-index: 0;
  filter: blur(80px);
  pointer-events: none;
  /* Forces a guaranteed smooth dissolve to transparent — relying on the
     radial-gradient's own fade + blur alone left a visible edge where
     the element's box ended. */
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 25%, transparent 75%);
  mask-image: linear-gradient(to bottom, black 0%, black 25%, transparent 75%);
}
.roadmap-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
}
.roadmap-section > .roadmap-inner > h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  margin: 0 0 44px;
  letter-spacing: -0.3px;
}
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  text-align: left;
}
.roadmap-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 26px 22px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.roadmap-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
}
.roadmap-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.roadmap-icon svg {
  width: 22px;
  height: 22px;
  color: var(--rr-active-blue);
}
.roadmap-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.1px;
}
.roadmap-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--rr-white-60);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #000000;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 20px;
  text-align: center;
}
.site-footer-logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.site-footer-tagline {
  font-size: 13px;
  color: var(--rr-white-60);
  margin: 0 0 16px;
}
.site-footer-copy {
  font-size: 12px;
  color: var(--rr-white-40);
  margin: 0;
}
