/* ==========================================================================
   바이오플랜 (BIOPLAN) — 서브페이지 공통 스타일
   --------------------------------------------------------------------------
   • 디자인 토큰 (변수)
   • 글로벌 리셋 + 타이포그래피
   • 공통 헤더 (메가메뉴)
   • 모바일 메뉴 (햄버거 슬라이드)
   • 공통 푸터
   • 스크롤 리빌 (.reveal)
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Color */
  --color-bg:           #ffffff;
  --color-text:         #111418;
  --color-text-soft:    #5b6470;
  --color-text-mute:    #9aa3ad;
  --color-line:         #e8ebee;
  --color-line-soft:    #f1f3f5;
  --color-accent:       #005a36;   /* Primary green */
  --color-accent-deep:  #145a29;
  --color-accent-soft:  #f3f9f5;
  --color-hover-bg:     #fafbfa;

  /* Size */
  --header-h:           84px;
  --container-w:        1440px;
  --content-w:          1100px;

  /* Motion */
  --ease:               cubic-bezier(0.22, 1, 0.36, 1);

  /* Shadow */
  --shadow-mega:        0 24px 60px -20px rgba(15, 30, 20, 0.18),
                        0 8px 20px -10px rgba(15, 30, 20, 0.08);

  /* Font */
  --font-kr: 'NanumSquareNeo', "Pretendard Variable", Pretendard,
             -apple-system, system-ui, sans-serif;
  --font-en: 'NanumSquareNeo', "Inter", var(--font-kr);
}


/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */
* { box-sizing: border-box; }

html, body {
  font-family: var(--font-kr);
  color: var(--color-text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}
body.is-locked { overflow: hidden; }

a       { color: inherit; text-decoration: none; }
button  { font-family: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img, svg{ display: block; max-width: 100%; }
address { font-style: normal; }

/* ===== Scroll Reveal (페이지 어디서나 .reveal 클래스로 사용) ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }


/* ==========================================================================
   3. HEADER (메가메뉴)
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--color-bg);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-open { border-bottom-color: var(--color-line); }

.header-inner {
  max-width: var(--container-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
}

/* ===== Logo ===== */
.logo a { display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; display: block; }

/* ===== GNB ===== */
nav { height: 100%; }
.gnb {
  display: flex;
  justify-content: center;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gnb > li {
  position: static;
  height: 100%;
}
.gnb > li > a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.25s var(--ease);
}
.gnb > li > a::after {
  content: "";
  position: absolute;
  left: 28px; right: 28px; bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s var(--ease);
}
.gnb > li:hover     > a,
.gnb > li.is-active > a { color: var(--color-accent); }
.gnb > li:hover     > a::after,
.gnb > li.is-active > a::after { transform: scaleX(1); }


/* ===== Utility (Lang + Hamburger) ===== */
.header-utility {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
}
.lang li a {
  display: block;
  padding: 6px 10px;
  color: var(--color-text-mute);
  transition: color 0.2s var(--ease);
  border-radius: 4px;
}
.lang li.on a { color: var(--color-text); }
.lang li a:hover { color: var(--color-accent); }
.lang .divider {
  width: 1px;
  height: 12px;
  background: var(--color-line);
}

/* ===== Hamburger (모바일) ===== */
.menu-trigger {
  position: relative;
  width: 40px;
  height: 40px;
  display: none;             /* 데스크탑에선 숨김 (반응형에서 노출) */
  place-items: center;
}
.menu-trigger span {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), top 0.3s var(--ease);
}
.menu-trigger span:nth-child(1) { top: 14px; }
.menu-trigger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-trigger span:nth-child(3) { bottom: 14px; }

.menu-trigger.is-active span:nth-child(1) { top: 50%; transform: translate(0, -50%) rotate(45deg); }
.menu-trigger.is-active span:nth-child(2) { opacity: 0; }
.menu-trigger.is-active span:nth-child(3) { bottom: 50%; transform: translate(0, 50%) rotate(-45deg); }


/* ==========================================================================
   4. MEGA PANEL (데스크탑 호버 메뉴)
   ========================================================================== */
.mega-panel {
  position: absolute;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--color-bg);
  box-shadow: var(--shadow-mega);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    max-height 0.5s var(--ease),
    opacity    0.3s var(--ease),
    visibility 0s linear 0.5s;
}
.site-header.is-open .mega-panel {
  max-height: 540px;
  opacity: 1;
  visibility: visible;
  transition:
    max-height 0.55s var(--ease),
    opacity    0.35s var(--ease) 0.05s,
    visibility 0s linear 0s;
}

