/* ═══════════════════════════════════════════════════════════════════════════
   디자인 토큰 — 사이트 전체 색상의 단일 원천(single source of truth)
   ───────────────────────────────────────────────────────────────────────────
   3개 계층으로 나뉘어 있다. 색을 바꿀 때는 아래 계층으로 내려갈수록 영향이 크다.

     1) 원시 팔레트  --space-* / --violet-* / --teal-* / --star-* / --ember-*
        실제 색값이 적힌 유일한 곳. 컴포넌트에서 직접 쓰지 않는다.
     2) 캔버스 토큰  --rgb-*
        <canvas> 드로잉은 알파를 자유롭게 섞어야 해서 "R, G, B" 형태로 둔다.
        theme.js 가 이 값을 읽어 캔버스 이펙트에 넘긴다.
     3) 의미 토큰    --bg / --surface / --ink / --accent ...
        컴포넌트가 쓰는 이름. 다크 테마는 이 계층만 다시 선언해서 갈아끼운다.
        (다크 오버라이드는 "상세 사례 공통 다크 테마" 블록에 있다)

   테마 = 네뷸라 바이올렛 주색 + 청록 보조 + 딥스페이스 배경.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* ── 1. 원시 팔레트 ───────────────────────────────────────────────────── */

  /* 딥스페이스 — 어두운 배경 (900이 가장 어두움) */
  --space-900: #05060d;
  --space-800: #080b16;
  --space-700: #0b0f1e;
  --space-600: #0e1222;
  --space-500: #161c33;
  --space-400: #282f4a;

  /* 네뷸라 바이올렛 — 주 강조색 */
  --violet-700: #453aa0;
  --violet-600: #5b4bc8;
  --violet-500: #7c6de0;
  --violet-400: #9a8bf0;
  --violet-300: #b8adff;

  /* 청록 — 보조 강조색 (성공/완료 상태) */
  --teal-600: #2ab8a0;
  --teal-500: #34c4a8;
  --teal-400: #5fdcc4;

  /* 별빛 — 텍스트와 별 (100이 가장 밝음) */
  --star-100: #f2f5ff;
  --star-200: #e4ecff;
  --star-300: #c4d0ff;
  --star-400: #b9c2dc;
  --star-500: #8b91a8;
  --star-600: #5f6578;
  --star-900: #15161f;

  /* 앰버 — 붉은거성, 따뜻한 대비색 */
  --ember-400: #ffb08c;
  --ember-500: #efa17f;
  --ember-600: #a65b3b;

  /* ── 2. 캔버스 토큰 (theme.js 가 읽음) ────────────────────────────────── */
  --rgb-void: 5, 6, 13;
  --rgb-star-bright: 242, 245, 255;
  --rgb-star: 228, 236, 255;
  --rgb-star-blue: 196, 214, 255;
  --rgb-star-warm: 255, 244, 214;
  --rgb-star-ember: 255, 206, 161;
  --rgb-violet: 154, 139, 240;
  --rgb-violet-deep: 124, 109, 224;
  --rgb-teal: 52, 196, 168;
  --rgb-blue: 70, 130, 220;
  --rgb-ember: 255, 176, 140;

  /* ── 3. 의미 토큰 (라이트: 페이지 안의 밝은 제품 목업용) ──────────────── */
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eceff9;
  --ink: var(--star-900);
  --muted: var(--star-600);
  --line: #dadeed;
  --accent: var(--violet-600);
  --accent-strong: var(--violet-700);
  --blue: #416f8f;
  --rust: var(--ember-600);
  --shadow: 0 8px 24px rgba(20, 22, 40, 0.07);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* 한국어 본문 가독성을 우선한 시스템 글꼴 스택 */
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  border-radius: 4px;
  background: rgba(91, 75, 200, 0.08);
  padding: 2px 5px;
  color: var(--accent-strong);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(218, 222, 237, 0.9);
  background: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 10px;
  font-weight: 760;
}

.home-link {
  position: relative;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.home-link:hover {
  background: var(--surface-soft);
}

.home-link::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  white-space: nowrap;
}

.home-link:hover::after,
.home-link:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.home-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 헤더 우측의 저장소 링크. 홈 버튼과 같은 원형 타깃을 쓰되 툴팁은 화면 밖으로
   나가지 않게 왼쪽으로 펼친다. */
.repo-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}

.repo-link:hover,
.repo-link:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
}

.repo-icon {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.repo-link::after {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.repo-link:hover::after,
.repo-link:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.repo-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-nav a:hover {
  border-color: currentColor;
  color: var(--ink);
}

.site-nav a[aria-current="location"] {
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 760;
}

.side-toc {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 128px;
  padding: 8px;
  border: 1px solid rgba(69, 58, 160, 0.16);
  border-radius: 16px;
  background: #fafbfe;
  transform: translateY(-50%);
}

.side-toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-radius: 9px;
  padding: 0 10px;
  color: #6e7791;
  transition: background 160ms ease, color 160ms ease;
}

.side-toc__dot {
  width: 7px;
  height: 7px;
  border: 1px solid #8f95c4;
  border-radius: 50%;
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease;
}

.side-toc__label {
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}

.side-toc a:hover,
.side-toc a:focus-visible {
  background: rgba(91, 75, 200, 0.07);
  color: var(--ink);
}

.side-toc a[aria-current="location"] {
  background: #e8e9fa;
  color: var(--accent-strong);
}

.side-toc a[aria-current="location"] .side-toc__label {
  font-weight: 800;
}

.side-toc a[aria-current="location"] .side-toc__dot {
  border-color: var(--accent);
  background: var(--accent);
}

.side-toc a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .side-toc {
    display: none;
  }

  .site-nav {
    display: flex;
  }}

.section,
.case-hero {
  padding: clamp(72px, 9vw, 124px) clamp(20px, 5vw, 84px);
}

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.case-hero {
  background: var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 410px);
  gap: clamp(36px, 6vw, 86px);
  align-items: center;
}

/* 히어로 우측에 프로젝트 개요 카드를 두는 2단 구성이다. 솔루션·패치노트
   페이지와 같은 비율을 써서 세 상세 페이지의 첫 화면을 맞춘다. */
.case-page .case-hero {
  min-height: calc(100vh - 67px);
  display: grid;
  align-items: center;
}

.case-page .case-hero .hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  gap: clamp(48px, 7vw, 92px);
}

.case-page .case-hero .hero-copy {
  max-width: 760px;
}

.hero-copy {
  min-width: 0;
  width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 22px;
  font-size: clamp(42px, 4.8vw, 68px);
  line-height: 1.14;
  letter-spacing: 0;
  word-break: keep-all;
  text-wrap: balance;
}

h2 {
  max-width: 940px;
  margin-bottom: 16px;
  font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1.34;
  word-break: keep-all;
  text-wrap: balance;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.35;
  word-break: keep-all;
}

h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

p {
  color: var(--muted);
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.hero-lead {
  max-width: 760px;
  margin-bottom: 32px;
  color: #3f4457;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.68;
  word-break: keep-all;
}

.problem-card,
.challenge-block{
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: clamp(34px, 5vw, 56px);
}

.section-heading p {
  max-width: 820px;
  font-size: 17px;
}

.section-quiet {
  background: var(--surface-soft);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.challenge-header > span {
  color: var(--rust);
  font-weight: 820;
}

.problem-card p {
  margin-bottom: 0;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 820px;
}

.stack-tags span {
  border: 1px solid rgba(91, 75, 200, 0.2);
  border-radius: 999px;
  background: white;
  padding: 8px 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
}


.problem-map {
  display: grid;
  gap: 16px;
}

.flow-label {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 820;
}

.problem-map-block {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 2.4vw, 28px);
}

.map-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.map-heading .flow-label {
  margin-bottom: 0;
}

.map-heading strong {
  max-width: 680px;
  color: #1f2333;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.38;
  text-align: right;
  word-break: keep-all;
}

.story-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.story-node {
  display: grid;
  min-height: 76px;
  flex: 1 1 0;
  max-width: 256px;
  place-items: center;
  border: 1px solid rgba(166, 91, 59, 0.18);
  border-radius: 8px;
  background: rgba(166, 91, 59, 0.04);
  padding: 12px;
  font-weight: 740;
  text-align: center;
}

.story-node:nth-of-type(1) {
  background: rgba(166, 91, 59, 0.035);
}

.story-node:nth-of-type(3) {
  background: rgba(166, 91, 59, 0.07);
}

.story-node:nth-of-type(5) {
  background: rgba(166, 91, 59, 0.105);
}

.story-node:nth-of-type(7) {
  background: rgba(166, 91, 59, 0.14);
}

.story-node.alert {
  border-color: rgba(166, 91, 59, 0.34);
}

.story-arrow,
.refresh-flow i{
  position: relative;
  display: block;
  width: 28px;
  height: 2px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent);
}

.story-arrow::before,
.story-arrow::after,
.refresh-flow i::before,
.refresh-flow i::after{
  position: absolute;
  top: 50%;
  right: -1px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  transform-origin: right center;
}

.story-arrow::before,
.refresh-flow i::before{
  transform: translateY(-50%) rotate(45deg);
}

.story-arrow::after,
.refresh-flow i::after{
  transform: translateY(-50%) rotate(-45deg);
}

.linked-problems {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  position: relative;
  max-width: 940px;
  margin: 0 auto;
}

.linked-problems .problem-card {
  display: inline-flex;
  min-height: 0;
  max-width: 100%;
  align-items: center;
  border-color: rgba(166, 91, 59, 0.24);
  border-radius: 999px;
  background: rgba(166, 91, 59, 0.055);
  padding: 12px 18px;
  box-shadow: none;
}

