/* src/nnt/css/style.css */

/* 폰트(Pretendard dynamic subset)는 index.html <head>의 <link>로 건다.
   여기서 @import 하면 이 파일을 받은 뒤에야 발견돼 임계 경로가 한 단계
   길어진다. jsDelivr의 gh/orioncactus/pretendard 경로는 저장소가 50MB
   제한을 넘어 403(영구)이고, npm 원본은 웨이트당 ~766KB라 dynamic subset을
   쓴다 — 자체 호스팅/서브셋은 런칭 전 체크리스트 항목이다. */

:root {
  /* ── 팔레트: 확정 시 이 블록만 교체 ── */
  --bg:       #0B0D0F;
  --surface:  #14181C;
  --fg:       #F2F4F5;
  --muted:    #8B959C;
  --accent:   #3DDC97;
  --accent-2: #7C5CFF;
  --line:     #232A30;
  --cta-fg:     #06231A;
  --accent-glow: color-mix(in srgb, var(--accent) 25%, transparent);

  /* 제품컷 스튜디오 배경(#F3F3F3 실측)과 맞춘 카드 상단 배경.
     제품명/설명 텍스트는 이 위가 아니라 카드 하단의 --surface 영역에 둔다
     (--fg on --card-bg 대비 1.01:1로 사실상 안 보임 — 절대 텍스트를 얹지 말 것). */
  --card-bg:  #F3F3F3;

  --maxw: 1140px;
  --pad-block: clamp(72px, 10vw, 140px);
  --pad-inline: clamp(20px, 5vw, 40px);

  --fs-hero:  clamp(2.5rem, 7vw, 5rem);
  --fs-h2:    clamp(1.75rem, 4vw, 2.75rem);
  --fs-body:  clamp(1rem, 1.6vw, 1.125rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.7;
  word-break: keep-all;      /* 한글 단어 중간 줄바꿈 방지 */
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ── 레이아웃 유틸 ── */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-inline); }
.section { padding-block: var(--pad-block); }
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
  font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
h2 { font-size: var(--fs-h2); line-height: 1.25; margin: 0 0 20px; font-weight: 700; }
p  { margin: 0 0 16px; color: var(--muted); }

/* ── CTA (자사몰 유도) ── */
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px;
  background: var(--accent); color: var(--cta-fg);
  font-weight: 700; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.cta:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

.cta--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }

/* ── 히어로 ── */
.hero {
  padding-block: clamp(88px, 12vw, 160px) var(--pad-block);
  position: relative;      /* 배경 영상 레이어의 기준 */
  isolation: isolate;      /* 음수 z-index가 body 배경 뒤로 빠지지 않게 */
  /* overflow:hidden 을 두지 않는다. 영상·스크림은 .hero를 컨테이닝 블록으로
     하는 absolute inset:0 라 애초에 섹션 밖으로 새지 못하고, 이 규칙은 실제로는
     제목·CTA·3D가 넘치는 것을 가려 360px 가로 스크롤 검사를 무력화한다. */
}

/* 레이어: 영상(-2) → 스크림(-1) → 카피·3D(기본) */
.hero__bg {
  position: absolute; inset: 0;
  /* 이 두 줄은 inset:0 과 중복이 아니다. <video>는 치환 요소라 width/height:auto
     가 고유 크기(1920×1080)로 풀리고, inset:0 은 늘리지 못한 채 배치만 한다.
     빼면 360px 뷰포트에서 가로 1560px이 넘친다(실측). */
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0;                       /* 로드 전엔 --bg 그대로, 튀는 전환 없음 */
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.hero__bg[data-video-state="playing"] { opacity: .6; }

/* JS 게이트는 모듈 로드 시 1회만 평가한다. 세션 도중 OS 설정을 켠 사용자를
   위해 표시 쪽은 선언적으로 즉시 끈다(다운로드 차단은 게이트가 계속 담당). */
@media (prefers-reduced-motion: reduce) { .hero__bg { display: none; } }

/* 카피 쪽을 더 어둡게 덮어 한글 본문 대비를 지킨다 */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* color-mix() 폴백: 미지원 브라우저는 background 선언 전체를 무효로 처리해
     스크림이 통째로 사라지고 카피가 opacity .6 영상 위에 그대로 얹힌다.
     그 브라우저를 위해 평범한 rgba() 그라데이션을 먼저 선언해 둔다(캐스케이드상
     color-mix 지원 브라우저는 아래 줄로 덮어씀). --bg는 #0B0D0F 고정값이라
     rgba()는 var()로 채널을 못 뽑아내므로 여기서만 리터럴을 쓴다 — :root가
     바뀌면 이 줄도 같이 맞춰야 한다. */
  background: linear-gradient(100deg,
    rgba(11, 13, 15, .92) 0%,
    rgba(11, 13, 15, .78) 55%,
    rgba(11, 13, 15, .45) 100%);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--bg) 92%, transparent) 0%,
    color-mix(in srgb, var(--bg) 78%, transparent) 55%,
    color-mix(in srgb, var(--bg) 45%, transparent) 100%);
}

