﻿/* ============================================================
   desk.css — 랜딩 "기획자의 데스크" (이미지 배경 + 라이브 레이어)
   배경: 2002x786 기준 레이어 씬
   오브젝트는 개별 투명 PNG 레이어와 %좌표로 정렬.
   ============================================================ */

/* ---------- 무대 ---------- */
.desk {
  position: relative;
  width: 100vw;
  height: calc(100vh - var(--nav-h));
  max-width: none;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}

.desk__stage {
  position: absolute;
  left: 50%; top: 50%;
  width: max(100vw, calc((100vh - var(--nav-h)) * 2002 / 786));
  height: max(calc(100vw * 786 / 2002), calc(100vh - var(--nav-h)));
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.desk-layer {
  position: absolute;
  display: block;
  height: auto;
  user-select: none;
  pointer-events: none;
  transition: transform 0.28s var(--ease), filter 0.28s var(--ease);
}
.menu-object {
  transform-origin: center;
}

.layer-pad       { left: 4.6%;  top: -14.1%; width: 90.1%; z-index: 1; }
.layer-lamp      { left: 12.3%; top: -6.9%;  width: 18.6%; z-index: 4; }
.layer-documents { left: 15.3%; top: calc(35.4% + 3px);  width: 18.0%; z-index: 3; }
.layer-tablet    { left: 34.0%; top: 3.3%;   width: 35.5%; z-index: 3; }
.layer-badge     { left: 72.7%; top: 2.9%;   width: 8.2%;  z-index: 3; }
.layer-postit    { left: 71.2%; top: calc(63.4% - 3px);  width: 12.1%; z-index: 3; }
.layer-keyboard  { left: 38.0%; top: 68.0%;  width: 22.7%; z-index: 3; }
.layer-mouse     { left: 61.8%; top: 70.8%;  width: 4.9%;  z-index: 3; }
.guestbook-preview {
  position: absolute;
  left: 73.2%; top: calc(74.8% - 3px);
  width: 7.7%; min-height: 10.3%;
  z-index: 4;
  color: #315042;
  font-family: var(--font-body);
  pointer-events: none;
  user-select: none;
  transform-origin: center;
  transition: transform 0.28s var(--ease), filter 0.28s var(--ease), opacity 0.35s var(--ease);
}
.guestbook-preview.is-fading { opacity: 0; transform: translateY(2%); }
.guestbook-preview__msg {
  font-size: clamp(0.54rem, 0.92vw, 0.9rem);
  line-height: 1.22;
  max-height: 3.8em;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.guestbook-preview__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-family: inherit;
  font-size: clamp(0.48rem, 0.78vw, 0.74rem);
  color: rgba(49, 80, 66, 0.68);
  letter-spacing: 0.02em;
}
.guestbook-preview__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guestbook-preview__date { flex: 0 0 auto; }

/* ============================================================
   조명 시스템
   - 전구 origin: 약 24% / 12% (스탠드 헤드 개구부)
   - .desk.lit  = 켜짐 / 클래스 없음 = 꺼짐(어둑하지만 보임)
   ============================================================ */

/* 어둠(앰비언트) 레이어 — 꺼짐 상태에서도 적용.
   꺼져도 너무 어둡지 않게 약하게, 켜지면 거의 사라짐. */
.desk__dark {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(135% 120% at 22% 24%,
      rgba(12,10,8,0)    0%,
      rgba(12,10,8,0.16) 46%,
      rgba(10,8,6,0.38)  76%,
      rgba(8,6,5,0.50)  100%);
  opacity: 1;                 /* 꺼짐: 은은한 그림자 (보임) */
  transition: opacity 1.8s var(--ease);
}
.desk.lit .desk__dark { opacity: 0.25; }   /* 켜짐: 거의 사라짐 */

/* 진입 순간 암전 → lit 되면 사라짐 (최초 1회 연출) */
.desk::before {
  content: ""; position: absolute; inset: 0; z-index: 35;
  background: #070604; opacity: 0.55;
  transition: opacity 1.8s var(--ease) 0.15s;
  pointer-events: none;
}
.desk.lit::before { opacity: 0; }
.desk::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 36;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at calc(24% - 20px) calc(17% + 50px),
      rgba(255, 246, 214, 0.82) 0%,
      rgba(255, 222, 150, 0.52) 5%,
      rgba(255, 199, 96, 0.24) 11%,
      rgba(255, 196, 92, 0.08) 19%,
      rgba(255, 196, 92, 0) 30%);
  mix-blend-mode: screen;
  transition: opacity 1.1s var(--ease);
}
.desk.awaiting-light::after {
  opacity: 1;
  animation: standbyLightPulse 2.8s ease-in-out infinite;
}
.desk.lit::after {
  opacity: 0;
  animation: none;
}

