:root {
  /* Ultra-Premium Neutral Palette */
  --bg-color: #fafafa;
  --surface-light: rgba(255, 255, 255, 0.85);
  --surface-border: rgba(255, 255, 255, 0.6);
  
  --text-main: #0a0a0a;
  --text-muted: #52525b;
  --text: var(--text-main);
  --muted: var(--text-muted);
  --blue: var(--accent-dark);
  
  --accent-dark: #000000;
  --accent-light: #ffffff;
  
  --focus-ring: rgba(0, 0, 0, 0.15);
  --error: #e11d48;

  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Abstract Background Shapes with Breathing Animation */
.bg-shape {
  position: absolute;
  filter: blur(120px);
  z-index: -1;
  border-radius: 50%;
  opacity: 0.4;
  animation: breathe 12s ease-in-out infinite alternate;
}

.shape-1 {
  width: 50vw;
  height: 50vw;
  background: #e4e4e7;
  top: -10vw;
  left: -10vw;
}

.shape-2 {
  width: 40vw;
  height: 40vw;
  background: #d4d4d8;
  bottom: 10vw;
  right: -5vw;
  animation-delay: -6s;
}

@keyframes breathe {
  0% { transform: scale(1) translate(0, 0); opacity: 0.3; }
  100% { transform: scale(1.1) translate(2vw, 2vw); opacity: 0.5; }
}

/* Glassmorphism Panel - Refined */
.glass-panel {
  background: var(--surface-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border);
  border-radius: 28px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 1);
  transition: var(--transition-smooth);
}

/* Header */
.topbar {
  min-height: 64px;
  background: rgba(250, 250, 250, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text-main);
  font-weight: 800;
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--accent-dark);
}

/* Main Layout */
.candidate-shell {
  width: min(1000px, calc(100% - 32px));
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Candidate Card */
.candidate-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.candidate-media img {
  width: 100%;
  display: block;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  aspect-ratio: 4/5;
  transition: transform 0.5s ease;
}

.candidate-media img:hover {
  transform: scale(1.02);
}

.candidate-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.office {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  color: var(--text-main);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.number {
  color: var(--accent-dark);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 900;
  line-height: 1;
  margin: 8px 0;
  letter-spacing: -0.06em;
}

.message {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Generator Panel - Anti Layout Shift */
.generator-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.format-selector {
  align-self: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
  padding: 4px;
  width: min(420px, 100%);
}

.format-selector button {
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  height: 48px;
  letter-spacing: 0;
  transition: var(--transition-smooth);
}

.format-selector button.active {
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

.format-selector button:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* Dropzone - Magnetic Feel */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 24px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.dropzone:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.dropzone:hover::before {
  transform: translateX(100%);
}

.dropzone:focus-within {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  z-index: 1;
}

.icon-circle {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  color: var(--accent-dark);
  transition: var(--transition-bounce);
}

.dropzone:hover .icon-circle {
  transform: scale(1.1);
}

.dropzone-content span {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.mobile-text {
  display: none;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Loading State - Premium Spinner */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  animation: fadeIn 0.4s ease-out;
  width: 100%;
}

.spinner-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.4);
}

@keyframes pulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 0.2; box-shadow: 0 0 40px rgba(37, 99, 235, 0.1); }
  100% { transform: scale(0.85); opacity: 0.9; }
}

.dynamic-loading-text {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-align: center;
  animation: fadeText 0.8s ease-in-out infinite alternate;
}

@keyframes fadeText {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* Result State */
.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-image-wrapper {
  width: min(420px, 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
  background: #f4f4f5;
  position: relative;
}

.result img {
  width: 100%;
  display: block;
}

/* Buttons - Premium Feel */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 32px;
  height: 56px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-bounce);
  border: none;
  outline: none;
}

.btn-primary {
  width: min(420px, 100%);
  background: var(--accent-dark);
  color: var(--accent-light);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.btn-massive {
  width: 100%;
  height: 64px;
  font-size: 1.2rem;
  border-radius: 20px;
  letter-spacing: -0.02em;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
}

.btn-secondary:hover {
  color: var(--text-main);
  background: rgba(0,0,0,0.03);
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Error Shake */
.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.status-error {
  color: var(--error);
  text-align: center;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(225, 29, 72, 0.08);
  padding: 12px 20px;
  border-radius: 12px;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}

/* Sticky Mobile CTA Container */
.mobile-sticky-cta {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 50;
}

/* Ensure footer doesn't get hidden behind sticky CTA */
@media (max-width: 840px) {
  .footer {
    padding-bottom: 120px;
  }
} 

.btn-massive {
  width: 100%;
  height: 64px;
  font-size: 1.15rem;
  border-radius: 100px; /* Pill shape */
  letter-spacing: -0.01em;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

/* Footer */
.footer {
  padding: 40px 16px 140px; /* Extra padding for mobile CTA floating pill */
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive UX */
@media (max-width: 840px) {
  .candidate-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 24px;
    gap: 24px;
  }
  
  /* Mobile Avatar Reduction */
  .candidate-media {
    max-width: 100%;
  }
  
  .candidate-media img {
    /* Create a banner/avatar feel on mobile without stretching */
    width: 100%;
    height: 280px; 
    object-fit: cover;
    object-position: top center;
    border-radius: 20px;
    aspect-ratio: auto; /* override desktop ratio */
  }
  
  .candidate-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
  }
  
  .candidate-copy {
    align-items: center;
  }
  
  .generator-panel {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    min-height: auto;
  }

  .loading-state, .result {
    background: var(--surface-light);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 1);
    padding: 32px 24px;
    margin-top: 16px;
  }
  
  /* Hide the dropzone container on mobile */
  .upload-zone {
    display: none !important;
  }

  /* Show the sticky CTA on mobile */
  .mobile-sticky-cta {
    display: block;
  }
}
