:root {
  --color-navy: #0b1730;
  --color-navy-2: #162445;
  --color-gold: #d4a967;
  --color-gold-2: #b8934d;
  --color-ink: #111827;
  --color-ink-dim: #4b5563;
  --color-bg: #fdfbf7;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
  --border: #e5e7eb;

  /* Typography tokens - refined */
  --font-body: "Pretendard Variable", Pretendard, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-heading: "Noto Serif KR", Georgia, serif;
  --font-display: "Noto Serif KR", Georgia, serif;
  --measure: 68ch; /* optimal reading width */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 900;

  /* Header sizing defaults (fallback when page CSS fails to load) */
  --header-h: 112px;
  --topbar-h: 36px;
  --cta-bar-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Ensure anchor jumps land below fixed header */
html { scroll-padding-top: calc(var(--header-h, 112px) + 16px); }

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.75;
  letter-spacing: 0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* Fixed header safety: keep content visible even if page CSS is missing */
  padding-top: var(--header-h, 112px);
  padding-bottom: calc(var(--cta-bar-h, 0px) + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 992px){
  :root{ --header-h: 104px; --topbar-h: 34px; }
}

@media (max-width: 640px){
  :root{ --header-h: 96px; --topbar-h: 30px; }
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-ink);
}

h1 { 
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

h2 { 
  font-size: clamp(26px, 4vw, 42px); 
  font-weight: 800;
  letter-spacing: -0.02em;
}

h3 { 
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 700;
}

p { margin: 0 0 1em; color: var(--color-ink); }

/* Improve longform readability */
.seoBody__inner p { max-width: var(--measure); text-wrap: pretty; }
.seoBody__inner li { max-width: var(--measure); }

small, .text-dim { color: var(--color-ink-dim); }

a { color: var(--color-navy); text-decoration: none; }
 a:hover { color: var(--color-navy-2); text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea {
  font: inherit;
}

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-navy-2);
  box-shadow: 0 0 0 3px rgba(11, 23, 48, 0.08);
}

label { display: block; margin: 0 0 6px; font-weight: 600; }

.btn, .button, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--color-navy);
  color: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn:hover, .button:hover, button[type="submit"]:hover { background: var(--color-navy-2); }
.btn:active, .button:active, button[type="submit"]:active { transform: translateY(1px); }

.btn--gold { background: var(--color-gold); }
.btn--gold:hover { background: var(--color-gold-2); }

.container, .ks-container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section { margin: 36px 0; }
.section__title { margin-bottom: 12px; }

hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* Accessible focus visible */
:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(212, 169, 103, .55);
  outline-offset: 2px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Header + Topbar layout safety patch
   - Prevents header breakage on templates whose page CSS
     assumes header-inner is 100% of header height.
   - Uses per-page variables: --header-h, --topbar-h.
========================================================= */

#header.site-header.ksHeader{
  display: flex !important;
  flex-direction: column !important;
  height: var(--header-h, 112px) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 12px 34px rgba(2, 6, 23, 0.10) !important;
}

#header.site-header.ksHeader.is-scrolled,
#header.site-header.ksHeader.scrolled,
#header.site-header.ksHeader.scroll{
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.14) !important;
}

#header.site-header.ksHeader .topbar{
  flex: 0 0 var(--topbar-h, 0px) !important;
  height: var(--topbar-h, 0px) !important;
  display: flex !important;
  align-items: center !important;
  background: rgba(11, 19, 34, 0.92) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

#header.site-header.ksHeader .topbar__inner{
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 750;
  font-size: 13px;
  letter-spacing: -0.01em;
}

#header.site-header.ksHeader .topbar__meta{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#header.site-header.ksHeader .topbar__tel{
  color: rgba(212, 169, 103, 0.95);
  font-weight: 900;
  text-decoration: none;
}

#header.site-header.ksHeader .topbar__tel:hover{
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
}

@media (max-width: 992px){
  #header.site-header.ksHeader .topbar__inner{ padding: 0 16px; font-size: 12px; }
}

@media (max-width: 640px){
  #header.site-header.ksHeader .topbar__inner{ gap: 10px; }
  #header.site-header.ksHeader .topbar__meta{ gap: 10px; }
}

#header.site-header.ksHeader .header-inner{
  flex: 1 1 auto !important;
  height: calc(var(--header-h, 112px) - var(--topbar-h, 0px)) !important;
}
