html {
  scroll-padding-top: calc(var(--header-h, 80px) + 16px);
}

[id] {
  scroll-margin-top: calc(var(--header-h, 80px) + 16px);
}

/* Keep real controls above decorative media and overlay layers. */
a[href],
button,
[role="button"],
summary {
  position: relative;
}

a[href],
button,
[role="button"] {
  z-index: 1;
}

a[href]::before,
a[href]::after,
button::before,
button::after,
[role="button"]::before,
[role="button"]::after {
  pointer-events: none;
}

.nav-service {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-service-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-service-link::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.nav-service:hover .nav-service-link::after,
.nav-service:focus-within .nav-service-link::after,
.nav-service.is-open .nav-service-link::after {
  transform: translateY(1px) rotate(225deg);
}

.service-dropdown {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  z-index: 40;
  width: 288px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 19, 26, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.site[data-theme="light"] .service-dropdown,
[data-theme="light"] .service-dropdown {
  background: rgba(255, 255, 255, 0.96);
}

.service-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}

.nav-service:hover .service-dropdown,
.nav-service:focus-within .service-dropdown,
.nav-service.is-open .service-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.service-dropdown a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  white-space: normal;
}

.service-dropdown a:hover,
.service-dropdown a:focus-visible {
  background: rgba(63, 182, 255, 0.13);
  color: var(--accent);
  outline: 0;
}

.service-dropdown .service-dropdown-all {
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 4px 4px;
  color: var(--ink);
}

@media (max-width: 1220px) {
  .nav.open .nav-service {
    display: block;
    border-bottom: 1px solid var(--line);
  }

  .nav.open .nav-service-link {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 17px 0;
    border-bottom: 0;
    font-size: 18px;
  }

  .nav.open .service-dropdown {
    position: static;
    display: none;
    width: 100%;
    padding: 0 0 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .nav.open .service-dropdown::before {
    display: none;
  }

  .nav.open .nav-service.mobile-open .service-dropdown {
    display: grid;
    gap: 4px;
  }

  .nav.open .service-dropdown a {
    min-height: 44px;
    padding: 12px 0 12px 16px;
    border-bottom: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    font-size: 15.5px;
    line-height: 1.45;
  }

  .nav.open .service-dropdown .service-dropdown-all {
    margin-bottom: 0;
    border-bottom: 0;
    color: var(--accent);
  }
}

.nav > .nav-voucher-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--card-radius, var(--radius, 8px));
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav > .nav-voucher-link:hover,
.nav > .nav-voucher-link:focus-visible,
.nav > .nav-voucher-link.active {
  border-color: rgba(63, 182, 255, 0.58);
  background: rgba(63, 182, 255, 0.12);
  color: var(--accent);
  outline: 0;
}

.site[data-theme="light"] .nav > .nav-voucher-link,
[data-theme="light"] .nav > .nav-voucher-link {
  background: rgba(10, 14, 20, 0.04);
}

.nav > .nav-dropdown-only {
  display: none;
}

.menu-button {
  display: inline-flex;
}

.header-project-link {
  flex: 0 0 auto;
}

body.nav-open {
  overflow: auto;
}

.header-actions {
  position: relative;
}

.header-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 19, 26, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.site[data-theme="light"] .header-dropdown-panel,
[data-theme="light"] .header-dropdown-panel {
  background: rgba(255, 255, 255, 0.96);
}

.header-dropdown-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.header-dropdown-panel:not(.is-open),
.header-dropdown-panel:not(.is-open) * {
  pointer-events: none;
}

.header-dropdown-panel:not(.is-open) .service-dropdown,
.header-dropdown-panel:not(.is-open) .service-dropdown * {
  visibility: hidden;
  pointer-events: none;
}

.header-dropdown-panel > a,
.header-dropdown-panel .nav-service-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  text-decoration: none;
  touch-action: manipulation;
  white-space: normal;
}

.header-dropdown-panel > a:hover,
.header-dropdown-panel > a:focus-visible,
.header-dropdown-panel .nav-service-link:hover,
.header-dropdown-panel .nav-service-link:focus-visible,
.header-dropdown-panel .service-dropdown a:hover,
.header-dropdown-panel .service-dropdown a:focus-visible {
  background: rgba(63, 182, 255, 0.13);
  color: var(--accent);
  outline: 0;
}

