/* ==============================
   Studio i — UI System
   Untitled UI tokens · Pretendard
   Shared by / and /members
   ============================== */

:root {
  /* Gray scale */
  --gray-25:  #FCFCFD;
  --gray-50:  #F9FAFB;
  --gray-100: #F2F4F7;
  --gray-200: #EAECF0;
  --gray-300: #D0D5DD;
  --gray-400: #98A2B3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1D2939;
  --gray-900: #101828;

  /* Brand — violet (Untitled UI signature) */
  --primary-25:  #FBFAFF;
  --primary-50:  #F4F3FF;
  --primary-100: #EBE9FE;
  --primary-200: #D9D6FE;
  --primary-500: #875BF7;
  --primary-600: #7839EE;
  --primary-700: #6927DA;

  /* Surfaces & semantics */
  --bg:      var(--gray-50);
  --surface: #FFFFFF;
  --border:  var(--gray-200);
  --border-strong: var(--gray-300);
  --heading: var(--gray-900);
  --text:    var(--gray-700);
  --muted:   var(--gray-500);
  --dim:     var(--gray-400);
  --accent:  var(--primary-600);
  --accent-soft: var(--primary-50);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.10), 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  /* 한국어: 단어(어절) 중간 줄바꿈 금지 — 모바일에서 "시간"이 "시/간"으로 깨지는 것 방지 */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, video { max-width: 100%; display: block; }

/* Container */
.container {
  max-width: 1216px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ============== Header ============== */
.header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--heading);
  white-space: nowrap; /* 모바일에서 로고가 한 글자씩 세로로 깨지지 않도록 */
  flex-shrink: 0;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  box-shadow: var(--shadow-xs), inset 0 0 0 1px rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.brand-sep { color: var(--dim); font-weight: 400; }
.brand-sub { color: var(--muted); font-weight: 500; }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--gray-700);
  padding: 8px 12px; border-radius: var(--r-md);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--gray-50); color: var(--gray-900); }
.nav-link-active { background: var(--primary-50); color: var(--primary-700); }
.nav-link-active:hover { background: var(--primary-100); color: var(--primary-700); }
.nav-cta-group { display: flex; align-items: center; gap: 8px; }
.auth-box { display: flex; align-items: center; }
.auth-box #user-button:empty { display: none; }
/* hidden 속성이 .btn display 규칙을 확실히 이기도록 (로그인 후 로그인버튼 숨김) */
[hidden] { display: none !important; }
@media (max-width: 720px) {
  .nav-menu { display: none; }
  .header-inner { gap: 12px; }
  .nav-cta-group { gap: 6px; }
  /* 좁은 화면: hide-mobile 표시된 보조 버튼은 숨김 — 푸터에 동일 링크 있음 */
  .hide-mobile { display: none !important; }
}
@media (max-width: 420px) {
  /* 아주 좁은 화면: 영문 부제 생략, 로고는 "극단 아이"만 */
  .brand-sep, .brand-sub { display: none; }
}

/* ============== Resource link (자료실 — 카드보다 가벼운 한 줄) ============== */
.resource-link {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 14px 18px;
  font-size: 14px; color: var(--gray-700);
  background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--r-xl);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.resource-link:hover { border-color: var(--accent); background: var(--primary-50); }
.resource-link b { color: var(--heading); font-weight: 600; }
.resource-link-icon { color: var(--accent); display: grid; place-items: center; }
.resource-link-arrow { margin-left: auto; color: var(--dim); }

/* ============== Notice (계정 안내 배너) ============== */
.notice {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.notice-title {
  font-size: 14px; font-weight: 700; color: var(--primary-700);
  margin-bottom: 6px;
}
.notice p {
  font-size: 13.5px; line-height: 1.7; color: var(--gray-700);
}
.notice b { color: var(--primary-700); }

/* ============== Buttons ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  padding: 9px 14px; border-radius: var(--r-md);
  border: 1px solid transparent; transition: all 0.12s ease;
  white-space: nowrap;
}
.btn-ghost { color: var(--gray-700); background: transparent; }
.btn-ghost:hover { background: var(--gray-50); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-xs), inset 0 0 0 1px rgba(255,255,255,0.16);
}
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary {
  background: var(--surface); color: var(--gray-700);
  border-color: var(--border-strong); box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); }
.btn-lg { font-size: 15px; padding: 11px 18px; }

/* ============== Hero ============== */
.hero { padding: 72px 0 56px; }
.hero-narrow { max-width: 760px; }
.hero-title {
  font-size: clamp(36px, 5.4vw, 60px);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.28;
  color: var(--heading);
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 18px; line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
}
@media (max-width: 640px) { .hero-sub { font-size: 16px; } }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--primary-700);
  background: var(--primary-50);
  padding: 4px 10px 4px 4px; border-radius: 100px;
  border: 1px solid var(--primary-100);
  margin-bottom: 20px;
}
.badge-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--surface); color: var(--primary-700);
  padding: 2px 8px; border-radius: 100px;
  border: 1px solid var(--primary-100);
}