/* 전구 발광 코어 — 전구 위치에서 강하게 퍼져나옴 */
.desk__bulb {
  position: absolute; z-index: 8;
  left: calc(28.5% - 20px); top: calc(14.2% + 50px);
  width: 15%; height: 24%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255,247,225,0.92) 0%,
    rgba(255,233,180,0.55) 18%,
    rgba(255,214,150,0.22) 40%,
    rgba(255,210,140,0)    68%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(3px);
  transition: opacity 0.8s var(--ease);
}
.desk.lit .desk__bulb { opacity: 0.86; animation: bulbFlicker 5s ease-in-out 1.6s infinite; }

/* 넓은 따뜻한 조명 — 포스트잇(우하단)까지 닿도록 크게 */
.desk__glow {
  position: absolute; z-index: 7;
  left: calc(28.5% - 20px); top: calc(14.2% + 50px);
  width: 230%; height: 200%;
  transform: translate(-12%, -40%);
  background: radial-gradient(ellipse 90% 70% at 14% 42%,
    rgba(255,228,172,0.46) 0%,
    rgba(255,216,152,0.30) 18%,
    rgba(253,208,142,0.16) 36%,
    rgba(251,202,134,0.06) 56%,
    rgba(250,198,130,0)    74%);
  opacity: 0;
  mix-blend-mode: soft-light;
  pointer-events: none;
  transition: opacity 2s var(--ease) 0.18s;
}
.desk.lit .desk__glow { opacity: 0.92; }

/* 스탠드 헤드 입구 유도 광원 — 전체 조명 전, 시선만 잡아주는 작은 빛 */
.desk__mouth-light {
  position: absolute;
  z-index: 20;
  left: calc(28.5% - 20px);
  top: calc(14.2% + 50px);
  width: 5.4%;
  height: 13.8%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 248, 224, 1) 0%,
      rgba(255, 226, 154, 0.86) 24%,
      rgba(255, 196, 92, 0.42) 52%,
      rgba(246, 177, 70, 0) 78%);
  mix-blend-mode: screen;
  filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease), filter 1.2s var(--ease);
}
.desk.awaiting-light .desk__mouth-light {
  opacity: 1;
  animation: mouthLightPulse 2.6s ease-in-out infinite;
}
.desk.lit .desk__mouth-light {
  opacity: 1;
  animation: none;
  filter: blur(2.4px);
}

/* 전구 미세 깜빡임 (켜진 동안 살아있는 느낌) */
@keyframes bulbFlicker {
  0%,100% { opacity: 1; }
  48%     { opacity: 0.96; }
  50%     { opacity: 0.88; }
  52%     { opacity: 0.97; }
}

