/* ==========================================================================
   STUDIO: 개발 스튜디오 소개와 문의 (/studio/)  · uiux-audit §3-3
   휴대폰 부품(.phone)은 apps.css, 공통 재료(.glass .rim-card .fill-on-view .v2-head)는 brand-v2.css.
   연출은 첫 화면 기기 묶음의 포인터 기울기 하나뿐(studio.js)
   ========================================================================== */

.studio [hidden] { display: none !important; }
main.studio { overflow-x: clip; }
.st-sec { padding-block: calc(var(--sec-y) / 2); }

/* ---------- 1. 히어로 ---------- */
.st-hero {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(32px, 5vw, 80px);
  min-height: min(calc(100svh - var(--header-h)), 860px);
  padding-block: clamp(40px, 6vw, 80px);
}
.st-hero-copy { display: grid; gap: 22px; justify-items: start; }
.st-title { font-family: var(--f-display); font-weight: var(--w-display); font-size: clamp(2.5rem, 5vw, 4.4rem); line-height: 1.12; letter-spacing: -0.025em; max-width: 9em; }
/* 영어 표어는 제목 위 머리표가 아니라 제목 다음의 둘째 목소리 */
.st-motto { font-family: var(--f-display-latin); font-style: italic; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; color: var(--text-2); letter-spacing: -0.01em; margin-top: -8px; }
.st-lead { max-width: 30em; color: var(--text-2); font-size: clamp(1.02rem, 1.25vw, 1.12rem); line-height: 1.8; }
.st-hero-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; }

/* 기기 묶음: 뒤 유리 창 두 장 + 앞 휴대폰 */
.st-devices {
  --tx: 0deg; --ty: 0deg;
  position: relative; margin: 0; height: clamp(380px, 38vw, 540px); perspective: 1200px;
}
.st-devices > .dev, .st-devices > .dev-phone {
  position: absolute; transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) rotateY(var(--tx)) rotateX(var(--ty));
  transition: transform 700ms var(--ease-out);
}
.dev { width: 74%; padding: 0 0 8px; border-radius: 16px; overflow: hidden; box-shadow: 0 40px 80px -40px rgb(var(--shade-rgb) / calc(.9 * var(--shade-a))); }
.dev img { display: block; width: calc(100% - 16px); height: auto; margin: 0 8px; border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; }
.dev-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; }
.dev-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--tint-rgb) / .16); }
.dev-url { margin-left: 10px; font-size: .76rem; color: var(--text-2); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-back { right: 0; top: 0; width: 66%; opacity: .78; }
.dev-mid { left: 0; top: 22%; }
.dev-phone { --w: clamp(150px, 13vw, 200px); right: 6%; bottom: 0; z-index: 2; }
.dev-phone .phone-screen { background: #5B6862; }

/* ---------- 2. 숫자 띠: 카드 없이 위아래 선 ---------- */
.st-band { padding-block: 0; }
.st-nums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.st-nums li { display: grid; gap: 6px; align-content: start; padding: 26px 24px 28px; }
.st-nums li + li { border-left: 1px solid var(--line); }
.st-n { display: flex; align-items: baseline; gap: 4px; }
.st-n .num { font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1; color: var(--text); letter-spacing: -0.05em; }
.st-n .u { font-size: .95rem; font-weight: 650; color: var(--text-2); }
.st-l { color: var(--text-2); font-size: .95rem; line-height: 1.5; }

/* ---------- 3. 작업 사례 ---------- */
.st-cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.st-cases > li { display: flex; }
.st-case { display: flex; flex-direction: column; width: 100%; overflow: hidden; }
.st-shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg-2); }
.st-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform var(--d-4) var(--ease-expo); }
a.st-case:hover .st-shot img { transform: scale(1.03); }
.st-case-body { display: grid; gap: 10px; padding: 20px 22px 24px; align-content: start; flex: 1; }
.st-case-name { font-family: var(--f-display); font-weight: var(--w-display-strong); font-size: 1.35rem; letter-spacing: -0.02em; }
.st-case-name[lang="en"] { font-family: var(--f-display-latin); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; line-height: 1.1; }
.st-case-line { color: var(--text-2); font-size: .98rem; line-height: 1.7; }
.st-case-line [data-app-status] { color: var(--ether); font-weight: 600; }
.st-case-line [data-app-status].is-soon { color: var(--xync); }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.st-chips .chip { height: 30px; padding: 0 12px; font-size: .84rem; }
.st-work-note { margin-top: 22px; color: var(--text-2); font-size: .95rem; }

