/* KBGMA Design Tokens — Editorial Trust */

:root {
  /* Navy scale (brand: #0B2545) */
  --navy-50: #F0F4FA;
  --navy-100: #DDE5F0;
  --navy-200: #BBC9DF;
  --navy-300: #8DA1C2;
  --navy-400: #5C7AA1;
  --navy-500: #3D5C87;
  --navy-600: #294670;
  --navy-700: #1B345A;
  --navy-800: #122448;
  --navy-900: #0B2545;
  --navy-950: #061429;

  /* Gold scale (accent: #B7842A) */
  --gold-50: #FBF7EE;
  --gold-100: #F5EBD2;
  --gold-200: #EBD49E;
  --gold-300: #DEB670;
  --gold-400: #CC9A48;
  --gold-500: #B7842A;
  --gold-600: #9A6E22;
  --gold-700: #7B561D;
  --gold-800: #604319;
  --gold-900: #4A3414;
  --gold-950: #2A1D0A;

  /* Neutrals */
  --paper: #F7F8FA;
  --surface: #FFFFFF;
  --ink: #14171F;
  --muted: #6B7280;
  --line: #E1E6EE;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background:
    linear-gradient(180deg, #FFFFFF 0%, var(--paper) 42%, #FFFFFF 100%);
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
  letter-spacing: 0;
  font-size: 16px;
  line-height: 1.7;
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width: 1024px) { body { font-size: 17px; } }

.bg-paper { background-color: var(--paper) !important; }
.bg-paper\/85 { background-color: rgba(247,248,250,.88) !important; }
.bg-paper\/40 { background-color: rgba(247,248,250,.55) !important; }
.border-line { border-color: var(--line) !important; }
.bg-line { background-color: var(--line) !important; }
.hover\:bg-paper:hover { background-color: var(--paper) !important; }

.font-serif { font-family: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif; letter-spacing: -0.02em; }
.font-display { font-family: 'Cormorant Garamond', 'Noto Serif KR', Georgia, serif; letter-spacing: 0; }

/* Selection */
::selection { background: var(--navy-900); color: var(--gold-300); }

/* Hairline */
.hairline { border-top: 1px solid var(--line); }

/* Decorative gold rule */
.gold-rule { width: 48px; height: 1.5px; background: var(--gold-500); display: inline-block; }

/* Hover under-line for nav links */
.nav-link {
  position: relative;
  transition: color .25s ease;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1px; background: var(--gold-500);
  transition: width .35s ease;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { width: 100%; }
.nav-link[aria-current="page"] { color: var(--navy-900); }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem;
  background: var(--navy-900); color: #fff;
  font-weight: 600; font-size: .94rem;
  border: 1px solid var(--navy-900);
  border-radius: 4px;
  min-height: 46px;
  transition: all .25s ease;
}
.btn-primary:hover { background: var(--navy-950); transform: translateY(-1px); box-shadow: 0 14px 30px -14px rgba(11,37,69,.5); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem;
  background: transparent; color: var(--navy-900);
  font-weight: 600; font-size: .94rem;
  border: 1px solid var(--navy-200);
  border-radius: 4px;
  min-height: 46px;
  transition: all .25s ease;
}
.btn-ghost:hover { border-color: var(--navy-900); background: #fff; }

.btn-gold {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem;
  background: transparent; color: var(--gold-700);
  font-weight: 600; font-size: .94rem;
  border-bottom: 1.5px solid var(--gold-500);
  transition: all .25s ease;
}
.btn-gold:hover { color: var(--gold-900); }
.btn-gold:hover svg { transform: translateX(4px); }
.btn-gold svg { transition: transform .25s ease; }

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(11,37,69,.04);
  transition: border-color .25s ease, transform .35s ease, box-shadow .35s ease;
}
.card:hover { border-color: var(--navy-300); transform: translateY(-2px); box-shadow: 0 18px 40px -32px rgba(11,37,69,.55); }

/* Section eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-700);
}
.eyebrow::before {
  content: ''; width: 24px; height: 1px; background: var(--gold-500);
}

/* Headings */
h1.display, h2.display {
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.16;
  color: var(--navy-950);
  word-break: keep-all;
}

header.sticky {
  box-shadow: 0 1px 0 rgba(11,37,69,.04), 0 12px 32px -28px rgba(11,37,69,.5);
}

header.sticky > div:first-child { height: 72px; }

header.sticky img {
  filter: drop-shadow(0 6px 10px rgba(11,37,69,.08));
}

header button[aria-label="메뉴 열기"] {
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 4px;
}

header button[aria-label="메뉴 열기"]:hover {
  background: rgba(11,37,69,.06);
}

.hero-section {
  background:
    linear-gradient(90deg, rgba(247,248,250,.95) 0%, rgba(247,248,250,.58) 48%, rgba(255,255,255,0) 100%),
    linear-gradient(180deg, #fff 0%, var(--paper) 100%);
}

.hero-copy .display {
  max-width: 820px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 720px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 2rem 0 2.4rem;
}

.proof-item {
  background: rgba(255,255,255,.92);
  padding: 1rem 1.1rem;
}

.proof-item strong {
  display: block;
  color: var(--navy-950);
  font-size: .95rem;
  line-height: 1.35;
}

.proof-item span {
  display: block;
  margin-top: .35rem;
  color: var(--navy-500);
  font-size: .78rem;
  line-height: 1.45;
}

/* Korean word-break for body text — avoids splitting words mid-character */
p, .font-serif, h3, h4, li, td, th {
  word-break: keep-all;
  overflow-wrap: break-word;
}

section div,
section a {
  overflow-wrap: break-word;
}

/* Hero placeholder image */
.hero-image-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(150deg, rgba(6,20,41,.98) 0%, rgba(11,37,69,.92) 58%, rgba(27,52,90,.88) 100%),
    url('/assets/logo-emblem-transparent.png') 50% 47% / 56% auto no-repeat,
    var(--navy-900);
  border-radius: 6px;
  box-shadow: 0 30px 70px -48px rgba(6,20,41,.9);
  overflow: hidden;
}
.hero-image-frame::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: .5;
}

