/* ============================================================
   CELL:29 GLOBAL — COMMON STYLESHEET
   4개 페이지 공통 사용: index / products / restore-program / partnership
   수정 시 모든 페이지에 반영됩니다.
   ============================================================ */

/* ---------- 1. DESIGN TOKENS (디자인 토큰) ---------- */
:root {
  /* Color */
  --ink:        #0A1633;   /* 본문 텍스트 / 딥 네이비 */
  --ink-soft:   #5A6880;   /* 보조 텍스트 */
  --ink-faint:  #96A1B5;   /* 캡션 / 라벨 */
  --signal:     #1B47FF;   /* 브랜드 시그널 블루 (CTA, 강조) */
  --signal-dk:  #1236CC;   /* 시그널 블루 hover */
  --signal-lt:  #EBF0FF;   /* 시그널 블루 배경 틴트 */
  --paper:      #FFFFFF;   /* 기본 배경 */
  --mist:       #F4F7FB;   /* 섹션 교차 배경 */
  --line:       #E1E7F0;   /* 구분선 / 카드 테두리 */
  --line-dk:    #C9D3E2;   /* 진한 구분선 */

  /* Type */
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --gutter: 20px;          /* 모바일 좌우 여백 */
  --maxw: 1120px;          /* 데스크톱 최대 폭 */
  --bar-h: 64px;           /* 하단 고정 CTA 바 높이 */
  --header-h: 56px;        /* 상단 헤더 높이 */
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
    --bar-h: 72px;
    --header-h: 72px;
  }
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 하단 고정 CTA 바에 콘텐츠가 가리지 않도록 여백 확보 */
  padding-bottom: var(--bar-h);
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* 접근성: 키보드 포커스 표시 */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* 접근성: 모션 최소화 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. LAYOUT UTILITIES ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: 64px;
  padding-bottom: 64px;
}
@media (min-width: 768px) {
  .section { padding-top: 96px; padding-bottom: 96px; }
}

.section--mist { background: var(--mist); }

/* 섹션 상단 라벨 (예: SEC.03 / BRAND STORY) */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 섹션 제목 */
.section-title {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
@media (min-width: 768px) {
  .section-title { font-size: 40px; }
}

.section-lead {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 58ch;
}
@media (min-width: 768px) {
  .section-lead { font-size: 17px; }
}

/* ---------- 4. HEADER (전 페이지 공통) ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.hdr__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hdr__logo {
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hdr__logo sup {
  color: var(--signal);
  font-size: 11px;
  vertical-align: super;
}

.hdr__logomark {
  display: block;
  width: auto;
  height: 15px;
  transition: filter 0.25s ease;
}
@media (min-width: 900px) {
  .hdr__logomark { height: 17px; }
}

.hdr__nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hdr__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.hdr__link:hover { color: var(--ink); }
.hdr__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}

.hdr__cta {
  display: none;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  margin-left: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: 2px;
  background: var(--signal);
  color: #fff;
  border: 1px solid var(--signal);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
@media (min-width: 900px) {
  .hdr__cta { display: inline-flex; }
}
.hdr__cta:hover {
  background: #1338CC;
  border-color: #1338CC;
  color: #fff;
}

/* ---------- LANGUAGE SELECTOR ---------- */
.lang-menu {
  position: relative;
  font-family: var(--font-sans);
}

.lang-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border: 1px solid rgba(116, 134, 166, 0.3);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(244, 247, 251, 0.48));
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 4px 14px rgba(10, 24, 55, 0.07);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.lang-menu__trigger:hover {
  border-color: rgba(73, 96, 139, 0.46);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(238, 243, 250, 0.64));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    0 6px 18px rgba(10, 24, 55, 0.11);
  transform: translateY(-1px);
}
.lang-menu__trigger:focus-visible,
.lang-menu__option:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.lang-menu__flag {
  display: inline-flex;
  width: 28px;
  height: 19px;
  overflow: hidden;
  border: 1px solid rgba(10, 24, 55, 0.13);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.52),
    0 2px 5px rgba(10, 24, 55, 0.12);
}
.lang-menu__flag svg { display: block; width: 100%; height: 100%; }

