/* ========================================
   common.css — Reset & Base Styles
   ======================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Chillax', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #FFFFFF;
  background-color: #0A0A0A;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- CSS Variables ---------- */
:root {
  /* Colors */
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-tertiary: #1A1A1A;
  --text-primary: #FFFFFF;
  --text-secondary: #888888;
  --text-muted: #666666;
  --accent: #FF6B6B;
  --accent-hover: #FF8E53;
  --border: #222222;

  /* Spacing */
  --container-max: 1400px;
  --header-height: 70px;
  --section-spacing: 160px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Screen reader only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Screen reader only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.4s ease;
  padding: 20px;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal__container {
  background: var(--bg-secondary);
  width: 100%;
  max-width: 800px;
  max-height: 80vh;
  border-radius: 24px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal__container {
  transform: translateY(0);
}

.modal__header {
  padding: 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 600;
}

.modal__close {
  font-size: 2rem;
  color: var(--text-secondary);
  line-height: 1;
  transition: color 0.2s;
}

.modal__close:hover {
  color: #fff;
}

.modal__body {
  padding: 30px;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.modal__body h3 {
  color: #fff;
  margin: 25px 0 10px;
  font-size: 1.2rem;
}

.modal__body p {
  margin-bottom: 15px;
}

.modal__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
  opacity: 0.5;
}

/* ========== Page Ads ========== */
.page-ad {
  width: 100%;
  max-width: 340px;
  margin: 32px auto;
}

.page-ad-top {
  margin-top: 32px;
}

.page-ad-bottom {
  margin-bottom: 48px;
}

.footer-ad,
.top-ad {
  width: 100%;
  max-width: 728px;
  margin: 40px auto;
  text-align: center;
}

.footer-ad {
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .page-ad {
    max-width: 100%;
  }
}

.page-top {
  position: relative;
  width: min(100%, var(--container-max));
  margin: 0 auto 48px;
  padding: 0 40px;
}

.page-top__content {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.page-ad-right {
  position: absolute;
  top: -80px;
  right: -100px;
}

.page-ad-right--analyzer {
  right: -400px;
}

.ui-preview .page-ad-right {
  top: -100px;
  right: -50px;
}

@media (max-width: 1200px) {
  .page-top {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
  }

  .page-top__content {
    width: 100%;
  }

  .page-ad-right {
    position: static;
    margin: 0 auto;
    max-width: 100%;
    right: auto;
  }
}

@media (max-width: 768px) {
  .page-top {
    padding: 0 20px;
  }

  .page-ad-right {
    margin: 24px auto 0;
    max-width: 100%;
  }
}

/* Hide 728x90 ads on mobile devices */
@media (max-width: 728px) {
  .footer-ad,
  .top-ad {
    display: none !important;
  }
}

/* Mobile Kakao Ad (320x480) */
.mobile-kakao-ad {
  display: none;
  width: 100%;
  max-width: 320px;
  margin: 40px auto;
  text-align: center;
}

@media (max-width: 728px) {
  .mobile-kakao-ad {
    display: block;
  }
}
