:root {
  --holala-viewport-width: 100vw;
  --holala-viewport-height: 100dvh;
  --holala-viewport-offset-top: 0px;
  --holala-viewport-offset-left: 0px;
}

.footer {
  width: 100%;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  color: #888;
  background: transparent;
  border-top: 1px solid rgba(74, 74, 74, 0.07);
  font-family: 'NanumSquare Neo', sans-serif;
  font-weight: 600;
  flex-shrink: 0;
}

body {
  --shell-max-width: var(--landing-shell-max-width, var(--page-max-width, 500px));
  --sidebar-base-width: min(50vw, calc(var(--shell-max-width) / 2));
  --viewport-zoom-design-width: 360px;
  --viewport-zoom-design-height: 700px;
  --viewport-zoom-floor: 0.82;
  --width-based-viewport-zoom: 1;
  --height-based-viewport-zoom: 1;
  --viewport-zoom: 1;
  --effective-viewport-zoom: 1;
  --holala-shell-min-height: var(--holala-viewport-height);
  --holala-viewport-shift-y: 0px;
}

body[data-viewport-zoom="compact"] {
  --width-based-viewport-zoom: min(1, calc(var(--holala-viewport-width) / var(--viewport-zoom-design-width)));
  --height-based-viewport-zoom: min(1, calc(var(--holala-viewport-height) / var(--viewport-zoom-design-height)));
  --viewport-zoom: clamp(
    var(--viewport-zoom-floor),
    min(var(--width-based-viewport-zoom), var(--height-based-viewport-zoom)),
    1
  );
  --effective-viewport-zoom: var(--viewport-zoom);
  --holala-shell-min-height: calc(
    var(--holala-viewport-height) / var(--effective-viewport-zoom)
  );
}

body.is-capturing {
  --effective-viewport-zoom: 1;
  --holala-shell-min-height: var(--holala-viewport-height);
}

body[data-viewport-zoom="off"] {
  --viewport-zoom: 1;
  --effective-viewport-zoom: 1;
  --holala-shell-min-height: var(--holala-viewport-height);
}

body .page-shell {
  min-height: var(--holala-shell-min-height) !important;
  margin-top: var(--holala-viewport-shift-y);
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  font-weight: inherit;
}

.legal-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0 8px;
  overflow: visible;
  line-height: 1.25;
  font-weight: 700;
}

.legal-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 4px;
}

.legal-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 6px 10px;
  border: none !important;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: inherit;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.legal-links-row a:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 10px;
  transform: translateY(-50%);
  background: rgba(128, 128, 128, 0.25);
}

.legal-links a:hover {
  color: #555;
  text-decoration: underline;
}

.legal-links a.pressed {
  opacity: 0.7;
  transform: scale(0.97);
}

.footer.is-simple .legal-links {
  display: none !important;
}

.footer.is-simple {
  padding: 16px;
}