.lang-menu__current {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.lang-menu__chevron {
  font-size: 13px;
  line-height: 1;
  transform: translateY(-1px);
}

.lang-menu--header { flex: 0 0 auto; }
.lang-menu--header .lang-menu__trigger {
  width: 46px;
  padding: 0;
}
.lang-menu--header .lang-menu__current,
.lang-menu--header .lang-menu__chevron { display: none; }

.lang-menu__panel {
  position: absolute;
  z-index: 90;
  right: 0;
  top: calc(100% + 8px);
  width: 174px;
  padding: 6px;
  border: 1px solid rgba(116, 134, 166, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 42px rgba(10, 24, 55, 0.17);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.lang-menu__panel[hidden] { display: none; }

.lang-menu__option {
  display: grid;
  grid-template-columns: 26px 1fr 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 2px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}
.lang-menu__option:hover { background: var(--mist); }
.lang-menu__check { color: var(--signal); font-weight: 700; }

.lang-menu--footer { margin-top: 14px; }
.lang-menu--footer .lang-menu__trigger {
  justify-content: flex-start;
  width: 172px;
  padding: 0 11px;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 6px 18px rgba(0, 0, 0, 0.12);
}
.lang-menu--footer .lang-menu__trigger:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
}
.lang-menu--footer .lang-menu__current { flex: 1; text-align: left; }
.lang-menu--footer .lang-menu__panel {
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
}

.hdr__label-mobile { display: none; }

@media (max-width: 767px) {
  .hdr__inner { position: relative; gap: 8px; padding-inline: 12px; }
  .hdr__logomark { height: 14px; }
  .hdr__nav { gap: 8px; margin-right: 36px; }
  .hdr__link { font-size: clamp(11px, 3vw, 13px); min-height: 40px; display: inline-flex; align-items: center; }
  .hdr__label-full { display: none; }
  .hdr__label-mobile { display: inline; }
  .lang-menu--header {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
  }
  .lang-menu--header .lang-menu__trigger,
  .lang-menu--header .lang-menu__trigger:hover {
    width: 28px;
    height: 19px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
  }
  .lang-menu--header .lang-menu__flag {
    border: 0;
    box-shadow: none;
  }
}

/* Very narrow phones keep all three links on a dedicated second row. */
@media (max-width: 359px) {
  :root { --header-h: 80px; }
  .hdr__inner { display: grid; grid-template-columns: 1fr; grid-template-rows: 36px 44px; gap: 0; }
  .hdr__logo { justify-self: start; }
  .hdr__nav { width: 100%; margin-right: 0; justify-content: space-between; }
  .hdr__link { font-size: 12px; }
  .lang-menu--header { top: 18px; }
}

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 26px;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--signal);
  color: #fff;
}
.btn--primary:hover { background: var(--signal-dk); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-dk);
}
.btn--ghost:hover { border-color: var(--ink); }

.btn--block { width: 100%; }

/* 텍스트 링크형 CTA (섹션 하단용) */
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--signal);
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.btn-text:hover { border-bottom-color: var(--signal); }
.btn-text .arw { transition: transform 0.15s ease; }
.btn-text:hover .arw { transform: translateX(3px); }

/* ---------- 6. STICKY BOTTOM CTA BAR (전 페이지 공통) ---------- */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: var(--bar-h);
  background: var(--paper);
  border-top: 1px solid var(--line);
  transition: transform 0.25s ease;
}
/* Partnership 페이지에서 폼이 화면에 보일 때 숨김 처리용 클래스 */
.cta-bar.is-hidden { transform: translateY(100%); }

.cta-bar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cta-bar__copy {
  display: none;
}
@media (min-width: 768px) {
  .cta-bar__copy {
    display: block;
    font-size: 14px;
    color: var(--ink-soft);
  }
  .cta-bar__copy strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 15px;
  }
}

.cta-bar .btn {
  flex: 1;
  height: 46px;
}
@media (min-width: 768px) {
  .cta-bar .btn { flex: 0 0 auto; height: 48px; }
}

/* ---------- 7. FOOTER (전 페이지 공통) ---------- */
.ftr {
  background: var(--ink);
  color: #fff;
  padding-top: 48px;
  padding-bottom: 40px;
}