/* ---------- 스탠드 조명 클릭 영역 (온/오프) ---------- */
.hs-lamp {
  left: 12.3%; top: -6.9%; width: 18.6%; height: 43.4%;
  z-index: 30;            /* 어둠 레이어 위에서 항상 클릭 가능 */
}
.hs-lamp::after { display: none; }
.lamp-hint {
  position: absolute;
  left: 18.6%;
  top: calc(9.2% + 30px);
  z-index: 120;
  width: max-content;
  max-width: 18rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  isolation: isolate;
  mix-blend-mode: normal;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.desk.awaiting-light .lamp-hint {
  opacity: 1;
  transform: translateY(0);
  animation: lampHintPulse 1.8s ease-in-out infinite;
}
.desk.awaiting-light .layer-lamp {
  filter:
    drop-shadow(0 0 8px rgba(255, 224, 164, 0.28))
    drop-shadow(0 8px 16px rgba(255, 190, 92, 0.18));
}
.desk.awaiting-light .desk__bulb {
  opacity: 0;
  animation: none;
}
.desk.awaiting-light .desk__glow {
  opacity: 0;
}
/* 시작 상태: 전체는 어둡게, 스탠드 주변만 아주 작게 열어 시선 유도 */
.desk.awaiting-light::before {
  opacity: 0.72;
  background: #070604;
}
.desk.awaiting-light .desk__dark { opacity: 0.64; }

/* ---------- hotspot 공통 ---------- */
.hotspot {
  position: absolute; z-index: 10;
  border: 0; background: transparent;
  cursor: pointer; border-radius: 12px;
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  outline: none;
}
.hotspot:hover, .hotspot:focus-visible {
  background: transparent;
  box-shadow: none;
}
/* hover 라벨 */
.hotspot::after {
  content: attr(data-label);
  position: absolute; left: 50%; bottom: -28px;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-size: 0.7rem; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--gold); color: #ffffff; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.hotspot:hover::after, .hotspot:focus-visible::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.hs-blog::after { bottom: -12px; }
.hs-tablet::after { bottom: -20px; }
@keyframes lampHintPulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
@keyframes mouthLightPulse {
  0%, 100% { opacity: 0.82; filter: blur(1.5px); }
  50% { opacity: 1; filter: blur(2.2px); }
}
@keyframes standbyLightPulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
.desk__stage:has(.hs-lamp:hover) .layer-lamp,
.desk__stage:has(.hs-lamp:focus-visible) .layer-lamp,
.desk__stage:has(.hs-blog:hover) .layer-documents,
.desk__stage:has(.hs-blog:focus-visible) .layer-documents,
.desk__stage:has(.hs-badge:hover) .layer-badge,
.desk__stage:has(.hs-badge:focus-visible) .layer-badge,
.desk__stage:has(.hs-note:hover) .layer-postit,
.desk__stage:has(.hs-note:focus-visible) .layer-postit,
.desk__stage:has(.hs-note:hover) .guestbook-preview,
.desk__stage:has(.hs-note:focus-visible) .guestbook-preview {
  transform: translateY(-1.1%) scale(1.018);
  filter: drop-shadow(0 18px 22px rgba(32, 24, 16, 0.20));
}

/* ---------- 각 오브젝트 좌표 (측정값, %) ---------- */
/* 태블릿 */
.hs-tablet { left: 34.0%; top: 3.3%; width: 35.5%; height: 61.3%; }
/* 사원증 */
.hs-badge  { left: 72.7%; top: 2.9%; width: 8.2%;  height: 53.0%; }
/* Blog 종이 */
.hs-blog   { left: 15.3%; top: calc(35.4% + 3px); width: 18.0%; height: 59.5%; }
/* Guestbook 포스트잇 */
.hs-note   { left: 71.2%; top: calc(63.4% - 3px); width: 12.1%; height: 31.2%; }

/* ---------- 태블릿 라이브 시계 (잠금화면) ---------- */
.tablet-screen {
  position: absolute; z-index: 8;
  left: calc(36.0% + 12px); top: calc(7.7% - 1px); width: calc(31.1% - 17px); height: calc(52.4% + 3px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #f3ece0; pointer-events: none;
  overflow: hidden;
  border-radius: 2.6% / 4%;
  opacity: 0; transition: opacity 0.8s var(--ease) 0.6s;
}
.desk.lit .tablet-screen { opacity: 1; }
.screen-saver {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(98, 183, 210, 0.48), transparent 32%),
    radial-gradient(circle at 82% 20%, rgba(221, 149, 82, 0.44), transparent 30%),
    radial-gradient(circle at 62% 78%, rgba(132, 91, 201, 0.46), transparent 34%),
    linear-gradient(135deg, #0a1020 0%, #17121d 45%, #090807 100%);
  background-size: 140% 140%, 130% 130%, 150% 150%, 100% 100%;
  filter: saturate(1.12) contrast(1.04);
  opacity: 0.9;
  transform: scale(1.08);
  animation: screenSaverDrift 16s ease-in-out infinite alternate;
}
.screen-saver::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.06), rgba(255,255,255,0)),
    radial-gradient(circle at 50% 12%, rgba(255,255,255,0.16), transparent 32%);
  mix-blend-mode: screen;
}
.screen-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0,0,0,0.55);
}
.tablet-screen .clock {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5.8vw, 4.2rem);
  font-weight: 300; letter-spacing: 0.02em;
  line-height: 1;
}
.tablet-screen .date {
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  color: rgba(243, 236, 224, 0.82); margin-top: 0.4rem; letter-spacing: 0.08em;
}
.tablet-screen .hint {
  margin-top: 1.5rem; font-size: clamp(0.78rem, 1.35vw, 1rem); letter-spacing: 0.12em;
  color: rgba(255,255,255,0.76); text-transform: uppercase;
  animation: screenHintPulse 2.8s ease-in-out infinite;
}
@keyframes screenSaverDrift {
  0% {
    background-position: 0% 20%, 100% 0%, 45% 100%, 0 0;
    transform: scale(1.08) translate3d(-1%, -1%, 0);
  }
  100% {
    background-position: 80% 55%, 18% 85%, 100% 20%, 0 0;
    transform: scale(1.12) translate3d(1%, 1%, 0);
  }
}
@keyframes screenHintPulse {
  0%,100% { opacity: 0.46; transform: translateY(0); }
  50%     { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .screen-saver,
  .tablet-screen .hint {
    animation: none;
  }
}

/* ---------- 태블릿 확대(풀스크린) 오버레이 ---------- */
.tablet-os {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6,5,4,0.92); backdrop-filter: blur(6px);
  display: none; place-items: center; padding: 2.5vh 2vw;
}
.tablet-os[data-open="true"] { display: grid; }
.tablet-os__device {
  position: relative;
  width: min(1320px, 97vw); height: min(720px, 92vh);
  border: 10px solid #1a1714;
  border-radius: 26px; box-shadow: 0 40px 100px rgba(0,0,0,0.7);
  padding: clamp(1rem, 2.5vw, 2rem);
  display: flex; flex-direction: column; gap: 1rem;
  overflow: hidden;
  animation: tabletPop 0.45s var(--ease);
  /* 배경화면: 은은한 CSS 그라디언트 (오로라 톤) */
  background:
    radial-gradient(120% 80% at 15% 10%, rgba(99,102,241,0.45), transparent 55%),
    radial-gradient(110% 90% at 90% 20%, rgba(236,72,153,0.30), transparent 55%),
    radial-gradient(120% 120% at 70% 100%, rgba(45,212,191,0.30), transparent 55%),
    linear-gradient(160deg, #1b2244, #0c1023 70%);
}

/* ---- 상태바 (반투명) ---- */
.os-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.1rem 0.4rem 0.2rem;
  color: rgba(255,255,255,0.92); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.os-status__icons { display: inline-flex; align-items: center; gap: 0.55rem; }
.os-ico { width: 19px; height: auto; fill: currentColor; color: rgba(255,255,255,0.92); }
.os-battery { display: inline-flex; align-items: center; gap: 2px; }
.os-battery__shell {
  width: 24px; height: 12px; border: 1.5px solid rgba(255,255,255,0.85);
  border-radius: 3px; padding: 1.5px; display: inline-flex;
}
.os-battery__level { flex: 1; background: rgba(255,255,255,0.92); border-radius: 1px; }
.os-battery__cap {
  width: 2px; height: 5px; background: rgba(255,255,255,0.85);
  border-radius: 0 1px 1px 0;
}
@keyframes tabletPop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tablet-os__close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 1.3rem;
  display: grid; place-items: center;
}
.tablet-os__close:hover { background: rgba(255,255,255,0.18); }

