:root {
  --bg: #0a0a0a;
  --text: #ffffff;
  --pink: #ff6b9d;
  --pink-light: #ffb3d1;
  --pink-dark: #ff1744;
  --red: #ff1744;
  --red-light: #ff5252;
  --link: #ff6b9d;
  --link-hover: #ffb3d1;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #1a0a1a 0%, #0a0a0a 50%, #1a0a1a 100%);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

body.valentines-body {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

.topbar {
  display: none;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color 0.3s;
}

.logo:hover {
  color: var(--pink);
}

.topnav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--pink);
}

.page {
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.hearts-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--pink);
  opacity: 0.3;
  transform: rotate(-45deg);
  animation: float 15s infinite ease-in-out;
}

.heart::before,
.heart::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--pink);
  border-radius: 50%;
}

.heart::before {
  top: -10px;
  left: 0;
}

.heart::after {
  left: 10px;
  top: 0;
}

.heart:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.heart:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; }
.heart:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 15s; }
.heart:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 20s; }
.heart:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 14s; }
.heart:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 16s; }
.heart:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 13s; }
.heart:nth-child(8) { left: 80%; animation-delay: 4.5s; animation-duration: 17s; }
.heart:nth-child(9) { left: 90%; animation-delay: 1.5s; animation-duration: 19s; }
.heart:nth-child(10) { left: 15%; animation-delay: 6s; animation-duration: 11s; }

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(-45deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100px) rotate(-45deg);
    opacity: 0;
  }
}

.valentines-container {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  min-height: 60vh;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.8s ease-out;
}

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

.greeting-content,
.message-content,
.ask-content,
.success-content {
  text-align: center;
  width: 100%;
}

.heart-icon-large {
  width: 120px;
  height: 120px;
  color: var(--pink);
  margin: 0 auto 2rem;
  display: block;
  animation: heartbeat 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.6));
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.greeting-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--pink);
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-variant-ligatures: normal;
}

.greeting-text {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
}

.typing-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--text);
  line-height: 1.6;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 107, 157, 0.1);
  border-radius: 20px;
  border: 2px solid rgba(255, 107, 157, 0.3);
  margin-bottom: 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-variant-ligatures: normal;
}

.continue-btn {
  background: linear-gradient(135deg, var(--pink) 0%, var(--red) 100%);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
  font-family: 'Inter', sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

.continue-btn:active {
  transform: translateY(0);
}

.continue-btn.hidden {
  display: none;
}

.ask-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--pink);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 15px rgba(255, 107, 157, 0.5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-variant-ligatures: normal;
}

.ask-message {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--text);
  margin-bottom: 3rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-variant-ligatures: normal;
}

.button-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.response-btn {
  padding: 1.2rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.yes-btn {
  background: linear-gradient(135deg, var(--pink) 0%, var(--red) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.5);
}

.yes-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 107, 157, 0.7);
}

.no-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.no-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.success-content {
  animation: celebrateIn 1s ease-out;
}

@keyframes celebrateIn {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(30px);
  }
  50% {
    transform: scale(1.1) translateY(-10px);
  }
  70% {
    transform: scale(0.95) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.celebration-hearts {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.celebration-heart {
  font-size: 3rem;
  animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.3) rotate(-10deg);
  }
  75% {
    transform: scale(1.3) rotate(10deg);
  }
}

.success-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--pink);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-variant-ligatures: normal;
}

.success-message {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.success-date {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--pink);
  font-weight: 500;
  margin-top: 1rem;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

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

@media (max-width: 768px) {
  .page {
    padding-top: 1rem;
    padding-bottom: 1rem;
    min-height: 100vh;
  }

  .valentines-container {
    padding: 0 1rem;
    max-width: 100%;
  }

  .screen {
    min-height: 70vh;
    padding: 1rem 0;
  }

  .button-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
  }

  .response-btn {
    width: 100%;
    max-width: 280px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  .typing-text {
    min-height: 120px;
    padding: 1.5rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    margin-bottom: 1.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .heart-icon-large {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
  }

  .greeting-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.75rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .greeting-text {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }

  .continue-btn {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    width: 100%;
    max-width: 280px;
  }

  .ask-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .ask-message {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .success-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .success-message {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin-bottom: 0.75rem;
    padding: 0 1rem;
    line-height: 1.5;
  }

  .success-date {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    padding: 0 1rem;
  }

  .celebration-hearts {
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .celebration-heart {
    font-size: 2rem;
  }

  .message-content,
  .ask-content,
  .success-content,
  .greeting-content {
    width: 100%;
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .page {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .valentines-container {
    padding: 0 0.75rem;
  }

  .screen {
    min-height: 75vh;
  }

  .typing-text {
    min-height: 100px;
    padding: 1.25rem 0.75rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.3rem, 5vw, 1.6rem);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .response-btn {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    max-width: 100%;
  }

  .continue-btn {
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }

  .heart-icon-large {
    width: 70px;
    height: 70px;
    margin-bottom: 1rem;
  }

  .celebration-heart {
    font-size: 1.75rem;
  }

  .button-container {
    padding: 0 0.5rem;
  }

  .no-btn {
    touch-action: manipulation;
  }
}

@media (max-width: 360px) {
  .typing-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.2rem, 5vw, 1.4rem);
    padding: 1rem 0.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .greeting-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .ask-title,
  .ask-message {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.4rem, 6vw, 2rem);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