/* ============== Section ============== */
.section { padding: 56px 0; }
.section-tight { padding: 40px 0; }
.section-wide { padding: 96px 0; }
.section-head { margin-bottom: 28px; }
.section-head-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap;
}
.section-eyebrow {
  font-size: 14px; font-weight: 600; color: var(--accent);
  margin-bottom: 6px;
}
.section-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
  color: var(--heading);
  margin-bottom: 8px;
}
.section-desc {
  font-size: 16px; color: var(--muted); line-height: 1.55;
  max-width: 560px;
}
.section-link {
  font-size: 14px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0;
}
.section-link:hover { color: var(--primary-700); }

/* ============== Featured icon ============== */
.feat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--primary-50);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--primary-100);
  flex-shrink: 0;
}
.feat-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.feat-icon-lg { width: 48px; height: 48px; border-radius: var(--r-lg); }
.feat-icon-lg svg { width: 24px; height: 24px; }
.feat-icon-neutral {
  background: var(--gray-50); color: var(--gray-700);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--gray-200);
}

/* ============== Service cards (/members) ============== */
.dash-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dash-grid { grid-template-columns: 1fr; gap: 16px; } }

.svc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 32px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  min-height: 196px;
}
.svc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.svc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.svc-badge {
  font-size: 12px; font-weight: 500; color: var(--gray-600);
  padding: 2px 8px; border-radius: 100px;
  background: var(--gray-100);
}
.svc-badge-active {
  color: var(--primary-700); background: var(--primary-50);
  border: 1px solid var(--primary-100);
}
.svc-body { display: flex; flex-direction: column; gap: 6px; }
.svc-name {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--heading); line-height: 1.3;
}
.svc-desc {
  font-size: 14px; color: var(--muted); line-height: 1.55;
}
.svc-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  margin-top: auto;
}
.svc.coming { opacity: 0.72; cursor: default; }
.svc.coming:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border); }
.svc.coming .feat-icon { background: var(--gray-100); color: var(--gray-500); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--gray-200); }
.svc.coming .svc-arrow { color: var(--gray-500); }

/* ============== About / Story (home) ============== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-text p {
  font-size: 16px; line-height: 1.75; color: var(--text);
  margin-bottom: 16px;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--heading); font-weight: 600; }

.solution-list { display: flex; flex-direction: column; gap: 20px; }
.solution-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; gap: 16px; align-items: flex-start;
  box-shadow: var(--shadow-xs);
}
.solution-item-body { display: flex; flex-direction: column; gap: 4px; }
.solution-item-title {
  font-size: 15px; font-weight: 600; color: var(--heading);
  letter-spacing: -0.01em;
}
.solution-item-desc {
  font-size: 14px; color: var(--muted); line-height: 1.55;
}

/* ============== Cast cards (home) ============== */
.cast-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
@media (max-width: 720px) { .cast-grid { grid-template-columns: 1fr; } }
.cast-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  display: flex; gap: 20px; align-items: flex-start;
}
.cast-photo {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gray-100); flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.cast-photo img { width: 100%; height: 100%; object-fit: cover; }
.cast-body { flex: 1; min-width: 0; }
.cast-name {
  font-size: 17px; font-weight: 600; color: var(--heading);
  letter-spacing: -0.01em;
}
.cast-role {
  font-size: 13px; font-weight: 500; color: var(--accent);
  margin-bottom: 12px;
}
.cast-credits {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  word-break: keep-all; /* 한국어 단어가 음절 중간에서 끊기지 않도록 */
}
.cast-credit-line { display: flex; gap: 8px; }
.cast-credit-year {
  flex-shrink: 0; min-width: 64px; color: var(--dim); font-variant-numeric: tabular-nums;
}

/* ============== Media (home archive) ============== */
.media-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.media-tab {
  padding: 7px 16px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color .15s, background .15s, border-color .15s;
}
.media-tab:hover { color: var(--text); border-color: var(--border-strong); }
.media-tab.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.media-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 720px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
.media-tile {
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
  display: block;
}
.media-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.media-tile img, .media-tile video {
  width: 100%; height: 100%; object-fit: cover;
}
.media-tile-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  font-size: 12px; font-weight: 500; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55));
}
.media-tile-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--gray-900);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.media-tile-play svg { width: 18px; height: 18px; fill: currentColor; }

/* ============== Lightbox ============== */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 24, 40, 0.88);
  align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-content { max-width: 92vw; max-height: 88vh; }
.lightbox-content img, .lightbox-content video {
  max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px;
  display: block;
}

/* ============== Footer ============== */
.footer { padding: 56px 0 64px; border-top: 1px solid var(--border); margin-top: 24px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--muted);
}
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.footer-links { display: flex; gap: 24px; font-size: 14px; color: var(--gray-700); font-weight: 500; }
.footer-links a:hover { color: var(--gray-900); }

/* ============== Accessibility ============== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px; left: 12px;
  background: var(--gray-900); color: #fff;
  font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--r-md);
  z-index: 300;
  transition: top 0.18s ease;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; outline: 2px solid var(--accent); outline-offset: 2px; }

/* button reset for tiles that double as semantic buttons */
button.media-tile {
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
