/* ============================================
   GRACE GATE CHURCH — DESIGN SYSTEM
   Premium Church Website
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', system-ui, -apple-system, sans-serif;
  background: #FBFBFB;
  color: #121212;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font: inherit; }
ul, ol { list-style: none; }

/* --- Color Tokens --- */
:root {
  --charcoal: #121212;
  --offwhite: #FBFBFB;
  --warm: #F5F3EF;
  --sand: #E8E4DD;
  --accent: #8B7355;
  --accent-light: #A89279;
  --accent-soft: rgba(139,115,85,0.08);
  --muted: #6B6B6B;
  --border: rgba(18,18,18,0.06);
  --glass-light: rgba(255,255,255,0.65);
  --glass-dark: rgba(18,18,18,0.75);
  --glass-border-light: rgba(255,255,255,0.3);
  --glass-border-dark: rgba(255,255,255,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
  --shadow-xl: 0 32px 80px rgba(0,0,0,0.1);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1CCC4; border-radius: 3px; }
::selection { background: rgba(139,115,85,0.15); }

/* --- Typography Scale --- */
.text-display { font-size: clamp(2.75rem, 7vw, 6.5rem); font-weight: 300; line-height: 1.05; letter-spacing: -0.03em; }
.text-h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.025em; }
.text-h2 { font-size: clamp(1.75rem, 3.5vw, 3rem); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; }
.text-h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 400; line-height: 1.3; letter-spacing: -0.01em; }
.text-body { font-size: 1rem; font-weight: 300; line-height: 1.7; color: var(--muted); }
.text-body-lg { font-size: 1.125rem; font-weight: 300; line-height: 1.75; color: var(--muted); }
.text-caption { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.text-overline { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; }
.font-bold { font-weight: 600; }
.gradient-text { background: linear-gradient(135deg, #121212 0%, #8B7355 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.font-serif { font-family: Georgia, 'Noto Serif KR', serif; }

/* --- Layout --- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 768px) { .container { padding: 0 2.5rem; } }
@media (min-width: 1440px) { .container { padding: 0 4rem; } }
.section-gap { padding-top: 8rem; padding-bottom: 8rem; }
@media (min-width: 768px) { .section-gap { padding-top: 12rem; padding-bottom: 12rem; } }

/* --- Section Label (01 — About Us style) --- */
.section-label {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 5rem;
}
.section-label .num { font-size: 0.6875rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.section-label .line { height: 1px; width: 3rem; background: rgba(18,18,18,0.15); }
.section-label .name { font-size: 0.6875rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
@media (min-width: 768px) { .section-label { margin-bottom: 7rem; } }

/* --- Grain Texture Overlay --- */
.grain::after {
  content: ''; position: absolute; inset: 0; opacity: 0.02; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Floating Orbs --- */
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
  animation: orbFloat 10s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.06); }
}

/* --- Glass Effects --- */
.glass {
  background: var(--glass-light);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-light);
}
.glass-dark {
  background: var(--glass-dark);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border-dark);
}

/* ============================================
   NAVIGATION — PREMIUM MOBILE & DESKTOP
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: all 0.5s var(--ease-out);
}
.nav.scrolled {
  background: rgba(251,251,251,0.88);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.nav.dark-mode { /* for dark pages */ }
.nav.scrolled.dark-mode {
  background: rgba(18,18,18,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 5rem; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
}
@media (min-width: 768px) { .nav-inner { height: 5.5rem; padding: 0 2.5rem; } }

/* Logo */
.nav-logo { display: flex; align-items: center; gap: 0.75rem; z-index: 110; }
.nav-logo-mark {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--charcoal); display: flex; align-items: center; justify-content: center;
  transition: transform 0.5s var(--ease-out);
}
.nav-logo:hover .nav-logo-mark { transform: scale(1.1) rotate(90deg); }
.nav-logo-text { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; color: var(--charcoal); }
.dark-mode .nav-logo-mark { background: rgba(255,255,255,0.12); }
.dark-mode .nav-logo-text { color: var(--offwhite); }

/* Desktop Links */
.nav-links { display: none; align-items: center; gap: 2.5rem; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.8125rem; font-weight: 400; letter-spacing: 0.04em;
  color: var(--muted); transition: color 0.3s ease; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--accent); transition: width 0.4s var(--ease-out);
}
.nav-links a:hover { color: var(--charcoal); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--charcoal); }
.nav-links a.active::after { width: 100%; }
.dark-mode .nav-links a { color: rgba(251,251,251,0.5); }
.dark-mode .nav-links a:hover { color: var(--offwhite); }
.dark-mode .nav-links a.active { color: var(--offwhite); }