.hero__grid {
  display: grid; gap: clamp(40px, 6vw, 72px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) {
  .hero__grid { grid-template-columns: 1.05fr .95fr; }
}

.hero__title {
  font-size: var(--fs-hero); line-height: 1.1; letter-spacing: -.02em;
  margin: 0 0 24px; font-weight: 700;
}
.hero__lead { max-width: 42ch; margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* poster와 3D를 같은 칸에 겹쳐 놓는다. poster가 항상 LCP.
   퓨리틱은 폭:높이 ≈ 1:5.4로 세로로 긴 제품이라 정사각형 프레임에서는
   모델이 작게 잡히고 좌우가 비었다. 세로로 긴 프레임을 준다.
   poster는 object-fit:contain이라 정사각 이미지가 폭 기준으로 맞춰지므로
   표시 크기(=LCP 후보 크기)는 프레임 비율을 바꿔도 그대로다. */
.hero__visual { position: relative; aspect-ratio: 3 / 4; }

.hero-poster {
  width: 100%; height: 100%; object-fit: contain;
  transition: opacity .6s ease;
}

#hero-model {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity .6s ease;
  background: transparent;
}
#hero-model[data-state="loaded"] { opacity: 1; }

/* 3D가 뜨면 poster를 숨겨 겹침을 없앤다.
   .hero-poster가 DOM상 앞에 오므로 형제 결합자(~)로는 잡을 수 없다. :has()를 쓴다. */
.hero__visual:has(#hero-model[data-state="loaded"]) .hero-poster { opacity: 0; }

/* ── 브랜드 소개 ── */
.brand__grid { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: 1fr; }
@media (min-width: 820px) { .brand__grid { grid-template-columns: .8fr 1.2fr; } }

/* ── 유통 채널 ── */
.channels__note { margin-bottom: 40px; }
.channels__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .channels__list { grid-template-columns: repeat(4, 1fr); } }

.channel {
  display: grid; place-items: center;
  padding: 28px 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  /* 미확정 채널: 흐리게 (opacity .62 = AA 4.5:1 이상, 계산 확인 완료) */
  filter: grayscale(1); opacity: .62;
  transition: filter .3s ease, opacity .3s ease;
}
/* 입점 확정 시 이 클래스만 추가하면 된다 */
.channel.is-confirmed { filter: none; opacity: 1; border-color: var(--accent); }

.channel__name { font-weight: 700; letter-spacing: .02em; }

/* ── 제품 갤러리 ──
   제품컷은 밝은 스튜디오 배경(#F3F3F3)이라 배경을 지우지 않고
   카드 상단을 같은 색으로 맞춰 여백 없이 붙인다(다크 페이지 위의 밝은 타일).
   텍스트는 전부 카드 하단의 --surface 영역(어두운 톤)에 둔다 —
   --fg on --surface 16.17:1, --muted on --surface 5.84:1 (둘 다 AA 4.5:1 이상, 계산 확인 완료). */
.products__grid {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: clamp(16px, 2.5vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.product {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; text-align: center;
  display: flex; flex-direction: column;
}
.product img { margin: 0; background: var(--card-bg); }
.product__body { padding: 20px; }
.product__name { font-size: 1.25rem; margin: 0 0 8px; }
.product__desc { font-size: .9375rem; margin-bottom: 20px; }

/* ── 디바이스 카드 ── */
.device {
  margin-top: clamp(16px, 2.5vw, 28px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  display: grid; grid-template-columns: 1fr;
}
@media (min-width: 620px) {
  .device { grid-template-columns: minmax(200px, 280px) 1fr; align-items: stretch; }
}
.device img { margin: 0; background: var(--card-bg); width: 100%; height: 100%; object-fit: cover; }
.device__body { padding: clamp(20px, 3vw, 32px); }
.device__body h3 { font-size: 1.5rem; margin: 0 0 12px; }

/* ── 비전 ── */
.vision__list {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: clamp(20px, 3vw, 36px);
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.vision__num {
  display: block; font-size: 2.5rem; font-weight: 700;
  color: var(--accent-2); line-height: 1; margin-bottom: 16px;
}
.vision__item h3 { font-size: 1.25rem; margin: 0 0 10px; }

/* ── 정보성 본문 ── */
.article { max-width: 74ch; }
.article h3 {
  font-size: 1.25rem; margin: 40px 0 12px; color: var(--fg); font-weight: 700;
}
.article__list { margin: 0 0 16px; padding-left: 1.2em; color: var(--muted); }
.article__list li { margin-bottom: 10px; }
.article__list strong { color: var(--fg); }
.article__cta { margin-top: 40px; }

/* ── 소셜 ── */
.social__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ── 푸터 ── */
.footer {
  padding-block: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: .875rem;
}
.footer__brand { font-weight: 700; font-size: 1.125rem; color: var(--fg); margin-bottom: 20px; }
.footer__brand span { color: var(--accent); }
.footer__biz { line-height: 1.9; }
.footer__note { color: var(--fg); margin-top: 20px; }
.footer__copy { margin: 20px 0 0; font-size: .8125rem; }
