:root {
  color-scheme: dark;
  --bg: #1c1c30;
  --bg-elevated: #242440;
  --surface: rgba(38, 38, 58, 0.55);
  --surface-solid: #20203a;
  --surface-2: rgba(46, 44, 68, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(196, 181, 253, 0.18);
  --text: #f5f4fa;
  --text-2: #a9a4c0;
  --text-dim: #8884a8;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-glow: rgba(167, 139, 250, 0.42);
  --teal-soft: rgba(34, 211, 238, 0.12);
  --pastel-violet: #c4b5fd;
  --pastel-teal: #67e8f9;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --r: 18px;
  --r-lg: 24px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --topbar-h: 68px;

  /* 반투명 패널 — backdrop-filter 미사용 (마우스/스크롤 시 재블러 GPU 스파이크 방지) */
  --glass-bg: linear-gradient(
    145deg,
    rgba(44, 42, 64, 0.88) 0%,
    rgba(34, 34, 52, 0.82) 55%,
    rgba(38, 40, 60, 0.9) 100%
  );
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
#top, #repos, #journey, section[id] { scroll-margin-top: calc(var(--topbar-h) + 12px); }

html { scrollbar-width: thin; scrollbar-color: var(--border-hi) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--border-hi) 80%, transparent);
  border-radius: 999px;
  border: 2px solid var(--bg);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--accent), var(--accent-2));
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

::selection { background: var(--accent-soft); color: var(--text); }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 8px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Pretendard, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* ── Background: 10s loop video + veil (하드웨어 디코드, JS 파티클 없음) ── */
.bg-stack {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  contain: strict;
  overflow: hidden;
  background: #1c1c30;
  transform: translateZ(0);
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* 콘텐츠 가독성 — 영상은 분위기만 */
  opacity: 0.62;
  /* GPU 레이어 1장 */
  transform: translateZ(0);
}

.bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(110, 55, 165, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(20, 20, 36, 0.3) 0%, rgba(20, 20, 36, 0.44) 45%, rgba(20, 20, 36, 0.62) 100%);
}

/* 데이터 절약 / reduced-motion: 정지 포스터만 */
@media (prefers-reduced-motion: reduce) {
  .bg-video { display: none !important; }
}
@media (max-width: 768px) {
  .bg-video { opacity: 0.42; }
}

.accent-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 20%,
    var(--accent-3) 50%,
    var(--accent-2) 80%,
    transparent 100%
  );
  opacity: 0.95;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

/* ── Glass utility (opaque-ish panel, no backdrop-filter) ── */
.glass {
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow);
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 14px 1.5rem;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  margin-top: 2px;
  background: rgba(24, 24, 40, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s, box-shadow 0.25s;
}
html.is-scrolled .topbar {
  border-bottom-color: rgba(167, 139, 250, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0f;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--display);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 6px 24px var(--accent-glow);
  transition: box-shadow 0.2s var(--ease);
}
.brand:hover .brand-mark {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 8px 32px var(--accent-glow);
}
.brand-name {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-2);
  font-weight: 500;
}

/* 배경 영상 전환 — 로고 옆 컴팩트 드롭다운 */
.bg-switch {
  position: relative;
  flex-shrink: 0;
}
.bg-switch-toggle {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  cursor: pointer;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(34, 211, 238, 0.14));
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.1),
    0 0 16px rgba(167, 139, 250, 0.18);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bg-switch-toggle:hover,
