/* ---------------------------------------------------------------------------
   이상빈 — 개발하는 브랜드 마케터
   잔잔한 아이소메트릭 디오라마형 포트폴리오
   팔레트: ivory / beige / sage / charcoal (4색 고정)
--------------------------------------------------------------------------- */

:root {
  --ivory: #f5f1e8;
  --ivory-deep: #ece6d8;
  --beige: #dfd5c2;
  --sage: #77896f;
  --sage-soft: #a9b5a2;
  --charcoal: #33312c;
  --charcoal-soft: #6b675e;
  --line: rgba(51, 49, 44, 0.14);
  --panel-bg: #fbf9f3;
  --shadow: 0 18px 50px rgba(51, 49, 44, 0.16);
  --radius: 14px;
  --font:
    "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

::selection {
  background: var(--sage-soft);
  color: var(--charcoal);
}

a {
  color: var(--sage);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#app {
  opacity: 0;
  transition: opacity 0.6s ease;
}

#app.is-ready {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   레이아웃 골격
-------------------------------------------------------------------------- */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* 헤더 */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 14px;
}

.site-header .brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--charcoal);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav button {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--charcoal-soft);
  border-radius: 8px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.site-nav button:hover {
  color: var(--charcoal);
  background: var(--ivory-deep);
}

.site-nav button[aria-expanded="true"] {
  color: var(--charcoal);
  background: var(--beige);
}

/* 히어로 */

.hero {
  padding: clamp(18px, 3.5vh, 44px) 0 0;
  max-width: 560px;
}

.hero .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--sage);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.hero .sub {
  margin-top: 12px;
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--charcoal-soft);
}

.hero .cta-row {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}

.btn-primary {
  background: var(--charcoal);
  color: var(--ivory);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--charcoal-soft);
  transform: translateY(-2px);
}

.hero .pitch {
  margin-top: 14px;
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.7;
  color: var(--charcoal);
}

.hero-stats {
  margin-top: 20px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats li {
  flex: 1 1 150px;
  min-width: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
}

.hero-stats strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

.hero-stats span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--charcoal-soft);
}


/* --------------------------------------------------------------------------
   작업실 스테이지 (3D)
-------------------------------------------------------------------------- */

.stage {
  position: relative;
  flex: 1;
  min-height: 420px;
  margin-top: clamp(-40px, -2vh, -8px);
}

.stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: manipulation;
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--charcoal-soft);
  background: rgba(251, 249, 243, 0.82);
  border: 1px solid var(--line);
  padding: 7px 16px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

/* 오브젝트 호버 라벨 */

.object-label {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -130%);
  background: var(--charcoal);
  color: var(--ivory);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: center;
  max-width: min(280px, calc(100% - 32px));
  padding: 7px 12px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(51, 49, 44, 0.18);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.object-label .label-desc {
  display: block;
  margin-left: 0;
  margin-top: 2px;
  font-weight: 400;
  opacity: 0.75;
}

.object-label.is-below {
  transform: translate(-50%, 18px);
}

.object-label.is-visible {
  opacity: 1;
}


/* 키보드 접근용 핫스팟 버튼 (화면상 시각적 존재 없음, 포커스 시 라벨 표시) */

.hotspot-buttons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot-buttons button {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  pointer-events: auto;
}

.hotspot-buttons button:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   모바일: 세로형 미니어처 카드 목록
-------------------------------------------------------------------------- */

.mobile-room {
  display: none;
}

.mobile-room ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.mobile-room li {
  display: contents;
}

.object-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.object-card:active {
  transform: scale(0.98);
}

.object-card .glyph {
  width: 46px;
  height: 46px;
  color: var(--sage);
}

.object-card .glyph svg {
  width: 100%;
  height: 100%;
}

.object-card .card-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.object-card .card-desc {
  font-size: 12.5px;
  color: var(--charcoal-soft);
  margin-top: -7px;
}

/* --------------------------------------------------------------------------
   정보 패널
-------------------------------------------------------------------------- */

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(51, 49, 44, 0.18);
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 40;
}

.panel-backdrop.is-open {
  opacity: 1;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 92vw);
  background: var(--panel-bg);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 50;
  transform: translateX(24px);
  opacity: 0;
  transition: transform 0.26s ease, opacity 0.26s ease;
  display: flex;
  flex-direction: column;
}

.panel.is-open {
  transform: translateX(0);
  opacity: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 0;
}

.panel-head .panel-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}

.panel-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.panel-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 16px;
  line-height: 1;
  color: var(--charcoal-soft);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.panel-close:hover {
  background: var(--ivory-deep);
  color: var(--charcoal);
}

.panel-body {
  padding: 18px 28px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.panel-body > * + * {
  margin-top: 16px;
}

.panel-body p {
  font-size: 15px;
  color: var(--charcoal);
}

.panel-body .muted {
  color: var(--charcoal-soft);
  font-size: 14px;
}

/* 정의 리스트: 문제/역할/방식/결과 */

.detail-list {
  border-top: 1px solid var(--line);
}

.detail-list > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sage);
  margin-bottom: 5px;
}

.detail-list dd {
  font-size: 14.5px;
  line-height: 1.7;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  font-size: 12px;
  color: var(--charcoal-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}

.link-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.link-row a::after {
  content: "\2197";
  color: var(--sage);
}

.link-row a:hover {
  border-color: var(--sage);
  background: var(--ivory);
}

.project-snapshot {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ivory);
  padding: 16px;
}

.project-snapshot > * + * {
  margin-top: 14px;
}

.project-lead,
.snapshot-summary {
  color: var(--charcoal-soft);
}

