/* ============================================================
   PAL Homepage — Soft Purple Design System
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* Color tokens */
  --bg: #F6F4FF;
  --bg-deep: #EDE8FF;
  --surface: #FFFFFF;
  --surface-soft: #FBFAFF;
  --primary: #7C5CFC;
  --primary-deep: #5B3FD9;
  --primary-light: #A98CFF;
  --accent: #C9BFFF;
  --accent-pink: #F3C6E8;
  --text: #2A2440;
  --text-muted: #6E6690;
  --text-faint: #9C93BE;
  --border: #E7E1FF;
  --success: #58C9A3;
  --shadow-soft: 0 8px 30px rgba(124, 92, 252, 0.12);
  --shadow-card: 0 4px 20px rgba(124, 92, 252, 0.08);
  --shadow-pop: 0 20px 60px rgba(91, 63, 217, 0.25);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: 'Pretendard', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

::selection { background: var(--accent); color: var(--primary-deep); }

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: 0 0 12px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Ambient background blobs
   ============================================================ */
.blob-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}
.blob-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -120px; left: -100px;
  animation-delay: 0s;
}
.blob-2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--accent-pink), transparent 70%);
  top: 40%; right: -140px;
  animation-delay: -6s;
}
.blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--primary-light), transparent 70%);
  bottom: -100px; left: 30%;
  animation-delay: -12s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-20px, 30px) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(160%);
  background: rgba(246, 244, 255, 0.75);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1080px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-deep);
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 0.95rem;
  box-shadow: var(--shadow-card);
  animation: pulse-mark 4s ease-in-out infinite;
}
@keyframes pulse-mark {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(-4deg); }
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--primary-deep); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.btn-ghost {
  background: var(--surface);
  color: var(--primary-deep);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-deep); }
.btn-google {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.btn-google img { width: 18px; height: 18px; }
.btn-google:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.user-chip {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.user-chip img { width: 28px; height: 28px; border-radius: 50%; }
.user-chip span { font-size: 0.85rem; font-weight: 700; }
.user-chip button { color: var(--text-faint); font-size: 0.78rem; }

.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
}
.hamburger span, .hamburger span::before, .hamburger span::after {
  content: ''; display: block; width: 18px; height: 2px;
  background: var(--primary-deep); position: relative; border-radius: 2px;
}
.hamburger span::before { position: absolute; top: -6px; }
.hamburger span::after { position: absolute; top: 6px; }

/* ============================================================
   Sections (rendered dynamically)
   ============================================================ */
main { position: relative; z-index: 1; }
.section { padding: 96px 0; }
.section-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-deep);
  background: var(--bg-deep);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text);
}
.section-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 40px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 90px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  animation: gentle-bounce 3s ease-in-out infinite;
}
@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 22px;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-actions .btn { padding: 14px 28px; font-size: 1rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.about-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.about-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.about-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.about-card p { font-size: 0.92rem; color: var(--text-muted); }

/* ---------- Notice ---------- */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.16s ease;
}
.notice-item:hover { transform: translateX(4px); }
.notice-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--primary-deep);
}
.notice-tag.is-new { background: var(--primary); color: #fff; }
.notice-item .notice-title { font-weight: 700; flex: 1; }
.notice-item .notice-date { font-size: 0.82rem; color: var(--text-faint); flex-shrink: 0; }

/* ---------- Tests / Services grid ---------- */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.test-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.test-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.25s ease;
}
.test-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.test-card:hover::before { opacity: 0.35; }
.test-card .emoji { font-size: 2rem; margin-bottom: 12px; }
.test-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; position: relative; }
.test-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 18px; position: relative; }
.test-card .btn { position: relative; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gallery-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--bg-deep);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.06); }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.contact-info h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; }
.contact-info p { color: var(--text-muted); margin-bottom: 18px; }
.contact-detail { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; margin-bottom: 8px; color: var(--text); }

/* ---------- Custom (free text block) ---------- */
.custom-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
}
.custom-block :is(h1,h2,h3) { font-weight: 800; margin-bottom: 12px; }
.custom-block p { color: var(--text-muted); margin-bottom: 10px; }

/* ============================================================
   Opening celebration popup
   ============================================================ */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(42, 36, 64, 0.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.popup-overlay.is-open { opacity: 1; pointer-events: auto; }
.popup-card {
  background: var(--surface);
  border-radius: 26px;
  max-width: 420px;
  width: 100%;
  padding: 40px 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  position: relative;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(.2,.9,.3,1.3);
  overflow: hidden;
}
.popup-overlay.is-open .popup-card { transform: translateY(0) scale(1); }
.popup-card::before {
  content: '';
  position: absolute; top: -60px; left: -60px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
}
.popup-card::after {
  content: '';
  position: absolute; bottom: -70px; right: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-pink), transparent 70%);
}
.popup-emoji { font-size: 2.6rem; margin-bottom: 14px; position: relative; }
.popup-card h2 {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; position: relative;
  color: var(--text);
}
.popup-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; position: relative; }
.popup-actions { display: flex; flex-direction: column; gap: 10px; position: relative; }
.popup-close-x {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-deep); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.popup-dismiss-today {
  font-size: 0.8rem; color: var(--text-faint); text-decoration: underline;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 40px 24px 60px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.site-footer .logo { justify-content: center; margin-bottom: 10px; }

/* ============================================================
   Loading / empty states
   ============================================================ */
.loading-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .about-grid, .tests-grid, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .about-grid, .tests-grid, .gallery-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero { padding: 70px 0 60px; }
}