.bg-switch.open .bg-switch-toggle {
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.18),
    0 0 22px rgba(167, 139, 250, 0.28);
}
.bg-switch-toggle:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.bg-switch-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.bg-switch-cur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  width: 1.1em;
  min-width: 1.1em;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.bg-switch-toggle .car {
  font-size: 10px;
  color: var(--text-2);
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.bg-switch.open .bg-switch-toggle .car {
  transform: rotate(180deg);
}
.bg-switch-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  width: max-content;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(28, 28, 44, 0.96);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(34, 211, 238, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.bg-switch.open .bg-switch-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.bg-switch-item {
  appearance: none;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  background: transparent;
  text-align: left;
  transition: color 0.12s, background 0.12s;
}
.bg-switch-item kbd {
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3, var(--text-2));
  opacity: 0.7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
}
.bg-switch-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.bg-switch-item.is-active {
  color: #0a0a0f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.bg-switch-item.is-active kbd {
  color: rgba(10, 10, 15, 0.7);
  border-color: rgba(10, 10, 15, 0.2);
  opacity: 1;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
  flex-shrink: 1;
}
.topnav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.topnav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.topnav a.nav-cta {
  color: #0c0b12;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 16px var(--accent-glow);
}
.topnav a.nav-cta:hover {
  color: #0c0b12;
  filter: brightness(1.06);
  box-shadow: 0 4px 22px var(--accent-glow);
}

/* dropdown */
.nav-dd { position: relative; }
.nav-dd-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s, background 0.2s;
}
.nav-dd-btn:hover,
.nav-dd.open .nav-dd-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.nav-dd-btn .car {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.25s var(--ease);
}
.nav-dd.open .nav-dd-btn .car,
.nav-dd:hover .nav-dd-btn .car { transform: rotate(180deg); }

.nav-dd-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  width: 248px;
  max-height: min(70vh, 440px);
  padding-top: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-dd-card {
  background: rgba(30, 30, 46, 0.92);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  max-height: min(70vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nav-dd.open .nav-dd-panel,
.nav-dd:hover .nav-dd-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.nav-dd-group + .nav-dd-group {
  margin-top: 0.2rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
}
.nav-dd-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.25rem 0.55rem 0.15rem;
}
.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.25;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.nav-dd-item:hover {
  color: var(--text);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.nav-dd-item .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-2);
}

/* ── Layout ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 4.5rem 2.75rem 5.5rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  margin-bottom: 2rem;
  text-align: left;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pastel-teal);
  margin: 0 0 1.4rem;
  padding: 0.42rem 0.9rem 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 0 0 1rem;
  line-height: 0.98;
}
h1 .name-line {
  display: block;
  color: var(--text);
  margin-bottom: 0.12em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 4px 20px rgba(0, 0, 0, 0.55);
}
h1 .hl {
  display: inline-block;
  background: linear-gradient(
    110deg,
    var(--accent) 0%,
    #e9d5ff 32%,
    var(--accent-2) 62%,
    var(--accent-3) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  display: inline-block;
  color: var(--text-2);
  font-size: clamp(1.05rem, 2.5vw, 1.22rem);
  font-weight: 400;
  margin: 0 0 1.6rem;
  max-width: 32em;
  line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.5);
  background: rgba(10, 10, 20, 0.34);
  padding: 0.3em 0.6em;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  transition:
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease),
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    filter 0.2s;
}
.btn-arrow {
  font-size: 12px;
  opacity: 0.8;
  transition: transform 0.28s var(--ease);
}
.btn-primary {
  color: #0c0b12;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow:
    0 4px 28px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
@media (hover: hover) {
  .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 36px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.12);
  }
  .btn-primary:hover .btn-arrow { transform: translateY(3px); }
  .btn-ghost:hover {
    border-color: rgba(167, 139, 250, 0.5);
    background: var(--accent-soft);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }
  .btn-ghost:hover .btn-arrow { transform: translateY(3px); }
  .btn:active { transform: translateY(0) scale(0.98); }
}

/* hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.stat-card {
  position: relative;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease),
    transform 0.28s var(--ease);
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 30%,
    rgba(167, 139, 250, 0.12) 48%,
    rgba(34, 211, 238, 0.1) 55%,
    transparent 72%
  );
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}
@media (hover: hover) {
  .stat-card:hover {
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 16px 40px rgba(0, 0, 0, 0.35),
      0 0 32px rgba(167, 139, 250, 0.12);
  }
  .stat-card:hover::before { transform: translateX(120%); }
  .stat-card:hover .stat-num {
    filter: brightness(1.15);
  }
}
.stat-num {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--pastel-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* marquee 제거됨 — 무한 transform 애니 idle GPU 소모 */
.marquee { display: none; }

