/* ---------- 색 / 기본값 (여기서 분위기 조절) ---------- */
:root {
  --accent: #3fae5a;        /* 포인트 색 (직함, 강조 글자, 버튼) */
  --text: #222;
  --muted: #919191;
  --line: #e6e6e6;
  --band: #e4e4e4;          /* 연혁 강조 띠 */
  --chip: #f2f2f2;
  --header-bg: #f5f5f5;
  --header-h: 74px;
  --max: 1140px;
  --font-en: "Dosis", "Noto Sans KR", sans-serif;
  --font-ko: "Noto Sans KR", "Dosis", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #fff; color: var(--muted);
  font-family: var(--font-en); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- 헤더 ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); background: var(--header-bg); }
.header__inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid #222; color: #222;
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  transition: transform .3s;
}
.logo:hover { transform: rotate(-8deg); }
.logo--img { border: 0; width: auto; height: 52px; border-radius: 0; }
.logo--img img { height: 100%; width: auto; }

.nav { display: flex; gap: 38px; }
.nav a { font-size: 15px; color: #555; letter-spacing: .02em; transition: color .2s; }
.nav a:hover { color: #111; }
.nav a.is-active { color: #c4c4c4; }

.menu-toggle { display: none; background: none; border: 0; padding: 10px; flex-direction: column; gap: 5px; }
.menu-toggle span { width: 22px; height: 1.5px; background: #333; display: block; transition: .25s; }

main { padding-top: var(--header-h); min-height: 70vh; }
.page { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 메인 배너 ---------- */
/* 프로젝트 화면을 "창" 안에 넣어서 사이트 헤더·내비와 섞이지 않게 한다 */
.hero { background: #16161b; color: #fff; border-bottom: 1px solid #000; }
.hero__inner {
  max-width: var(--max); margin: 0 auto; padding: 56px 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: 48px; align-items: center;
}
.hero__text { display: flex; flex-direction: column; gap: 28px; }
.hero__count { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.5); }
.hero__count span { color: var(--accent); text-transform: uppercase; }
.hero__count b { color: #fff; font-weight: 500; }
.hero__caps { display: grid; }
.hero__cap {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  opacity: 0; transform: translateY(8px); visibility: hidden;
  transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s;
}
.hero__cap.is-on { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.hero__cap strong { font-family: var(--font-en); font-weight: 600; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: .02em; }
.hero__cap em { font-style: normal; font-family: var(--font-ko); font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.78); text-wrap: pretty; }
.hero__meta { font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,.45); }
.hero__more {
  margin-top: 8px; font-family: var(--font-ko); font-size: 14px; color: #fff;
  padding: 9px 16px; border: 1px solid rgba(255,255,255,.35); transition: background .2s, border-color .2s, color .2s;
}
.hero__more span { display: inline-block; transition: transform .2s; }
.hero__more:hover { background: #fff; border-color: #fff; color: #16161b; }
.hero__more:hover span { transform: translateX(3px); }
.hero__more:focus-visible, .hero__arrow:focus-visible, .hero__dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hero__ctrl { display: flex; align-items: center; gap: 14px; }
.hero__arrow {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0 0 3px;
  background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 22px; line-height: 1;
  transition: border-color .2s, background .2s;
}
.hero__arrow:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.hero__dots { display: flex; gap: 8px; }
.hero__dots button { width: 22px; height: 3px; padding: 0; border: 0; background: rgba(255,255,255,.25); transition: background .2s, width .3s; }
.hero__dots button.is-on { width: 36px; background: var(--accent); }

.hero__frame {
  border-radius: 10px; overflow: hidden; background: #0d0d10;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px rgba(0,0,0,.5);
}
.hero__bar { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: #26262d; }
.hero__bar i { width: 10px; height: 10px; border-radius: 50%; background: #4a4a54; }
.hero__url {
  margin-left: 12px; flex: 1; max-width: 360px; height: 20px; padding: 0 12px; border-radius: 10px;
  background: #1a1a20; color: rgba(255,255,255,.55); font-family: var(--font-mono); font-size: 11px; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero__screen { position: relative; aspect-ratio: 16 / 10; }
.hero__slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.hero__slide.is-on { opacity: 1; pointer-events: auto; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero__slide.is-contain img { object-fit: contain; object-position: center; }

/* ---------- 프로필 + 연혁 ---------- */
.about {
  max-width: var(--max); margin: 0 auto; padding: 44px 20px 60px;
  display: grid; grid-template-columns: 1fr 2fr; gap: 40px;
}
.profile { color: var(--text); font-family: var(--font-ko); }
.profile__name { font-weight: 700; font-size: 28px; margin: 0 0 18px; text-align: center; color: #111; }
.profile__role { color: var(--accent); font-family: var(--font-en); font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.profile__links { list-style: none; margin: 0 0 22px; padding: 0; font-size: 13px; line-height: 1.75; }
.profile__links a { color: var(--accent); word-break: break-all; }
.profile__links a:hover { text-decoration: underline; }
.profile__status { font-size: 13px; margin: 0 0 20px; }
.profile__status b, .profile__intro b { color: var(--accent); font-weight: 500; }
.profile__intro { font-size: 13px; line-height: 1.75; margin: 0 0 18px; }
.profile__stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; color: #444;
  background: var(--chip); padding: 4px 9px; border-radius: 3px;
}
.profile__mail { font-family: var(--font-en); font-weight: 500; font-size: 20px; color: #111; margin: 0; word-break: break-all; }
.profile__mail a:hover { color: var(--accent); }

.credits { columns: 2; column-gap: 36px; font-family: var(--font-ko); }
.credits__year { break-inside: avoid; margin-bottom: 26px; }
.credits__year h3 { font-family: var(--font-en); font-weight: 500; font-size: 12px; color: var(--muted); margin: 0 0 8px; letter-spacing: .05em; }
.credits__year ul { list-style: none; margin: 0; padding: 0; }
.credits__year li { font-size: 12.5px; line-height: 1.45; color: #333; padding: 2px 0; }
.credits__year li.hl span { background: var(--band); padding: 1px 3px; }
.credits__year li a:hover span { color: var(--accent); }

/* ---------- 목록 페이지 공통 ---------- */
.works { max-width: var(--max); margin: 0 auto; padding: 50px 20px 70px; }
.works__title {
  font-family: var(--font-en); font-weight: 400; font-size: 22px;
  letter-spacing: .12em; color: #333; text-align: center; margin: 0 0 26px;
}

.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 34px; }
.filters button {
  background: none; border: 0; padding: 4px 2px; color: #aaa; font-size: 14px; letter-spacing: .04em;
  border-bottom: 1px solid transparent; transition: .2s;
}
.filters button:hover { color: #333; }
.filters button.is-on { color: #222; border-color: #222; }

/* 프로젝트 카드 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 22px; }
.card { display: block; color: var(--text); }
.card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #1a1b26; }
.card__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.card__view {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.45); color: #fff; letter-spacing: .3em; font-size: 13px;
  opacity: 0; transition: opacity .3s;
}
.card:hover .card__img img { transform: scale(1.06); }
.card:hover .card__view { opacity: 1; }
.card__body { padding-top: 14px; }
.card__meta { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; margin: 0 0 4px; }
.card__title { font-family: var(--font-en); font-weight: 600; font-size: 18px; margin: 0 0 4px; color: #111; }
.card__sum { font-family: var(--font-ko); font-size: 12.5px; line-height: 1.55; color: #555; margin: 0 0 10px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.tag::before { content: "#"; opacity: .6; }
.empty { grid-column: 1 / -1; text-align: center; font-family: var(--font-ko); padding: 40px 0; }

.more {
  display: block; margin: 44px auto 0; min-width: 210px; padding: 12px 24px;
  background: #fff; border: 1px solid #333; color: #333; font-family: var(--font-ko); font-size: 13px;
  transition: background .2s, color .2s;
}
.more:hover { background: #333; color: #fff; }

/* ---------- 프로젝트 상세 ---------- */
.detail { max-width: 920px; margin: 0 auto; padding: 36px 20px 70px; color: var(--text); }
.detail__back { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.detail__back:hover { color: #111; }
.detail__head { text-align: center; margin: 26px 0 30px; }
.detail__head h1 { font-family: var(--font-en); font-weight: 600; font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; color: #111; letter-spacing: .02em; }
.detail__sum { font-family: var(--font-ko); font-size: 15px; color: #555; margin: 0 0 20px; }
.detail__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid #333; padding: 9px 20px; font-size: 13px; color: #333; letter-spacing: .04em; transition: .2s;
}
.btn:hover { background: #333; color: #fff; }
/* 대표 이미지는 자르지 않고 원래 비율 그대로. 세로로 긴 이미지는 화면 높이의 80%까지만 */
.detail__cover { background: #16161b; display: flex; justify-content: center; }
.detail__cover img { width: auto; max-width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1a1b26; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.detail__grid { display: grid; grid-template-columns: 220px 1fr; gap: 44px; margin-top: 44px; }
.detail__meta { margin: 0; font-family: var(--font-ko); font-size: 13px; align-self: start; position: sticky; top: calc(var(--header-h) + 20px); }
.detail__meta dt { font-family: var(--font-en); color: var(--muted); font-size: 12px; letter-spacing: .08em; margin-top: 16px; }
.detail__meta dt:first-child { margin-top: 0; }
.detail__meta dd { margin: 4px 0 0; color: #333; line-height: 1.5; }
.detail__sec { margin-bottom: 34px; font-family: var(--font-ko); font-size: 14px; line-height: 1.8; color: #333; }
.detail__sec h3, .detail__shots h3 {
  font-family: var(--font-en); font-weight: 500; font-size: 13px; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.detail__sec p { margin: 0 0 8px; }
.dash { list-style: none; margin: 0; padding: 0; }
.dash li { padding-left: 16px; position: relative; }
.dash li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.trouble { background: #fafafa; border-left: 2px solid var(--accent); padding: 12px 16px; margin-bottom: 10px; }
.trouble p { margin: 0; }
.trouble b { display: inline-block; min-width: 42px; color: var(--accent); font-weight: 500; font-size: 12.5px; }

.detail__shots { margin-top: 10px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shot { padding: 0; border: 0; background: #1a1b26; aspect-ratio: 16 / 10; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s; }
.shot:hover img { transform: scale(1.05); }

.detail__nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); }
.detail__nav a { font-family: var(--font-en); font-size: 16px; color: #333; display: flex; flex-direction: column; gap: 2px; }
.detail__nav a:last-child { text-align: right; }
.detail__nav small { font-size: 11px; letter-spacing: .15em; color: var(--muted); }
.detail__nav a:hover { color: var(--accent); }

/* ---------- 기술 스택 ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 60px; max-width: 900px; margin: 0 auto; }
.skills__group h3 {
  font-family: var(--font-en); font-weight: 500; font-size: 13px; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.skills__group ul { list-style: none; margin: 0; padding: 0; }
.skills__group li { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.skill__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.skill__name { font-family: var(--font-mono); font-size: 13.5px; color: #222; }
.dots { display: flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #e2e2e2; }
.dots i.on { background: var(--accent); }
.skill__note { font-family: var(--font-ko); font-size: 12.5px; color: #777; margin: 5px 0 0; }

/* ---------- 연락처 ---------- */
.contact { text-align: center; padding: 90px 20px 110px; font-family: var(--font-ko); }
.contact h2 { font-family: var(--font-en); font-weight: 400; letter-spacing: .14em; color: #333; font-size: 22px; margin: 0 0 30px; }
.contact__mail { font-family: var(--font-en); font-size: clamp(22px, 4vw, 34px); color: #111; font-weight: 500; word-break: break-all; }
.contact__mail:hover { color: var(--accent); }
.contact p { line-height: 1.9; font-size: 14px; margin: 26px 0 0; }
.contact__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.contact__links a { border: 1px solid #ccc; padding: 8px 18px; font-size: 13px; color: #444; transition: .2s; }
.contact__links a:hover { border-color: #333; color: #111; }

/* ---------- 푸터 ---------- */
.footer { text-align: center; padding: 20px 20px 40px; }
.footer__mail { font-size: 13px; letter-spacing: .03em; margin: 0 0 22px; }
.footer__social { display: flex; justify-content: center; gap: 26px; }
.footer__social a { color: #8a8a8a; transition: color .2s; }
.footer__social a:hover { color: #222; }
.footer__social svg { width: 18px; height: 18px; display: block; }

.to-top {
  position: fixed; right: 100px; bottom: 56px; z-index: 40; width: 36px; height: 36px;
  display: grid; place-items: center; background: #e9e9e9; color: #999; border: 0;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.to-top.is-on { opacity: 1; pointer-events: auto; }
.to-top:hover { color: #333; }

/* ---------- 라이트박스 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,10,10,.92);
  display: flex; align-items: center; justify-content: center; padding: 40px 70px;
}
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: calc(100vh - 120px); max-width: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { color: #bbb; font-family: var(--font-ko); font-size: 13px; margin-top: 14px; }
.lightbox button { position: absolute; background: none; border: 0; color: #ddd; }
.lightbox button:hover { color: #fff; }
.lightbox__close { top: 14px; right: 22px; font-size: 38px; font-weight: 200; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 56px; font-weight: 200; padding: 10px; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; gap: 44px; }
  .to-top { right: 20px; bottom: 24px; }
}
@media (max-width: 760px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .detail__grid { grid-template-columns: 1fr; gap: 30px; }
  .detail__meta { position: static; display: grid; grid-template-columns: 60px 1fr; gap: 10px 12px; }
  .detail__meta dt { margin: 0; }
  .detail__meta dd { margin: 0; }
  .skills { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --header-h: 62px; }
  .logo { width: 40px; height: 40px; font-size: 11px; }
  .menu-toggle { display: flex; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--header-bg);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav.is-open { max-height: 420px; border-bottom: 1px solid var(--line); }
  .nav a { padding: 15px 24px; border-top: 1px solid var(--line); }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .credits { columns: 1; }
  .hero__inner { grid-template-columns: 1fr; gap: 28px; padding: 32px 16px 36px; }
  .hero__frame { order: -1; border-radius: 8px; }
  .hero__bar { height: 26px; padding: 0 10px; gap: 5px; }
  .hero__bar i { width: 8px; height: 8px; }
  .hero__url { height: 16px; line-height: 16px; font-size: 10px; margin-left: 8px; }
  .hero__text { gap: 18px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .lightbox { padding: 40px 10px; }
  .lightbox__nav { font-size: 40px; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