.snapshot-summary {
  max-width: 44ch;
}

.project-notes {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ivory);
  padding: 12px 14px;
}

.project-notes summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.project-notes summary::-webkit-details-marker {
  display: none;
}

.project-notes[open] summary {
  margin-bottom: 12px;
}

.snapshot-media-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.snapshot-media-card {
  flex: 0 0 min(220px, 72%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-bg);
  color: var(--charcoal);
  text-decoration: none;
  overflow: hidden;
  scroll-snap-align: start;
}

.snapshot-media-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.snapshot-media-caption {
  display: block;
  padding: 10px 12px 12px;
  font-size: 12.5px;
  color: var(--charcoal-soft);
}

.snapshot-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.snapshot-stats li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg);
  padding: 12px 13px;
}

.snapshot-stat-label,
.snapshot-stat-note {
  display: block;
}

.snapshot-stat-label {
  font-size: 12px;
  color: var(--sage);
  font-weight: 600;
}

.snapshot-stat-value {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.snapshot-stat-note,
.object-card .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.snapshot-stat-note {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--charcoal-soft);
  line-height: 1.55;
}

.snapshot-media-card:hover {
  border-color: var(--sage);
  background: var(--ivory);
}
/* 목록형 콘텐츠 (works 목록, experiments, now, jasain 제품) */

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.entry-list > li {
  border-bottom: 1px solid var(--line);
}

.entry-list > li:first-child {
  border-top: 1px solid var(--line);
}

.entry-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 14px 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.15s ease;
}

.entry-button:hover {
  background: var(--ivory);
}

.entry-button .entry-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.entry-button .entry-kind {
  flex: none;
  font-size: 12px;
  color: var(--sage);
  font-weight: 600;
}

.entry-static {
  padding: 14px 2px;
}

.entry-static .entry-title {
  font-size: 15px;
  font-weight: 700;
}

.entry-static .entry-desc {
  font-size: 13.5px;
  color: var(--charcoal-soft);
  margin-top: 4px;
}

.entry-static .entry-meta {
  font-size: 12px;
  color: var(--sage);
  margin-top: 5px;
}

.entry-static a {
  font-size: 13px;
}

.back-button {
  border: 0;
  background: transparent;
  color: var(--sage);
  font-size: 13.5px;
  font-weight: 600;
  padding: 2px 0;
}

/* 연락 폼 */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal-soft);
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--charcoal);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--sage);
  outline-offset: 0;
  border-color: transparent;
}

.contact-form textarea {
  min-height: 110px;
  resize: vertical;
}

.contact-form .form-status {
  font-size: 13px;
  color: var(--sage);
  min-height: 1.2em;
}

.site-meta-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ivory);
  padding: 16px;
}

.site-meta-card > * + * {
  margin-top: 16px;
}

.site-meta-section > .muted {
  margin-bottom: 8px;
  font-weight: 600;
}

.site-meta-list {
  margin-top: 0;
}

.site-meta-footnote {
  font-size: 12.5px;
  color: var(--charcoal-soft);
}

/* 푸터 */

.site-footer {
  padding: 20px 0 30px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--charcoal-soft);
}

.footer-meta-trigger {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-bg);
  color: var(--charcoal-soft);
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
}

.footer-meta-trigger:hover {
  border-color: var(--sage);
  color: var(--charcoal);
}

/* --------------------------------------------------------------------------
   반응형
-------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  /* 태블릿: 패널을 하단 시트로 */
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    transform: translateY(30px);
  }

  .panel.is-open {
    transform: translateY(0);
  }

  .panel-head {
    padding-top: 20px;
  }
}

@media (max-width: 719px) {
  /* 모바일: 3D 방 대신 카드 목록 */
  .stage {
    display: none;
  }

  .mobile-room {
    display: block;
    padding-bottom: 24px;
  }

  .hero {
    padding-top: 26px;
  }

  .site-nav {
    display: none;
  }

  .snapshot-stats {
    grid-template-columns: 1fr;
  }

  .snapshot-media-card {
    flex-basis: min(240px, 82%);
  }

  .mobile-room .mobile-note {
    margin-top: 26px;
    font-size: 13px;
    color: var(--charcoal-soft);
  }
}

@media (min-width: 720px) and (max-height: 640px) {
  .stage {
    min-height: 380px;
  }
}

/* --------------------------------------------------------------------------
   모션 억제
-------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  #app,
  .panel,
  .panel-backdrop,
  .btn,
  .object-card,
  .object-label {
    transition: none !important;
  }
}

/* 백드롭은 열려 있을 때만 클릭을 받는다 */
.panel-backdrop {
  pointer-events: none;
}

.panel-backdrop.is-open {
  pointer-events: auto;
}

/* hidden 속성이 display 지정보다 우선하도록 강제 */
.panel[hidden],
.panel-backdrop[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   방 전환 UI
-------------------------------------------------------------------------- */

.room-switch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 4px;
  background: rgba(251, 249, 243, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(4px);
}

.room-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal-soft);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.room-switch button:hover {
  color: var(--charcoal);
}

.room-switch button[aria-selected="true"] {
  background: var(--charcoal);
  color: var(--ivory);
}

/* 방 전환 페이드 오버레이 */

.stage-fade {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--ivory);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.stage-fade.is-active {
  opacity: 1;
}

/* 모바일 방 섹션 제목 */

.mobile-room-title {
  margin-top: 26px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}

.mobile-room-title:first-of-type {
  margin-top: 8px;
}

.mobile-room ul {
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .room-switch button,
  .stage-fade {
    transition: none !important;
  }
}
