/* 공통 스타일, 프리텐다드 로드 + 디자인 토큰 + 리셋 + 버튼 */

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

:root {
  /* Brand */
  --color-primary: #0F52FF;
  --color-primary-hover: #2461FF;
  --color-primary-active: #0A3FCC;
  --color-primary-tint: #131B33;
  --color-primary-text: #5A78FF;

  /* Neutral */
  --color-bg: #0A0D16;
  --color-bg-soft: #12172A;
  --color-text: #EDEFF3;
  --color-text-muted: #8B93A8;
  --color-border: #232A3D;

  /* 외부 서비스 예외 컬러 */
  --color-kakao: #FEE500;
  --color-kakao-text: #191919;
  --color-kmong: #92FA72;
  --color-kmong-text: #212224;

  /* 타이포 */
  --font-h1: 800 56px/1.05 'Pretendard';
  --font-h2: 700 34px/1.2 'Pretendard';
  --font-h3: 600 22px/1.3 'Pretendard';
  --font-body-l: 500 19px/1.6 'Pretendard';
  --font-body: 400 16px/1.7 'Pretendard';
  --font-caption: 500 13px/1.6 'Pretendard';

  /* 여백 */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;

  /* 라운드 */
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* 그림자 */
  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-elevated: 0 0 0 1px rgba(15,82,255,0.4), 0 12px 32px rgba(15,82,255,0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--font-body);
  word-break: keep-all;
  overflow-wrap: normal;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 767px) {
  .container {
    padding: 0 16px;
  }
}

/* 버튼 — 5개 상태 (hover/focus/active/disabled) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  transition: background 200ms ease-out, transform 200ms ease-out, box-shadow 200ms ease-out;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-elevated); }
.btn-primary:focus-visible { outline: 3px solid rgba(15,82,255,0.45); outline-offset: 2px; }
.btn-primary:active { background: var(--color-primary-active); transform: scale(0.98); }
.btn-primary:disabled { background: #2A3040; color: #5C6270; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-text-muted); background: rgba(255,255,255,0.03); }
.btn-secondary:focus-visible { outline: 3px solid rgba(255,255,255,0.2); outline-offset: 2px; }
.btn-secondary:active { transform: scale(0.98); background: rgba(255,255,255,0.06); }
.btn-secondary:disabled { color: #5C6270; border-color: #2A3040; cursor: not-allowed; }

.btn-kakao {
  background: var(--color-kakao);
  color: var(--color-kakao-text);
}
.btn-kakao:hover { filter: brightness(0.96); }
.btn-kakao:focus-visible { outline: 3px solid rgba(254,229,0,0.5); outline-offset: 2px; }
.btn-kakao:active { transform: scale(0.98); filter: brightness(0.9); }
.btn-kakao:disabled { background: #4a4620; color: #8a8a70; cursor: not-allowed; }

.btn-kmong {
  background: var(--color-kmong);
  color: var(--color-kmong-text);
}
.btn-kmong:hover { filter: brightness(0.96); }
.btn-kmong:focus-visible { outline: 3px solid rgba(146,250,114,0.5); outline-offset: 2px; }
.btn-kmong:active { transform: scale(0.98); filter: brightness(0.9); }
.btn-kmong:disabled { background: #3a4a38; color: #7a8a78; cursor: not-allowed; }

.btn-full {
  width: 100%;
}

/* 등장 애니메이션 */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* 설계근거 캡션 (시그니처 요소) */
.rationale-caption {
  border-left: 2px solid var(--color-primary-text);
  padding-left: 12px;
  font: var(--font-caption);
  color: var(--color-text-muted);
}

/* ===== Header (공통, 전 페이지) ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 84px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* 다른 페이지에서 #about 등으로 앵커 이동할 때 sticky 헤더에 가려지지 않도록 여유 확보 */
#hero, #about, #service, #contact {
  scroll-margin-top: 84px;
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo img {
  height: 36px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header__nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.header__nav a[href="./portfolio.html"] {
  color: var(--color-primary-text);
  font-weight: 800;
}

.header__menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  margin-right: -9px;
}

.header__menu-toggle span {
  width: 22px;
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.header__menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.header__menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.header__menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ===== Footer (공통, 전 페이지) ===== */
.footer {
  background: var(--color-bg-soft);
  padding: var(--space-6) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer img {
  height: 36px;
  width: auto;
}

.footer__tagline {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.footer__copyright {
  font-size: 12px;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ===== 플로팅 메뉴 (공통, 전 페이지) ===== */
.floating-menu {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 68px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.floating-menu.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-menu__kakao,
.floating-menu__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 14px 6px;
  transition: opacity 200ms ease-out, max-height 200ms ease-out;
}

.floating-menu__kakao {
  background: var(--color-kakao);
  color: var(--color-kakao-text);
}

.floating-menu__kakao svg {
  width: 20px;
  height: 20px;
}

.floating-menu__kakao span,
.floating-menu__top span {
  font-size: 10px;
  font-weight: 600;
}

.floating-menu__top {
  background: var(--color-border);
  color: var(--color-primary-text);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.floating-menu__top.is-visible {
  opacity: 1;
  max-height: 80px;
  padding: 14px 6px;
}

.floating-menu__top svg {
  width: 18px;
  height: 18px;
}

/* ===== Responsive (공통) ===== */
@media (max-width: 1199px) {
  .header__inner {
    padding: 0 24px;
  }
}

@media (max-width: 767px) {
  .header {
    height: 64px;
  }
  #hero, #about, #service, #contact {
    scroll-margin-top: 64px;
  }
  .header__nav {
    display: none;
  }
  .header__nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg-soft);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px 20px;
    z-index: 99;
  }
  .header__nav.is-open a:not(.btn) {
    padding: 16px 4px;
    border-bottom: 1px solid var(--color-border);
  }
  .header__nav.is-open a.btn {
    margin-top: 12px;
  }
  .header__menu-toggle {
    display: flex;
  }

  .floating-menu {
    right: 16px;
    bottom: 16px;
    width: 60px;
    border-radius: 18px;
  }
  .floating-menu__kakao svg {
    width: 18px;
    height: 18px;
  }
  .floating-menu__top svg {
    width: 16px;
    height: 16px;
  }
}
