/* =====================================================================
 *  컴포넌트 스타일 — 내용(글자) 길이가 바뀌어도 레이아웃이 유지되도록
 *  고정 높이 대신 flex/grid + min-height 로 구성했습니다.
 *  색/폰트/간격 변경은 theme.css 에서 하세요.
 * ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;          /* 한글 단어 중간에서 줄바꿈 방지 */
  overflow-wrap: anywhere;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 이미지 영역 공통: 이미지가 없으면 --placeholder 가 보임 */
.media { background-color: var(--surface); background-size: cover; background-position: center; }

/* ───────────────────────── 버튼 (모든 버튼 공통) ─────────────────────────
 * .btn            : 기본 (외곽선 알약형 + 오른쪽 화살표)
 * .btn--play      : 왼쪽에 원형 재생 아이콘이 붙는 버전 (Showreel, 영상 보기)
 * .btn--sm        : 작은 크기 (헤더 Contact)
 * 글자 길이와 상관없이 같은 높이·여백으로 유지됩니다. */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 22px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0;
  color: var(--text); white-space: nowrap;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn .ico { width: 14px; height: 14px; flex: none; transition: transform .3s var(--ease); }
.btn:hover { background: rgba(157, 140, 255, .12); border-color: var(--accent); }
.btn:hover .ico--arrow { transform: translateX(4px); }
.btn:hover .ico--out { transform: translate(2px, -2px); }

.btn--play { padding-left: 4px; }
.btn--play .play-dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center; flex: none;
}
.btn--play .play-dot svg { width: 10px; height: 10px; margin-left: 2px; }
.btn--sm { height: 40px; padding: 0 18px; }

/* 카드 위 동그란 재생 버튼 */
.play-circle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.8);
  display: grid; place-items: center; flex: none;
  background: rgba(10,10,16,.25); backdrop-filter: blur(4px);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.play-circle svg { width: 11px; height: 11px; margin-left: 2px; }

/* ───────────────────────── 섹션 공통 텍스트 ───────────────────────── */
.label {
  display: flex; align-items: center; gap: 18px;
  font-size: var(--fs-label); font-weight: 500;
  letter-spacing: .32em; color: var(--text-2);
  text-transform: uppercase; margin-bottom: 22px;
}
.label::after { content: ""; width: 52px; height: 1px; background: var(--line-strong); }
.label--plain::after { display: none; }

.sec-title { font-size: var(--fs-h2); font-weight: 600; line-height: 1.38; letter-spacing: -0.02em; }
.sec-desc  { margin-top: 20px; color: var(--text-2); font-size: var(--fs-body); }
.sec-title + .btn, .sec-desc + .btn { margin-top: 40px; }
.text-block { display: flex; flex-direction: column; align-items: flex-start; }

.section { position: relative; padding: var(--section-y) 0; border-top: 1px solid rgba(255,255,255,.05); }

/* ───────────────────────── 헤더 ───────────────────────── */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: background .35s var(--ease), backdrop-filter .35s;
}
.site-header.is-scrolled { background: rgba(10,10,16,.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo svg { width: 18px; height: 22px; color: var(--accent); }
.logo-name { font-size: 17px; font-weight: 600; line-height: 1.1; display: block; }
.logo-role { font-size: 8px; letter-spacing: .2em; color: var(--text-3); display: block; margin-top: 3px; }

.nav { display: flex; gap: clamp(24px, 4.5vw, 64px); }
.nav a { position: relative; font-size: var(--fs-small); color: var(--text-2); padding: 8px 0; transition: color .3s; }
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); }

.menu-toggle { display: none; width: 40px; height: 40px; }
.menu-toggle span { display: block; width: 22px; height: 1.5px; margin: 6px auto; background: var(--text); transition: transform .3s; }

/* ───────────────────────── 히어로 ───────────────────────── */
.hero { position: relative; min-height: max(640px, 100vh); display: flex; align-items: center; overflow: hidden; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; transform: scale(1.06); transition: opacity 1.4s var(--ease), transform 7s linear; }
.hero-slide.is-on { opacity: 1; transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10,10,16,.92) 0%, rgba(10,10,16,.55) 45%, rgba(10,10,16,.1) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 25%);
}
.hero .container { position: relative; z-index: 2; }
.hero-inner { position: relative; padding: 40px 0 40px 32px; max-width: 640px; }
.hero-inner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.hero .label { letter-spacing: .42em; }
.hero-title { font-size: var(--fs-hero); font-weight: 600; line-height: 1.02; letter-spacing: -0.035em; }
.hero-desc { margin-top: 28px; color: var(--text-2); font-size: clamp(15px, 1.2vw, 18px); }
.hero .btn { margin-top: 36px; }