.global-seo-nav {
  position: fixed;
  top: var(--holala-viewport-shift-y);
  left: 0;
  right: 0;
  z-index: 10000;
  width: 100%;
  max-width: min(100%, var(--shell-max-width));
  height: 48px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'NanumSquare Neo', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.global-seo-nav .nav-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-left: 5px;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.global-seo-nav .nav-logo:hover,
.global-seo-nav .nav-logo:active {
  opacity: 0.7;
}

.global-seo-nav .gnb-logo-img {
  display: block;
  width: auto;
  height: 32px;
  max-width: 150px;
}

.global-seo-nav .nav-hamburger {
  position: absolute;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.global-seo-nav .nav-hamburger .hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background-color: #333;
  transition: all 0.3s ease;
}

.sidebar-clip {
  position: fixed;
  top: var(--holala-viewport-shift-y);
  left: 0;
  right: 0;
  z-index: 10001;
  width: 100%;
  max-width: min(100%, var(--shell-max-width));
  height: var(--holala-viewport-height);
  margin: 0 auto;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-frame {
  position: fixed;
  top: var(--sidebar-top, 0px);
  right: var(--sidebar-right, 0px);
  bottom: var(--sidebar-bottom, 0px);
  left: var(--sidebar-left, 0px);
  z-index: 10001;
  clip-path: inset(0);
  contain: paint;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-frame.active {
  pointer-events: auto;
}

.nav-sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-base-width);
  max-width: var(--sidebar-base-width);
  height: auto;
  background: var(--sidebar-surface, #ffffff);
  box-shadow: 8px 0 24px var(--sidebar-shadow, rgba(0, 0, 0, 0.12));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.12s ease, visibility 0.12s ease;
}

.nav-sidebar.active {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header,
.sidebar-title {
  display: none;
}

.sidebar-links {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  padding: 18px 24px 72px;
  overflow-y: auto;
}

.sidebar-links a {
  display: block;
  padding: 14px 0;
  color: var(--sidebar-link-color, #444);
  font-family: 'NanumSquare Neo', sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  text-decoration: none;
  border-bottom: 1px solid var(--sidebar-divider, rgba(0, 0, 0, 0.06));
  transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-links a:last-child {
  border-bottom: none;
}

.sidebar-links a:hover,
.sidebar-links a:active,
.sidebar-links a.pressed {
  color: var(--sidebar-accent, #ff9f43);
  transform: translateX(4px);
}

.sidebar-close {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 42px;
  padding: 0;
  border: none;
  border-top: 1px solid var(--sidebar-divider, rgba(0, 0, 0, 0.06));
  border-radius: 0;
  background: var(--sidebar-close-bg, rgba(248, 248, 248, 0.96));
  color: var(--sidebar-close-color, rgba(17, 17, 17, 0.62));
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  z-index: 2;
}

.sidebar-close-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.5 5L8 12l6.5 7' stroke='black' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.5 5L8 12l6.5 7' stroke='black' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  transform: translateX(-1px);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.sidebar-frame .sidebar-overlay {
  position: absolute;
  z-index: 0;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.sidebar-open {
  width: 100%;
}

body::before {
  content: "";
  position: fixed;
  top: var(--holala-viewport-shift-y);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.sidebar-frame-open::before {
  opacity: 1;
  visibility: visible;
}

body.sidebar-frame-open .sidebar-frame .sidebar-overlay {
  background: transparent;
}

.dark-theme-mode .global-seo-nav {
  background: rgba(26, 26, 27, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.sidebar-frame-open .global-seo-nav {
  background: #ffffff !important;
  border-bottom-color: rgba(0, 0, 0, 0.05) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sidebar-frame-open.dark-theme-mode .global-seo-nav {
  background: #1a1a1b !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.dark-theme-mode .global-seo-nav .hamburger-line {
  background-color: rgba(255, 255, 255, 0.9);
}

.dark-theme-mode .global-seo-nav .gnb-logo-img {
  content: url('/shared/images/logo-gnb-dark.svg');
}

.dark-theme-mode .nav-sidebar {
  --sidebar-surface: #1a1a1b;
  --sidebar-shadow: rgba(0, 0, 0, 0.5);
  --sidebar-accent: rgba(255, 255, 255, 0.96);
}

.dark-theme-mode .sidebar-links a {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-theme-mode .sidebar-close {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(28, 28, 30, 0.96);
  color: rgba(255, 255, 255, 0.82);
}

.dark-theme-mode .footer {
  color: rgba(220, 220, 220, 0.68);
  background: linear-gradient(180deg, rgba(24, 24, 26, 0.96) 0%, rgba(18, 18, 20, 0.98) 100%);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.18);
}

.dark-theme-mode .footer p {
  color: rgba(215, 215, 215, 0.7);
}

.dark-theme-mode .legal-links a {
  color: rgba(232, 232, 232, 0.82);
}

.dark-theme-mode .legal-links-row a:not(:last-child)::after {
  background: rgba(255, 255, 255, 0.14);
}

.dark-theme-mode .legal-links a:hover {
  color: #f2f2f2;
}

@supports (zoom: 1) {
  body[data-viewport-zoom="compact"] .page-shell,
  body[data-viewport-zoom="compact"] .global-seo-nav,
  body[data-viewport-zoom="compact"] .sidebar-clip {
    zoom: var(--effective-viewport-zoom);
    width: var(--shell-max-width) !important;
    max-width: var(--shell-max-width) !important;
  }

  body[data-viewport-zoom="compact"] .nav-sidebar {
    zoom: var(--effective-viewport-zoom);
    width: var(--sidebar-base-width) !important;
    max-width: var(--sidebar-base-width) !important;
  }
}

@media (min-width: 481px) {
  .global-seo-nav {
    height: 52px;
  }

  .sidebar-clip {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* =========================================
   Global Loading States
   ========================================= */
.app-card.is-loading,
.story-card.is-loading,
.cta-btn.is-loading,
.btn-home.is-loading,
.secondary-btn.is-loading,
.tertiary-btn.is-loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.8;
  cursor: wait;
  transition: opacity 0.2s ease;
}

/* Button Text Hiding without Layout Shift */
.cta-btn.is-loading,
.btn-home.is-loading,
.secondary-btn.is-loading,
.tertiary-btn.is-loading {
  color: transparent !important;
}

/* Card Overlay Background */
.app-card.is-loading::before,
.story-card.is-loading::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: inherit;
  z-index: 9;
}

/* Base Spinner Animation */
.app-card.is-loading::after,
.story-card.is-loading::after,
.cta-btn.is-loading::after,
.btn-home.is-loading::after,
.secondary-btn.is-loading::after,
.tertiary-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.8s linear infinite;
  z-index: 10;
}

/* Colorful Spinner for Cards & Light Buttons */
.secondary-btn.is-loading::after,
.tertiary-btn.is-loading::after,
.app-card.is-loading::after,
.story-card.is-loading::after {
  border: 3px solid rgba(255, 77, 77, 0.2);
  border-top-color: #ff4d4d;
}

@keyframes button-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
