/* ===== Page Transitions ===== */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-fade-out 0.2s ease forwards;
}

::view-transition-new(root) {
  animation: vt-fade-in 0.25s ease forwards;
}

@keyframes vt-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Design System ===== */
:root {
  --surface:     #d8e2e9;
  --surface-alt: #ebf0fa;
  --ink:         #1e222a;
  --ink-warm:    #485f82;
  --accent:      #a7b3c7;
  --shadow:      #0f1e3c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background-color: var(--surface);
  color: var(--ink);
  font-family: 'Geist', 'Noto Sans KR', Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 2rem 4rem;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  transition: font-weight 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

a:hover { color: var(--ink-warm); }

/* ===== Responsive padding ===== */
@media (min-width: 1601px) { main { padding-left: 0; padding-right: 0; } }
@media (max-width: 1440px) { main { padding-left: 6rem; padding-right: 6rem; } }
@media (max-width: 1200px) { main { padding-left: 3rem; padding-right: 3rem; } }
@media (max-width: 991px)  { main { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (max-width: 575px)  { main { padding-left: 1rem; padding-right: 1rem; } }

/* ===== Header ===== */
.site-header {
  padding: 1.25rem 2rem;
}

@media (max-width: 1440px) { .site-header { padding: 1.25rem 6rem; } }
@media (max-width: 1200px) { .site-header { padding: 1.25rem 3rem; } }
@media (max-width: 991px)  { .site-header { padding: 1.25rem 1.5rem; } }
@media (max-width: 575px)  { .site-header { padding: 1.25rem 1rem; } }

.site-title {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* ===== Pill Nav ===== */
.pill-nav {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: var(--ink);
  border-radius: 100px;
  padding: 0.3rem 0.4rem;
  box-shadow: 0 4px 24px color-mix(in srgb, var(--ink) 25%, transparent);
  z-index: 100;
  white-space: nowrap;
}

.pill-link {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.4px;
  color: color-mix(in srgb, #fff 55%, transparent);
  text-decoration: none;
  padding: 0.32rem 1rem;
  border-radius: 100px;
  transition: background 0.18s, color 0.18s;
}

.pill-link:hover, .pill-link.active {
  background: #fff;
  color: var(--ink);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 1.5rem 2rem;
  background-color: var(--surface);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-inner p {
  font-size: 0.78rem;
  font-weight: 250;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  display: flex;
  align-items: center;
}

.footer-links a:hover { color: var(--ink); }

.footer-links svg { width: 1rem; height: 1rem; }

/* ===== Home: Intro grid ===== */
.intro-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: stretch;
  padding-top: 0;
  padding-bottom: 3rem;
}

@media (max-width: 640px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .intro-photo { order: -1; }
  .intro-photo img { width: 100px; border-radius: 50%; }
  .intro-text .contact-links a:first-child { width: 100%; }
}

.intro-text h1 {
  font-family: 'Geist', 'Noto Sans KR', Arial, sans-serif;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.intro-text h1 .name-ko {
  font-size: 1.1rem;
  font-weight: 300;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  margin-left: 0.5rem;
}

.intro-text .role {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--ink-warm);
  margin-bottom: 1.25rem;
}

.intro-text p {
  font-size: 0.92rem;
  font-weight: 250;
  line-height: 1.8;
  max-width: 600px;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.intro-text .contact-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.intro-text .contact-links a {
  font-size: 0.82rem;
  font-weight: 350;
  color: var(--ink-warm);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.intro-text .contact-links a:hover { color: var(--ink); }
.intro-text .contact-links svg { width: 0.85rem; height: 0.85rem; }

.intro-photo {
  align-self: stretch;
}

.intro-photo img {
  width: auto;
  height: 100%;
  max-height: 190px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.5rem;
  filter: grayscale(10%);
}

/* ===== Home: Section tabs ===== */
.stabs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0;
  padding-bottom: 2.5rem;
}

.stab {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s;
}
.stab:hover  { color: color-mix(in srgb, var(--ink) 65%, transparent); }
.stab.stab-on { color: var(--ink); }

.stab-dot {
  color: color-mix(in srgb, var(--accent) 70%, transparent);
  font-size: 0.65rem;
  user-select: none;
}

/* ===== Home: Section panels ===== */
.spanel { display: none; }

/* ===== Home: Recent Work grid ===== */
.rw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

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

.rw-card {
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  transition: border-color 0.18s;
  display: flex;
  flex-direction: column;
}
.rw-card:hover { border-color: var(--ink); }

.rw-thumb-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: color-mix(in srgb, var(--surface) 60%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rw-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rw-thumb-ph {
  width: 100%;
  aspect-ratio: 4/3;
  background: color-mix(in srgb, var(--surface) 60%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.rw-thumb-ph svg { width: 1.1rem; height: 1.1rem; }

.rw-body {
  padding: 0.6rem 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: white;
  flex: 1;
}

.rw-title {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
}

.rw-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.rw-tags span {
  font-size: 0.6rem;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--ink-warm);
}

/* ===== Home: Project detail panel ===== */
.rw-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.75rem;
  transition: color 0.15s;
}
.rw-back:hover { color: var(--ink); }
.rw-back svg { width: 0.85rem; height: 0.85rem; }

.proj-d-title {
  font-family: 'Geist', 'Noto Sans KR', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.proj-d-desc {
  font-size: 0.85rem;
  font-weight: 250;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  margin-bottom: 0.75rem;
}

.proj-d-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.proj-d-links a {
  font-size: 0.8rem;
  font-weight: 380;
  color: var(--ink-warm);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.18s;
}
.proj-d-links a:hover { color: var(--ink); }
.proj-d-links svg { width: 0.85rem; height: 0.85rem; }

.proj-d-body {
  font-size: 0.87rem;
  font-weight: 250;
  line-height: 1.8;
  color: color-mix(in srgb, var(--ink) 85%, transparent);
  max-width: 720px;
}
.proj-d-body p + p { margin-top: 0.75rem; }
.proj-d-body img {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  display: block;
}

/* ===== Home: Section heading ===== */
.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  margin-bottom: 1.25rem;
  margin-top: 2.5rem;
}

/* ===== Home: Horizontal scroller ===== */
.scroller-wrap {
  position: relative;
  margin: 0 -0.5rem;
}

.scroller {
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  mask: linear-gradient(90deg, transparent, white 4%, white 96%, transparent);
  -webkit-mask: linear-gradient(90deg, transparent, white 4%, white 96%, transparent);
  cursor: grab;
  padding: 0 1rem;
}

.scroller::-webkit-scrollbar { display: none; }
.scroller.is-dragging { cursor: grabbing; scroll-behavior: auto; }

.scroller-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  width: max-content;
  padding-block: 0.5rem;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--ink);
  transition: background 0.18s;
}

.scroll-btn:hover { background: var(--surface-alt); }
.scroll-btn svg  { width: 0.9rem; height: 0.9rem; }
.scroll-btn.left  { left: -0.6rem; }
.scroll-btn.right { right: -0.6rem; }

.scroll-card {
  width: 180px;
  background: var(--surface-alt);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.scroll-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--shadow) 12%, transparent);
}

.scroll-card-title {
  font-family: 'Geist', 'Noto Sans KR', Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.scroll-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.scroll-card-tags span {
  font-size: 0.65rem;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--ink-warm);
}

/* ===== modal-open body lock ===== */
body.modal-open { overflow: hidden; }

/* ===== Modal (shared: home + project pages) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  padding: 1rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.22s ease;
}

.modal-dialog {
  width: min(100%, 800px);
  margin: 2rem auto;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.modal.show .modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-content {
  background-color: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem 1.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.modal-date {
  font-size: 0.8rem;
  color: #7f90a2;
  margin-bottom: 0.25rem;
}

.modal-header h5 {
  font-family: 'Geist', 'Noto Sans KR', Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.modal-desc {
  font-size: 0.83rem;
  font-weight: 250;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  margin-bottom: 0.75rem;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-links a,
.modal-links .poster-btn {
  font-size: 0.8rem;
  font-weight: 380;
  color: var(--ink-warm);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.18s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.modal-links a:hover,
.modal-links .poster-btn:hover { color: var(--ink); }
.modal-links svg { width: 0.85rem; height: 0.85rem; }

.btn-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  line-height: 1;
  padding: 0.1rem 0.25rem;
  flex-shrink: 0;
  transition: color 0.18s;
}

.btn-close:hover { color: var(--ink); }

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  font-size: 0.87rem;
  font-weight: 250;
  line-height: 1.8;
  color: color-mix(in srgb, var(--ink) 85%, transparent);
}

.modal-body p + p { margin-top: 0.75rem; }

.modal-img {
  width: 100%;
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.modal-role {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.modal-role .role-label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-role .role-text {
  font-size: 0.78rem;
  font-weight: 350;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}