.scroll-down {
  position: absolute; left: var(--gutter); bottom: 32px; z-index: 2;
  display: flex; align-items: center; gap: 22px;
  font-size: 10px; letter-spacing: .2em; color: var(--text-2);
}
.scroll-down::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--text-2); border-radius: 50%; }

.hero-counter {
  position: absolute; right: var(--gutter); bottom: 32px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-size: 10px; letter-spacing: .15em; color: var(--text-2);
}
.hero-bars { display: flex; gap: 8px; }
.hero-bars button { width: 18px; height: 2px; padding: 8px 0; background: none; position: relative; }
.hero-bars button::after { content: ""; position: absolute; inset: 7px 0; background: var(--line-strong); transition: background .3s; }
.hero-bars button.is-on::after { background: var(--text); }

/* ───────────────────────── 좌우 분할 레이아웃 ───────────────────────── */
.split { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: clamp(32px, 5vw, 64px); align-items: center; }

/* 프로젝트 카드 */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.project-grid--page { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.card {
  position: relative; display: flex; align-items: flex-end;
  aspect-ratio: 16 / 7; min-height: 150px; overflow: hidden;
  border-radius: var(--radius); isolation: isolate;
}
.project-grid--page .card { aspect-ratio: 16 / 9; }
.card .media { position: absolute; inset: 0; z-index: -2; transition: transform .8s var(--ease); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(6,6,12,.85) 0%, rgba(6,6,12,.15) 60%); }
.card-body { width: 100%; padding: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-meta { font-size: 11px; letter-spacing: .12em; color: var(--accent-2); margin-bottom: 6px; }
.card:hover .media { transform: scale(1.05); }
.card:hover .play-circle { background: var(--accent); border-color: var(--accent); }
button.card { width: 100%; text-align: left; padding: 0; }

/* ───────────────────────── 워크플로우 ───────────────────────── */
.workflow { padding: 0; overflow: hidden; }
.workflow-grid { display: grid; grid-template-columns: 1.15fr 1fr 1.6fr; align-items: center; min-height: 250px; }
.workflow-img { align-self: stretch; position: relative; }
.workflow-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, var(--bg) 100%); }
.workflow .text-block { padding: 48px clamp(20px, 3vw, 40px); }

.steps { display: flex; align-items: flex-start; justify-content: center; gap: 8px; padding: 40px var(--gutter) 40px 0; }
.step { flex: 1; max-width: 160px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.step-icon {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center; margin-bottom: 18px;
  transition: border-color .3s, background .3s;
}
.step-icon svg { width: 28px; height: 28px; }
.step:hover .step-icon { border-color: var(--accent); background: rgba(157,140,255,.1); }
.step-title { font-size: 15px; font-weight: 600; }
.step-desc { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.step-sep { flex: none; color: var(--text-3); margin-top: 26px; font-size: 18px; }

/* ───────────────────────── 경력 타임라인 ───────────────────────── */
.experience { overflow: hidden; }
.exp-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: 0; position: relative; z-index: 1; }
.exp-grid > .text-block { padding-right: clamp(24px, 4vw, 48px); border-right: 1px solid var(--line); }
.timeline { padding-left: clamp(24px, 4vw, 40px); max-width: 560px; }
.tl-item { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-period { font-size: var(--fs-small); color: var(--text-2); }
.tl-title { font-size: 14px; font-weight: 600; }
.tl-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.tl-details { margin-top: 10px; display: grid; gap: 4px; }
.tl-details li { font-size: 13px; color: var(--text-2); padding-left: 14px; position: relative; }
.tl-details li::before { content: ""; position: absolute; left: 0; top: .75em; width: 5px; height: 1px; background: var(--accent); }
.side-img {
  position: absolute; top: 0; right: 0; bottom: 0; width: 42%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 45%);
  opacity: .9;
}

/* ───────────────────────── 소개 / 연락처 ───────────────────────── */
.about { overflow: hidden; padding-bottom: calc(var(--section-y) + 20px); }
.about-bg { position: absolute; inset: 0; opacity: .75; }
.about::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(10,10,16,.85) 40%, rgba(10,10,16,.2) 100%); }
.about-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; align-items: center; }
.about-grid > .text-block { padding-right: clamp(24px, 4vw, 48px); border-right: 1px solid var(--line); }
.contact { padding-left: clamp(24px, 5vw, 64px); }
.contact .label { margin-bottom: 18px; }
.contact-list { display: grid; gap: 12px; }
.contact-list a { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; transition: color .3s; }
.contact-list a:hover { color: var(--accent-2); }
.contact-list svg { width: 18px; height: 18px; flex: none; }
.script {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(40px, 4.6vw, 68px); line-height: 1; color: rgba(255,255,255,.88);
  transform: rotate(-8deg); text-align: center; white-space: pre-line;
}

