/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --primary: #0F172A;
  /* Deep Navy */
  --primary-light: #1E293B;
  --accent: #D4AF37;
  /* Metallic Gold */
  --accent-light: #E5C55D;
  --bg-color: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #F5D061 100%);
  --gradient-dark: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Spacing */
  --section-padding: 100px;

  /* Animation */
  --transition: all 0.3s ease;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: blur(12px);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

/* === Layout === */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

/* === Header === */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 20px 0;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  /* Changed to primary since hero bg is light/gradient now */
}




.header__nav {
  display: flex;
  gap: 32px;
}

.header__nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
}

.header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.header__nav a:hover {
  color: var(--accent);
}

.header__nav a:hover::after {
  width: 100%;
}

/* Header Navigation Mobile Overlay */
@media (max-width: 768px) {
  .header__nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 55;
  }

  .header__nav.open {
    opacity: 1;
    visibility: visible;
  }

  .header__nav a {
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
  }

  .header__nav.open a {
    opacity: 1;
    transform: translateY(0);
  }

  .header__nav.open a:nth-child(1) {
    transition-delay: 0.1s;
  }

  .header__nav.open a:nth-child(2) {
    transition-delay: 0.2s;
  }

  .header__nav.open a:nth-child(3) {
    transition-delay: 0.3s;
  }
}

/* === Hamburger Menu === */
.header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 60;
}

.header__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  margin: 5px 0;
  transition: var(--transition);
  border-radius: 2px;
}

.header__burger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header__burger.open span:nth-child(2) {
  opacity: 0;
}

.header__burger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* === Hero === */
.hero {
  position: relative;
  padding: 180px 0 120px;
  background: radial-gradient(circle at top right, #F1F5F9 0%, #FFFFFF 50%, #F8FAFC 100%);
  overflow: hidden;
}

.hero__bg {
  /* Abstract shapes can be added here or via pseudo elements */
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.hero__container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero__tag {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero__title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 48px;
  font-weight: 300;
}

.hero__buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  /* Ensure they wrap on very small screens if needed, effectively one line on mobile/desktop usually */
}

.store-badge {
  transition: transform 0.2s, opacity 0.2s;
  display: inline-flex;
  height: 40px;
  /* Reduced height to compact them */
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}

.store-badge:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.store-badge img {
  height: 100%;
  width: auto;
  display: block;
}

/* Fix for Google Play badge visual weight (often has buffering padding) */
.store-badge--google img {
  height: 145%;
}

/* Visual Circle Placeholder */
.visual-circle {
  width: 400px;
  height: 500px;
  background: var(--gradient-dark);
  /* Placeholder for image */
  border-radius: 200px 200px 20px 20px;
  margin-left: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  /* In a real scenario, this would be an image container */
  background-image: url('https://images.unsplash.com/photo-1542596768-5d1d21f1cfad?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80');
  /* Sample image if user permits, otherwise color */
  background-size: cover;
  background-position: center;
}

.visual-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.4), transparent);
  border-radius: inherit;
}

/* === Features === */
.features {
  padding: 120px 0;
  background-color: var(--surface);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 80px;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.feature-card {
  padding: 48px 32px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  transition: var(--transition);
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(212, 175, 55, 0.4);
}

.feature-card__icon-wrapper {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  box-shadow: var(--shadow-md);
  color: var(--accent);
  font-size: 2rem;
}

.feature-card__title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card__desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* === Legal Pages (Shared) === */
.legal {
  padding: 140px 0 100px;
}

.legal__title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.legal__date {
  color: var(--text-light);
  margin-bottom: 3rem;
}

.legal h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.legal p {
  margin-bottom: 1rem;
  color: var(--text-main);
}

.legal ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal li {
  margin-bottom: 0.5rem;
}

/* === Referral Page === */
.referral-hero {
  padding: 180px 0 80px;
  background: radial-gradient(circle at top right, #F1F5F9 0%, #FFFFFF 50%, #F8FAFC 100%);
  text-align: center;
}

.referral-hero__title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.referral-hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* Steps */
.referral-steps {
  padding: 100px 0;
  background-color: var(--surface);
}

.referral-steps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(212, 175, 55, 0.3);
}

.step-card__number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: var(--primary);
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-md);
}

.step-card__title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.step-card__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Benefits */
.referral-benefits {
  padding: 100px 0;
  background-color: var(--bg-color);
}

.referral-benefits__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.benefit-card {
  padding: 48px 36px;
  border-radius: 24px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid transparent;
}

.benefit-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.benefit-card--referrer {
  background: var(--surface);
  border-color: rgba(212, 175, 55, 0.2);
}