.linked-problems .problem-card h3 {
  margin: 0;
  color: #44271c;
  font-size: 16px;
  line-height: 1.45;
  word-break: keep-all;
}

.problem-transition {
  display: grid;
  place-items: center;
  min-height: 52px;
}

.problem-transition span {
  position: relative;
  width: 2px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
}

.problem-transition span::before,
.problem-transition span::after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.problem-transition span::before {
  transform: translateX(calc(-100% + 1px)) rotate(45deg);
  transform-origin: right center;
}

.problem-transition span::after {
  transform: translateX(-1px) rotate(-45deg);
  transform-origin: left center;
}

.goal-block {
  border-color: rgba(91, 75, 200, 0.28);
  background: #f6f6fe;
}

.goal-box {
  display: grid;
  min-height: 92px;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(91, 75, 200, 0.32);
  border-radius: 8px;
  background: white;
  padding: 18px;
  color: #241f4d;
  font-size: clamp(19px, 1.85vw, 25px);
  font-weight: 820;
  line-height: 1.55;
  text-align: center;
}

.goal-box span {
  display: inline;
  word-break: keep-all;
}

/* 목표 문장이 걸려 있는 한 구절만 강조색을 쓴다. 밑줄은 링크와 주석에만 남긴다. */
.goal-box em {
  color: var(--accent-strong);
  font-style: normal;
}

.problem-card {
  display: grid;
  min-height: 128px;
  align-items: center;
  padding: 24px;
  box-shadow: none;
}

.compact-heading {
  margin-bottom: 28px;
}

.compact-heading h2 {
  font-size: clamp(23px, 2.2vw, 32px);
}

.refresh-flow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-flow div {
  display: grid;
  min-height: 106px;
  flex: 1;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
  text-align: center;
}

.refresh-flow .scheduled-step {
  border-color: rgba(91, 75, 200, 0.34);
  background: #f6f6fe;
}

.schedule-icon {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 2px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: white;
}

.schedule-icon::before,
.schedule-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  transform-origin: bottom center;
}

.schedule-icon::before {
  height: 10px;
  transform: translate(-50%, -100%) rotate(0deg);
}

.schedule-icon::after {
  height: 8px;
  transform: translate(-50%, -100%) rotate(90deg);
}

.refresh-flow span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.challenge-block {
  display: grid;
  gap: 28px;
  margin-bottom: 32px;
  padding: clamp(24px, 4vw, 36px);
}

.challenge-block:last-child {
  margin-bottom: 0;
}

.challenge-header {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 24px;
}

.challenge-header h3 {
  font-size: clamp(22px, 2.1vw, 29px);
}

.challenge-header p {
  max-width: 840px;
  margin-bottom: 0;
}

.challenge-theme {
  display: inline-flex;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(91, 75, 200, 0.1);
  padding: 5px 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}

.chat-ux-frame {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: clamp(14px, 2vw, 24px);
}

.chat-ux-frame figcaption {
  padding: 14px 4px 0;
  color: var(--muted);
  font-size: 14px;
}


.chat-ux-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.chat-screen {
  display: grid;
  min-height: 410px;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.after-screen {
  border-color: rgba(91, 75, 200, 0.28);
  background: var(--surface-soft);
}

.chat-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.chat-screen-header span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}

.before-screen .chat-screen-header span {
  color: var(--rust);
}

.chat-screen-header strong {
  color: #1f2333;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.35;
  text-align: right;
}

.chat-window {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(18px, 2.5vw, 28px);
}

.chat-bubble {
  max-width: 82%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px 16px;
  color: #1f2333;
  line-height: 1.55;
}

.chat-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.user-row .speaker-icon {
  grid-column: 2;
  grid-row: 1;
}

.user-row .chat-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.speaker-icon {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.user-icon {
  color: var(--accent-strong);
}

.bot-icon {
  color: var(--blue);
}

.user-bubble {
  border-color: rgba(91, 75, 200, 0.28);
  background: #f6f6fe;
  font-weight: 720;
}

.loading-bubble {
  display: grid;
  max-width: 76%;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.loading-bubble strong {
  color: #1f2333;
  font-size: 16px;
}

.loading-bubble em {
  max-width: 260px;
  font-style: normal;
  font-size: 13px;
}

.gear-loader {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, white 0 35%, transparent 36%),
    repeating-conic-gradient(from 0deg, var(--rust) 0deg 18deg, transparent 18deg 36deg);
}

.gear-loader::before {
  position: absolute;
  inset: 10px;
  border: 4px solid rgba(166, 91, 59, 0.26);
  border-radius: inherit;
  content: "";
}

.stream-bubble {
  display: grid;
  max-width: 86%;
  gap: 10px;
  border-color: rgba(91, 75, 200, 0.25);
  background: white;
}

.stream-bubble p {
  margin: 0;
}

.stream-bubble p::before {
  color: var(--accent);
  content: "▸ ";
  font-weight: 820;
}

.typing-line {
  position: relative;
  color: var(--accent-strong);
  font-weight: 760;
}

.typing-line::after {
  display: inline-block;
  width: 8px;
  height: 17px;
  margin-left: 5px;
  background: var(--accent);
  content: "";
  vertical-align: -3px;
}

.chat-ux-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.metric-shift {
  position: relative;
}

.metric-shift::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(91, 75, 200, 0.22);
  content: "";
  transform: translateX(-50%);
}

.ux-time-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px 18px;
}

.ux-time-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.ux-time-card strong {
  color: #1f2333;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.ux-time-card i {
  display: block;
  height: 10px;
  border-radius: 999px;
}

.wait-card {
  border-color: rgba(166, 91, 59, 0.28);
}

.wait-card i {
  width: 100%;
  background: rgba(166, 91, 59, 0.42);
}

.stream-card {
  border-color: rgba(91, 75, 200, 0.28);
}

.stream-card i {
  width: 28%;
  background: var(--accent);
}

.ux-shift {
  display: grid;
  place-items: center;
  position: relative;
}

.ux-shift span {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 820;
  z-index: 1;
}

.ux-shift span::before,
.ux-shift span::after {
  position: absolute;
  content: "";
}

.ux-shift span::before {
  top: 50%;
  left: -34px;
  right: -34px;
  height: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  z-index: -1;
}

.ux-shift span::after {
  top: 50%;
  right: -34px;
  width: 14px;
  height: 14px;
  border: 0;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 0 66%, 54% 50%, 0 34%);
  transform: translateY(-50%);
}

.solution-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 18px;
}

.solution-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.solution-note p {
  margin-bottom: 0;
}

.result-statement {
  max-width: 920px;
  margin: clamp(48px, 6vw, 74px) auto 0;
  color: #343950;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.68;
  text-align: center;
  word-break: keep-all;
  text-wrap: balance;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 84px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.project-pagination {
  display: grid;
  width: min(1180px, calc(100% - 48px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
  padding: 34px 0;
}

.project-pagination__item {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--ink);
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.project-pagination__item:last-child {
  justify-items: end;
  text-align: right;
}

.project-pagination__item > span {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-pagination__item > strong {
  font-size: 17px;
  line-height: 1.4;
}

a.project-pagination__item:hover,
a.project-pagination__item:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-3px);
}

a.project-pagination__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

@media (max-width: 680px) {
  .project-pagination {
    width: min(100% - 36px, 680px);
    gap: 14px;
    padding: 26px 0;
  }

  .project-pagination__item > strong {
    font-size: 14px;
  }}

@media (max-width: 980px) {
  .hero-grid{
    grid-template-columns: 1fr;
  }

  .case-page .case-hero {
    min-height: auto;
  }

  .case-page .case-hero .hero-grid {
    grid-template-columns: 1fr;
  }


  
  .problem-grid{
    grid-template-columns: 1fr 1fr;
  }

  .chat-ux-compare {
    grid-template-columns: 1fr;
  }

  .chat-ux-metrics {
    grid-template-columns: 1fr;
  }

  .metric-shift {
    display: none;
  }

  .ux-shift {
    min-height: 72px;
  }

  .ux-shift span::before {
    top: -24px;
    right: auto;
    bottom: -24px;
    left: 50%;
    width: 2px;
    height: auto;
    transform: translateX(-50%);
  }

  .ux-shift span::after {
    top: auto;
    right: auto;
    bottom: -27px;
    left: 50%;
    clip-path: polygon(0 0, 100% 0, 50% 100%, 66% 0, 50% 54%, 34% 0);
    transform: translateX(-50%);
  }

  .chat-screen {
    min-height: auto;
  }

  
  .refresh-flow,
  .story-path {
    flex-direction: column;
  }

  
  .refresh-flow div,
  .story-node {
    width: 100%;
  }

  
  .refresh-flow i,
  .story-arrow {
    width: 16px;
    height: 16px;
    background: transparent;
  }

  
  .refresh-flow i::before,
  .story-arrow::before {
    display: none;
  }

  
  .refresh-flow i::after,
  .story-arrow::after {
    top: 50%;
    right: auto;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform: translate(-50%, -50%);
  }

  
  .refresh-flow i,
  .story-arrow {
    width: 2px;
    height: 28px;
    background: var(--accent);
  }

  
  .refresh-flow i::before,
  .story-arrow::before {
    display: block;
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 10px;
    height: 2px;
    border-radius: 999px;
    clip-path: none;
    transform: translateX(calc(-100% + 1px)) rotate(45deg);
    transform-origin: right center;
  }

  
  .refresh-flow i::after,
  .story-arrow::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 10px;
    height: 2px;
    border-radius: 999px;
    clip-path: none;
    transform: translateX(-1px) rotate(-45deg);
    transform-origin: left center;
  }

  .map-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-heading strong {
    text-align: left;
  }

  #problem .section-heading,
  #problem .section-heading h2,
  #problem .section-heading p {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .linked-problems {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .linked-problems .problem-card {
    display: grid;
    width: 100%;
    border-radius: 18px;
  }

  .linked-problems .problem-card h3 {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
  }}

