/* KBI renewal — main page v2 (blue, light). Builds on tokens.css + components.css. */

:root {
  --blue: #0170d6;          /* primary: buttons, eyebrow, active tab (white text on it 5.1:1) */
  --blue-strong: #0b5cad;   /* headline accent */
  --blue-hover: #005bb8;
  --blue-50: #eaf3fc;       /* tints: icon chips, panels */
  --navy: #0b1736;          /* titles */
  --text: #3d4a5c;          /* body */
  --muted: #6b7588;         /* dates, captions (4.6:1 on white) */
  --line: #e3e9f0;
  --bg: #ffffff;            /* page */
  --bg-footer: #f1f6fb;
  --radius-card: 14px;
  --shadow-card: 0 8px 24px rgba(16, 42, 84, .07);
  --grad-brand: linear-gradient(110deg, #5ec3f8 0%, #3f83ed 48%, #975ee5 100%);   /* sky → blue → violet, from the 'ON' reference */
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
.wrap { max-width: 1440px; margin: 0 auto; padding-inline: 16px; }   /* same box as .kbi-header__inner */
@media (min-width: 1024px) { .wrap { padding-inline: 40px; } }
.section { padding-block: 72px; }
@media (min-width: 1024px) { .section { padding-block: 110px; } }

/* ---------- shared bits ---------- */
.eyebrow { margin: 0 0 14px; font: 600 14px/1.4 var(--font-sans); letter-spacing: .08em; color: var(--blue); }
.eyebrow--ko { letter-spacing: 0; font-size: 16px; font-weight: 700; }
.sec-title { margin: 0; font: 600 28px/1.42 var(--font-sans); letter-spacing: -0.03em; color: var(--navy); word-break: keep-all; }
.sec-desc { margin: 18px 0 0; font: 400 16px/1.75 var(--font-sans); color: var(--text); }
@media (min-width: 1024px) { .sec-title { font-size: 30px; } }
@media (min-width: 1280px) { .sec-title { font-size: 32px; } }

.btn { display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--font-sans); white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s; }
.btn .ico { width: 20px; height: 20px; transition: transform .2s; }
.btn:hover .ico { transform: translateX(3px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); }
.btn--outline { background: #fff; color: var(--blue); border-color: var(--blue); margin-top: 32px; }
.btn--outline:hover { background: var(--blue); color: #fff; }
.btn--lg { height: 56px; padding: 0 30px; font-size: 16px; }

.circle-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--navy);
  box-shadow: 0 4px 14px rgba(16, 42, 84, .12); cursor: pointer; transition: background-color .2s, color .2s; }
.circle-btn svg { width: 18px; height: 18px; }
.circle-btn:hover { background: var(--blue); color: #fff; }

/* ---------- header (always solid white) ---------- */
.site-header { position: sticky; top: 0; background: #fff; border-bottom: 1px solid transparent; transition: box-shadow .3s; }
.site-header.is-scrolled { box-shadow: 0 4px 20px rgba(16, 42, 84, .08); }
.site-header .kbi-header__inner { max-width: 1440px; }
.site-header .kbi-header__logo img { height: 34px; width: auto; }
.header-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--navy); cursor: pointer; }
.header-icon:hover { background: var(--blue-50); color: var(--blue); }
.header-icon svg { width: 22px; height: 22px; }
.site-header .kbi-gnb > li > a { font-size: 16px; font-weight: 500; color: var(--navy); }
.site-header .kbi-gnb > li > a:hover { color: var(--blue); }
@media (min-width: 1024px) { .site-header .kbi-header__logo img { height: 38px; } }
/* desktop shows the full GNB, so the menu button is only for tablet/phone */
@media (min-width: 1024px) {
  .header-menu { display: none; }
  /* logo | centered GNB | empty column of the same width, so the menu sits in the true center */
  .site-header .kbi-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .site-header .kbi-header__actions { justify-self: end; }
}

/* mega menu, CSS only: hover/focus on any 1depth slides down every 2depth column */
@media (min-width: 1024px) {
  .site-header { --mega-h: 280px; --mega-dur: .4s; --mega-ease: cubic-bezier(.4, 0, .2, 1); }
  .kbi-gnb > li { width: 136px; }
  .kbi-gnb > li > a { justify-content: center; padding: 0 4px; white-space: nowrap; }
  .kbi-gnb::before, .kbi-gnb::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--mega-h); pointer-events: none; }
  /* white panel: scaleY from the top instead of clip-path. It is a plain white box, so scaling looks identical,
     and it avoids Chrome painting a fully collapsed clip (inset 100%) unclipped for one frame = a white blink at the end. */
  .kbi-gnb::after { z-index: -1; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 24px 40px rgba(16, 42, 84, .08);
    transform: scaleY(0); transform-origin: 50% 0; visibility: hidden;
    transition: transform var(--mega-dur) var(--mega-ease), visibility 0s linear var(--mega-dur); }
  .kbi-gnb__sub { top: 100%; left: 0; right: 0; transform: none; min-width: 0; min-height: var(--mega-h);
    padding: 22px 2px 28px; text-align: center; background: transparent; border: 0; border-radius: 0; box-shadow: none;
    clip-path: inset(0 0 100% 0); opacity: 0; visibility: hidden;
    transition: clip-path var(--mega-dur) var(--mega-ease), opacity var(--mega-dur) var(--mega-ease), visibility 0s linear var(--mega-dur); }
  .kbi-gnb__sub a { padding: 7px 4px; white-space: normal; word-break: keep-all; font-size: 15px; color: var(--muted); }
  .kbi-gnb__sub a:hover { background: transparent; color: var(--blue); }
  .kbi-gnb:is(:hover, :focus-within)::before { pointer-events: auto; }
  .kbi-gnb:is(:hover, :focus-within)::after { transform: scaleY(1); visibility: visible; transition: transform var(--mega-dur) var(--mega-ease), visibility 0s; }
  .kbi-gnb:is(:hover, :focus-within) .kbi-gnb__sub { clip-path: inset(0 0 0 0); opacity: 1; visibility: visible;
    transition: clip-path var(--mega-dur) var(--mega-ease), opacity var(--mega-dur) var(--mega-ease), visibility 0s; }
  .site-header:has(.kbi-gnb:hover) { box-shadow: none; }
}
@media (min-width: 1280px) { .kbi-gnb > li { width: 168px; } }
@media (prefers-reduced-motion: reduce) { .kbi-gnb::after, .kbi-gnb__sub { transition: none !important; } }