.ftr__top {
  display: grid;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
@media (min-width: 768px) {
  .ftr__top {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
  }
}

.ftr__brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ftr__brand sup { color: #6E8DFF; font-size: 12px; vertical-align: super; }

.ftr__tag {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  max-width: 34ch;
}

.ftr__company {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.48);
}

.ftr__h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.ftr__list { list-style: none; display: grid; gap: 9px; }
.ftr__list a, .ftr__list li {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}
.ftr__list a:hover { color: #fff; }

.ftr__feedback-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 3px;
}
.ftr__feedback-link:hover,
.ftr__feedback-link:focus-visible { color: #fff; }

.ftr__bottom {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
}

/* ---------- Website feedback ---------- */
body.feedback-open { overflow: hidden; }
.feedback[hidden], .feedback-toast[hidden] { display: none; }
.feedback {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 20px;
}
.feedback__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 31, 0.68);
  backdrop-filter: blur(5px);
}
.feedback__panel {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 34px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}
.feedback__close {
  position: absolute;
  top: 15px;
  right: 17px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.feedback__eyebrow {
  margin-bottom: 10px;
  color: var(--blue, #1647d8);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.feedback__title { margin: 0 42px 10px 0; font-size: clamp(26px, 5vw, 36px); line-height: 1.12; }
.feedback__intro { margin: 0 0 25px; color: #667085; font-size: 15px; line-height: 1.6; }
.feedback__form { display: grid; gap: 17px; }
.feedback__field { display: grid; gap: 7px; }
.feedback__field label { color: #344054; font-size: 13px; font-weight: 600; }
.feedback__field input,
.feedback__field textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.feedback__field textarea { min-height: 130px; resize: vertical; }
.feedback__field input:focus,
.feedback__field textarea:focus { border-color: #1b47ff; box-shadow: 0 0 0 3px rgba(27, 71, 255, 0.12); }
.feedback__field [aria-invalid="true"] { border-color: #d92d20; }
.feedback__error { min-height: 16px; color: #d92d20; font-size: 12px; }
.feedback__status { margin: -3px 0 0; color: #b42318; font-size: 13px; line-height: 1.45; }
.feedback__submit {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  background: #0b3aa4;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.feedback__submit:hover { background: #082f87; }
.feedback__submit:disabled { cursor: wait; opacity: .62; }
.feedback__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.feedback-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10030;
  display: grid;
  gap: 4px;
  width: min(calc(100% - 32px), 420px);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: #0b3aa4;
  color: #fff;
  box-shadow: 0 16px 48px rgba(4, 27, 87, 0.28);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .25s, transform .25s;
}
.feedback-toast.is-visible { opacity: 1; transform: translateY(0); }
.feedback-toast strong { font-size: 15px; }
.feedback-toast span { color: rgba(255, 255, 255, .78); font-size: 13px; line-height: 1.45; }
@media (max-width: 600px) {
  .feedback { align-items: end; padding: 0; }
  .feedback__panel { width: 100%; max-height: 92vh; padding: 28px 20px 24px; border-radius: 20px 20px 0 0; }
  .feedback-toast { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .feedback-toast { transition: none; }
}

/* ---------- 8. 가로 스냅 캐러셀 (모바일) ---------- */
/* 제품 라인 등 카드 목록을 모바일에서 좌우 스와이프로 표시 */
.snap-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-left: calc(var(--gutter) * -1);
  margin-right: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.snap-row::-webkit-scrollbar { display: none; }
.snap-row > * { scroll-snap-align: start; }

@media (min-width: 768px) {
  .snap-row {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-columns: auto;
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    gap: 16px;
  }
}

/* Chinese: original heading typography, Noto CJK sans for reading.
   Latin product names and figures continue to use IBM Plex.
   Font files are subsetted and loaded by i18n.js only for Chinese pages. */
html:lang(zh) {
  --font-sans: 'IBM Plex Sans', 'CELL29 CN Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', 'CELL29 CN Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html:lang(zh) main :is(h1, h2) {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html:lang(zh) :is(input, select, textarea) { font-family: var(--font-sans); }
html:lang(zh) #cell29-cookie-banner { font-family: var(--font-sans); }

/* German compounds and translated related-product links must fit narrow cards. */
html:lang(de) .vip__role {
  hyphens: auto;
  overflow-wrap: anywhere;
}
html:lang(de) .pdx-rel__head,
html:lang(fr) .pdx-rel__head { flex-wrap: wrap; }
html:lang(de) .pdx-rel__all,
html:lang(fr) .pdx-rel__all {
  white-space: normal;
  overflow-wrap: anywhere;
}