.benefit-card--invitee {
  background: var(--gradient-dark);
  color: #fff;
}

.benefit-card__label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  color: var(--accent);
}

.benefit-card--invitee .benefit-card__label {
  color: var(--accent-light);
}

.benefit-card__amount {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.benefit-card--referrer .benefit-card__amount {
  color: var(--primary);
}

.benefit-card__unit {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.benefit-card--referrer .benefit-card__unit {
  color: var(--text-muted);
}

.benefit-card--invitee .benefit-card__unit {
  color: var(--accent-light);
}

.benefit-card__desc {
  font-size: 0.9rem;
  line-height: 1.7;
}

.benefit-card--referrer .benefit-card__desc {
  color: var(--text-muted);
}

.benefit-card--invitee .benefit-card__desc {
  color: rgba(255, 255, 255, 0.7);
}

/* FAQ */
.referral-faq {
  padding: 100px 0;
  background-color: var(--surface);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  padding: 24px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item__q {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.faq-item__a {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 3-column benefits grid */
.referral-benefits__grid--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1000px;
}

.referral-benefits__invitee {
  max-width: 500px;
  margin: 32px auto 0;
}

/* Activity Multiplier */
.referral-multiplier {
  padding: 100px 0;
  background-color: var(--surface);
}

.multiplier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 720px;
  margin: 0 auto;
}

.multiplier-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition);
}

.multiplier-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.multiplier-card__badge {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.multiplier-card--active .multiplier-card__badge {
  color: #16A34A;
}

.multiplier-card--semi .multiplier-card__badge {
  color: #EA580C;
}

.multiplier-card--inactive .multiplier-card__badge {
  color: var(--text-muted);
}

.multiplier-card__title {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.multiplier-card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.multiplier-note {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* CTA */
.referral-cta {
  padding: 80px 0;
  background: var(--bg-color);
  text-align: center;
}

.referral-cta__title {
  font-size: 2rem;
  margin-bottom: 12px;
}

.referral-cta__desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.referral-cta__note {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
  margin-bottom: 40px;
}

/* Referral responsive */
@media (max-width: 768px) {
  .referral-hero__title {
    font-size: 2.25rem;
  }

  .referral-steps__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .referral-benefits__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .referral-benefits__grid--three {
    grid-template-columns: 1fr;
  }

  .multiplier-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .referral-hero {
    padding: 140px 0 60px;
  }

  .referral-hero__title {
    font-size: 1.75rem;
  }

  .benefit-card {
    padding: 32px 24px;
  }

  .benefit-card__amount {
    font-size: 1.75rem;
  }
}

/* === Legal Content Tables === */
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.legal th,
.legal td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--bg-color);
}

.legal th {
  background-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 2rem;
  border-radius: 12px;
}

/* === Footer === */
.footer {
  background-color: var(--primary);
  color: #fff;
  padding: 80px 0 40px;
  margin-top: auto;
}

.footer__container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: center;
}

.footer__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
}

.footer__desc {
  color: var(--text-light);
  font-size: 0.95rem;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.footer__links a {
  color: #fff;
  font-size: 0.95rem;
  opacity: 0.8;
}

.footer__links a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer__contact {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 40px;
  color: var(--text-light);
  font-size: 0.875rem;
}

.footer__contact a {
  color: var(--accent);
}

/* === Responsive === */
@media (max-width: 900px) {
  .hero {
    padding: 140px 0 80px;
    /* Reduced padding for smaller screens */
  }

  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero__buttons {
    justify-content: center;
  }

  .visual-circle {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
    height: 400px;
  }
}

@media (max-width: 768px) {
  .header__burger {
    display: block;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__subtitle br {
    display: none;
  }

  .features {
    padding: 60px 0;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 2rem;
  }

  .feature-card {
    padding: 32px 24px;
  }

  .feature-card__icon-wrapper {
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
    margin-bottom: 24px;
  }

  .visual-circle {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 1.75rem;
  }

  .hero {
    padding: 100px 0 40px;
  }

  .header__logo {
    font-size: 1.25rem;
  }

  .visual-circle {
    height: 250px;
    border-radius: 120px 120px 16px 16px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .feature-card__icon-wrapper {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .legal {
    padding: 110px 0 60px;
  }

  .legal__title {
    font-size: 1.75rem;
  }

  .footer {
    padding: 48px 0 24px;
  }

  .footer__container {
    gap: 24px;
  }

  .footer__contact {
    padding-top: 24px;
  }

  .footer__links {
    flex-direction: column;
    gap: 12px;
  }

  .referral-hero {
    padding: 110px 0 40px;
  }
}