/* ---------- 폰트 ---------- */
@font-face {
  font-family: 'Pretendard';
  src: url('../fonts/Pretendard-Light.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Melodrame';
  src: url('../fonts/Melodrame.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'Quentin';
  src: url('../fonts/Quentin.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: block;
}

/* ---------- SR 프레임 변수 ---------- */
/* ---------- 공통 변수 ---------- */
:root{
  --se-aspect: 0.5625;                 /* 375/667 */
  --frame-w: min(100svw, calc(100dvh * var(--se-aspect)));
  --frame-left: calc((100svw - var(--frame-w)) / 2);

  /* 레일/아이콘/팝업 규격 */
  --rail-w: 70px;                      
  --rail-border: 1px;
  --icon-size: 25px;

  /* 레일 중앙 좌표 (공용) */
  --rail-center-x: calc(var(--frame-left) + var(--rail-w)/2 + var(--rail-border)/2);
}
* { box-sizing: border-box; }

/* ---------- 레터박스 + 가로폭 흔들림 방지 ---------- */
html, body { height: 100%; margin: 0; padding: 0; }
html, body{
  overflow-x: clip;                 /* 가로 스크롤/스와이프 차단 */
  overscroll-behavior-x: none;
  touch-action: pan-y;              /* 세로만 스크롤 */
  scrollbar-gutter: stable both-edges; /* 스크롤 유무 상관없이 가로폭 고정 */
}
@supports not (overflow: clip){ html, body{ overflow-x:hidden; } }

body{
  background: #000;                 /* 좌우 검정 레터박스 */
  color: #222;
  font-family: 'Pretendard', sans-serif;
  display: flex;
  justify-content: center;
  font-weight: 300;
  align-items: flex-start;
  overflow-y: scroll;               /* 항상 스크롤바 예약 */
}

/* ---------- 가운데 프레임 ---------- */
.profile-page{
  position: relative;
  width: var(--frame-w);            /* ✅ SR 프레임 폭 통일 */
  min-height: 100dvh;
  height: auto;
  background: #fafafa;
  margin: 0 auto;

  display: grid;
  grid-template-columns: var(--rail-w) 1fr; /* ✅ 레일 폭 변수 사용 */
  overflow: visible;               /* 팝업 잘림 방지 */
  container-type: inline-size;
}

/* ---------- 좌측 레일 ---------- */
.left-rail{
  background: #fafafa;
  border-right: 1px solid #000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: var(--rail-w);
  padding-top: 20px;
  position: relative;
  min-height: unset;
  align-self: stretch;
}

.rail-inner{ writing-mode: vertical-rl; transform: rotate(180deg); position: relative; }

/* Hong Sungwon */
.side-name{
  position: absolute;
  top: -170px; left: -15px;
  font-family: 'Quentin', cursive;
  font-size: 25px; color:#ACBFCD; line-height:1; white-space:nowrap;
}
/* Profile */
.side-profile{
  position: absolute;
  top: -100px; left: -15px;
  font-family: 'Melodrame', serif;
  font-size: 25px; color:#000; line-height:1;
}

/* ---------- 우측 본문 ---------- */
#interview-tab{ padding: 60px 20px; }

.interview-list{ list-style:none; padding:0; margin:0; }
.interview-list li{ margin-bottom:16px; }
.interview-list a{
  text-decoration:none; color:#000; font-size:18px; line-height:1.6;
}
.interview-list a:hover{ text-decoration:underline; }

/* ---------- 고정 아이콘 (레일 왼쪽 칸 '가운데' 고정 + 미세조정) ---------- */
/* ---------- 좌측 하단 아이콘 ---------- */
.fixed-icons {
  position: fixed;
  bottom: 20px;
  left: calc(var(--frame-left) + var(--rail-w)/2 - 12px);  /* 아이콘 크기에 따라 조정 */

  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}
.fixed-icons img{
  width: var(--icon-size);
  height: auto;
  cursor: pointer;
  transition: transform .2s ease;
}
.fixed-icons img:hover{ transform: scale(1.1); }

/* ---------- 메뉴 팝업: 레일 중앙 기준 ---------- */
#menu-popup {
  display: none;
  position: fixed;
  bottom: 20px;

  left: calc(var(--frame-left) + var(--rail-w)/2 - 12px) 
  transform: translateX(0);

  background: #fff;
  border: 1px solid #000;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
  padding: 8px 0;
  z-index: 2000;
}
#menu-popup a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: #000;
  font-family: 'Melodrame', serif;
  font-size: 20px;
}
#menu-popup a:hover { background: #f0f0f0; }

/* ---------- 모바일: vw 기준으로 좌표 재계산 ---------- */
@media (hover:none) and (pointer:coarse){
  :root{
    --frame-w: min(100vw, calc(100dvh * var(--se-aspect)));
    --frame-left: calc((100vw - var(--frame-w)) / 2);
    --rail-center-x: calc(var(--frame-left) + var(--rail-w)/2 + var(--rail-border)/2);
  }
  #menu-popup{
    left: var(--rail-center-x) !important;
    transform: translateX(0) !important;
    right: auto !important;
  }
  .fixed-icons{
    left: calc(var(--frame-left) + var(--rail-w)/2 - 12px) !important;
    transform: translateX(-50%) !important;
  }
}

/* === 팝업 박스 위치만 수정 (아이콘 건드리지 않음) === */
:root { 
  --popup-gap: 16px;  /* ← 아이콘-팝업 사이 간격. 크게 하고 싶으면 값만 늘려! */
}

/* PC 포함 전체 */
#menu-popup{
  left: calc(var(--frame-left) + var(--rail-w) + var(--rail-border) + var(--popup-gap)) !important;
  transform: translateX(0) !important;
  right: auto !important;
}

/* 모바일 주소창 변화 대응: vw 기준 재계산 */
@media (hover:none) and (pointer:coarse){
  :root{
    --frame-w: min(100vw, calc(100dvh * var(--se-aspect)));
    --frame-left: calc((100vw - var(--frame-w)) / 2);
  }
  #menu-popup{
    left: calc(var(--frame-left) + var(--rail-w) + var(--rail-border) + var(--popup-gap)) !important;
  }
}

/* ---------- iOS 하단 안전영역 ---------- */
@supports (padding-bottom: env(safe-area-inset-bottom)){
  #interview-tab{ padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

/* (선택) iOS 글자 자동축소 방지 */
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