/* Desktop CTA */
.nav-cta {
  display: none; padding: 0.625rem 1.5rem; border-radius: var(--radius-full);
  background: var(--charcoal); color: var(--offwhite); font-size: 0.8125rem;
  font-weight: 500; letter-spacing: 0.02em;
  transition: all 0.4s var(--ease-out);
}
.nav-cta:hover { transform: scale(1.04); box-shadow: 0 4px 20px rgba(18,18,18,0.15); }
@media (min-width: 1024px) { .nav-cta { display: block; } }
.dark-mode .nav-cta { background: var(--offwhite); color: var(--charcoal); }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; align-items: flex-end;
  justify-content: center; gap: 5px; width: 2.5rem; height: 2.5rem;
  z-index: 110; cursor: pointer;
}
@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger span {
  display: block; height: 1.5px; background: var(--charcoal); border-radius: 1px;
  transition: all 0.4s var(--ease-out); transform-origin: center;
}
.hamburger span:nth-child(1) { width: 24px; }
.hamburger span:nth-child(2) { width: 18px; }
.hamburger span:nth-child(3) { width: 24px; }
.hamburger:hover span:nth-child(2) { width: 24px; }
.dark-mode .hamburger span { background: var(--offwhite); }

/* Hamburger Active */
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.hamburger.active span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* ============================================
   MOBILE FULL-SCREEN MENU — ULTRA PREMIUM
   ============================================ */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 105;
  background: var(--offwhite);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

.mobile-overlay-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.mobile-overlay-bg .orb-1 {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: var(--accent); opacity: 0.06; filter: blur(80px);
  top: 10%; right: -20%; animation: orbFloat 8s ease-in-out infinite;
}
.mobile-overlay-bg .orb-2 {
  position: absolute; width: 250px; height: 250px; border-radius: 50%;
  background: var(--sand); opacity: 0.15; filter: blur(60px);
  bottom: 15%; left: -15%; animation: orbFloat 10s ease-in-out infinite 3s;
}

.mobile-menu-content {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; padding: 6rem 2rem 4rem;
}

.mobile-nav-item {
  overflow: hidden; border-bottom: 1px solid var(--border);
}
.mobile-nav-item:first-child { border-top: 1px solid var(--border); }

.mobile-nav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 0.5rem;
  font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; color: var(--charcoal);
  transform: translateY(100%); opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out), color 0.3s ease;
}
.mobile-overlay.open .mobile-nav-link {
  transform: translateY(0); opacity: 1;
}
.mobile-nav-item:nth-child(1) .mobile-nav-link { transition-delay: 0.08s; }
.mobile-nav-item:nth-child(2) .mobile-nav-link { transition-delay: 0.14s; }
.mobile-nav-item:nth-child(3) .mobile-nav-link { transition-delay: 0.20s; }
.mobile-nav-item:nth-child(4) .mobile-nav-link { transition-delay: 0.26s; }
.mobile-nav-item:nth-child(5) .mobile-nav-link { transition-delay: 0.32s; }
.mobile-nav-item:nth-child(6) .mobile-nav-link { transition-delay: 0.38s; }

.mobile-nav-link .label-en {
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted); opacity: 0.5;
}
.mobile-nav-link:active { color: var(--accent); }

.mobile-menu-footer {
  position: relative; z-index: 2;
  padding: 0 2rem 3rem;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out) 0.4s, transform 0.5s var(--ease-out) 0.4s;
}
.mobile-overlay.open .mobile-menu-footer { opacity: 1; transform: translateY(0); }

.mobile-menu-footer .info-row {
  display: flex; gap: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.mobile-menu-footer .info-item .label {
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); opacity: 0.5; margin-bottom: 0.375rem;
}
.mobile-menu-footer .info-item .value {
  font-size: 0.8125rem; font-weight: 300; color: var(--charcoal);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 2rem; border-radius: var(--radius-full);
  font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
  transition: all 0.4s var(--ease-out); cursor: pointer;
}
.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--charcoal); color: var(--offwhite); box-shadow: 0 4px 16px rgba(18,18,18,0.12); }
.btn-primary:hover { box-shadow: 0 8px 30px rgba(18,18,18,0.18); }
.btn-secondary { background: transparent; color: var(--charcoal); border: 1px solid rgba(18,18,18,0.12); }
.btn-secondary:hover { border-color: rgba(18,18,18,0.3); }
.btn-white { background: var(--offwhite); color: var(--charcoal); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.btn-ghost-white { background: transparent; color: var(--offwhite); border: 1px solid rgba(251,251,251,0.15); }
.btn-ghost-white:hover { border-color: rgba(251,251,251,0.35); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 500; color: var(--charcoal);
}
.link-arrow .arrow { transition: transform 0.3s var(--ease-out); }
.link-arrow:hover .arrow { transform: translateX(4px); }
.link-arrow .underline-bar { border-bottom: 1px solid rgba(18,18,18,0.25); padding-bottom: 2px; transition: border-color 0.3s ease; }
.link-arrow:hover .underline-bar { border-color: var(--charcoal); }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: #fff; border-radius: var(--radius-lg); padding: 2rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lg); }
@media (min-width: 768px) { .card { padding: 2.5rem; } }

.card-dark {
  background: var(--glass-dark); border: 1px solid var(--glass-border-dark);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border-radius: var(--radius-lg); padding: 2rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  position: relative; overflow: hidden;
}
.card-dark:hover { transform: translateY(-4px); box-shadow: 0 24px 64px rgba(0,0,0,0.15); }
@media (min-width: 768px) { .card-dark { padding: 2.5rem; } }

.card-glow::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(139,115,85,0.06), transparent 60%);
  opacity: 0; transition: opacity 0.6s ease;
}
.card-glow:hover::before { opacity: 1; }