.skill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}
.skill-strip span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.36rem 0.75rem;
  border-radius: 999px;
  background: rgba(10, 10, 20, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}
@media (hover: hover) {
  .skill-strip span:hover {
    color: var(--pastel-teal);
    border-color: rgba(34, 211, 238, 0.5);
    background: var(--teal-soft);
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.15);
  }
}

.exp-note {
  position: relative;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.72;
  padding: 1.4rem 1.5rem 1.4rem 1.65rem;
  border-radius: var(--r);
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.exp-note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
}

.learning-note {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.3rem 1.45rem;
  border-radius: var(--r);
  margin-bottom: 3.8rem;
  position: relative;
  overflow: hidden;
}
.learning-note::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -8%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12), transparent 70%);
  pointer-events: none;
}
.learning-note .li-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--accent-soft), var(--teal-soft));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.learning-note .li-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.learning-note .li-body p {
  margin: 0 0 0.8rem;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.6;
}
.learning-note .li-body p b {
  color: var(--text);
  font-weight: 600;
}
.learning-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.learning-tags span {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.2);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}
@media (hover: hover) {
  .learning-tags span:hover {
    color: var(--pastel-teal);
    border-color: rgba(34, 211, 238, 0.5);
    background: var(--teal-soft);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(34, 211, 238, 0.12);
  }
}

/* sections */
section { margin-bottom: 3.8rem; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.4rem;
}
h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px var(--accent-glow);
}
.section-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#repos .section-head h2::before {
  background: linear-gradient(135deg, var(--accent), var(--pastel-violet));
}
#journey .section-head h2::before {
  background: linear-gradient(135deg, var(--accent-2), var(--pastel-teal));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

/* repo cards */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}
.repo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 18px;
  transition:
    transform 0.32s var(--ease),
    box-shadow 0.32s var(--ease),
    border-color 0.25s;
  overflow: hidden;
  min-height: 180px;
}
.repo-card:focus,
.repo-card:focus-visible,
.tl-item:focus,
.tl-item:focus-visible {
  outline: none;
}
.repo-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(167, 139, 250, 0.55),
    transparent 40%,
    transparent 60%,
    rgba(34, 211, 238, 0.45)
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 0;
  /* 보더 글로우: 마스크로 테두리만 */
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.repo-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transform: skewX(-18deg) translateX(0);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.55s var(--ease), opacity 0.2s;
}
@media (hover: hover) {
  .repo-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 8px 20px rgba(0, 0, 0, 0.3),
      0 0 20px rgba(167, 139, 250, 0.12);
  }
  .repo-card:hover::before { opacity: 1; }
  .repo-card:hover::after {
    opacity: 1;
    transform: skewX(-18deg) translateX(320%);
  }
  .repo-card:hover .repo-head svg { color: var(--accent); transform: scale(1.15); }
  .repo-card:hover .repo-live {
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
    border-color: rgba(34, 211, 238, 0.45);
  }
  .repo-card:hover .repo-tags span {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    border-color: rgba(167, 139, 250, 0.35);
  }
  .repo-card:active { transform: translateY(0); }
}

.repo-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 2;
}
.repo-head svg,
.repo-head .icon-gh {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.25s, transform 0.28s var(--ease);
}
.repo-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--mono);
  flex: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.repo-live {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid rgba(34, 211, 238, 0.25);
  flex-shrink: 0;
  transition: box-shadow 0.28s, border-color 0.28s;
}
.repo-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.6);
}
.repo-desc {
  margin: 0 0 0.85rem;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.52;
  min-height: 3.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  position: relative;
  z-index: 2;
}
.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  position: relative;
  z-index: 2;
}
.repo-tags span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--pastel-violet);
  font-weight: 500;
  border: 1px solid rgba(167, 139, 250, 0.18);
  transition: background 0.25s, border-color 0.25s;
}

