/* ================================================
   PGD Ship Design — 공통 스타일
   모든 페이지에서 공유하는 CSS
   ================================================ */

/* Google Fonts는 각 HTML에서 import */

:root {
  --gold:#c9a84c; --gold2:#e8c96e; --gold3:#f5e4b0;
  --black:#0a0a0a; --dark:#111827; --dark2:#1f2937;
  --mid:#374151; --muted:#6b7280; --subtle:#9ca3af;
  --light:#e5e7eb; --lighter:#f3f4f6; --white:#ffffff;
  --ff-head:'Inter',sans-serif;
  --ff-body:'Noto Sans KR','Inter',sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family:var(--ff-body);
  background:var(--white);
  color:var(--dark);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

/* ── NAV ── */
nav {
  position:fixed; top:0; left:0; right:0; z-index:999;
  height:72px; padding:0 56px;
  display:flex; align-items:center; justify-content:space-between;
  background:rgba(3,6,16,.97);
  backdrop-filter:blur(24px);
  border-bottom:1px solid rgba(201,168,76,.18);
}
.nav-logo {
  display:flex; align-items:center; gap:12px; text-decoration:none;
}
.nav-logo img {
  height:44px; width:auto;
  filter:brightness(1.5) drop-shadow(0 2px 14px rgba(63,149,210,.55)) drop-shadow(0 0 5px rgba(255,255,255,.2));
}
.nav-links { display:flex; gap:36px; list-style:none; }
.nav-links a {
  color:rgba(255,255,255,.6); text-decoration:none;
  font-family:var(--ff-head); font-size:11px;
  letter-spacing:2px; font-weight:500;
  transition:color .25s; text-transform:uppercase;
}
.nav-links a:hover, .nav-links a.active { color:var(--gold); }
.nav-cta {
  background:transparent; color:var(--gold);
  padding:9px 24px; border:1px solid var(--gold); border-radius:2px;
  font-size:11px; font-weight:600; text-decoration:none;
  letter-spacing:2px; text-transform:uppercase;
  transition:all .25s; font-family:var(--ff-head);
}
.nav-cta:hover { background:var(--gold); color:var(--black); }

/* 서브페이지 NAV 뒤로가기 버튼 */
.nav-back {
  display:flex; align-items:center; gap:8px;
  color:rgba(255,255,255,.65); text-decoration:none;
  font-family:var(--ff-head); font-size:11px;
  letter-spacing:2px; text-transform:uppercase;
  transition:color .25s;
}
.nav-back:hover { color:var(--gold); }

/* ── FOOTER ── */
footer {
  background:var(--black);
  padding:64px 56px;
  border-top:1px solid rgba(201,168,76,.15);
}
.ft-inner {
  max-width:1200px; margin:0 auto;
  display:grid; grid-template-columns:1fr auto;
  gap:40px; align-items:start;
}
.ft-logo-wrap { margin-bottom:20px; }
.ft-logo-wrap img {
  height:40px; width:auto;
  filter:brightness(1.5) drop-shadow(0 2px 12px rgba(63,149,210,.5)) drop-shadow(0 0 4px rgba(255,255,255,.15));
}
.ft-tagline {
  font-size:12px; color:rgba(255,255,255,.65);
  letter-spacing:1px; margin-top:8px;
}
.ft-address {
  font-size:12px; color:rgba(255,255,255,.55);
  line-height:2.2; margin-top:20px;
}
.ft-right { text-align:right; }
.ft-sns { display:flex; gap:10px; justify-content:flex-end; margin-bottom:20px; }
.ft-sn {
  width:38px; height:38px;
  border:1px solid rgba(255,255,255,.2);
  display:flex; align-items:center; justify-content:center;
  text-decoration:none; color:rgba(255,255,255,.65);
  font-size:14px; transition:all .25s;
}
.ft-sn:hover { border-color:var(--gold); color:var(--gold); }
.ft-copy { font-size:10px; color:rgba(255,255,255,.45); letter-spacing:1px; line-height:2; }
.ft-admin-link {
  display:inline-block; margin-top:12px;
  font-size:10px; color:rgba(255,255,255,.25);
  letter-spacing:1px; text-decoration:none; transition:color .2s;
}
.ft-admin-link:hover { color:rgba(255,255,255,.45); }

/* ── 공통 섹션 ── */
.ctn { max-width:1200px; margin:0 auto; padding:0 56px; }
.section-label {
  font-family:var(--ff-head); font-size:10px;
  letter-spacing:4px; color:var(--gold);
  text-transform:uppercase; font-weight:600; margin-bottom:16px;
}
.section-title {
  font-family:var(--ff-head); font-size:clamp(32px,4vw,52px);
  font-weight:900; line-height:1.05; letter-spacing:-1.5px;
  color:var(--dark); margin-bottom:16px;
}
.section-title.on-dark { color:var(--white); }
.section-desc {
  font-size:15px; color:var(--muted); line-height:1.8; font-weight:300;
}

/* ── 버튼 ── */
.btn-gold {
  background:var(--gold); color:var(--black);
  padding:14px 36px; border:none;
  font-family:var(--ff-head); font-size:11px;
  font-weight:700; letter-spacing:2px; text-transform:uppercase;
  text-decoration:none; cursor:pointer; transition:all .25s;
  display:inline-block;
}
.btn-gold:hover { background:var(--gold2); transform:translateY(-2px); box-shadow:0 8px 28px rgba(201,168,76,.25); }
.btn-ghost {
  background:transparent; color:rgba(255,255,255,.75);
  padding:14px 36px; border:1px solid rgba(255,255,255,.25);
  font-family:var(--ff-head); font-size:11px;
  font-weight:500; letter-spacing:2px; text-transform:uppercase;
  text-decoration:none; cursor:pointer; transition:all .25s;
  display:inline-block;
}
.btn-ghost:hover { border-color:var(--gold); color:var(--gold); }
.btn-ghost.dark {
  color:var(--dark); border-color:var(--light);
}
.btn-ghost.dark:hover { border-color:var(--gold); color:var(--gold); }

/* ── 떠다니는 AI 챗 위젯 ── */
.ai-fab {
  position:fixed; bottom:32px; right:32px; z-index:8888;
  width:58px; height:58px; border-radius:50%;
  background:linear-gradient(135deg,var(--gold),var(--gold2));
  border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:24px;
  box-shadow:0 4px 24px rgba(201,168,76,.45), 0 2px 8px rgba(0,0,0,.3);
  animation:fab-float 3s ease-in-out infinite;
  transition:transform .25s, box-shadow .25s;
}
.ai-fab:hover {
  transform:scale(1.1) translateY(-4px);
  box-shadow:0 8px 36px rgba(201,168,76,.6), 0 4px 12px rgba(0,0,0,.3);
  animation:none;
}
.ai-fab-tooltip {
  position:absolute; bottom:68px; right:0;
  background:var(--black); color:var(--white);
  font-family:var(--ff-head); font-size:11px; font-weight:600;
  letter-spacing:1px; white-space:nowrap;
  padding:8px 14px; border-radius:4px;
  border:1px solid rgba(201,168,76,.3);
  opacity:0; pointer-events:none; transition:opacity .2s;
}
.ai-fab:hover .ai-fab-tooltip { opacity:1; }
@keyframes fab-float {
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-6px)}
}

