/* =========================
   FONT: SATOSHI
   ========================= */

@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}


/* =====================================================
   ROOT VARIABLES
   Change colors & fonts here later without hunting
   ===================================================== */
:root {
  /* Backgrounds */
  --bg-main: radial-gradient(circle, rgba(11, 12, 46, 1) 0%, rgba(58, 11, 27, 1) 100%);
  --bg-panel: #12141a;

  /* Text */
  --text-main: #e0e0e0;
  --text-muted: #a0a0a0;

  /* Accent */
  --accent: #ff7a2f;
  --accent-alt: #00eaff;

  /* UI */
  --border-soft: rgba(255, 255, 255, 0.25);
  --border-hard: rgba(255, 255, 255, 0.15);
  --button-bg: #d0d0d0;
  --button-text: #111;

  /* Typography */
  --font-body: "Satoshi", system-ui, -apple-system, sans-serif;

  /* Typography scale */
  --font-base: 16px;
  --font-sm: 0.875rem;
  /* 14px */
  --font-md: 1rem;
  /* 16px */
  --font-lg: 1.25rem;
  /* 20px */
  --font-xl: 1.875rem;
  /* 30px */
  --font-xxl: 2.5rem;
  /* 40px */

  /* Spacing */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;

  /* Radius */
  --radius-lg: 1rem;
}

/* =====================================================
   BASE RESET / GLOBAL
   ===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-main);
  background-image: url(assets/BG.jpg);
  background-position: center;
  background-size: cover;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--font-base);
}

/* =====================================================
   APP WRAPPER
   Centers content and constrains width
   ===================================================== */
.app {
  max-width: 1100px;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem);

  display: grid;
  gap: var(--space-lg);
}

/* =====================================================
   HEADER / BRANDING
   ===================================================== */
.brand-header {
  display: flex;
  flex-direction: row;        /* 👈 force horizontal */
  align-items: center;        /* vertical alignment */
  gap: 1rem;
  max-width: 100%;
}

.brand-logo {
  height: auto;               /* 👈 smaller, tool-like */
  width: auto;
  max-width: 180px;            /* 👈 prevents hero scaling */
  flex-shrink: 0;
  display: block;
  opacity: .9;
  margin-right:20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}
.app-header {
  max-width: 100%;
}

.app-eyebrow {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 300;
  color: var(--text-muted);
}

.app-title {
  margin-top: 0.5rem;
  font-size: var(--font-xxl);
  font-weight: 900;
  line-height: 1.15;
}

.app-title span {
  color: var(--accent);
}

@media (max-width: 600px) {
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }


  .app-title {
    font-size: var(--font-xl);
    line-height: 1.2;
  }
}

/* =====================================================
   EMAIL ACCESS OVERLAY
   ===================================================== */

.access-overlay {
  position: fixed;
  inset: 0;
  display: none; /* hidden by default */
  place-items: center;
  padding: 1.5rem;
  z-index: 9999;

  /* Soft blur/dim background */
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.access-overlay.is-open {
  display: grid;
}

.access-modal {
  width: min(520px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hard);
  background: rgba(18, 20, 26, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 1.25rem;
}

.access-header {
  margin-bottom: 1rem;
}

.access-kicker {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.access-title {
  margin: 0.25rem 0 0.5rem;
  font-size: var(--font-xl);
  line-height: 1.15;
}

.access-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-md);
}

.access-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.access-label {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.access-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-hard);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--font-md);
  outline: none;
}

.access-input:focus {
  border-color: var(--accent);
}

.access-button {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: var(--button-text);
  font-size: var(--font-md);
  cursor: pointer;
}

.access-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.access-fineprint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.access-error {
  font-size: 0.85rem;
  color: #ffb3b3;
}


/* =====================================================
   UPLOAD GRID
   Stacks on mobile, side-by-side on desktop
   ===================================================== */