/* ───────────────────────── 하위 페이지 공통 ───────────────────────── */
.page-hero { padding: calc(var(--header-h) + 72px) 0 56px; border-bottom: 1px solid rgba(255,255,255,.05); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; width: 600px; height: 600px; right: -150px; top: -300px; background: radial-gradient(circle, rgba(138,120,255,.18), transparent 65%); }
.page-hero .sec-title { font-size: clamp(32px, 4vw, 52px); }
.back-link { display: inline-flex; margin-bottom: 28px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.tab { height: 36px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-small); color: var(--text-2); transition: all .3s; }
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.is-active { color: var(--text); border-color: var(--accent); background: rgba(157,140,255,.12); }

/* 프로젝트 상세 목록 */
.project-item { display: flex; flex-direction: column; gap: 14px; }
.project-item .info { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.project-item .info b { color: var(--text); font-weight: 500; margin-right: 8px; }

/* 제작 과정 상세 */
.flow-list { display: grid; gap: 0; }
.flow-row { display: grid; grid-template-columns: 90px 1.1fr 1.6fr; gap: 32px; padding: 40px 0; border-bottom: 1px solid var(--line); align-items: start; }
.flow-row .step-icon { margin: 0; }
.flow-num { font-size: var(--fs-label); letter-spacing: .3em; color: var(--accent-2); margin-bottom: 8px; }
.flow-row h3 { font-size: 22px; font-weight: 600; }
.flow-row p { color: var(--text-2); margin-top: 8px; }
.tool-line { margin-top: 18px; font-size: 13px; color: var(--text-3); }
.tool-line b { color: var(--text-2); font-weight: 500; margin-right: 8px; }

.timeline--page { max-width: 880px; padding-left: 0; }
.timeline--page .tl-item { grid-template-columns: 200px 1fr; padding: 32px 0; }
.timeline--page .tl-title { font-size: 18px; }
.timeline--page .tl-desc { font-size: 14px; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 48px; }
.skill { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.skill h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.skill p { font-size: 13px; color: var(--text-2); }

.site-footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ───────────────────────── 영상 모달 ───────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(5,5,10,.9); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal-box { position: relative; width: min(1100px, 100%); aspect-ratio: 16/9; background: #000; }
.modal-box iframe, .modal-box video { width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--text); }
.modal-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-size: 14px; text-align: center; padding: 20px; }

/* ───────────────────────── 등장 애니메이션 ───────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero-slide { transition: opacity .3s; transform: none !important; }
}

/* ───────────────────────── 반응형 ───────────────────────── */
@media (max-width: 1024px) {
  .split, .exp-grid { grid-template-columns: 1fr; gap: 40px; }
  .exp-grid > .text-block, .about-grid > .text-block { border-right: 0; padding-right: 0; }
  .timeline { padding-left: 0; }
  .side-img { width: 60%; opacity: .35; }
  .workflow-grid { grid-template-columns: 1fr 1fr; }
  .workflow-img { display: none; }
  .workflow .text-block { padding-left: var(--gutter); }
  .about-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .contact { padding-left: 0; }
  .script { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(10,10,16,.97); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px; transform: translateY(-120%); transition: transform .4s var(--ease); z-index: -1;
  }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a.is-active::after { display: none; }
  .nav a.is-active { color: var(--accent-2); }
  .site-header.menu-open .nav { transform: none; }
  .site-header.menu-open { background: rgba(10,10,16,.97); }
  .header-contact { display: none; }

  .project-grid { grid-template-columns: 1fr; }
  .card { aspect-ratio: 16 / 8; }
  .workflow-grid { grid-template-columns: 1fr; }
  .steps { padding: 0 var(--gutter) 48px; }
  .about-grid { grid-template-columns: 1fr; }
  .tl-item, .timeline--page .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .flow-row { grid-template-columns: 1fr; gap: 16px; }
  .hero-counter { display: none; }
}