/* drawer (full menu) */
.drawer { position: fixed; inset: 0; z-index: 60; background: #fff; padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 32px; overflow-y: auto; }
.drawer__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.drawer__top img { height: 30px; width: auto; }
.drawer__group { border-top: 1px solid var(--line); padding-block: 16px; }
.drawer__group h2 { margin: 0 0 8px; font: 700 17px/1.4 var(--font-sans); color: var(--navy); }
.drawer__group ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.drawer__group a { display: block; padding: 8px 0; font: 400 15px/1.4 var(--font-sans); color: var(--muted); }

/* ---------- hero ---------- */
.hero__frame { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 560px; background: #e9f1f8; }
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.9) 45%, rgba(255,255,255,.35) 100%); }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; transform: scale(1); }
.hero__slide.is-active { opacity: 1; }
.hero__slide.is-active img, .hero__slide.is-leaving img { transform: scale(1.08); transition: transform 8s linear; }
.hero__slide.no-fade { transition: none; }
.hero__content { position: relative; width: 100%; padding-block: 56px; }
.hero h1 { margin: 0; font: 400 36px/1.3 var(--font-sans); letter-spacing: -0.035em; color: var(--navy); word-break: keep-all; }
.hero h1 strong { font-weight: 700; color: var(--blue-strong);
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero__lead { margin: 22px 0 34px; font: 400 17px/1.7 var(--font-sans); color: #2b3646; }
.hero__pager { display: flex; align-items: center; gap: 10px; margin-top: 44px; }
.hero__count { min-width: 60px; font: 400 14px/1 var(--font-sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.hero__count b { font-weight: 700; color: var(--navy); }
.hero__bar { position: relative; width: 48px; height: 2px; margin-right: 8px; background: rgba(11,23,54,.15); overflow: hidden; }
.hero__bar i { position: absolute; inset: 0; background: var(--navy); transform: scaleX(0); transform-origin: left; }
.hero__bar i.is-running { transform: scaleX(1); transition: transform var(--hero-interval, 6s) linear; }
@media (min-width: 768px) { .hero h1 { font-size: 46px; } }
@media (min-width: 1024px) {
  .hero__frame { min-height: 600px; }
  .hero__bg::after { background: linear-gradient(90deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 28%, rgba(255,255,255,.35) 48%, rgba(255,255,255,0) 62%); }
  .hero__slide img { object-position: 100% 50%; }
  .hero h1 { font-size: 54px; line-height: 1.28; }
  .hero__lead { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .hero__slide, .hero__slide img { transition: none !important; transform: none !important; } }

/* ---------- news & notice ---------- */
.news__grid { display: grid; gap: 48px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; position: relative; padding: 12px 18px 16px; border: 0; background: transparent; font: 500 16px/1 var(--font-sans); color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--navy); }
.tab[aria-selected="true"] { color: var(--blue); font-weight: 700; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue); }
.post-list { margin: 0; padding: 0; list-style: none; }
.post-list a { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 4px; border-bottom: 1px solid var(--line);
  font: 400 16px/1.5 var(--font-sans); color: var(--navy); }
.post-list a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list a:hover span { color: var(--blue); }
.post-list time { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-list__empty { padding: 60px 0; text-align: center; color: var(--muted); border-bottom: 1px solid var(--line); }
.feature-card { position: relative; display: block; min-height: 260px; border-radius: 18px; overflow: hidden; color: #fff; }
.feature-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,32,76,.05) 20%, rgba(8,32,76,.72) 100%); }
.feature-card:hover img { transform: scale(1.05); }
.feature-card__body { position: absolute; left: 24px; right: 24px; bottom: 24px; z-index: 1; display: grid; gap: 8px; justify-items: start; }
.feature-card__body strong { font: 600 24px/1.3 var(--font-sans); letter-spacing: -0.02em; }
.feature-card__body > span:not(.circle-btn) { font: 400 15px/1.5 var(--font-sans); color: rgba(255,255,255,.88); }
.circle-btn--light { width: 36px; height: 36px; margin-top: 8px; color: var(--blue); box-shadow: none; }
@media (min-width: 1024px) {
  .news__grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr) minmax(0, .7fr); gap: 56px; align-items: stretch; }
  .feature-card { min-height: 300px; }
}