/* AI 챗 패널 */
.ai-chat-panel {
  position:fixed; bottom:104px; right:32px; z-index:8889;
  width:380px;
  background:var(--dark); border:1px solid rgba(201,168,76,.25);
  border-radius:12px; overflow:hidden;
  box-shadow:0 16px 64px rgba(0,0,0,.6);
  display:none; flex-direction:column;
  height:600px; max-height:calc(100vh - 120px);
}
.ai-chat-panel.open { display:flex; }
.ai-chat-head {
  padding:16px 20px;
  background:rgba(201,168,76,.08);
  border-bottom:1px solid rgba(201,168,76,.15);
  display:flex; align-items:center; gap:12px;
}
.ai-chat-head-icon {
  width:36px; height:36px; border-radius:50%;
  background:linear-gradient(135deg,var(--gold),var(--gold2));
  display:flex; align-items:center; justify-content:center;
  font-size:16px; flex-shrink:0;
}
.ai-chat-head-info { flex:1; }
.ai-chat-head-name { font-family:var(--ff-head); font-size:13px; font-weight:700; color:var(--white); }
.ai-chat-head-sub  { font-size:10px; color:rgba(255,255,255,.45); margin-top:1px; letter-spacing:.5px; }
.ai-chat-head-close { background:none; border:none; color:rgba(255,255,255,.4); cursor:pointer; font-size:20px; padding:0 4px; transition:color .2s; }
.ai-chat-head-close:hover { color:var(--white); }
.ai-chat-msgs {
  flex:1; min-height:0; overflow-y:auto; padding:20px;
  display:flex; flex-direction:column; gap:12px;
  scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.1) transparent;
}
.ai-msg { max-width:85%; line-height:1.6; font-size:13px; }
.ai-msg.bot {
  align-self:flex-start;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
  color:rgba(255,255,255,.85);
  padding:10px 14px; border-radius:0 10px 10px 10px;
}
.ai-msg.user {
  align-self:flex-end;
  background:var(--gold);
  color:var(--black);
  padding:10px 14px; border-radius:10px 0 10px 10px;
  font-weight:600;
}
.ai-chat-quick {
  padding:0 16px 10px;
  display:flex; flex-wrap:wrap; gap:5px;
  max-height:80px; overflow:hidden;
  transition:max-height .3s ease, opacity .3s ease, padding .3s;
}
.ai-chat-quick.hidden {
  max-height:0; padding-bottom:0; opacity:0; pointer-events:none;
}
.ai-qbtn {
  background:rgba(201,168,76,.12); border:1px solid rgba(201,168,76,.2);
  color:rgba(255,255,255,.7); font-size:11px;
  font-family:var(--ff-head); letter-spacing:.5px;
  padding:6px 12px; border-radius:20px;
  cursor:pointer; transition:all .2s;
}
.ai-qbtn:hover { background:rgba(201,168,76,.25); color:var(--gold); border-color:var(--gold); }
.ai-chat-inp {
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.06);
  display:flex; gap:8px; align-items:center;
}
.ai-chat-inp input {
  flex:1; background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  border-radius:4px; padding:10px 14px;
  color:var(--white); font-size:13px;
  font-family:var(--ff-body); outline:none;
  transition:border-color .2s;
}
.ai-chat-inp input:focus { border-color:rgba(201,168,76,.4); }
.ai-chat-inp input::placeholder { color:rgba(255,255,255,.3); }
.ai-chat-inp button {
  width:38px; height:38px; flex-shrink:0;
  background:var(--gold); border:none; border-radius:4px;
  color:var(--black); font-size:16px; cursor:pointer;
  transition:background .2s; display:flex; align-items:center; justify-content:center;
}
.ai-chat-inp button:hover { background:var(--gold2); }