.upload-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 700px) {
  .upload-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* =====================================================
   UPLOAD CARDS
   ===================================================== */
.upload-card,
.upload-dropzone {
  min-width: 0;
}

.upload-card {
  padding: var(--space-md);
}

.upload-dropzone {
  min-height: 250px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-soft);
  padding: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--accent);
}

.upload-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-icon {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
}

.upload-label {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.upload-filename {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* Prevent long filenames from wrecking layout */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: var(--accent);
}

.upload-dropzone.has-file>.upload-filename {
  font-size: var(--font-lg);
}

.upload-dropzone.has-file>.upload-icon,
.upload-dropzone.has-file>.upload-label {
  display: none;
}

.upload-privacy {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  text-align: center;
}

.upload-privacy-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
}

.upload-privacy-text {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
}

/* =====================================================
   LOUDNESS READOUT
   ===================================================== */

.loudness-readout {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.25rem;
  margin-top: auto;
  padding-bottom: 1rem;
  min-height: 2.5rem;
}

.loudness-value {
  font-weight: 500;
  color: var(--text-main);
}


/* =====================================================
   LOCKED STATE (User upload gated)
   ===================================================== */

.upload-dropzone.locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}

/* Optional: subtle hint text */
.upload-dropzone.locked .card-status-text {
  color: rgba(255, 255, 255, 0.4);
}


/* =====================================================
   CARD STATUS / LOADING BAR
   ===================================================== */

.card-status {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  max-width: 260px;
  min-height: 0rem;
  text-align: center;
}

.card-status-text {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Loading bar container (hidden by default) */
.card-loading-bar {
  height: 7px;
  margin-top: 7px;
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Animated fill */
.card-loading-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 999px;
  transform: translateX(-100%);
  animation: card-loading-slide 1.2s ease-in-out infinite;
}
/* Loading bar container (hidden by default) */
.comparison-loading-bar {
  height: 2px;
  margin-top: 27px;
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.3s ease 1.5s;
}

/* Animated fill */
.comparison-tonal.analyzing .comparison-loading-fill {
  height: 100%;
  width: 40%;
  background: var(--accent-alt);
  border-radius: 999px;
  animation: comparison-loading-slide 5s ease-in-out 1;
  animation-delay:1.4s;
}
/* Show loader ONLY when this card is analyzing */
.upload-dropzone.analyzing .card-loading-bar, .comparison-tonal.analyzing .comparison-loading-bar {
  opacity: 1;
}

/* Animation */
@keyframes card-loading-slide {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(200%);
  }
}
@keyframes comparison-loading-slide {
  0% { width: 0; }
  100% { width: 100%; }
}



/* =====================================================
   ANALYSIS PANEL
   ===================================================== */
.analysis-panel {
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  padding:0.75rem 1.0rem;
  display: grid;
  gap: var(--space-md);
}

/* Canvas wrapper controls sizing */
.chart-wrapper {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-hard);
  background: #111;
}

#chartWrapper {
  margin-top:-100px;
  transition: margin-top 0.5s ease 1s;
}
#chartWrapper.show-comparison {
  margin-top:0;
}
/* Canvas itself scales to wrapper */
#spectrum {
  width: 100%;
  height: 100%;
  display: block;
}

#comparisonSummary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  transform: scaleY(0);
  transform-origin: top;
  opacity: 0;
  
  transition:
    transform 0.3s ease 1.4s,
    opacity 0.2s ease 1.1s;
}

#comparisonSummary.show-comparison {
  transform: scaleY(1);
  opacity: 1;
}

.comparison-summary {
  padding: 0.75rem 1rem;
  min-height: 93px;
}

.comparison-loudness {
  font-weight: 600;
}

.comparison-tonal {
  font-weight: 600;
}

/* =====================================================
   EXPORT BUTTON ROW
   ===================================================== */
.export-row {
  display: flex;
  justify-content: flex-end;
}

.export-button {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  margin-top:10px;
  background: var(--accent);
  color: var(--button-text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.export-button:hover {
  opacity: 0.9;
}