/* ---------- about ---------- */
.news { border-top: 1px solid var(--line); }   /* divider between the two text-led sections */
.about__grid { display: grid; gap: 40px; }
.svc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.svc-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden;
  transition: box-shadow .25s, transform .25s; }
.svc-card:hover { box-shadow: var(--shadow-card); transform: translateY(-4px); }
.svc-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.svc-card__body { position: relative; flex: 1; display: grid; align-content: start; justify-items: start; gap: 10px; padding: 20px 20px 56px; }
.svc-card__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--blue); color: var(--blue); margin-bottom: 6px; }
.svc-card__icon svg { width: 20px; height: 20px; }
.svc-card__body strong { font: 700 20px/1.35 var(--font-sans); letter-spacing: -0.02em; color: var(--navy); }
.svc-card__body > span:not(.svc-card__icon):not(.svc-card__go) { font: 400 14px/1.6 var(--font-sans); color: var(--muted); }
.svc-card__go { position: absolute; right: 18px; bottom: 18px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue); transition: background-color .2s, color .2s; }
.svc-card__go svg { width: 16px; height: 16px; }
.svc-card:hover .svc-card__go { background: var(--blue); color: #fff; }
@media (min-width: 1024px) {
  .about__grid { grid-template-columns: minmax(360px, 1fr) minmax(0, 2.4fr); gap: 48px; align-items: start; }
  .svc-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- promise ---------- */
.promise-wrap { padding-bottom: 72px; }
.promise { display: grid; overflow: hidden; border-radius: 28px; background: linear-gradient(120deg, #eef5fc 0%, #f6faff 60%, #eaf2fb 100%); }
.promise__text { padding: 48px 28px 36px; }
.promise__media img { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
@media (min-width: 1024px) {
  .promise-wrap { padding-bottom: 96px; }
  .promise { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); min-height: 360px; }
  .promise__text { padding: 56px 20px 56px 56px; align-self: center; }
  .promise__media { clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
}

/* ---------- related organizations: logo mark + name as real text, endless slow marquee ---------- */
.orgs { padding-bottom: 72px; }
.orgs__title { margin: 0 0 24px; font: 700 18px/1.4 var(--font-sans); color: var(--navy); }
.orgs__viewport { overflow: hidden; border-block: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
/* JS duplicates the list once; the track moves exactly one copy (-50%) so the loop has no seam */
.orgs__track { display: flex; width: max-content; margin: 0; padding: 0; list-style: none; animation: orgs-scroll 48s linear infinite; }
@keyframes orgs-scroll { to { transform: translateX(-50%); } }
.org { flex: none; display: flex; align-items: center; gap: 12px; height: 84px; padding: 0 44px; position: relative; }
.org + .org::before, .org:first-child::before { content: ""; position: absolute; left: 0; top: 50%; height: 26px; margin-top: -13px; border-left: 1px solid var(--line); }
.org img { height: 30px; width: auto; display: block; }
.org span { font: 600 16px/1.3 var(--font-sans); letter-spacing: -0.02em; color: var(--navy); white-space: nowrap; }
.org small { margin-left: 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
@media (min-width: 1024px) { .orgs { padding-bottom: 96px; } .org { height: 96px; padding: 0 56px; } .org img { height: 34px; } .org span { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .orgs__track { animation: none; } }

/* ---------- footer: logo navy ground, light text (white 10.6:1, muted #c3cbe0 7.3:1 on #233d7f) ---------- */
.site-footer { --f-bg: #233d7f; --f-text: #c3cbe0; --f-strong: #ffffff; --f-line: rgba(255, 255, 255, .16);
  background: var(--f-bg); color: var(--f-text); }
.site-footer__inner { display: grid; gap: 24px; padding-block: 40px; }
.site-footer__logo { height: 32px; width: auto; }
.site-footer__info { font: 400 14px/1.9 var(--font-sans); color: var(--f-text); }
.site-footer__info p { margin: 0; }
.site-footer__info i { display: inline-block; width: 1px; height: 11px; margin: 0 12px; background: var(--f-line); vertical-align: middle; }
.site-footer__side { display: grid; gap: 14px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 0; padding: 0; list-style: none; font: 400 14px/1 var(--font-sans); }
.site-footer__links li + li::before { content: ""; display: inline-block; width: 1px; height: 11px; margin: 0 14px; background: var(--f-line); vertical-align: middle; }
.site-footer__links a { color: var(--f-text); }
.site-footer__links a:hover { color: var(--f-strong); }
.site-footer__links b { color: var(--f-strong); font-weight: 600; }
.site-footer__sns { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; --sns-glyph: var(--f-bg); }
.site-footer__sns a { display: grid; place-items: center; width: 28px; height: 28px; color: var(--f-text); }
.site-footer__sns a:hover { color: var(--f-strong); }
.site-footer__sns svg { width: 24px; height: 24px; }
.site-footer__copy { margin: 0; font: 400 13px/1 var(--font-sans); color: var(--f-text); }
.site-footer :focus-visible { outline-color: var(--f-strong); }
@media (min-width: 1024px) {
  .site-footer__inner { grid-template-columns: auto 1fr auto; align-items: start; gap: 40px; padding-block: 48px; }
  .site-footer__info { padding-left: 40px; border-left: 1px solid var(--f-line); }
  .site-footer__side { justify-items: end; }
}

.kbi :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* grid children must be allowed to shrink, or nowrap rows (post titles) push the page wider than the phone */
.news__grid > *, .about__grid > *, .promise > * { min-width: 0; }
@media (max-width: 1023px) { .news__grid, .about__grid, .promise { grid-template-columns: minmax(0, 1fr); } }

/* hero CTA in the brand gradient; hover slides the gradient toward violet */
.hero .btn--primary { background: var(--grad-brand); background-size: 160% 100%; background-position: 0% 50%;
  box-shadow: 0 8px 20px rgba(63, 131, 237, .28); transition: background-position .45s ease, box-shadow .3s; }
.hero .btn--primary:hover { background-position: 100% 50%; box-shadow: 0 10px 24px rgba(151, 94, 229, .3); }