/* ---------- 4. 맡는 일 (S1: 왼쪽 제목이 따라 내려온다) ---------- */
.st-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.st-sticky { position: sticky; top: calc(var(--header-h) + 32px); display: grid; gap: 14px; }
.st-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(28px, 4vw, 56px); }
.st-service { padding: 24px 0 28px; border-top: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.st-service h3 { font-size: 1.24rem; letter-spacing: -0.025em; }
.st-service p { color: var(--text-2); max-width: 30em; }

/* ---------- 5. 진행 방식: 진짜 순서라서 번호, 선은 스크롤에 따라 차오른다 ---------- */
.st-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; position: relative; }
.st-steps-line { position: absolute; left: 22px; right: 22px; top: 22px; height: 1px; background: var(--line-2); padding: 0; }
.st-steps-line .fill-on-view { position: absolute; inset: 0; display: block; background: linear-gradient(90deg, var(--ether), var(--xync)); }
.st-steps li:not(.st-steps-line) { counter-increment: st; position: relative; display: grid; gap: 10px; align-content: start; }
.st-steps li:not(.st-steps-line)::before {
  content: counter(st);
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-input);
  font-family: var(--f-mono); font-size: .9rem; color: var(--text-2);
  position: relative; z-index: 1;
}
.st-steps li:nth-child(2)::before { border-color: var(--ether); color: var(--ether); }
.st-steps h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.st-steps p { color: var(--text-2); font-size: .97rem; }

/* ---------- 6. 협업: 코랄 판, 테두리 빛 ---------- */
.st-collab {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 32px clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(28px, 4.4vw, 56px); border-radius: var(--r-xl);
  background: radial-gradient(90% 120% at 100% 100%, rgb(var(--xync-rgb) / 0.09), transparent 60%), var(--bg-2);
}
.st-collab-copy { position: relative; z-index: 1; display: grid; gap: 18px; justify-items: start; }
.st-collab-copy p { color: var(--text-2); max-width: 32em; }
.st-collab-list { position: relative; z-index: 1; display: grid; gap: 22px; margin: 0; }
.st-collab-list > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-collab-list dt { flex-basis: 100%; font-size: .88rem; font-weight: 650; color: var(--text-2); margin-bottom: 2px; }
.st-collab-list dd { margin: 0; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--text); font-size: .94rem; font-weight: 550; }

