@layer base, layout, components, utilities;

@layer base {
  :root {
    --primary: #3F51B5;
    --primary-light: #7986CB;
    --accent: #FF4081;
    --accent-light: #FF80AB;
    --highlight: #FFC107;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    
    --font-kr: 'Pretendard', sans-serif;
    --font-en: 'Montserrat', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-color: rgba(63, 81, 181, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-family: var(--font-kr);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
  }

  h1, h2, h3 {
    font-family: var(--font-en);
    font-weight: 900;
  }
}

@layer layout {
  .container {
    padding: 0 24px;
    max-width: 500px;
    margin: 0 auto;
  }

  section {
    padding: 64px 0;
  }

  .grid {
    display: grid;
    gap: 20px;
  }

  /* Noise Texture */
  .bg-textured::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  }
}

@layer components {
  /* Hero Section */
  .hero-section {
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1A237E 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
    padding: 0;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    box-shadow: 0 10px 30px var(--shadow-color);
  }

  .hero-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent);
    filter: blur(100px);
    opacity: 0.3;
    top: -50px;
    right: -50px;
    border-radius: 50%;
  }

  .hero-content {
    text-align: center;
    z-index: 1;
    animation: fadeInScale 1s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-subtitle {
    font-family: var(--font-en);
    font-weight: 700;
    letter-spacing: 4px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    opacity: 0.8;
  }

  .hero-title {
    font-size: 3.5rem;
    line-height: 0.95;
    margin-bottom: 24px;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }

  .hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
  }

  /* Greeting Section */
  .greeting-section {
    text-align: center;
    background: var(--white);
    margin: -40px 24px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    position: relative;
  }

  .section-title {
    font-family: var(--font-kr);
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--primary);
  }

  .greeting-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    word-break: keep-all;
  }

  /* Cards */
  .info-card {
    background: var(--white);
    padding: 32px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
  }

  .info-card:active {
    transform: scale(0.98);
  }

  .highlight-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .icon-box {
    width: 60px;
    height: 60px;
    background: rgba(63, 81, 181, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 8px;
  }

  .info-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0;
  }

  .info-card .bold {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
  }

  .badge {
    background: var(--highlight);
    color: #4E342E;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
  }

  /* Event Details */
  .details-box {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
  }

  .detail-item {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
  }

  .detail-item:last-child {
    margin-bottom: 0;
  }

  .detail-item i {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
  }

  .detail-item .label {
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
  }

  .detail-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
  }

  .address-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
  }

  /* Map Container */
  .map-container {
    margin-bottom: 32px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 4px solid var(--white);
  }

  .map-container iframe {
    display: block;
    filter: grayscale(0.2);
  }

  /* RSVP Button */
  .rsvp-button {
    width: 100%;
    padding: 20px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-kr);
    box-shadow: 0 10px 20px rgba(255, 64, 129, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .rsvp-button:active {
    transform: translateY(2px);
    box-shadow: 0 5px 10px rgba(255, 64, 129, 0.2);
  }

  /* Footer */
  .footer {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
  }

  .footer-contact {
    margin-top: 8px;
    font-weight: 500;
  }
}

@layer utilities {
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

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

  /* Reveal animations */
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* :has() selector for card emphasis */
  .highlights-section:has(.info-card:hover) .info-card:not(:hover) {
    opacity: 0.7;
    filter: blur(2px);
  }
}