/* 홈 레이아웃: 좌측 위젯 스택 + 우측 앱 그리드 */
.os-home {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 520px 1fr; gap: 1.4rem; overflow: hidden;
}
/* 좌측 위젯 스택: 시계 → (날씨+메모) → 영상 */
.os-side {
  display: flex; flex-direction: column; gap: 1rem; min-height: 0;
}
.os-side__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; flex: 0 0 auto; }

/* 좌측 큰 시계/날짜 */
.os-bigclock { padding: 0.2rem 0.3rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.os-bigclock__time { font-size: 3.4rem; font-weight: 300; line-height: 1; letter-spacing: -0.01em; }
.os-bigclock__date { font-size: 1rem; font-weight: 500; margin-top: 0.3rem; color: rgba(255,255,255,0.92); }

/* 날씨 위젯 가로 정렬 */
.os-weather-row { display: flex; align-items: center; gap: 0.55rem; }
.os-weather-ico { width: 46px; height: 46px; flex: 0 0 auto; display: block; }
.os-weather-ico svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }
.os-widget--weather .big { font-size: 1.9rem; }
.os-widget--weather .os-weather-row { flex-wrap: wrap; }
.os-widget--weather .os-widget__sub { flex-basis: 100%; }

/* 메모(사용 안내) 위젯 */
.os-widget--note .os-note__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
  font-size: 0.72rem; line-height: 1.5; color: rgba(255,255,255,0.92);
}
.os-widget--note .os-note__list li { position: relative; padding-left: 0.9rem; white-space: nowrap; }
.os-widget--note .os-note__list li::before {
  content: "·"; position: absolute; left: 0.1rem; color: rgba(255,255,255,0.6);
}
.os-widget--note b { color: #fff; font-weight: 700; }
.os-widget {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px; padding: 1rem 1.2rem;
  color: #f3ece0;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.15);
}
.os-widget h4 { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.72); margin-bottom: 0.5rem; }
.os-widget .big { font-size: 1.9rem; font-weight: 300; }
.os-widget__sub { font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 0.15rem; }