/* journey timeline */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 15px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}
.timeline-progress {
  position: absolute;
  top: 6px;
  left: 15px;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-2);
  transition: height 0.12s linear;
  pointer-events: none;
  z-index: 1;
}
.tl-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1rem 0.55rem 2.3rem;
  text-decoration: none;
  color: inherit;
  border-radius: 13px;
  overflow: hidden;
  transition:
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease),
    background 0.28s,
    transform 0.28s var(--ease);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(7, 7, 13, 0.85);
  transform: translateY(-50%);
  transition: background 0.25s, box-shadow 0.28s var(--ease), border-color 0.25s, transform 0.28s var(--ease);
  z-index: 2;
}
@media (hover: hover) {
  .tl-item:hover {
    border-color: rgba(167, 139, 250, 0.4);
    background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 10px 26px rgba(0, 0, 0, 0.28),
      0 0 20px rgba(34, 211, 238, 0.07);
  }
  .tl-item:hover::before {
    background: var(--accent);
    transform: translateY(-50%) scale(1.25);
    box-shadow:
      0 0 0 4px rgba(7, 7, 13, 0.85),
      0 0 20px var(--accent-glow);
  }
  .tl-item:hover h3 .go {
    color: var(--accent-2);
    transform: translate(4px, -3px) scale(1.15);
  }
  .tl-item:active { background: color-mix(in srgb, var(--surface-solid) 65%, transparent); }
}
.tl-meta {
  flex-shrink: 0;
  width: 72px;
}
.tl-date {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  display: block;
}
.tl-ver {
  font-family: var(--mono);
  font-size: 0.56rem;
  color: var(--pastel-teal);
  display: inline-block;
  margin-top: 3px;
  padding: 0.06rem 0.35rem;
  background: var(--teal-soft);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 6px;
}
.tl-body { flex: 1; min-width: 0; }
.tl-body h3 {
  margin: 0 0 0.1rem;
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-body h3 .go {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 400;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.28s var(--ease), color 0.2s;
}
.tl-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* footer */
footer {
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 20, 0.3);
  border-radius: 14px;
}
footer .flinks {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
footer a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
footer a:hover {
  color: var(--pastel-teal);
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--teal-soft);
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .hero-stats { grid-template-columns: 1fr; }
  .stat-card { display: flex; align-items: baseline; gap: 0.75rem; }
  .stat-num { margin-bottom: 0; }
}