/* ============================================
   BENTO GRID
   ============================================ */
.bento { display: grid; gap: 1rem; }
@media (min-width: 768px) { .bento { gap: 1.25rem; } }
.bento-2x2 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .bento-2x2 { grid-template-columns: repeat(3, 1fr); } }
.bento-span-2 { grid-column: span 1; }
@media (min-width: 768px) { .bento-span-2 { grid-column: span 2; } }
.bento-row-2 { grid-row: span 1; }
@media (min-width: 768px) { .bento-row-2 { grid-row: span 2; } }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.vis { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }
.reveal-up { transform: translateY(36px); }
.reveal-left { transform: translateX(-36px); }
.reveal-right { transform: translateX(36px); }
.reveal-scale { transform: scale(0.95); }
.reveal.vis.reveal-left, .reveal.vis.reveal-right { transform: translateX(0); }
.reveal.vis.reveal-scale { transform: scale(1); }

/* ============================================
   MARQUEE
   ============================================ */
.marquee-wrap { overflow: hidden; white-space: nowrap; }
.marquee-track {
  display: flex; animation: marquee 35s linear infinite;
}
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee-item {
  flex-shrink: 0; padding: 0 2rem;
  font-size: 0.8125rem; font-weight: 400; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(107,107,107,0.35);
}
@media (min-width: 768px) { .marquee-item { padding: 0 3rem; font-size: 0.875rem; } }

/* ============================================
   PAGE HERO (inner pages)
   ============================================ */
.page-hero {
  min-height: 60vh; display: flex; align-items: flex-end;
  padding-top: 8rem; padding-bottom: 5rem; position: relative;
}
@media (min-width: 768px) {
  .page-hero { min-height: 70vh; padding-top: 10rem; padding-bottom: 7rem; }
}

/* ============================================
   FOOTER
   ============================================ */
.footer { background: var(--charcoal); color: rgba(251,251,251,0.4); padding: 5rem 0; }
@media (min-width: 768px) { .footer { padding: 6rem 0; } }
.footer a { transition: color 0.3s ease; }
.footer a:hover { color: var(--offwhite); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 4rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 6rem; } }
.footer-heading { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(251,251,251,0.2); margin-bottom: 1.5rem; }
.footer-link { display: block; font-size: 0.875rem; font-weight: 300; padding: 0.25rem 0; }
.footer-bottom {
  padding-top: 2rem; border-top: 1px solid rgba(251,251,251,0.05);
  display: flex; flex-direction: column; gap: 1rem;
  align-items: center; text-align: center;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-bottom p { font-size: 0.75rem; font-weight: 300; }

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter { font-variant-numeric: tabular-nums; }

/* ============================================
   CUSTOM CURSOR (desktop)
   ============================================ */
@media (pointer: fine) {
  .cursor-dot {
    width: 8px; height: 8px; background: var(--accent); border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 9999;
    transition: transform 0.2s var(--ease-out);
    mix-blend-mode: difference;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.bg-charcoal { background: var(--charcoal); }
.bg-offwhite { background: var(--offwhite); }
.bg-warm { background: var(--warm); }
.bg-warm-subtle { background: rgba(245,243,239,0.4); }
.text-charcoal { color: var(--charcoal); }
.text-offwhite { color: var(--offwhite); }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.z-10 { position: relative; z-index: 10; }

/* Dot indicator */
.dot-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Separator */
.sep { height: 1px; background: var(--border); }

/* Grid pattern background */
.grid-bg {
  background-image:
    linear-gradient(rgba(18,18,18,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,18,18,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ============================================
   IMAGE SYSTEM
   ============================================ */
.img-cover {
  width: 100%; height: 100%; object-fit: cover;
}
.img-frame {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
}
.img-frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.img-frame:hover img { transform: scale(1.03); }
.img-frame-xl { border-radius: var(--radius-xl); }

/* Image overlay gradient */
.img-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(18,18,18,0.5) 0%, transparent 60%);
  pointer-events: none;
}
.img-overlay-full::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(18,18,18,0.35);
  pointer-events: none;
}

/* Photo gallery grid */
.photo-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
@media (min-width: 768px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.photo-grid .tall { grid-row: span 2; }
.photo-grid .wide { grid-column: span 2; }

/* Parallax image wrapper */
.parallax-img {
  overflow: hidden; position: relative;
}
.parallax-img img {
  width: 100%; height: 120%; object-fit: cover;
  position: absolute; top: -10%;
  transition: transform 0.1s linear;
}