/* 영상: 좌측 스택에서 남은 세로 공간을 꽉 채움 */
.os-widget--video { padding: 0; overflow: hidden; position: relative;
  flex: 1 1 auto; min-height: 0; }
.os-widget--video video { width: 100%; height: 100%;
  border: 0; display: block; object-fit: cover; background: #000; cursor: pointer; }
/* 기본 컨트롤바 숨김 (hover 시에도 안 뜸) */
.os-widget--video video::-webkit-media-controls { display: none !important; }
.os-widget--video video::-webkit-media-controls-enclosure { display: none !important; }

/* 좌우 넘김 버튼 */
.os-vid__nav {
  position: absolute; top: 50%; transform: translateY(-50%) scale(0.9);
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  background: rgba(15,15,18,0.5); border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  display: grid; place-items: center; cursor: pointer; z-index: 2;
  opacity: 0; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.os-vid__nav svg { width: 16px; height: 16px; display: block; }
.os-vid__prev { left: 10px; }
.os-vid__next { right: 10px; }
.os-widget--video:hover .os-vid__nav { opacity: 1; transform: translateY(-50%) scale(1); }
.os-vid__nav:hover { background: rgba(15,15,18,0.78); }
.os-vid__nav:active { transform: translateY(-50%) scale(0.92); }

/* 중앙 재생 오버레이 (정지 상태에서만 표시) */
.os-vid__pause {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: #fff; font-size: 1.5rem;
  display: grid; place-items: center; pointer-events: none; z-index: 1;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.2s var(--ease);
}
.os-vid__pause.is-hidden { opacity: 0; }

/* 우측 앱 그리드 (포트폴리오 - 아이콘 앱처럼) */
.os-apps { flex: 1 1 auto; min-height: 0; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1.3rem 1rem; align-content: start; align-items: start; }
.os-app { display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  cursor: pointer; color: #f3ece0; }
.os-app .icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.9rem;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.os-app .icon { transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.os-app .icon .cb-logo { width: 74%; height: 74%; }
.os-app:hover .icon,
.os-app:focus-visible .icon { background: rgba(255,255,255,0.22); }
.os-app:active .icon,
.os-app:focus-visible .icon {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7), 0 6px 16px rgba(0,0,0,0.22);
}
.os-app:focus-visible { outline: none; }
.os-app .name { font-size: 0.72rem; text-align: center; line-height: 1.3;
  color: rgba(255,255,255,0.9); max-width: 92px;
  word-break: keep-all; }

/* ---------- 모바일 ---------- */
@media (max-width: 720px) {
  .desk { max-height: none; }
  .os-home { grid-template-columns: 1fr; }
  .os-side__row { grid-template-columns: 1fr; }
}

/* ============================================================
   요약 팝업 모달 (Blog / About / Guestbook)
   ============================================================ */
.popup {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: center; padding: 5vh 5vw;
  background: rgba(20, 16, 12, 0.55); backdrop-filter: blur(4px);
}
.popup[data-open="true"] { display: grid; }
.popup__card {
  position: relative;
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px; padding: 2rem 2.2rem;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  animation: tabletPop 0.4s var(--ease);
}

/* ============================================================
   태블릿 내부 PDF 뷰어 (포트폴리오 문서) — 태블릿 안에서 열림
   ============================================================ */
.os-view {
  position: absolute;
  inset: clamp(1rem, 2.5vw, 2rem);
  z-index: 10;
  display: none; flex-direction: column;
  background: #14110d; border-radius: 16px; overflow: hidden;
}
.os-view[data-open="true"] { display: flex; animation: osViewIn 0.3s var(--ease); }
@keyframes osViewIn { from { opacity: 0; } to { opacity: 1; } }
.os-view__bar {
  position: relative; z-index: 20;
  flex: 0 0 auto; display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25); color: #f3ece0;
}
.os-view__title { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-view__open { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 1rem; background: rgba(255,255,255,0.1); }
.os-view__open:hover { background: rgba(255,255,255,0.2); }
.os-view__close {
  flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%;
  display: none; place-items: center; color: #fff; font-size: 1rem;
  background: rgba(255,255,255,0.1); cursor: pointer;
  backdrop-filter: blur(8px);
}
.os-view__close:hover { background: rgba(255,255,255,0.2); }
.os-view__body { flex: 1; min-height: 0; position: relative; background: #101526; }
.os-view__frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.os-view__empty { color: #666; padding: 2rem; text-align: center; }
.os-view__body > .chatbot {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.os-view__body > .chatbot .chatbot__close { display: none; }
.pad-pdf {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px minmax(150px, 18%);
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 2.25rem;
  background: #101526;
  overscroll-behavior: contain;
}
.pad-pdf__canvas-wrap {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pad-pdf__canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}
.pad-pdf__nav {
  width: 34px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.pad-pdf__nav:hover { background: rgba(255,255,255,0.16); }
.pad-pdf__nav:disabled { opacity: 0.32; cursor: default; }
.pad-pdf__toc {
  align-self: stretch;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 0.7rem;
  color: #fff;
  overscroll-behavior: contain;
}
.pad-pdf__toc-title {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  color: rgba(255,255,255,0.92);
  margin: 0.1rem 0 0.55rem;
}
.pad-pdf__toc-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 0.15rem;
}
.pad-pdf__toc-btn {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  text-align: left;
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
}
.pad-pdf__toc-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
}
.pad-pdf__toc-btn small {
  flex: 0 0 auto;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
}
.pad-pdf__toc-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.pad-pdf__toc-btn.is-active {
  color: #fff;
  background: rgba(245,190,77,0.22);
  border-color: rgba(245,190,77,0.45);
}
.pad-pdf__toc-btn.is-active small { color: rgba(255,225,160,0.9); }
.pad-pdf__bar {
  position: absolute;
  left: 1rem;
  right: calc(18% + 2.1rem);
  bottom: 0.7rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.82);
  font-size: 0.78rem;
  pointer-events: none;
}
.pad-pdf__open {
  color: rgba(255,255,255,0.88);
  font-weight: 700;
  pointer-events: auto;
}
.pad-pdf__open:hover { color: #fff; }

@media (max-width: 900px) {
  .pad-pdf {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    padding-right: 0.8rem;
  }
  .pad-pdf__toc { display: none; }
  .pad-pdf__bar { right: 1rem; }
}

/* ============================================================
   ChatJJK — 독립 앱 화면 (GPT/Gemini 사이트처럼 풀스크린)
   ============================================================ */
.chatbot {
  position: fixed; inset: 0; z-index: 320;
  display: none; flex-direction: column;
  background: radial-gradient(120% 90% at 50% 32%, #1a2238 0%, #0c1020 60%, #070a14 100%);
  color: #e7e9ee;
}
.chatbot[data-open="true"] { display: flex; }
.chatbot__card { flex: 1; display: flex; flex-direction: column; min-height: 0;
  width: 100%; max-width: none; background: none; border: 0; box-shadow: none; }
.chatbot__bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.4rem; }
.chatbot__id { display: flex; align-items: center; gap: 0.7rem; }
.chatbot__avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--gold); color: #fff; display: grid; place-items: center; padding: 6px; }
.chatbot__avatar .cb-logo { width: 78%; height: 78%; }
.chatbot__name { font-weight: 700; font-size: 1rem; }
.chatbot__status { font-size: 0.72rem; color: rgba(255,255,255,0.55); }
.chatbot__close { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,0.08); color: #fff; font-size: 1.1rem;
  display: grid; place-items: center; cursor: pointer; }
.chatbot__close:hover { background: rgba(255,255,255,0.16); }
.chatbot__log { flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
  width: min(720px, 92%); margin: 0 auto; padding: 1rem 0 0.5rem; }
.cb-msg { display: flex; }
.cb-msg--user { justify-content: flex-end; }
.cb-msg--bot { justify-content: flex-start; }
.cb-bubble { max-width: 80%; padding: 0.7rem 1rem; border-radius: 16px;
  font-size: 0.95rem; line-height: 1.6; word-break: break-word; white-space: pre-line; }
.cb-msg--user .cb-bubble { background: var(--gold); color: #fff; border-bottom-right-radius: 5px; }
.cb-msg--bot .cb-bubble { background: rgba(255,255,255,0.08); color: #e7e9ee; border-bottom-left-radius: 5px; }
.cb-typing { display: inline-flex; gap: 4px; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.5);
  animation: cbBlink 1.2s infinite ease-in-out; }
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cbBlink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }
.chatbot__suggestions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  width: min(720px, 92%); margin: 0 auto; padding: 0.6rem 0; }
.cb-sug { font-size: 0.85rem; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); color: #e7e9ee; }
.cb-sug:hover { background: rgba(255,255,255,0.12); }
.chatbot__form {
  flex: 0 0 auto;
  width: min(720px, 92%);
  margin: 0 auto;
  padding: 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.chatbot__form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 0 1rem;
  outline: none;
}
.chatbot__form input::placeholder { color: rgba(255,255,255,0.48); }
.chatbot__form input:focus {
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.12);
}
.chatbot__form button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

/* ============================================================
   요약 팝업 모달 (Blog / About / Guestbook 공용)
   ============================================================ */
.popup {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: center; padding: 5vh 5vw;
  background: rgba(20, 16, 12, 0.55); backdrop-filter: blur(4px);
}
.popup[data-open="true"] { display: grid; }
.popup__card {
  position: relative; width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px; padding: 2rem 2.2rem;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  animation: tabletPop 0.4s var(--ease);
}
.popup__close {
  position: absolute; top: 1rem; right: 1.2rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); color: var(--text-soft); font-size: 1.1rem;
  display: grid; place-items: center; cursor: pointer;
}
.popup__close:hover { color: var(--text); }
.popup__kicker {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.6rem;
}
.popup__title { font-family: var(--font-brand); font-size: 1.4rem; line-height: 1.3; color: var(--text); }
.popup__meta { font-size: 0.8rem; color: var(--text-mute); margin-top: 0.4rem; }
.popup__body { color: var(--text-soft); line-height: 1.75; margin-top: 1rem; }
.popup__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.popup__chip {
  font-size: 0.72rem; color: var(--gold);
  border: 1px solid var(--gold-dim); border-radius: 999px; padding: 0.2rem 0.7rem;
}
.popup__cta {
  display: inline-block; margin-top: 1.4rem;
  color: var(--gold); font-weight: 700; font-size: 0.9rem;
}
.popup__cta:hover { color: var(--gold-dim); }

/* 팝업 내 방명록 목록 */
.gb-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1rem; }
.gb-item { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem; background: var(--bg); }
.gb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.gb-name { font-weight: 700; font-size: 0.85rem; color: var(--text); }
.gb-date { font-size: 0.72rem; color: var(--text-mute); }
.gb-msg { font-size: 0.85rem; color: var(--text-soft); line-height: 1.6; margin-top: 0.4rem; }
.gb-note { font-size: 0.76rem; color: var(--text-mute); margin-top: 1rem; }

/* os-view 안에 들어온 챗봇은 그 영역만 채움 (태블릿 밖 fixed 방지) */
.tablet-os .os-view__body > .chatbot {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
}