@media (max-width: 680px) {
  body {
    overflow-x: hidden;
  }

  .page-shell,
  .problem-map,
  .problem-map-block,
  .challenge-block,
  .chat-ux-frame,
  .chat-screen{
    width: min(100%, calc(100vw - 36px));
    max-width: 100%;
    min-width: 0;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
  }

  .site-nav a[aria-current="location"] {
    background: #e8e9fa;
    color: var(--accent-strong);
  }

  .section,
  .case-hero {
    padding: 62px 18px;
  }

  .case-hero {
    overflow: hidden;
  }

  .case-hero .page-shell,
  .case-hero .hero-copy,
  .case-hero .hero-lead,
  .case-hero .stack-tags {
    width: min(100%, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }

  .case-hero h1,
  .case-hero h2,
  .case-hero .hero-lead,
  .case-hero .stack-tags span {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .case-hero .stack-tags {
    display: grid;
    grid-template-columns: 1fr;
  }

  .case-hero .stack-tags span {
    justify-content: center;
    padding: 8px;
    text-align: center;
  }

  h1{
    font-size: 34px;
    overflow-wrap: break-word;
    word-break: keep-all;
  }

  h2,
  h3,
  p,
  span,
  dd,
  figcaption {
    overflow-wrap: anywhere;
    word-break: normal;
  }


  h2 {
    font-size: 25px;
  }

  
  .problem-grid{
    grid-template-columns: 1fr;
  }

  .linked-problems {
    display: grid;
  }

  .linked-problems .problem-card {
    display: grid;
    width: 100%;
    border-radius: 18px;
  }

  .linked-problems .problem-card h3 {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
  }

  .challenge-header{
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }}

.gallery-case {
  overflow: hidden;
  display: grid;
  grid-template-rows: 250px 1fr;
  min-height: 590px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  transition: border-color 180ms ease, background 180ms ease;
}

.gallery-case:hover,
.gallery-case:focus-visible {
  border-color: rgba(91, 75, 200, 0.44);
  background: #fbfcfe;
}

.gallery-case:focus-visible {
  outline: 3px solid rgba(91, 75, 200, 0.24);
  outline-offset: 4px;
}

.gallery-visual {
  display: grid;
  grid-template-columns: minmax(70px, 0.72fr) 28px minmax(118px, 1fr) 28px minmax(108px, 0.92fr);
  gap: 8px;
  align-items: center;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

/* GitLab 카드(.gallery-image-visual)와 같은 밝은 면으로 비주얼 영역 전체를 채운다. */
.rag-gallery-visual {
  background: #eceff9;
}

.solution-gallery-visual {
  display: flex;
  align-items: center;
  background: var(--surface-soft);
}

/* 헬로(Law) 카드: 마스코트와 서비스명을 밝은 면 위에 한 덩어리로 보여준다. */
.hellolaw-gallery-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eceff9;
}

.hellolaw-logo-composition {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.hellolaw-mascot {
  width: auto;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(22, 26, 48, 0.16));
}

.hellolaw-logo-copy {
  display: grid;
  gap: 6px;
}

.hellolaw-logo-copy > strong {
  color: #1f56d6;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hellolaw-logo-copy > strong span {
  color: #2f6ff0;
}

.hellolaw-logo-copy > span {
  color: #5b6480;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@media (max-width: 680px) {
  .hellolaw-mascot {
    height: 118px;
  }

  .hellolaw-logo-copy > strong {
    font-size: 24px;
  }
}

@media (max-width: 680px) {
  .solution-gallery-case {
    grid-template-rows: 270px 1fr;
  }

  .solution-gallery-visual {
    min-height: 270px;
    padding: 14px;
  }}

/* RAG case study: concise decision, system, control, and result flows */

.case-page #problem,
.case-page #solution,
.case-page #challenges,
.case-page #result {
  scroll-margin-top: 72px;
}

.rag-solution-section .section-heading {
  max-width: 760px;
}

.rag-system-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

.rag-system-heading span {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.rag-system-heading strong {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  text-align: right;
  word-break: keep-all;
}

.rag-architecture-card {
  margin: clamp(22px, 4vw, 48px) 0;
  padding: clamp(14px, 2.4vw, 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.rag-result-matrix {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rag-matrix-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.rag-matrix-row:first-child {
  border-top: 0;
}

.rag-matrix-row > * {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 19px 22px;
  line-height: 1.55;
  word-break: keep-all;
}

.rag-matrix-row > * + * {
  border-left: 1px solid var(--line);
}

.rag-matrix-row.heading {
  background: var(--ink);
  color: #fff;
}

.rag-matrix-row.heading span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rag-matrix-row strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.rag-matrix-row:not(.heading) > span:nth-child(2) {
  color: var(--muted);
  background: rgba(173, 87, 53, 0.045);
}

.rag-matrix-row:not(.heading) > span:last-child {
  background: rgba(91, 75, 200, 0.055);
  font-weight: 700;
}

.rag-matrix-row em {
  color: var(--accent-strong);
  font-size: 18px;
  font-style: normal;
  font-weight: 850;
}

.result-section .result-statement {
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  padding: 22px 26px;
  text-align: left;
}

@media (max-width: 680px) {
  .case-page #problem,
  .case-page #solution,
  .case-page #challenges,
  .case-page #result {
    scroll-margin-top: 120px;
  }

  .case-page .case-hero .hero-copy h1,
  .case-page .case-hero .hero-copy h2 {
    font-size: 29px;
    line-height: 1.38;
  }

  .case-page .section-heading h2 {
    width: 100%;
    max-width: 100%;
    font-size: 24px;
    line-height: 1.45;
    overflow-wrap: normal;
    text-wrap: wrap;
    word-break: keep-all;
  }

  .rag-system-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
  }

  .rag-system-heading strong {
    text-align: left;
  }

  .rag-result-matrix {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .rag-matrix-row {
    grid-template-columns: 1fr;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .rag-matrix-row.heading {
    display: none;
  }

  .rag-matrix-row > * {
    padding: 15px 18px;
  }

  .rag-matrix-row > * + * {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .rag-matrix-row strong::before,
  .rag-matrix-row > span::before {
    display: inline-block;
    flex: 0 0 44px;
    margin-right: 10px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 820;
    letter-spacing: 0.06em;
  }

  .rag-matrix-row strong::before {
    content: "항목";
  }

  .rag-matrix-row > span:nth-child(2)::before {
    content: "기존";
  }

  .rag-matrix-row > span:last-child::before {
    content: "개선";
  }

  .result-section .result-statement {
    padding: 20px;
    font-size: 18px;
  }}

.ax-gallery-visual {
  background: var(--surface-soft);
}

.gallery-visual > i {
  position: relative;
  height: 2px;
  background: rgba(91, 75, 200, 0.44);
}

.gallery-visual > i::after {
  position: absolute;
  top: -4px;
  right: 0;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
  content: "";
}

.gallery-card-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
}

.gallery-card-copy h3 {
  margin: 15px 0 13px;
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.22;
}

.gallery-card-copy p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* De-slop pass: 기술 스택은 배지가 아니라 읽기 쉬운 메타데이터로 표시한다.
   구분자(·)를 ::after로 넣으면 줄바꿈이 일어나는 지점마다 점이 줄 끝에 고아로
   남는다. 어느 항목이 줄 끝인지는 CSS로 알 수 없으므로 gap으로 간격을 만든다. */
.stack-tags{
  gap: 6px 20px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 720;
}

.stack-tags span{
  display: inline-block;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.gallery-card-copy h3 {
  margin-top: 0;
}

.gallery-card-copy p {
  color: #3f4459;
  font-size: 16px;
}

/* 과제 번호 대신 실제 평가 관점과 설명을 같은 축에서 읽게 한다. */
.challenge-header {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
}

.challenge-theme {
  display: block;
  margin: 5px 0 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.challenge-header > div > p:last-child {
  color: #3f4459;
  font-size: 16px;
  line-height: 1.72;
}

@media (max-width: 760px) {
  .case-hero .stack-tags,
  .stack-tags{
    display: flex;
    width: auto;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .case-hero .stack-tags span,
  .stack-tags span{
    padding: 0;
    text-align: left;
  }

  .challenge-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .challenge-theme {
    margin-top: 0;
  }}

/* Portfolio home */
.portfolio-home {
  --star-rotate-x: 0deg;
  --star-rotate-y: 0deg;
  background: var(--space-900);
  color: var(--ink);
}

.portfolio-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(1320px, calc(100% - 48px));
  min-height: 100vh;
  grid-template-columns: minmax(300px, 0.78fr) minmax(520px, 1.35fr);
  column-gap: clamp(72px, 10vw, 150px);
  row-gap: clamp(70px, 9vw, 120px);
  margin: 0 auto;
  padding: clamp(76px, 10vw, 132px) 0 clamp(80px, 10vw, 132px);
}

.portfolio-ambient {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 14% 12%, rgba(var(--rgb-violet-deep), 0.12), transparent 30%),
    radial-gradient(circle at 85% 45%, rgba(var(--rgb-teal), 0.08), transparent 32%),
    radial-gradient(circle at 55% 75%, rgba(var(--rgb-blue), 0.09), transparent 34%),
    linear-gradient(180deg, var(--space-900) 0%, #030209 55%, #000103 100%);
  pointer-events: none;
  transform: translateX(-50%);
}

.portfolio-ambient canvas,
.gallery-effect-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portfolio-sidebar,
.portfolio-content,
.project-gallery {
  position: relative;
  z-index: 1;
}

.portfolio-sidebar,
.portfolio-content {
  align-self: center;
}

/* 시스템 한글 폰트는 음수 자간을 견디지 못한다. 큰 크기에서는 글자가 붙어
   보이므로 라틴 기준 트래킹을 그대로 적용하지 않는다. */
.portfolio-intro h1 {
  margin: 0 0 14px;
  color: #f8fafd;
  font-size: clamp(52px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.portfolio-role {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

/* 폭을 고정하면 사이드바 칼럼(0.78fr)보다 넓어져 좁은 데스크톱에서 SKILLS
   칼럼을 침범한다. 칼럼을 채우고 읽기 폭만 상한으로 둔다. */
.portfolio-summary {
  width: 100%;
  max-width: 480px;
  margin: 0;
  color: #ccd3e8;
  font-size: 18px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: normal;
}

.portfolio-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(190px, 0.9fr);
  grid-template-areas:
    "experience contact"
    "skills skills";
  gap: 28px clamp(28px, 5vw, 56px);
}

.portfolio-meta > div {
  border-top: 1px solid rgba(178, 186, 226, 0.28);
  padding-top: 18px;
}

.portfolio-meta h2 {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.portfolio-experience {
  grid-area: experience;
}

.portfolio-experience dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.portfolio-experience dl > div {
  display: grid;
  /* 날짜 열은 내용 폭에 맞춘다. 96px 고정이면 "23.07 ~ 24.06"(약 110px)이 열을
     넘쳐 gap을 잡아먹고 날짜와 내용이 붙어 보인다. */
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
}

.portfolio-experience dt,
.portfolio-experience dd {
  margin: 0;
  color: #cad1e6;
  font-size: 14px;
  line-height: 1.55;
}

.portfolio-experience dt {
  color: var(--accent);
  font-weight: 760;
  white-space: nowrap;
}

.portfolio-experience dd {
  word-break: keep-all;
}

.portfolio-stack {
  grid-area: skills;
}

/* 구분자(·)를 ::after로 넣으면 줄바꿈이 일어나는 지점마다 점이 줄 끝에 고아로
   남는다. 어느 항목이 줄 끝인지 CSS로는 알 수 없으므로 구분자를 없애고
   gap으로 간격을 만든다. 어떤 폭에서도 깨지지 않는다.
   4열 그리드로 두어 EXPERIENCE·CONTACT 아래 남던 우측 여백까지 채운다. */
.portfolio-stack ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portfolio-stack li {
  display: inline-flex;
  align-items: center;
  color: #cad1e6;
  font-size: 15px;
  line-height: 1.55;
  white-space: nowrap;
  transition: color 340ms ease, text-shadow 340ms ease, opacity 340ms ease;
}

/* 갤러리에서 보고 있는 프로젝트가 쓰는 기술에만 불을 켠다. 성운 보라를 안쪽,
   청록을 바깥쪽에 겹쳐 배경 우주 테마와 같은 광원으로 읽히게 한다. */
.portfolio-stack li.is-lit {
  color: #fff;
  text-shadow:
    0 0 10px rgba(var(--rgb-violet), 0.9),
    0 0 22px rgba(var(--rgb-violet-deep), 0.55),
    0 0 38px rgba(var(--rgb-teal), 0.3);
}

/* 켜진 항목이 있을 때만 나머지를 한 단계 낮춰 대비를 만든다. */
.portfolio-stack ul:has(.is-lit) li:not(.is-lit) {
  opacity: 0.42;
}

/* 그리드로 바꾼 뒤에는 줄바꿈 스페이서가 셀 하나를 차지하므로 흐름에서 뺀다.
   줄 나눔은 4열 배치가 대신한다. `.portfolio-stack li` 보다 명시도가 높아야
   display 선언이 이긴다. */
.portfolio-stack li.portfolio-stack__line-break {
  display: none;
}

.portfolio-contact {
  display: flex;
  align-content: flex-start;
  flex-direction: column;
  grid-area: contact;
}

.portfolio-contact a {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  color: #dae0f2;
  font-size: 14px;
  line-height: 1.4;
}

.portfolio-contact a:hover span,
.portfolio-contact a:focus-visible span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portfolio-contact a:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.portfolio-contact .contact-icon {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.78;
}

.portfolio-contact .contact-icon--solid {
  fill: currentColor;
  stroke: none;
}

.portfolio-shell > .project-gallery {
  width: 100%;
  grid-column: 1 / -1;
  justify-self: center;
}

.project-gallery__title {
  margin: 0 auto 18px;
  color: #f5f7fc;
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
}

.project-gallery__controls {
  display: flex;
  width: min(100%, 1000px);
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 12px;
  padding: 0 7%;
}

.project-gallery__count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #a8b2cf;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.project-gallery__count [data-gallery-current] {
  color: var(--accent);
  font-size: 18px;
  font-weight: 820;
}

.project-gallery__buttons {
  display: flex;
  gap: 8px;
}

.project-gallery__buttons button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(140, 148, 194, 0.44);
  border-radius: 50%;
  background: rgba(8, 11, 22, 0.9);
  color: #f5f7fc;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.project-gallery__buttons button:hover,
.project-gallery__buttons button:focus-visible {
  border-color: rgba(154, 139, 240, 0.72);
  background: #141527;
  transform: translateY(-2px);
}

.project-gallery__buttons button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-gallery__buttons .gallery-arrow-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-gallery__viewport {
  width: min(100%, 1000px);
  overflow-x: auto;
  margin: 0 auto;
  cursor: grab;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.project-gallery__viewport::-webkit-scrollbar {
  display: none;
}

.project-gallery__viewport.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.project-gallery__viewport:focus-visible {
  border-radius: 24px;
  outline: 2px solid rgba(91, 75, 200, 0.62);
  outline-offset: 3px;
}

.project-gallery__track {
  display: flex;
  gap: 22px;
  padding: 18px 7% 24px;
}

.project-gallery__track::after {
  flex: 0 0 7%;
  content: "";
}

.project-gallery .project-gallery__slide {
  display: grid;
  overflow: hidden;
  flex: 0 0 100%;
  height: 400px;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  border: 1px solid rgba(200, 206, 232, 0.92);
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 24px 52px rgba(22, 26, 48, 0.12),
    0 5px 15px rgba(22, 26, 48, 0.08);
  cursor: inherit;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.project-gallery .project-gallery__slide:hover,
.project-gallery .project-gallery__slide:focus-visible {
  border-color: rgba(91, 75, 200, 0.35);
  box-shadow:
    0 30px 64px rgba(22, 26, 48, 0.16),
    0 8px 20px rgba(22, 26, 48, 0.1);
  transform: translateY(-3px);
}

.project-gallery .project-gallery__slide:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-gallery .gallery-case * {
  cursor: inherit;
  user-select: none;
  -webkit-user-drag: none;
}

.project-gallery .gallery-case > * {
  pointer-events: none;
}

.project-gallery .gallery-visual {
  position: relative;
  isolation: isolate;
  min-height: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(208, 214, 236, 0.9);
}

.project-gallery .gallery-visual > :not(.gallery-effect-canvas) {
  position: relative;
  z-index: 1;
}

.gallery-effect-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0.2;
  transition: opacity 220ms ease;
}

.project-gallery__slide.is-active .gallery-effect-canvas {
  opacity: 0.58;
}

.project-gallery__slide.is-active .solution-gallery-visual .gallery-effect-canvas {
  opacity: 0.46;
}

.project-gallery__slide.is-active .ax-gallery-visual .gallery-effect-canvas {
  opacity: 0.38;
}

.project-gallery .gallery-card-copy {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px clamp(24px, 4vw, 54px);
  text-align: center;
  color: #15161f;
}

.project-gallery .gallery-card-copy h3 {
  margin: 0;
  font-size: clamp(23px, 2.3vw, 31px);
  line-height: 1.28;
  letter-spacing: -0.035em;
  text-align: center;
  white-space: nowrap;
}

.project-gallery .gallery-card-copy p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  white-space: nowrap;
}

.project-gallery__progress {
  width: min(86%, 860px);
  height: 2px;
  overflow: hidden;
  margin: 14px auto 0;
  background: #282f4a;
}

.project-gallery__progress span {
  display: block;
  width: 33.333%;
  height: 100%;
  background: #8b7ce8;
  transform: translateX(0);
  transition: transform 260ms ease;
}

@media (min-width: 861px) {
  .portfolio-shell {
    min-height: 100vh;
    align-content: start;
    row-gap: 20px;
    padding-top: 52px;
    padding-bottom: 12px;
    transform: none;
  }

  .project-gallery__title {
    margin-bottom: 10px;
    font-size: clamp(34px, 3.5vw, 42px);
  }

  .portfolio-shell > .project-gallery {
    margin-top: 22px;
  }

  .project-gallery__controls {
    margin-bottom: 6px;
  }

  .project-gallery__buttons button {
    width: 38px;
    height: 38px;
  }

  .project-gallery__track {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .project-gallery .project-gallery__slide { height: 400px; min-height: 0; }
  .project-gallery .gallery-visual { min-height: 0; }

  .project-gallery .gallery-card-copy {
    padding: 30px 38px;
  }

  .project-gallery .gallery-card-copy h3 {
    margin: 0;
    font-size: clamp(23px, 2.3vw, 31px);
  }

  .project-gallery .gallery-card-copy p { font-size: 15px; }

  .project-gallery__progress {
    margin-top: 8px;
  }}

@media (min-width: 861px) and (max-height: 800px) {
  .portfolio-shell {
    row-gap: 12px;
    padding-top: 38px;
    padding-bottom: 6px;
    transform: none;
  }

  .portfolio-intro h1 {
    margin-bottom: 10px;
    font-size: 58px;
  }

  .portfolio-role {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .portfolio-summary {
    font-size: 16px;
    line-height: 1.6;
  }

  .portfolio-meta > div {
    padding-top: 12px;
  }

  .portfolio-meta h2 {
    margin-bottom: 10px;
  }

  .portfolio-contact a {
    margin-bottom: 8px;
  }

  .project-gallery__title {
    margin-bottom: 8px;
    font-size: 32px;
  }

  .portfolio-shell > .project-gallery {
    margin-top: 16px;
  }

  .project-gallery__controls {
    margin-bottom: 2px;
  }

  .project-gallery__buttons button {
    width: 34px;
    height: 34px;
  }

  .project-gallery__track {
    padding-top: 6px;
    padding-bottom: 8px;
  }

  .project-gallery .project-gallery__slide { height: 360px; min-height: 0; }
  .project-gallery .gallery-visual { min-height: 0; }

  .project-gallery .gallery-card-copy {
    padding: 24px 30px;
  }

  .project-gallery .gallery-card-copy h3 {
    margin: 0;
    font-size: 27px;
  }

  .project-gallery .gallery-card-copy p { font-size: 14px; }

  .project-gallery__progress {
    margin-top: 5px;
  }}

@media (max-width: 860px) {
  .portfolio-shell {
    width: min(100% - 36px, 680px);
    grid-template-columns: 1fr;
    row-gap: 54px;
    padding-top: 64px;
  }

  .portfolio-summary {
    max-width: 520px;
  }

  .portfolio-content {
    align-self: start;
  }

  .portfolio-ambient {
    right: auto;
    left: 50%;
    height: 100%;
    border-radius: 0;
  }

  .portfolio-shell > .project-gallery {
    margin-top: 14px;
  }

  .project-gallery__title {
    margin-bottom: 30px;
  }

  .project-gallery .project-gallery__slide {
    flex-basis: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 250px auto;
  }

  .project-gallery .gallery-visual,
  .project-gallery .ax-gallery-visual {
    min-height: 250px;
    border-right: 0;
    border-bottom: 1px solid rgba(208, 214, 236, 0.9);
  }

  .project-gallery .gallery-card-copy {
    min-height: 230px;
    padding: 30px;
  }

  .project-gallery .gallery-card-copy h3 {
    margin: 0;
  }}

@media (max-width: 560px) {
  .portfolio-shell {
    width: min(100% - 28px, 460px);
    row-gap: 46px;
    padding: 52px 0 72px;
  }

  .portfolio-intro h1 {
    font-size: 50px;
  }

  .portfolio-summary {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    line-height: 1.7;
  }

  .portfolio-meta {
    grid-template-columns: 1fr;
    grid-template-areas:
      "experience"
      "contact"
      "skills";
    gap: 34px;
  }

  /* 한 칼럼으로 접힌 폭에서는 4열이 눌려 글자가 잘린다. */
  .portfolio-stack ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-ambient {
    right: auto;
    left: 50%;
    height: 100%;
    opacity: 0.78;
  }

  .portfolio-experience dl > div {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px;
  }

  .project-gallery__controls {
    padding: 0 5%;
  }

  .project-gallery__title {
    margin-bottom: 24px;
    font-size: 42px;
  }

  .project-gallery__track {
    gap: 14px;
    padding: 14px 5% 20px;
  }

  .project-gallery__track::after {
    flex-basis: 5%;
  }

  .project-gallery .project-gallery__slide {
    flex-basis: 100%;
    grid-template-rows: 210px auto;
    border-radius: 20px;
  }

  .project-gallery .gallery-visual,
  .project-gallery .ax-gallery-visual {
    min-height: 210px;
    padding: 16px 12px;
  }

  .project-gallery .gallery-card-copy {
    min-height: 210px;
    padding: 25px 22px;
  }

  .project-gallery .gallery-card-copy h3 {
    margin: 0;
    font-size: 19px;
  }

  .project-gallery .gallery-card-copy p {
    font-size: 13px;
    white-space: normal;
  }

  .project-gallery__progress {
    width: 82%;
  }}

@media (prefers-reduced-motion: reduce) {
  .project-gallery__buttons button,
  .project-gallery .project-gallery__slide,
  .project-gallery__progress span,
  .portfolio-stack li {
    transition-duration: 0.01ms;
  }

  .project-gallery__viewport {
    scroll-behavior: auto;
  }

  .project-gallery .project-gallery__slide:hover,
  .project-gallery .project-gallery__slide:focus-visible {
    transform: none;
  }

  .gallery-effect-canvas,
  .project-gallery__slide.is-active .gallery-effect-canvas {
    opacity: 0.28;
  }}

/* 갤러리 카드의 단순화된 프로젝트 비주얼 */
.project-gallery .gallery-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 32px);
}

.project-gallery .gallery-card-copy {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rag-logo-composition,
.rag-source-logos {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rag-logo-composition {
  gap: 16px;
}

.rag-source-logos {
  gap: 9px;
}

.rag-logo-card {
  display: grid;
  width: 100px;
  min-height: 112px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(91, 75, 200, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 8px;
  box-shadow: 0 10px 26px rgba(22, 26, 48, 0.08);
}

.rag-logo-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.rag-logo-card span {
  color: #343b52;
  font-size: 11px;
  font-weight: 760;
}

.rag-logo-plus {
  color: var(--accent);
  font-size: 30px;
  font-weight: 500;
}

.project-gallery .gallery-image-visual {
  overflow: hidden;
  padding: 0 10px;
  background: #eceff9;
}

.gallery-generated-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 래스터 일러스트는 초록으로 구워져 있어 CSS 로 내부 색을 바꿀 수 없다.
     색상환을 돌려 우주 테마의 바이올렛 계열로 맞춘다(무채색 영역은 그대로 유지된다).
     이미지를 교체하면 이 필터를 지우면 된다. */
  filter: hue-rotate(105deg) saturate(0.9);
}

@media (max-width: 860px) {
  .project-gallery__title {
    margin-bottom: 10px;
    font-size: 34px;
  }

  .project-gallery .project-gallery__slide {
    height: 400px;
    min-height: 0;
    grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  }

  .project-gallery .gallery-visual {
    min-height: 0;
  }

  .project-gallery .gallery-card-copy {
    min-height: 0;
    padding: 22px;
  }

  .project-gallery .gallery-card-copy p {
    white-space: nowrap;
  }}

@media (max-width: 560px) {
  .project-gallery__title {
    margin-bottom: 8px;
    font-size: 30px;
  }

  .project-gallery .project-gallery__slide {
    height: 360px;
    min-height: 0;
    grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  }

  .project-gallery .gallery-card-copy {
    padding: 18px 14px;
  }

  .project-gallery .gallery-card-copy h3 {
    font-size: 22px;
  }

  .project-gallery .gallery-card-copy p {
    font-size: 13px;
    white-space: normal;
  }

  .project-gallery .gallery-visual {
    padding: 14px 10px;
  }

  .rag-logo-composition {
    gap: 9px;
  }

  .rag-source-logos {
    gap: 5px;
  }

  .rag-logo-card {
    width: 76px;
    min-height: 94px;
    gap: 8px;
    border-radius: 15px;
    padding: 10px 5px;
  }

  .rag-logo-card img {
    width: 36px;
    height: 36px;
  }

  .rag-logo-card span {
    font-size: 9px;
  }

  .rag-logo-plus {
    font-size: 23px;
  }

  .project-gallery .gallery-image-visual {
    padding: 0 4px;
  }}

/* RAG architecture image */
.rag-architecture-figure,
.rag-architecture-figure .architecture-scroll,
.rag-architecture-figure img {
  display: block;
  width: 100%;
}

.rag-architecture-figure {
  margin: clamp(14px, 2vw, 24px) 0 0;
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: 12px;
  background: #f7f9fc;
}

.rag-architecture-figure img {
  height: auto;
}

.rag-architecture-figure .architecture-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* 다이어그램 위에 HTML 텍스트를 절대 배치하면 좁은 폭에서 SVG 내부 글자와
   겹친다(SVG는 축소되지만 오버레이는 그렇지 않음). 캡션으로 내려 고정 해제. */
.architecture-note {
  margin: 14px auto 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
  word-break: keep-all;
}

/* 넓은 화면에서는 스크롤이 필요 없으므로 힌트를 숨긴다. */
.architecture-scroll-hint {
  display: none;
}

@media (max-width: 760px) {
  /* 폭을 줄이는 대신 원래 크기를 유지하고 좌우로 밀어 보게 한다. */
  .rag-architecture-figure .architecture-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .rag-architecture-figure .architecture-scroll img {
    width: 557px;
    max-width: none;
  }

  .architecture-scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: #5f6578;
    font-size: 12px;
    font-weight: 700;
  }

  .architecture-scroll-hint::after {
    content: "→";
    font-weight: 800;
  }

  .architecture-note {
    font-size: 13px;
    text-align: left;
  }}

/* @멘션으로 검색 범위를 지정하는 채팅 UI 예시 */
.query-routing-figure {
  margin: 30px 0 0;
}

.query-routing-figure picture,
.query-routing-figure img {
  display: block;
  width: 100%;
}

.query-routing-figure img {
  height: auto;
  border: 1px solid rgba(91, 75, 200, 0.12);
  border-radius: 18px;
}

.query-routing-figure figcaption {
  max-width: 920px;
  margin: 16px auto 0;
  color: #3f4459;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}

.mention-demo-heading {
  margin: 58px 0 0;
  padding-left: 116px;
  color: var(--ink);
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.3;
}

.query-routing-code {
  overflow: hidden;
  margin: 30px 0 0;
  border-radius: 14px;
  background: #161c33;
}

.query-routing-code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 20px;
  color: #fff;
}

.query-routing-code figcaption span {
  color: #a9b0e8;
  font-size: 12px;
  font-weight: 800;
}

.query-routing-code figcaption strong {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.query-routing-code pre {
  overflow-x: auto;
  margin: 0;
  padding: 22px;
}

.query-routing-code code {
  color: #eef1fb;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.72;
}

.mention-search-demo {
  margin: 20px 0 0;
}

.mention-demo-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.mention-demo-window > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
}

.mention-demo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mention-demo-title strong {
  font-size: 16px;
}

.mention-demo-window > header > span {
  color: #565d73;
  font-size: 13px;
}

.mention-demo-chat-icon {
  position: relative;
  width: 28px;
  height: 22px;
  border: 2px solid var(--accent);
  border-radius: 7px;
}

.mention-demo-chat-icon::after {
  position: absolute;
  bottom: -6px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  background: white;
  content: "";
  transform: skewY(-35deg);
}

.mention-demo-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.8fr);
  min-height: 420px;
}

.mention-search-demo figcaption {
  margin-top: 14px;
  color: #565d73;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 760px) {
  .query-routing-figure {
    margin-top: 22px;
  }

  .query-routing-figure img {
    border-radius: 14px;
  }

  .query-routing-figure figcaption {
    margin-top: 12px;
    font-size: 14px;
    text-align: left;
  }

  .mention-demo-heading {
    margin-top: 42px;
    padding-left: 0;
    font-size: 24px;
  }

  .query-routing-code {
    margin-top: 22px;
  }

  .query-routing-code figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 13px 15px;
  }

  .query-routing-code pre {
    padding: 16px;
  }

  .query-routing-code code {
    font-size: 12px;
  }

  .mention-demo-window > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .mention-demo-body {
    grid-template-columns: 1fr;
  }}

/* 실제 입력 흐름에 가까운 스페이스 멘션 선택 UI */
.mention-demo-body {
  display: block;
  min-height: 0;
  padding: 32px;
}

.mention-picker-scene {
  width: min(100%, 920px);
  margin: 0 auto;
}

.mention-picker {
  position: relative;
  width: min(78%, 700px);
  margin-left: 2px;
  border: 1px solid #d0d6ea;
  border-radius: 12px;
  background: white;
  box-shadow: 10px 10px 0 rgba(30, 34, 60, 0.09);
}

.mention-picker > strong {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  font-size: 14px;
}

.mention-picker-list {
  display: grid;
  max-height: 270px;
  overflow: hidden;
  padding: 5px 14px 12px 0;
}

.mention-picker-list article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px 20px;
}

.mention-picker-list article.is-active {
  background: #eef2f5;
}

.mention-picker-list img {
  width: 34px;
  height: 34px;
  margin-top: 2px;
}

.mention-picker-list article > div {
  display: grid;
  gap: 5px;
}

.mention-picker-list b {
  font-size: 17px;
  line-height: 1.35;
}

.mention-picker-list article span {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mention-picker-list em {
  background: #edf1f4;
  padding: 3px 7px;
  color: #344b68;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.mention-picker-list small {
  color: #3f4459;
  font-size: 12px;
}

.mention-picker > i {
  position: absolute;
  top: 53px;
  right: 9px;
  bottom: 16px;
  width: 7px;
  border-radius: 4px;
  background: #e3e6f2;
}

.mention-picker > i::after {
  position: absolute;
  top: 34%;
  right: 0;
  left: 0;
  height: 70px;
  border-radius: inherit;
  background: #8b91a8;
  content: "";
}

.mention-input-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  margin-top: 10px;
  border: 1px solid #d0d6ea;
  border-radius: 24px;
  background: white;
  padding: 14px 14px 14px 26px;
  box-shadow: 8px 9px 0 rgba(30, 34, 60, 0.08);
}

.mention-input-bar p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.mention-input-bar p span {
  color: var(--accent-strong);
  font-weight: 850;
}

.mention-input-bar > b {
  position: relative;
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #263b55;
}

.mention-input-bar > b::before {
  position: absolute;
  top: 13px;
  left: 15px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 17px solid white;
  content: "";
}

@media (max-width: 760px) {
  .mention-demo-body {
    padding: 20px 14px;
  }

  .mention-picker {
    width: 100%;
    box-shadow: 6px 7px 0 rgba(30, 34, 60, 0.08);
  }

  .mention-picker-list article {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 14px;
  }

  .mention-picker-list img {
    width: 28px;
    height: 28px;
  }

  .mention-picker-list b {
    font-size: 15px;
  }

  .mention-input-bar {
    grid-template-columns: minmax(0, 1fr) 40px;
    min-height: 68px;
    border-radius: 18px;
    padding: 12px 12px 12px 16px;
  }

  .mention-input-bar p {
    font-size: 14px;
  }

  .mention-input-bar > b {
    width: 39px;
    height: 39px;
  }

  .mention-input-bar > b::before {
    top: 10px;
    left: 13px;
  }}

@media (min-width: 681px) and (max-width: 980px) {
  .gallery-case {
    grid-template-rows: 220px 1fr;
    min-height: 600px;
  }

  .gallery-visual {
    grid-template-columns: 52px 14px minmax(78px, 1fr) 14px 70px;
    gap: 4px;
    padding: 18px 14px;
  }

  .gallery-card-copy {
    padding: 24px 22px;
  }}

@media (max-width: 680px) {

  .gallery-case {
    grid-template-rows: auto 1fr;
    min-height: 0;
  }

  .gallery-visual {
    grid-template-columns: 1fr 18px 1.15fr 18px 1fr;
    min-height: 190px;
    padding: 20px 14px;
  }

  .gallery-card-copy {
    padding: 24px 22px;
  }

  .gallery-card-copy h3 {
    font-size: 26px;
  }}

@media (max-width: 680px) {
  .solution-gallery-case {
    grid-template-rows: 270px 1fr;
  }

  .solution-gallery-visual {
    min-height: 270px;
    padding: 14px;
  }}

/* 다크(우주) 테마 의미 토큰 — 홈과 상세 4개 페이지가 모두 공유한다.
   실제 색값은 :root 의 원시 팔레트에만 있으므로 여기서는 참조만 한다.
   새 페이지를 추가할 때는 이 선택자 목록에 body 클래스만 더하면 된다. */
.portfolio-home,
.case-page,
.solution-page,
.ax-page,
.hellolaw-page {
  color-scheme: dark;
  --bg: var(--space-900);
  --surface: var(--space-600);
  --surface-soft: var(--space-800);
  --ink: #eef1fb;
  --muted: var(--star-400);
  --line: rgba(186, 194, 232, 0.27);
  --accent: var(--violet-400);
  --accent-strong: var(--violet-300);
  --blue: #83bde3;
  --rust: var(--ember-500);
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

/* 상세 페이지 배경. 홈은 .portfolio-ambient 캔버스가 배경을 그리므로 제외한다. */
.case-page,
.solution-page,
.ax-page,
.hellolaw-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(var(--rgb-violet-deep), 0.1), transparent 26%),
    radial-gradient(circle at 88% 30%, rgba(var(--rgb-teal), 0.07), transparent 28%),
    radial-gradient(circle at 50% 88%, rgba(var(--rgb-blue), 0.07), transparent 32%),
    var(--space-900);
  color: var(--ink);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .site-header {
  border-bottom-color: var(--line);
  background: rgba(5, 6, 13, 0.92);
  color: var(--ink);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .site-nav {
  color: var(--muted);
  scrollbar-width: none;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .site-nav::-webkit-scrollbar {
  display: none;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .site-nav a:hover,
:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .site-nav a[aria-current="location"] {
  background: rgba(154, 139, 240, 0.14);
  color: var(--accent-strong);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) :is(.case-hero, .section) {
  background: transparent;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .section-quiet {
  background: rgba(8, 11, 22, 0.72);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) :is(.hero-copy h1, .hero-copy h2, .section-heading h2, .section-heading h3) {
  color: var(--ink);
}

.case-page .case-hero .hero-copy > h1 {
  max-width: 940px;
  margin-bottom: 16px;
  font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1.34;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) :is(.hero-lead, .section-heading > p:not(.eyebrow)) {
  color: var(--muted);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .eyebrow {
  color: var(--accent-strong);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .side-toc {
  border-color: var(--line);
  background: rgba(7, 9, 19, 0.94);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .side-toc a {
  color: var(--muted);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .side-toc a[aria-current="location"] {
  background: rgba(154, 139, 240, 0.14);
  color: var(--accent-strong);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .side-toc__dot {
  border-color: var(--line);
  background: var(--surface);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) :is(.project-pagination, .site-footer) {
  border-color: var(--line);
  background: #06070f;
}

/* 상세 페이지 이동: 다크 테마 안에서 링크와 비활성 상태를 모두 또렷하게 구분 */
:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .project-pagination {
  gap: 14px;
  padding-block: 38px;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .project-pagination__item {
  min-height: 108px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 15, 30, 0.86);
  padding: 20px 22px;
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .project-pagination__item > span {
  color: var(--accent-strong);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) .project-pagination__item > strong {
  color: var(--ink);
}

:is(.case-page, .solution-page, .ax-page, .hellolaw-page) a.project-pagination__item:hover,
:is(.case-page, .solution-page, .ax-page, .hellolaw-page) a.project-pagination__item:focus-visible {
  border-color: rgba(184, 173, 255, 0.7);
  background: rgba(26, 24, 58, 0.88);
  color: var(--ink);
  transform: translateY(-2px);
}

/* RAG 사례: 일반 카드는 어둡게, 실제 UI와 완성 도식은 밝은 자료 패널로 유지 */
.case-page :is(
  .problem-map-block,
  .story-node,
  .problem-card,
  .goal-block,
  .goal-box,
  .challenge-block,
  .refresh-flow div,
  .solution-note,
  .rag-choice-strip article,
  .rag-system-card,
  .rag-system-pipeline article,
  .rag-architecture-card,
  .architecture-zone,
  .architecture-source-pair article,
  .architecture-batch-card,
  .architecture-ollama-card,
  .architecture-answer-card,
  .architecture-qdrant-card,
  .chat-ux-frame,
  .chat-screen,
  .chat-bubble,
  .stream-bubble,
  .source-strip span,
  .ux-time-card,
  .principle-list article,
  .rag-result-matrix,
  .rag-matrix-row,
  .mention-picker,
  .mention-input-bar
) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.case-page :is(.story-node, .before-screen, .wait-card) {
  border-color: rgba(239, 161, 127, 0.34);
  background: rgba(239, 161, 127, 0.09);
}

.case-page :is(.goal-block, .goal-box, .after-screen, .user-bubble, .stream-card) {
  border-color: rgba(154, 139, 240, 0.4);
  background: rgba(154, 139, 240, 0.1);
}

.case-page :is(.chat-screen-header strong, .loading-bubble strong, .ux-time-card strong) {
  color: var(--ink);
}

.case-page :is(.loading-bubble em, .ux-time-card span) {
  color: var(--muted);
}

.case-page .linked-problems .problem-card h3 {
  color: var(--rust);
}

.case-page :is(.challenge-header > div > p:last-child, .result-section .result-statement) {
  color: var(--muted);
}

.case-page .result-section .result-statement {
  color: var(--ink);
}

.case-page :is(.query-routing-figure figcaption, .mention-search-demo figcaption) {
  color: var(--muted);
}

.case-page :is(.rag-architecture-figure, .query-routing-figure picture, .mention-demo-window){
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #fff;
  --surface-soft: #eceff9;
  --ink: #15161f;
  --muted: #5f6578;
  --line: #dadeed;
  --accent: #5b4bc8;
  --accent-strong: #453aa0;
  border-color: #dadeed;
  background: #f7f9fc;
  color: #15161f;
}

.case-page .rag-architecture-figure,
.case-page .query-routing-figure picture {
  overflow: hidden;
  border: 1px solid rgba(178, 186, 226, 0.28);
  border-radius: 18px;
  padding: clamp(8px, 1.4vw, 16px);
}

@media (prefers-reduced-motion: reduce) {
  :is(.case-page, .solution-page, .ax-page, .hellolaw-page) *,
  :is(.case-page, .solution-page, .ax-page, .hellolaw-page) *::before,
  :is(.case-page, .solution-page, .ax-page, .hellolaw-page) *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }}

@media (max-width: 680px) {
  :is(.case-page, .solution-page, .ax-page, .hellolaw-page) .project-pagination {
    grid-template-columns: 1fr;
  }}

/* 전체 다크 테마의 시각 언어: 배경 신호, 핵심 흐름, 프로젝트 이동을 하나로 연결 */
:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) {
  position: relative;
  overflow-x: clip;
}

.detail-canvas {
  display: block;
  pointer-events: none;
}

.detail-canvas--page {
  position: fixed;
  z-index: 0;
  inset: 70px 0 0;
  width: 100vw;
  height: calc(100vh - 70px);
  opacity: 0.82;
}

:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) > :is(main, .project-pagination, .site-footer) {
  position: relative;
  z-index: 1;
}

:is(.chat-ux-frame, .deployment-story, .tag-commit-flow){
  position: relative;
  isolation: isolate;
}

.detail-canvas--overlay,
.detail-canvas--pagination {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.detail-canvas--overlay {
  z-index: 0;
}

:is(.chat-ux-frame, .deployment-story, .tag-commit-flow) > :not(.detail-canvas) {
  position: relative;
  z-index: 1;
}

.detail-canvas--pagination {
  z-index: 0;
  opacity: 0.82;
}

/* 하단 이동 카드는 독립 블록이 아니라 하나의 흐름 레일로 보이게 한다. */
:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) .project-pagination.project-pagination {
  isolation: isolate;
  overflow: hidden;
  gap: 10px;
  margin-block: clamp(54px, 7vw, 86px) 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(154, 139, 240, 0.08), transparent 38%),
    rgba(6, 7, 15, 0.96);
  padding: clamp(22px, 3vw, 32px);
}

.project-pagination__heading {
  position: relative;
  z-index: 2;
  display: flex;
  grid-column: 1 / -1;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 0 4px 18px;
}

.project-pagination__heading > span {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.12em;
}

.project-pagination__heading > strong {
  color: var(--ink);
  font-size: clamp(17px, 1.7vw, 22px);
  letter-spacing: -0.02em;
}

:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) .project-pagination__item {
  position: relative;
  z-index: 2;
  min-height: 86px;
  border: 0;
  border-radius: 11px;
  background: rgba(8, 11, 22, 0.76);
  padding: 17px 18px;
}

:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) a.project-pagination__item:hover,
:is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) a.project-pagination__item:focus-visible {
  background: rgba(35, 30, 82, 0.58);
  box-shadow: inset 0 0 0 1px rgba(184, 173, 255, 0.4);
}

/* 어두운 페이지에서 채움색과 텍스트색을 역할별로 분리 */
.case-page .ux-shift span {
  background: #5b4bc8;
  color: #fff;
}


/* 홈 프로젝트 탐색 카드도 다크 shell로 묶고 실제 시각 자료만 밝게 유지 */
.portfolio-home .project-gallery .project-gallery__slide {
  border-color: rgba(140, 148, 194, 0.34);
  background: #0a0e1c;
  box-shadow:
    0 28px 62px rgba(0, 0, 0, 0.34),
    0 6px 18px rgba(0, 0, 0, 0.2);
}

.portfolio-home .project-gallery .project-gallery__slide:hover,
.portfolio-home .project-gallery .project-gallery__slide:focus-visible {
  border-color: rgba(154, 139, 240, 0.62);
  box-shadow:
    0 32px 70px rgba(0, 0, 0, 0.42),
    0 8px 22px rgba(0, 0, 0, 0.24);
}

.portfolio-home .project-gallery .gallery-visual {
  border-bottom-color: rgba(140, 148, 194, 0.28);
}

.portfolio-home .project-gallery .gallery-card-copy {
  background: #0b0f1e;
  color: #eef1fb;
}

.portfolio-home .project-gallery .gallery-card-copy p {
  color: #bac3dd;
}

@media (min-width: 1101px) and (max-width: 1439px) {
  .side-toc {
    display: none;
  }}

@media (max-width: 680px) {
  .detail-canvas--page {
    top: 58px;
    height: calc(100vh - 58px);
    opacity: 0.66;
  }

  :is(body.case-page, body.solution-page, body.ax-page, body.hellolaw-page) .project-pagination.project-pagination {
    gap: 8px;
    border-radius: 16px;
    padding: 18px;
  }

  .project-pagination__heading {
    display: grid;
    gap: 5px;
    padding-bottom: 15px;
  }}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .detail-canvas {
    opacity: 0.5;
  }}

/* GitLab 프로젝트 카드는 로고만 실제 3D 축으로 회전하고 장식 라벨은 두지 않는다. */
.gitlab-brand-visual {
  z-index: 4 !important;
  display: grid;
  grid-column: 1 / -1;
  width: 100%;
  height: 100%;
  place-content: center;
  place-items: center;
  gap: 8px;
  perspective: 720px;
}

.gitlab-brand-visual > strong {
  color: #111;
  font-size: clamp(54px, 7vw, 78px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.gitlab-logo-spinner {
  --gitlab-logo-scale: 1;
  position: relative;
  width: 128px;
  height: 116px;
  transform: scale(var(--gitlab-logo-scale)) rotateX(-8deg) rotateY(0deg);
  transform-style: preserve-3d;
}

.gitlab-logo-face {
  position: absolute;
  inset: 0;
  background-image: url("../assets/gitlab-logomark.svg?v=3");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  backface-visibility: hidden;
}

.gitlab-logo-face--front {
  transform: translateZ(1px);
}

.gitlab-logo-face--back {
  transform: rotateY(180deg) translateZ(1px);
}

.project-gallery__slide.is-active .gitlab-logo-spinner {
  animation: gitlab-logo-orbit 5.8s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

@keyframes gitlab-logo-orbit {
  0%, 10% {
    transform: scale(var(--gitlab-logo-scale)) rotateX(-8deg) rotateY(0deg) rotateZ(0deg);
  }

  34% {
    transform: scale(var(--gitlab-logo-scale)) rotateX(12deg) rotateY(120deg) rotateZ(-3deg);
  }

  62% {
    transform: scale(var(--gitlab-logo-scale)) rotateX(-10deg) rotateY(245deg) rotateZ(3deg);
  }

  90%, 100% {
    transform: scale(var(--gitlab-logo-scale)) rotateX(-8deg) rotateY(360deg) rotateZ(0deg);
  }
}

@media (max-width: 560px) {
  .gitlab-brand-visual {
    gap: 5px;
  }

  .gitlab-logo-spinner {
    --gitlab-logo-scale: 0.81;
  }

  .gitlab-brand-visual > strong {
    font-size: 48px;
  }}

@media (prefers-reduced-motion: reduce) {
  .project-gallery__slide.is-active .gitlab-logo-spinner {
    animation: none;
  }}

/* ───────────────────────────────────────────────────────────────────────────
   프로젝트 개요 카드 (공용)
   solution-management.css 안에만 있던 .project-overview-card / .project-facts를
   세 상세 페이지가 함께 쓸 수 있도록 테마 변수 기반으로 옮겨 왔다.
   solution-management.css가 뒤에 로드되므로 해당 페이지의 기존 정의가 우선한다.
   ─────────────────────────────────────────────────────────────────────────── */
.project-overview-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 2.4vw, 30px);
}

.project-overview-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* 저장소 진입점: 정보 카드 우측 상단에 아이콘 하나로 둔다. */
.overview-repo-link {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.overview-repo-link:hover,
.overview-repo-link:focus-visible {
  border-color: var(--accent);
  background: var(--surface-soft);
  color: var(--ink);
}

.overview-repo-link .repo-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.project-overview-heading span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0.09em;
}

.project-overview-heading strong {
  font-size: clamp(22px, 2vw, 27px);
}

.project-facts {
  margin: 0;
}

.project-facts > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.project-facts > div:last-child {
  padding-bottom: 0;
}

.project-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.project-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.6;
}

.project-facts dd strong {
  color: var(--accent-strong);
}

.project-scope-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-scope-list li {
  position: relative;
  padding-left: 13px;
  font-weight: 680;
  line-height: 1.45;
}

.project-scope-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  content: "·";
}

/* 개요 카드 안에서는 메타데이터 텍스트가 아니라 작은 칩으로 표시한다.
   (solution-management.css의 .solution-info-stack과 같은 모양) */
.project-info-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 540px;
}

.project-info-stack span {
  display: inline-flex;
  border: 1px solid rgba(154, 139, 240, 0.24);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 6px 10px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 760;
}

/* 채워 넣어야 하는 값. 배포 전에 반드시 실제 값으로 교체할 것. */
.fact-todo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed var(--rust);
  border-radius: 8px;
  padding: 5px 11px;
  color: var(--rust);
  font-size: 13px;
  font-weight: 760;
}

.fact-todo::before {
  content: "!";
  display: grid;
  width: 15px;
  height: 15px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--rust);
  color: var(--bg);
  font-size: 11px;
  line-height: 1;
}

@media (max-width: 680px) {
  .project-facts > div {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 15px 0;
  }

  .project-facts dd {
    font-size: 14px;
  }}

/* 홈 프로젝트 성도. 준비 클래스가 붙기 전에는 기존 카드 갤러리가 유일한 경로다. */
.portfolio-home .constellation-gallery {
  position: relative;
  isolation: isolate;
  display: none;
  width: min(100%, 1320px);
  height: clamp(540px, 64vh, 720px);
  overflow: hidden;
  margin: 0 auto;
  perspective: 1300px;
}

.portfolio-home .constellation-gallery__stage {
  position: absolute;
  z-index: 1;
  inset: 0;
  transform: rotateX(var(--star-rotate-x)) rotateY(var(--star-rotate-y)) scale(1.045);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
}

.portfolio-home .constellation-gallery [data-ascii-gallery] {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portfolio-home .constellation-gallery__targets {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.portfolio-home .star-target {
  position: absolute;
  display: block;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.portfolio-home .star-target::after {
  position: absolute;
  top: calc(50% + var(--connector-start-y, 0px));
  left: calc(50% + var(--connector-start-x, 0px));
  width: var(--connector-idle-length, 0px);
  height: 24px;
  background: linear-gradient(
    to right,
    rgba(var(--rgb-star), 0.88),
    rgba(var(--rgb-star), 0.88)
  ) center / 100% 1px no-repeat;
  content: '';
  filter:
    drop-shadow(0 0 5px rgba(var(--rgb-star), 0.86))
    drop-shadow(0 0 12px rgba(var(--rgb-violet), 0.48));
  opacity: 0.72;
  pointer-events: auto;
  transform: translateY(-50%) rotate(var(--connector-angle, 0rad));
  transform-origin: 0 50%;
  transition:
    opacity 160ms ease,
    width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-home .star-target__label {
  position: absolute;
  top: calc(50% + var(--panel-offset-y, 0px));
  left: calc(50% + var(--panel-offset-x, 0px));
  box-sizing: border-box;
  width: var(--panel-width, auto);
  height: var(--panel-height, auto);
  color: var(--ink);
  isolation: isolate;
  pointer-events: none;
  transform: none;
}

.portfolio-home .star-target__label::before {
  position: absolute;
  z-index: 0;
  top: var(--title-box-top, 0px);
  left: var(--title-box-left, 0px);
  box-sizing: border-box;
  width: var(--title-box-width, 100%);
  height: var(--title-box-height, 100%);
  border: 1px solid rgba(var(--rgb-star), 0.38);
  background: rgba(var(--rgb-void), 0.78);
  content: '';
  pointer-events: none;
  transition:
    top 240ms cubic-bezier(0.22, 1, 0.36, 1),
    left 240ms cubic-bezier(0.22, 1, 0.36, 1),
    width 240ms cubic-bezier(0.22, 1, 0.36, 1),
    height 240ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.portfolio-home .star-target__title {
  position: absolute;
  z-index: 1;
  top: var(--title-offset-y, 50%);
  left: var(--title-offset-x, 50%);
  box-sizing: border-box;
  padding: 8px 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.35;
  opacity: 0.82;
  pointer-events: auto;
  text-shadow:
    0 0 8px rgba(var(--rgb-star), 0.48),
    0 0 18px rgba(var(--rgb-violet), 0.32);
  transform: translate(-50%, -50%);
  transition:
    background-color 180ms ease,
    opacity 180ms ease,
    text-shadow 180ms ease;
  white-space: nowrap;
}

.portfolio-home .star-target:is(.is-active, .is-intro-preview, :focus-visible)
  .star-target__label {
  pointer-events: auto;
}

.portfolio-home .star-target:is(.is-active, .is-intro-preview, :focus-visible)
  .star-target__label::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-color: rgba(var(--rgb-star), 0.52);
  background: rgba(var(--rgb-void), 0.22);
  box-shadow: 0 0 20px rgba(var(--rgb-violet), 0.1);
}

.portfolio-home .star-target:is(.is-active, .is-intro-preview, :focus-visible)
  .star-target__title {
  border-color: transparent;
  background: transparent;
  opacity: 1;
  text-shadow:
    0 0 8px rgba(var(--rgb-star), 0.82),
    0 0 20px rgba(var(--rgb-violet), 0.54);
}

.portfolio-home .star-target:is(.is-active, .is-intro-preview, :focus-visible)::after {
  width: var(--connector-active-length, 0px);
  opacity: 1;
}

.portfolio-home .star-target:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.portfolio-home .constellation-gallery__rotation-ui {
  position: absolute;
  z-index: 3;
  bottom: 10px;
  left: 50%;
  display: flex;
  align-items: center;
  padding: 0;
  transform: translateX(-50%);
}

.portfolio-home .constellation-gallery__hint {
  display: none;
  margin: -2px auto 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  text-align: center;
}

.portfolio-home [data-star-rotation-reset] {
  border: 1px solid rgba(var(--rgb-star), 0.28);
  background: rgba(var(--rgb-void), 0.72);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
}

.portfolio-home [data-star-rotation-reset]:hover,
.portfolio-home [data-star-rotation-reset]:focus-visible {
  border-color: var(--accent);
  outline: none;
}

@media (min-width: 981px) and (hover: hover) {
  .portfolio-home .portfolio-ambient canvas {
    transform: perspective(1400px) rotateX(var(--star-rotate-x)) rotateY(var(--star-rotate-y)) scale(1.075);
    transform-origin: 50% 50vh;
    transition: transform 180ms ease-out;
  }

  .portfolio-home.is-star-rotation-ready {
    cursor: grab;
  }

  .portfolio-home.is-star-rotation-ready
    :is(.portfolio-ambient canvas, .constellation-gallery__stage) {
    will-change: transform;
  }

  .portfolio-home.is-star-dragging {
    cursor: grabbing;
    user-select: none;
  }

  .portfolio-home.is-star-dragging * {
    cursor: grabbing !important;
  }

  .portfolio-home.is-star-dragging
    :is(.portfolio-ambient canvas, .constellation-gallery__stage) {
    transition: none;
  }
}

@media (min-width: 981px) and (hover: hover) {
  .portfolio-home:has(.project-gallery.is-constellation-ready) {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .portfolio-home:has(.project-gallery.is-constellation-ready) .portfolio-shell {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .portfolio-home .project-gallery.is-constellation-ready {
    display: flex;
    min-height: 0;
    flex-direction: column;
    margin-top: 8px;
  }

  .portfolio-home .project-gallery.is-constellation-ready > .constellation-gallery__hint {
    display: block;
    flex: none;
  }

  .portfolio-home .project-gallery.is-constellation-ready .constellation-gallery:not([hidden]) {
    display: block;
    height: auto;
    min-height: 0;
    flex: 1;
  }

  .portfolio-home .project-gallery.is-constellation-ready
    :is(.project-gallery__controls, .project-gallery__viewport, .project-gallery__progress) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-home .portfolio-ambient canvas,
  .portfolio-home .constellation-gallery__stage {
    transform: none;
    transition: none;
  }

  .portfolio-home [data-star-rotation-reset] {
    display: none;
  }

  .portfolio-home .star-target__label,
  .portfolio-home .star-target__title {
    opacity: 1;
  }

  .portfolio-home .star-target__label,
  .portfolio-home .star-target__label::before,
  .portfolio-home .star-target__title,
  .portfolio-home .star-target::after {
    transition: none;
  }
}