/* ---------- 7. 자주 묻는 것 ---------- */
.st-faq { border-top: 1px solid var(--line); }
.st-faq details { border-bottom: 1px solid var(--line); }
.st-faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 16px 0; font-size: 1.1rem; font-weight: 680; letter-spacing: -0.02em;
}
.st-faq summary::-webkit-details-marker { display: none; }
.st-faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform var(--d-3) var(--ease-expo);
}
.st-faq details[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.st-faq summary:hover { color: var(--ether-2); }
.st-faq details p { padding: 0 0 22px; color: var(--text-2); max-width: 40em; line-height: 1.8; }

/* 휴대폰 아래에 붙는 문의 단추 (S4) */
.st-dock {
  position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 18px 40px -16px rgb(var(--shade-rgb) / calc(.9 * var(--shade-a)));
}
@media (min-width: 720px) { .st-dock { display: none !important; } }

/* ---------- 문의 ---------- */
.st-contact { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px clamp(32px, 6vw, 96px); align-items: start; }
.st-contact-info { display: grid; gap: 18px; position: sticky; top: calc(var(--header-h) + 32px); }
.st-contact-info > p { color: var(--text-2); max-width: 26em; }
.st-meta { display: grid; gap: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.st-meta > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.st-meta dt { color: var(--text-3); font-size: .92rem; }
.st-meta dd { margin: 0; }
.st-meta a { color: var(--ether); display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; }
.st-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }

.st-form-box { border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--panel); padding: clamp(22px, 3.6vw, 44px); }
.st-form { display: grid; gap: 22px; }
.st-kinds { border: 0; padding: 0; margin: 0; min-width: 0; }
.st-kinds legend { padding: 0; margin-bottom: 8px; }
.st-kind-row { display: flex; flex-wrap: wrap; gap: 8px; }
.st-kind { position: relative; }
.st-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-kind span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line-input); color: var(--text-2); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: color var(--d-2), background var(--d-2), border-color var(--d-2);
}
.st-kind span:hover { color: var(--text); border-color: rgb(var(--line-rgb) / .55); }
.st-kind input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.st-kind input:focus-visible + span { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-off); }
.st-msg-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.st-msg-foot .field-error { flex: 1; }
.st-count { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-count.is-over { color: var(--err); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--err); }
.input[aria-invalid="true"]:focus-visible, .textarea[aria-invalid="true"]:focus-visible { outline-color: var(--err); }
.st-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.st-form-err { padding: 12px 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--err) 35%, transparent); background: color-mix(in srgb, var(--err) 8%, transparent); color: var(--text); font-size: .94rem; }
.st-form-foot { color: var(--text-2); font-size: .92rem; }
.st-form-foot a, .st-form-privacy a { color: var(--ether); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.st-form-privacy { color: var(--text-3); font-size: .85rem; margin-top: -10px; }

.st-sent { display: grid; justify-items: start; gap: 14px; padding: 12px 0; }
.st-sent:focus { outline: none; }
.st-sent-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ether-dim); color: var(--ether); }
.st-sent h3 { font-size: 1.5rem; letter-spacing: -0.025em; }
.st-sent p { color: var(--text-2); }
.st-sent strong { color: var(--text); font-weight: 650; word-break: break-all; }

@media (max-width: 960px) {
  .st-hero { grid-template-columns: 1fr; min-height: 0; padding-block: 32px 24px; }
  .st-devices { height: clamp(300px, 80vw, 460px); }
  .st-split, .st-contact { grid-template-columns: 1fr; }
  .st-sticky, .st-contact-info { position: static; }
  .st-cases { grid-template-columns: 1fr 1fr; }
  .st-nums { grid-template-columns: 1fr 1fr; }
  .st-nums li:nth-child(3) { border-left: 0; }
  .st-nums li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .st-steps { grid-template-columns: 1fr; gap: 0; }
  .st-steps-line { left: 21px; right: auto; top: 22px; bottom: 22px; width: 1px; height: auto; }
  .st-steps-line .fill-on-view { background: linear-gradient(180deg, var(--ether), var(--xync)); transform-origin: center top; }
  .st-steps li:not(.st-steps-line) { grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; row-gap: 6px; padding-bottom: 28px; }
  .st-steps li:not(.st-steps-line)::before { grid-row: span 2; margin: 0; }
  .st-steps li:last-child { padding-bottom: 0; }
  .st-collab { grid-template-columns: 1fr; }
}
/* 세로 선은 세로로 차오른다 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (max-width: 960px) {
    .st-steps-line .fill-on-view { animation-name: v2-fill-y; }
  }
}
@media (max-width: 960px) and (prefers-reduced-motion: reduce) { .st-steps-line .fill-on-view { transform: none; } }
@media (max-width: 719px) {
  .st-cases { grid-template-columns: 1fr; }
  .st-services { grid-template-columns: 1fr; }
  .st-hero-actions .btn { flex: 1 1 auto; }
  .st-nums li { padding: 20px 14px 22px; }
  .dev { width: 80%; }
  .dev-back { width: 70%; }
  .dev-phone { --w: 128px; right: 2%; }
  .studio { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-devices > .dev, .st-devices > .dev-phone { transition: none; transform: none; }
}