.mega-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 56px 48px 64px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  min-height: 380px;
}

/* ===== Left visual card ===== */
.mega-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #2a3b2e;
  min-height: 320px;
  isolation: isolate;
}
.mega-visual .visual-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.8s var(--ease);
}
.site-header.is-open .mega-panel.active .visual-img { transform: scale(1); }

.mega-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(15,30,20,0.05) 0%,
    rgba(15,30,20,0.35) 45%,
    rgba(15,30,20,0.85) 100%);
  z-index: 1;
}
.mega-visual .visual-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  color: #fff;
}
.mega-visual .eyebrow {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.mega-visual h3 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.15;
}
.mega-visual p {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
  font-weight: 400;
}

/* ===== Right sub menu grid ===== */
.mega-content { padding-top: 8px; }
.mega-content .section-label {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-mute);
  margin-bottom: 28px;
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 40px;
  list-style: none;
  margin: 0; padding: 0;
}
.sub-grid li {
  border-bottom: 1px solid var(--color-line);
  transition: border-color 0.25s var(--ease);
}
.sub-grid li:hover { border-bottom-color: var(--color-accent); }

.sub-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.25s var(--ease), padding 0.3s var(--ease);
}
.sub-grid a:hover { color: var(--color-accent); padding-left: 8px; }

.sub-grid .arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease);
}
.sub-grid .arrow svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s var(--ease);
}
.sub-grid a:hover .arrow {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.sub-grid a:hover .arrow svg { transform: translateX(2px); }

.sub-grid.cols-2 { grid-template-columns: repeat(2, 1fr); gap: 0 60px; }


/* ===== Mega Backdrop ===== */
.mega-backdrop {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(15, 25, 18, 0.32);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
  z-index: 99;
}
.site-header.is-open ~ .mega-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0s;
}


/* ==========================================================================
   5. MOBILE MENU (햄버거 슬라이드) — index 사이드바와 동일 디자인
   --------------------------------------------------------------------------
   ※ 모바일에서 햄버거 클릭 시 왼쪽에서 슬라이드 인되는 메뉴 패널.
     데스크탑(>=861px)에서는 보이지 않음 (메가메뉴 사용).
   ========================================================================== */

/* 슬라이드 패널 본체 — index의 .site-header 사이드바와 동일 */
.mobile-menu {
  position: fixed;
  inset: 0 auto 0 0;                              /* 왼쪽에 붙음 */
  width: min(82vw, 320px);
  max-width: 320px;
  height: 100dvh;
  background: #fff;
  z-index: 110;
  transform: translateX(-100%);                   /* 닫혀있을 땐 왼쪽 밖 */
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.mobile-menu.is-open { transform: translateX(0); }

.mobile-menu__inner {
  padding: 40px 24px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* 로고 */
.mobile-menu__logo {
  display: block;
  margin: 0 auto 24px;
}
.mobile-menu__logo img {
  height: clamp(80px, 14vw, 120px);
  width: auto;
  margin: 0 auto;
  display: block;
}

/* 언어 스위치 (index 스타일) */
.mobile-menu__lang-switch {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-bottom: 32px;
}
.mobile-menu__lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 32px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #595959;
  background: #f3f3f0;
  border-radius: 6px;
}
.mobile-menu__lang-switch a.is-active {
  background: var(--color-accent);
  color: #fff;
}

/* 메뉴 (아코디언) */
.mobile-menu__nav { flex: 1; }
.mobile-menu__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.mobile-menu__item {
  border-bottom: 1px solid #e6e6e2;
}
.mobile-menu__btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: left;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: none;
  transition: color 180ms var(--ease);
}
.mobile-menu__btn::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-left: auto;
  margin-right: 4px;
  opacity: 0.4;
  transition: transform 320ms var(--ease), opacity 180ms var(--ease);
}
.mobile-menu__btn:hover { color: var(--color-accent); }
.mobile-menu__item.is-open .mobile-menu__btn { color: var(--color-accent); }
.mobile-menu__item.is-open .mobile-menu__btn::after {
  transform: rotate(45deg);
  opacity: 1;
}