/* ── 서브페이지 공통 HERO ── */
.sub-hero {
  padding:120px 0 72px;
  background:var(--black);
  position:relative; overflow:hidden;
}
.sub-hero::before {
  content:'';position:absolute;inset:0;
  background:radial-gradient(ellipse 70% 60% at 30% 50%, rgba(201,168,76,.06) 0%, transparent 65%);
}
.sub-hero-inner { position:relative; z-index:1; }
.sub-hero .section-label { color:var(--gold); }
.sub-hero .section-title { color:var(--white); }
.sub-hero .section-desc { color:rgba(255,255,255,.5); max-width:640px; }

/* ── 햄버거 버튼 ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none;
  cursor: pointer; padding: 6px;
  z-index: 1001;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: all .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 타이핑 인디케이터 */
.ai-typing { display: flex !important; align-items: center; gap: 4px; padding: 10px 14px !important; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(201,168,76,.6);
  animation: aiDot 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%,80%,100%{transform:scale(.7);opacity:.4} 40%{transform:scale(1);opacity:1} }
.nav-drawer {
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: rgba(3,6,18,.99);
  border-bottom: 2px solid rgba(201,168,76,.3);
  z-index: 9990;
  padding: 8px 0 20px;
  flex-direction: column;
  display: none;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}
.nav-drawer.open {
  display: flex !important;
}
.nav-drawer a {
  display: block;
  padding: 14px 28px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-family: var(--ff-head);
  font-size: 13px; letter-spacing: 2px;
  font-weight: 600; text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: color .2s, background .2s;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover, .nav-drawer a.active { color: var(--gold); background: rgba(201,168,76,.05); }
.nav-drawer .drawer-cta {
  margin: 12px 28px 0;
  padding: 12px; text-align: center;
  background: var(--gold); color: var(--black) !important;
  font-weight: 700; border-radius: 2px;
}
.nav-drawer .drawer-cta:hover { background: var(--gold2) !important; }

/* ── 반응형 ── */
@media(max-width:768px) {
  nav { padding: 0 20px; height: 60px; }
  .nav-logo img { height: 36px; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }

  .ctn { padding: 0 20px; }

  footer { padding: 40px 20px; }
  .ft-inner { grid-template-columns: 1fr; gap: 28px; }
  .ft-right { text-align: left; }
  .ft-sns { justify-content: flex-start; }
  .ft-logo-wrap img { height: 32px; }

  .section-title { letter-spacing: -0.5px; }

  .ai-fab { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 20px; }
  .ai-chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 86px; }
  .ai-fab-tooltip { display: none; }

  /* 서브페이지 HERO */
  .sub-hero { padding: 100px 0 48px; }
}