.hero-image-frame::before {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(222,182,112,.18);
  pointer-events: none;
}

.image-placeholder {
  position: relative;
  background: var(--navy-50);
  border: 1px dashed var(--navy-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy-400);
  font-size: .8rem; letter-spacing: .04em;
}
.image-placeholder::before {
  content: ''; position: absolute; inset: 12px;
  border: 1px solid var(--navy-200);
}

/* FAQ details */
details.faq {
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
}
details.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem;
  font-weight: 600; color: var(--navy-900); font-size: 1.05rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+'; font-size: 1.5rem; font-weight: 300; color: var(--gold-500);
  flex: 0 0 auto;
  transition: transform .3s ease;
}
details.faq[open] summary::after { content: '−'; }
details.faq p { margin-top: 1rem; color: var(--muted); line-height: 1.75; }

/* Number marker */
.num-marker {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.5rem; font-weight: 500;
  color: var(--gold-500); line-height: 1;
}

/* Service icon container */
.service-icon {
  width: 48px; height: 48px;
  border: 1px solid var(--gold-300);
  border-radius: 6px;
  background: var(--gold-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-700);
}

/* Mobile menu */
#mobile-menu { display: none; }
#mobile-menu.open { display: block; box-shadow: 0 18px 38px -34px rgba(11,37,69,.7); }

/* Subtle entrance */
@keyframes fadeUp { from { opacity: .92; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .8s ease both; }
.fade-up-delay-1 { animation: fadeUp .8s ease .15s both; }
.fade-up-delay-2 { animation: fadeUp .8s ease .3s both; }
.fade-up-delay-3 { animation: fadeUp .8s ease .45s both; }

/* Footer */
footer { background: var(--navy-950); color: var(--navy-200); }
footer a:hover { color: var(--gold-300); }

.trust-metric {
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
}

.section-kicker-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.35rem 1.5rem;
}

table {
  border-radius: 6px;
  overflow: hidden;
}

section .grid.gap-px {
  border-radius: 6px;
  overflow: hidden;
}

section[id^="s"] {
  scroll-margin-top: 92px;
}

iframe {
  background: var(--paper);
}

/* Responsive type */
@media (max-width: 640px) {
  * { min-width: 0; }
  h1.display { font-size: 2.5rem !important; }
  h2.display { font-size: 2rem !important; }
  body { font-size: 15px; }
  header.sticky > div:first-child { height: 66px; }
  header a,
  header button,
  section,
  section > div,
  section .grid,
  .card,
  .hero-image-frame {
    max-width: 100%;
  }
  .proof-grid { grid-template-columns: 1fr; margin: 1.6rem 0 2rem; }
  .btn-primary, .btn-ghost, .btn-gold { width: 100%; justify-content: center; }
  .hero-image-frame { aspect-ratio: 4 / 5 !important; }
  .eyebrow { letter-spacing: .12em; }
  .whitespace-nowrap { white-space: normal !important; }
  p,
  li,
  section div,
  section a,
  .font-serif {
    word-break: normal !important;
    overflow-wrap: anywhere;
  }
  section.py-24 { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  section.pt-20 { padding-top: 4.5rem; }
  section.pb-16 { padding-bottom: 4.5rem; }
  .p-10 { padding: 1.5rem; }
  .p-8 { padding: 1.35rem; }
  .min-h-\[420px\] { min-height: 280px !important; }
  .text-\[11px\] { font-size: 10px; }
  details.faq summary { align-items: flex-start; font-size: 1rem; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .trust-metric { padding: 1rem; }
  .hero-copy .text-lg,
  section .text-lg,
  section .text-xl {
    line-height: 1.75 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .fade-up-delay-1,
  .fade-up-delay-2,
  .fade-up-delay-3 {
    animation: none;
  }
}

/* Larger hero / section type on wide screens */
@media (min-width: 1280px) {
  h1.display { font-size: 5rem; line-height: 1.12; }
  h2.display { font-size: 3.5rem; line-height: 1.15; }
}
@media (min-width: 1600px) {
  h1.display { font-size: 6rem; }
  h2.display { font-size: 4rem; }
}

.eyebrow { font-size: .78rem !important; }
.btn-primary, .btn-ghost, .btn-gold { font-size: .95rem !important; padding: .9rem 1.35rem !important; }

@media (min-width: 1024px) {
  .btn-primary, .btn-ghost, .btn-gold { padding: .95rem 1.55rem !important; }
}