/* 서브 메뉴 (아코디언 펼침) */
.mobile-menu__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.mobile-menu__sub > ul {
  overflow: hidden;
  opacity: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  transition: opacity 0.3s var(--ease);
}
.mobile-menu__item.is-open .mobile-menu__sub { grid-template-rows: 1fr; }
.mobile-menu__item.is-open .mobile-menu__sub > ul {
  opacity: 1;
  padding-bottom: 16px;
}
.mobile-menu__sub > ul > li > a {
  display: block;
  padding: 8px 8px 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #595959;
  transition: color 180ms var(--ease);
}
.mobile-menu__sub > ul > li > a:hover { color: var(--color-accent); }

/* 소셜 아이콘 (index 스타일) */
.mobile-menu__social {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 24px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #e6e6e2;
}
.mobile-menu__social a {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 180ms var(--ease);
}
.mobile-menu__social a:hover { transform: translateY(-2px); }
.mobile-menu__social img { width: 100%; height: 100%; object-fit: cover; }

/* 배경 딤 */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
  z-index: 105;
}
.mobile-menu-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0s;
}


/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--color-line);
  background: #fff;
  padding: 48px 0 56px;
}
.footer-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 48px;
}
.footer-logo {
  text-align: center;
  margin-bottom: 28px;
}
.footer-logo img { height: 28px; opacity: 0.85; margin: 0 auto; }

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-links a {
  font-size: 13px;
  color: var(--color-text-soft);
  padding: 0 18px;
  border-right: 1px solid var(--color-line);
  transition: color 0.2s var(--ease);
}
.footer-links a:last-child { border-right: none; }
.footer-links a.strong { font-weight: 700; color: var(--color-text); }
.footer-links a:hover { color: var(--color-accent); }

.footer-info {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.8;
  margin-bottom: 8px;
}
.footer-info span {
  margin: 0 14px;
  position: relative;
  display: inline-block;
}
.footer-info span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 10px;
  background: var(--color-line);
}
.footer-copyright {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-mute);
  font-family: var(--font-en);
}


/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

/* ----- Tablet ----- */
@media (max-width: 1100px) {
  .header-inner { padding: 0 24px; gap: 24px; }
  .gnb > li > a { padding: 0 18px; font-size: 15px; }
  .mega-inner {
    grid-template-columns: 280px 1fr;
    gap: 48px;
    padding: 40px 24px 48px;
  }
  .mega-visual h3 { font-size: 26px; }
  .footer-inner { padding: 0 24px; }
}

/* ----- Mobile ----- */
@media (max-width: 860px) {
  :root { --header-h: 64px; }

  .header-inner { gap: 16px; padding: 0 20px; }
  .gnb,
  .lang { display: none; }                /* 데스크탑 메뉴 숨김 */
  .menu-trigger { display: grid; }        /* 햄버거 노출 */
  .mega-panel,
  .mega-backdrop { display: none; }       /* 메가메뉴 비활성 */

  .logo img { height: 32px; }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
  .footer-links a {
    border-right: none;
    padding: 4px 0;
  }
  .footer-info span {
    display: inline-block;
    margin: 0 8px;
  }
  .footer-info span:not(:last-child)::after { display: none; }
}


/* ==========================================================================
   8. ACCESSIBILITY / MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}