/* ── index.html 섹션별 모바일 ── */
@media(max-width:768px) {
  /* HERO */
  .hero-content { padding: 0 20px; }
  .hero h1 { font-size: clamp(38px,10vw,60px); letter-spacing: -2px; }
  .hero-sub { font-size: 13px; }
  .hero-btns { flex-direction: column; align-items: center; gap: 12px; }
  .hero-btns a { width: 100%; max-width: 280px; text-align: center; }
  .hero-stats { gap: 32px; bottom: 32px; }
  .hstat .n { font-size: 26px; }

  /* ABOUT */
  .about-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .about-visual { display: none; }
  .about-facts { grid-template-columns: 1fr 1fr !important; }

  /* AI 섹션 2컬럼 → 1컬럼 */
  #gyro-ai .ctn > div { grid-template-columns: 1fr !important; gap: 40px !important; }
  #gyro-ai .ctn > div > div:last-child { display: none; }

  /* WORKS 포트폴리오 3컬럼 → 1컬럼 */
  #pf-preview-grid { columns: 1 !important; }

  /* 실적 탭 */
  .wk-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .wk-list-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }

  /* 영상 탭 */
  .vid-grid { grid-template-columns: 1fr !important; }
  .shorts-grid { grid-template-columns: repeat(2,1fr) !important; }

  /* 서비스 그리드 */
  .sv-grid { grid-template-columns: 1fr !important; }

  /* 모달 */
  .vid-modal-inner { width: 96vw !important; }
}

@media(max-width:480px) {
  .hero h1 { font-size: 32px; letter-spacing: -1.5px; }
  .wk-list-grid { grid-template-columns: 1fr !important; }
  .shorts-grid { grid-template-columns: 1fr !important; }
  .about-facts { grid-template-columns: 1fr !important; }
}