@media (max-width: 560px) {
  .tl-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.6rem 1rem 0.6rem 2.2rem;
  }
  .tl-body h3, .tl-body p { white-space: normal; }
  .tl-meta {
    width: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  footer {
    flex-direction: column;
    gap: 0.7rem;
    text-align: center;
  }
  .nav-dd-panel { width: 82vw; max-width: 270px; }
  .brand-name { display: none; }
  .bg-switch-toggle {
    height: 30px;
    min-height: 30px;
    padding: 0 9px;
    gap: 4px;
  }
  .bg-switch-label { font-size: 9px; letter-spacing: 0.06em; }
  .bg-switch-cur {
    font-size: 11px;
    width: 1.15em;
    min-width: 1.15em;
  }
  .bg-switch-toggle .car { font-size: 9px; }
  .bg-switch-item { min-height: 40px; padding: 10px 12px; }
  .bg-switch-item kbd { display: none; }
  .brand-cluster { gap: 8px; }
  .topbar {
    padding: 10px 0.9rem;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-left: max(0.9rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.9rem, env(safe-area-inset-right, 0px));
  }
  .topnav a,
  .nav-dd-btn {
    padding: 8px 11px;
    font-size: 12px;
    min-height: 36px;
  }
  .wrap {
    padding: 3rem 1.15rem 3.5rem;
    padding-bottom: max(3.5rem, env(safe-area-inset-bottom, 0px) + 2rem);
    padding-left: max(1.15rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.15rem, env(safe-area-inset-right, 0px));
  }
  .exp-note,
  .learning-note { margin-bottom: 2rem; }
  .repo-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .hero-cta .btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
  h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  dialog.modal-frame {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  dialog.modal-frame::backdrop { backdrop-filter: none; }
}

@media (hover: none) {
  .nav-dd:hover .nav-dd-panel {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
  }
  .nav-dd.open .nav-dd-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .repo-card,
  .stat-card,
  .tl-item,
  .btn,
  .skill-strip span,
  .learning-tags span {
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s !important;
  }
  .repo-card:hover,
  .stat-card:hover,
  .tl-item:hover,
  .btn:hover,
  .skill-strip span:hover,
  .learning-tags span:hover {
    transform: none !important;
  }
  .repo-card::after,
  .stat-card::before { display: none; }
}

/* modal */
dialog.modal-frame {
  display: none;
  width: min(1100px, 94vw);
  height: 94vh;
  margin: auto;
  padding: 0;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  box-shadow: var(--shadow-lg), 0 0 100px rgba(0, 0, 0, 0.5);
  flex-direction: column;
  overflow: hidden;
}
dialog.modal-frame[open] {
  display: flex;
  animation: modalIn 0.25s var(--ease);
}
dialog.modal-frame::backdrop {
  background: rgba(14, 14, 24, 0.82);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.05rem;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 18, 30, 0.95);
  flex-shrink: 0;
}
.modal-title {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.modal-actions a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--pastel-teal);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--border-hi);
  transition: background 0.15s, border-color 0.15s;
}
.modal-actions a:hover {
  background: var(--teal-soft);
  border-color: rgba(34, 211, 238, 0.35);
}
.modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.modal-close svg { width: 13px; height: 13px; }
.modal-close:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.modal-frame iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--surface-solid);
}

/* entrance */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-badge,
h1,
.tagline,
.hero-cta,
.hero-stats,
.skill-strip,
.exp-note,
.learning-note {
  animation: riseIn 0.7s var(--ease-out) both;
}
h1 { animation-delay: 0.06s; }
.tagline { animation-delay: 0.12s; }
.hero-cta { animation-delay: 0.18s; }
.hero-stats { animation-delay: 0.24s; }
.skill-strip { animation-delay: 0.3s; }
.exp-note { animation-delay: 0.36s; }
.learning-note { animation-delay: 0.42s; }

.reveal-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
  /* content-visibility:auto가 암묵적으로 contain:paint를 걸어서
     호버 시 scale()로 커지는 카드 좌우 끝이 섹션 경계에 잘리는 것을 방지 */
  padding: 0 12px;
  margin-left: -12px;
  margin-right: -12px;
}
/* opacity only — transform 애니는 스크롤 시 GPU 부담 */
.reveal-section h2,
.reveal-section .section-sub,
.reveal-section .repo-card,
.reveal-section .tl-item {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.reveal-section.in-view h2,
.reveal-section.in-view .section-sub,
.reveal-section.in-view .repo-card,
.reveal-section.in-view .tl-item {
  opacity: 1;
}
.reveal-section.in-view h2,
.reveal-section.in-view .section-sub { transition-delay: 0s; }
.reveal-section.in-view .repo-card,
.reveal-section.in-view .tl-item {
  transition-delay: calc(0.05s + var(--reveal-i, 0) * 0.04s);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-section h2,
  .reveal-section .section-sub,
  .reveal-section .repo-card,
  .reveal-section .tl-item {
    opacity: 1;
    transition: none;
  }
  .hero-badge, h1, .tagline, .hero-cta, .hero-stats,
  .skill-strip, .exp-note, .learning-note {
    animation: none;
  }
}