.header-dropdown-panel > a.active,
.header-dropdown-panel .nav-service.active > .nav-service-link {
  color: var(--accent);
}

.header-dropdown-panel .nav-service {
  display: grid;
  gap: 4px;
}

.header-dropdown-panel .nav-service-link::after {
  display: none;
}

.header-dropdown-panel .service-dropdown,
.header-dropdown-panel .nav-service:hover .service-dropdown,
.header-dropdown-panel .nav-service:focus-within .service-dropdown,
.header-dropdown-panel .nav-service.is-open .service-dropdown {
  position: static;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 4px 0 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.header-dropdown-panel .service-dropdown::before {
  display: none;
}

.header-dropdown-panel .service-dropdown a {
  min-height: 44px;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 800;
}

.header-dropdown-panel .service-dropdown .service-dropdown-all {
  margin-bottom: 0;
  border-bottom: 0;
  color: var(--ink-soft);
}

.nav.open {
  position: static;
  display: flex;
  justify-content: center;
  justify-self: center;
  align-items: center;
  gap: 26px;
  width: auto;
  max-height: none;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.nav.open > .nav-dropdown-only,
.nav.open > .nav-project-link {
  display: none;
}

.nav.open > a,
.nav.open > .nav-service > .nav-service-link {
  width: auto;
  padding: 0;
  border-bottom: 0;
  border-radius: 0;
  font-size: 14.5px;
}

.nav.open > .nav-service {
  border-bottom: 0;
}

.nav.open > .nav-service > .nav-service-link {
  border-bottom: 0;
}

.nav.open .service-dropdown {
  position: static;
  display: none;
  width: 100%;
  padding: 0 0 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.nav.open .service-dropdown::before {
  display: none;
}

.nav.open .nav-service.mobile-open .service-dropdown {
  display: grid;
  gap: 4px;
}

.nav.open .service-dropdown a {
  min-height: 44px;
  padding: 12px 0 12px 16px;
  border-bottom: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  font-size: 15.5px;
  line-height: 1.45;
}

.nav.open .service-dropdown .service-dropdown-all {
  margin-bottom: 0;
  border-bottom: 0;
  color: var(--accent);
}

.global-quick-cta {
  position: fixed;
  z-index: 70;
  pointer-events: none;
}

.global-quick-cta a,
.global-quick-cta button {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  border: 0;
  font-size: 13px;
  font-weight: 900;
  font-family: inherit;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
  pointer-events: auto;
  cursor: pointer;
}

.global-quick-cta a:focus-visible,
.global-quick-cta button:focus-visible {
  outline: 2px solid var(--accent, #3fb6ff);
  outline-offset: 3px;
}

.quick-cta-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.quick-cta-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.quick-cta-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-quick-cta-desktop {
  position: fixed;
  bottom: 28px;
  right: max(24px, calc((100vw - 1820px) / 2 + 24px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

body.nav-open .global-quick-cta-desktop,
body.service-dropdown-open .global-quick-cta-desktop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

.global-quick-cta-desktop a,
.global-quick-cta-desktop button {
  min-width: 56px;
  min-height: 56px;
  justify-content: flex-start;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.84);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.global-quick-cta-desktop .quick-cta-label {
  max-width: 126px;
}

.global-quick-cta-desktop .voucher .quick-cta-label {
  max-width: 168px;
}

.global-quick-cta-desktop a:hover,
.global-quick-cta-desktop a:focus-visible,
.global-quick-cta-desktop button:hover,
.global-quick-cta-desktop button:focus-visible {
  border-color: rgba(63, 182, 255, 0.58);
  background: rgba(63, 182, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.global-quick-cta a.primary,
.global-quick-cta button.primary {
  border-color: var(--accent, #3fb6ff);
  background: var(--accent, #3fb6ff);
  color: #06121c;
}

.global-quick-cta a.kakao {
  border-color: rgba(255, 219, 67, 0.58);
  background: rgba(57, 48, 13, 0.9);
  color: #ffe985;
}

.global-quick-cta button.top {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-desktop a,
.site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-desktop button {
  border-color: rgba(10, 14, 20, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #0a0e14;
  box-shadow: 0 14px 34px rgba(20, 30, 55, 0.14);
}

.site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-desktop a.primary {
  border-color: var(--accent, #3fb6ff);
  background: var(--accent, #3fb6ff);
  color: #06121c;
}

.site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-desktop a.kakao {
  border-color: rgba(180, 140, 0, 0.34);
  background: #ffe500;
  color: #2e2200;
}

.global-quick-cta-mobile {
  display: none;
}

@media (max-width: 767px) {
  body.has-global-quick-cta {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .global-quick-cta-desktop {
    display: none;
  }

  .global-quick-cta-mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 12, 18, 0.94);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
  }

  .global-quick-cta-mobile a {
    min-height: 48px;
    gap: 0;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 13px;
  }

  .global-quick-cta-mobile .quick-cta-icon {
    display: none;
  }

  .global-quick-cta-mobile a.phone {
    border-color: rgba(64, 211, 146, 0.5);
    color: #b7f7dc;
  }

  .global-quick-cta-mobile a.kakao {
    border-color: rgba(255, 219, 67, 0.58);
    color: #ffe985;
  }

  .site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-mobile {
    border-top-color: rgba(10, 14, 20, 0.12);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -16px 40px rgba(20, 30, 55, 0.14);
  }

  .site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-mobile a {
    border-color: rgba(10, 14, 20, 0.12);
    background: rgba(10, 14, 20, 0.04);
    color: #0a0e14;
  }

  .site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-mobile a.phone {
    border-color: rgba(31, 155, 94, 0.34);
    color: #14784a;
  }

  .site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-mobile a.kakao {
    border-color: rgba(180, 140, 0, 0.34);
    color: #7b6100;
  }

  .site[data-theme="light"] ~ .global-quick-cta .global-quick-cta-mobile a.primary {
    border-color: var(--accent, #3fb6ff);
    background: var(--accent, #3fb6ff);
    color: #06121c;
  }

  .header-dropdown-panel {
    top: calc(100% + 16px);
    width: min(310px, calc(100vw - 24px));
    max-height: calc(100vh - var(--header-h, 68px) - 92px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Align shared header controls with the landing page across subpages. */
.site-header .theme-toggle {
  width: 68px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.site[data-theme="light"] .site-header .theme-toggle,
[data-theme="light"] .site-header .theme-toggle {
  background: #eef2f6;
  border-color: rgba(10, 14, 20, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.site-header .theme-option {
  width: 30px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease, color 180ms ease;
}

.site[data-theme="light"] .site-header .theme-option.light,
.site[data-theme="dark"] .site-header .theme-option.dark,
[data-theme="light"] .site-header .theme-option.light,
[data-theme="dark"] .site-header .theme-option.dark {
  background: var(--accent);
  color: #06121c;
  box-shadow: 0 4px 14px rgba(63, 182, 255, 0.28);
}

.site-header .theme-option svg {
  width: 15px;
  height: 15px;
}

.site-header .icon-button,
.site-header .menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--card-radius, 24px);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.site-header .icon-button:hover,
.site-header .menu-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-header .youtube {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #ff0000;
  border-radius: 999px;
  background: #ff0000;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.32);
}

.site-header .youtube:hover {
  color: #ffffff;
  background: #df0000;
  border-color: #df0000;
}

@media (max-width: 720px) {
  :root {
    --header-h: 68px;
  }

  .site-header .wrap {
    width: min(100% - 32px, var(--max, 1240px));
  }

  .site-header .header-inner {
    gap: 12px;
  }

  .site-header .brand-group {
    gap: 8px;
    flex: 0 0 auto;
  }

  .site-header .brand,
  .site[data-theme="light"] .site-header .brand,
  [data-theme="light"] .site-header .brand {
    width: 134px;
    min-width: 0;
    height: 44px;
    padding: 4px 8px;
    border-radius: 10px;
    background: transparent;
  }

  .site-header .brand img {
    width: 118px;
    height: 38px;
    object-fit: contain;
  }

  .site-header .header-actions {
    gap: 8px;
    flex: 0 0 auto;
  }

  .site-header .theme-toggle {
    width: 62px;
    height: 32px;
    padding: 3px;
    gap: 2px;
    display: inline-flex;
    flex: 0 0 auto;
  }

  .site-header .theme-option {
    width: 27px;
    height: 24px;
  }

  .site-header .theme-option svg {
    width: 14px;
    height: 14px;
  }

  .site-header .youtube,
  .site-header .menu-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    flex: 0 0 auto;
  }

  .site-header .button-primary,
  .site-header .header-actions .button,
  .site-header .header-project-link {
    display: none;
  }
}
