/* ==========================================================================
   메인 스타일 — 레이아웃 · 컴포넌트 · 반응형 · 애니메이션
   (테마 변수는 themes.css 참고)
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* 고정 네비 높이 보정 */
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

/* ---------- 배경 데코 ---------- */
.bg-grid {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  display: none;
  position: fixed;
  top: -10%;
  left: 50%;
  width: 70vw;
  height: 60vh;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.brand-name { font-size: 1.05rem; }

.nav-links {
  display: flex;
  gap: 0.4rem;
}
.nav-link {
  position: relative;
  padding: 0.5rem 0.9rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.active { color: var(--accent); }
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
}
.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   BUTTONS / TAGS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    opacity 0.2s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--accent-soft); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 68px;
}
.hero-inner { text-align: center; padding-block: 3rem; }
.hero-eyebrow {
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.8rem;
}
.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.hero-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 4.5vw, 2.4rem);
  min-height: 1.4em;
  margin-bottom: 1.4rem;
}
.typed {
  color: var(--accent);
}
.caret {
  color: var(--accent);
  font-weight: 400;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-summary {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
}
.hero-cta {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stats {
  display: flex;
  gap: clamp(1.5rem, 6vw, 4rem);
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats li { text-align: center; }
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  display: grid;
  place-items: start center;
  padding-top: 8px;
}
.scroll-hint span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollDot 1.6s var(--ease) infinite;
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ==========================================================================
   SECTIONS (공통)
   ========================================================================== */
.section { padding-block: clamp(6rem, 14vw, 11rem); }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section-kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
}
.section-sub {
  margin-top: 0.9rem;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }
.about-text p:first-child { color: var(--text); font-size: 1.1rem; }
.about-points { margin-top: 1.2rem; display: grid; gap: 0.6rem; }
.about-points li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-muted);
}
.about-points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.about-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.about-avatar {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  color: #fff;
  background: var(--accent);
  margin-bottom: 1.4rem;
}
.about-meta { display: grid; gap: 0.9rem; }
.about-meta > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
}
.about-meta > div:last-child { border-bottom: 0; padding-bottom: 0; }
.about-meta dt { color: var(--text-faint); font-size: 0.85rem; }
.about-meta dd { font-weight: 600; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin-inline: auto;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-strong);
}
.timeline-item {
  position: relative;
  padding-bottom: 2.6rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2rem + 1px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-period {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.timeline-card {
  margin-top: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.3rem 1.4rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.timeline-card:hover { border-color: var(--card-hover-border); transform: translateX(4px); }
.timeline-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.timeline-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.timeline-company { color: var(--text-muted); font-weight: 500; margin-bottom: 0.7rem; }
.timeline-summary { color: var(--text-muted); margin-bottom: 0.9rem; font-size: 0.96rem; }
.timeline-highlights { display: grid; gap: 0.45rem; margin-bottom: 1rem; }
.timeline-highlights li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}
.timeline-highlights li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-size: 0.8rem;
}
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- PROJECTS ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  transition: border-color 0.28s var(--ease);
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.project-card:hover {
  border-color: var(--card-hover-border);
}
.project-card:hover::before { opacity: 1; }
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--card-hover-border);
}
.project-card:focus-visible::before { opacity: 1; }
.project-thumb {
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
}
.thumb-violet { background: linear-gradient(135deg, #3d4a5c, #55637a); }
.thumb-blue { background: linear-gradient(135deg, #2f4459, #456179); }
.thumb-cyan { background: linear-gradient(135deg, #37505c, #4d6b77); }
/* 코드 생성 SVG 비주얼: 그라데이션 배경 대신 SVG가 전체를 채움 */
.project-thumb.has-visual {
  padding: 0;
  background: none;
  overflow: hidden;
  border: 1px solid var(--border);
}
.project-visual,
.project-visual svg {
  display: block;
  width: 100%;
  height: 100%;
}
.project-visual svg { object-fit: cover; }
.project-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.project-blurb { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 1rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.project-links { display: flex; gap: 1rem; }
.project-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.project-links a:hover { text-decoration: underline; }
.project-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.project-card.has-detail { cursor: pointer; }
.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}
.project-foot .project-links { margin: 0; }
.project-more {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 999px;
  padding: 0.34rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.project-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.project-more:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}

/* ---------- PROJECT MODAL ---------- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 16, 0.62);
  backdrop-filter: blur(4px);
  animation: modalFade 0.2s var(--ease);
}
.modal-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.55);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  animation: modalPop 0.22s var(--ease);
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}
/* 모달 상단 와이드 비주얼 (코드 생성 SVG) — dialog 패딩만큼 음수 마진으로 가장자리까지 채움 */
.modal-visual {
  --pad: clamp(1.5rem, 4vw, 2.4rem);
  width: calc(100% + var(--pad) * 2);
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 1.4rem;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-visual svg {
  display: block;
  width: 100%;
  height: 100%;
}
.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.modal-meta .modal-dot { opacity: 0.5; }
.modal-blurb {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.96rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.modal-section { margin-bottom: 1.3rem; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 0.7rem;
  letter-spacing: 0.01em;
}
.modal-section ul { display: grid; gap: 0.5rem; }
.modal-section li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.modal-section li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.modal-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* 제품 구성(라인업) 카드 그리드 */
.lineup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}
.lineup-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
}
.lineup-name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}
.lineup-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.15rem 0 0.4rem;
}
.lineup-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}
/* 실제 제품 화면 / 현장 사진 갤러리 */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.7rem;
}
.shot {
  margin: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.shot img {
  display: block;
  width: 100%;
  /* 고정 px 대신 칸 너비에 비례 — 열이 넓어지면 사진도 같이 커진다 */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-alt);
}
.shot figcaption {
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}
/* 파노라마 형태(가로로 긴) 캡처 — 잘리지 않도록 전체 폭으로 펼친다 */
.shot.wide {
  grid-column: 1 / -1;
}
.shot.wide img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}
/* 제품컷 등 잘리면 안 되는 사진 — 칸 폭은 유지하고 전체가 보이도록 맞춘다 */
.shot.fit img {
  object-fit: contain;
  padding: 0.5rem;
}
/* 세로로 긴 모바일 캡처 — 4:3에 맞추면 대부분 잘리므로 세로 비율을 준다 */
.shot.tall img {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  padding: 0.5rem;
}
.shot-credit {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* 코드 생성 SVG 다이어그램 — 사진(.shot)과 달리 잘리면 안 되므로 전체 폭에 비율 그대로 */
.diagram {
  margin: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  /* viewBox(640×320)와 동일 — hero의 slice 크롭이 라벨을 자르지 않게 비율을 고정한다 */
  aspect-ratio: 2 / 1;
}
.diagram figcaption {
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .shot.wide img { height: auto; }
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-dialog { animation: none; }
}

/* ---------- STRENGTHS ---------- */
.strengths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}
.strength-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s var(--ease);
  overflow: hidden;
}
.strength-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--border-strong);
  opacity: 0.85;
}
.strength-card:hover {
  border-color: var(--card-hover-border);
}
.strength-icon {
  display: inline-flex;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.85rem;
}
.strength-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
.strength-summary {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.strength-proof {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.skill-group {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.3rem;
  transition: border-color 0.25s var(--ease);
}
.skill-group:hover { border-color: var(--card-hover-border); }
.skill-group h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.55rem;
  color: var(--accent);
}
.skill-note {
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.skill-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.skill-list span {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- CONTACT ---------- */
.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.contact-text h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: 0.4rem;
}
.contact-text p { color: var(--text-muted); max-width: 420px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem; }
.contact-info {
  font-size: 0.98rem;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 1.6rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer-top { color: var(--text-muted); font-weight: 600; }
.footer-top:hover { color: var(--accent); }

/* ==========================================================================
   REVEAL 애니메이션
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
/* Hero 내부 reveal은 순차 등장 */
.hero .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero .reveal:nth-child(2) { transition-delay: 0.12s; }
.hero .reveal:nth-child(3) { transition-delay: 0.19s; }
.hero .reveal:nth-child(4) { transition-delay: 0.26s; }
.hero .reveal:nth-child(5) { transition-delay: 0.33s; }
.hero .reveal:nth-child(6) { transition-delay: 0.40s; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-card { max-width: 360px; }
}

@media (max-width: 720px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 0.8rem clamp(1.1rem, 4vw, 2rem) 1.2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link { padding: 0.85rem 0.5rem; font-size: 1rem; border-radius: 8px; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   접근성 — 모션 최소화 선호
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   PRINT — PDF 첨부용 출력
   ========================================================================== */
@media print {
  /* 라이트 테마 강제 — 다크 배경이 인쇄되지 않도록 */
  :root,
  html[data-theme="dark"],
  html[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --bg-card: #ffffff;
    --text: #16181d;
    --text-muted: #3d434e;
    --text-faint: #5b6270;
    --border: #c9ced8;
  }

  html,
  body {
    background: #fff !important;
    color: #16181d !important;
  }

  /* 스크롤로 등장하는 요소를 모두 펼친다 — 없으면 섹션이 통째로 빈다 */
  .reveal,
  .reveal.in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* 화면 전용 UI·장식 제거 */
  .navbar,
  .menu-toggle,
  .theme-toggle,
  .nav-actions,
  .bg-grid,
  .bg-glow,
  .modal,
  .modal-backdrop,
  .footer-top {
    display: none !important;
  }

  /* 첫 장 맨 위에 포트폴리오 주소를 한 줄로 (hero 레이아웃 밖) */
  .hero-inner::before {
    content: "Portfolio · https://suhunjang.github.io/portfolio/";
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #c9ced8;
    font-size: 10pt;
    font-weight: 600;
    color: #1b56d6;
    text-align: left;
  }

  /* 타이핑 애니메이션은 인쇄 시 글자가 잘린 채 굳으므로,
     JS가 채우는 #typed를 숨기고 전체 문구를 CSS로 찍는다. */
  .caret,
  .scroll-hint { display: none !important; }
  #typed { display: none !important; }
  .hero-role::after {
    content: "COO · CTO · Full-Stack & AI Leader";
  }

  /* 인쇄 시 상단 여백 보정 (navbar 제거분) + 빈 공간 압축 */
  .hero {
    padding-top: 0 !important;
    padding-bottom: 0.8rem !important;
    min-height: auto !important;
    height: auto !important;
    display: block !important;
  }
  section,
  .section { padding: 1rem 0 !important; }

  /* About 첫 문단은 hero 소개와 동일 텍스트 — 인쇄에서는 중복 제거 */
  #aboutSummary { display: none !important; }

  /* 카드가 페이지 경계에서 잘리지 않도록.
     .timeline-item은 길어서 avoid를 걸면 페이지 하단이 크게 비므로 제외한다. */
  .strength-card,
  .project-card,
  .about-card,
  .skill-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  /* 경력은 카드 단위로만 보호 (항목 전체가 아니라) */
  .timeline-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 콘텐츠 폭을 지면 전체로 — 좁은 폭이 페이지 수를 늘리는 주원인 */
  .container {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 넓힌 폭에서 그리드가 1열로 무너지지 않도록 2열을 명시한다 */
  .project-grid,
  .strengths-grid,
  .skills-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.7rem !important;
  }

  /* 세로 여백 압축 — 13p → 목표 9~10p */
  .section-head { margin-bottom: 0.8rem !important; }
  .timeline-item { margin-bottom: 0.9rem !important; }
  .hero-stats { margin-top: 0.9rem !important; }
  .hero-cta { margin: 0.8rem 0 !important; }
  p { orphans: 3; widows: 3; }

  h1, h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* 링크는 주소를 함께 노출 (종이에서도 접근 가능하도록) */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    color: #5b6270;
    word-break: break-all;
  }
  /* 단, 내부 앵커·중복 노출은 제외 */
  .nav-link::after,
  .brand::after {
    content: "" !important;
  }

  @page {
    margin: 14mm 12mm;
  }
}
