/* ===========================================
   Yeseo Ahn — Portfolio v2
   Layout: sticky sidebar (profile) + scrolling content
   Type: Geist Sans + Pretendard, Geist Mono accent
   Color: warm off-white + tomato red point; full dark mode
   =========================================== */

:root {
  /* light theme (default) */
  --bg: #fbfaf6;
  --bg-elev: #ffffff;
  --bg-sunken: #f3efe7;
  --ink: #16140f;
  --ink-soft: #4a4439;
  --ink-mute: #8a8170;
  --line: #e9e2d3;
  --line-soft: #f0ebde;

  --tomato: oklch(0.62 0.20 28);
  --tomato-hover: oklch(0.56 0.20 28);
  --tomato-tint: color-mix(in oklch, var(--tomato) 12%, transparent);

  --radius: 12px;
  --radius-lg: 20px;

  --font-en: "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-kr: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-sans: var(--font-kr), var(--font-en);
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1320px;
  --gutter: 40px;
  --sidebar-w: 340px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  --bg: #11100d;
  --bg-elev: #1a1815;
  --bg-sunken: #0c0b09;
  --ink: #ece5d8;
  --ink-soft: #b5ad9d;
  --ink-mute: #7a7160;
  --line: #2a2620;
  --line-soft: #1f1c17;

  --tomato: oklch(0.7 0.18 28);
  --tomato-hover: oklch(0.78 0.18 28);
  --tomato-tint: color-mix(in oklch, var(--tomato) 18%, transparent);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  transition: background-color 280ms var(--ease), color 280ms var(--ease);
}

::selection {
  background: var(--tomato);
  color: #fff;
}

:focus-visible { outline: 2px solid var(--tomato); outline-offset: 4px; }
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 300;
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  transform: translateY(-150%); transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

a {
  color: inherit;
  text-decoration: none;
}
a.underline {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color 180ms ease, color 180ms ease;
}
a.underline:hover {
  color: var(--tomato);
  border-bottom-color: var(--tomato);
}

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

/* ============== top nav ============== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: color-mix(in oklch, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.topnav.scrolled { border-bottom-color: var(--line); }

.brand {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.brand .accent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tomato);
  display: inline-block;
  transform: translateY(-1px);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 0;
  position: relative;
  transition: color 160ms ease;
  border: 0;
  background: transparent;
  font: inherit;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--tomato);
  transition: width 220ms var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.utility {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.utility .pill {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  font-family: var(--font-en);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.utility .pill button {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-mute);
  transition: all 180ms ease;
  font: inherit;
}
.utility .pill button.active {
  background: var(--ink);
  color: var(--bg);
}
.theme-btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 180ms ease, background 180ms ease;
  padding: 0;
}
.theme-btn:hover {
  color: var(--ink);
  background: var(--bg-sunken);
}
.theme-btn svg { width: 16px; height: 16px; }

/* ============== layout ============== */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--gutter) 80px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 80px;
  align-items: start;
}

/* ============== sidebar ============== */
.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.avatar {
  width: 168px;
  height: 168px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  align-self: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  position: relative;
}
.avatar image-slot,
.avatar image-slot::part(content),
.avatar image-slot img {
  border-radius: 50% !important;
}
.avatar image-slot {
  width: 100%;
  height: 100%;
  display: block;
}

.profile h1 {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.profile h1 .sub {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.5em;
  color: var(--ink-mute);
  letter-spacing: -0.01em;
  margin-top: 6px;
}
.profile .role {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0 auto;
  max-width: 28ch;
}
.profile .org {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-top: 6px;
  display: block;
}

.handle {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--tomato);
  margin: 0;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.profile-links a {
  font-family: var(--font-en);
  font-size: 13.5px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}
.profile-links a:hover {
  color: var(--tomato);
  border-bottom-color: var(--tomato);
}
.profile-links a::before {
  content: "↗";
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  transition: color 160ms ease, transform 200ms var(--ease);
}
.profile-links a:hover::before {
  color: var(--tomato);
  transform: translate(2px, -2px);
}

.side-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  width: 100%;
}
.side-block h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin: 0 0 4px;
}
.side-block .item .place {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.side-block .item .meta {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.side-block .item .period {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.side-block .item + .item { margin-top: 14px; }
.awards-block .item .place {
  line-height: 1.4;
  text-wrap: balance;
}

/* ============== content ============== */
.content {
  min-width: 0;
  padding-top: 8px;
}
.content section {
  scroll-margin-top: 90px;
}
.content section + section {
  margin-top: 96px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.about h2 {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 36px;
  text-wrap: balance;
  position: relative;
}
.about h2::after {
  content: ".";
  color: var(--tomato);
  margin-left: 2px;
}
.about p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 20px;
  text-wrap: pretty;
  letter-spacing: -0.005em;
}
.about p:last-child { margin-bottom: 0; }
.about p .accent {
  color: var(--tomato);
}
.about-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 18px; margin-top: 34px;
}
.primary-action, .text-action {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 14px/1 var(--font-sans); cursor: pointer;
}
.primary-action {
  border: 1px solid var(--tomato); border-radius: 999px;
  padding: 13px 18px; background: var(--tomato); color: #fff;
  transition: transform 180ms var(--ease), background 180ms ease;
}
.primary-action:hover { background: var(--tomato-hover); transform: translateY(-2px); }
.text-action { color: var(--ink-soft); border-bottom: 1px solid var(--line); padding: 8px 0; }
.text-action:hover { color: var(--tomato); border-color: var(--tomato); }

/* ============== skills ============== */
.skills-headline {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 40px;
  max-width: 28ch;
  text-wrap: balance;
  color: var(--ink);
}
.skills-headline::after {
  content: ".";
  color: var(--tomato);
}

.skills-tools {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
  align-items: start;
}
.skills-tools .tools-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 4px;
}
.tool-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tool-group {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: center;
}
.tool-group .group-label {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.tool-group .group-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-pill {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--tomato);
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--tomato);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}
.tool-pill:hover {
  background: var(--tomato);
  color: #fff;
}

.skills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.skills-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}
.skills-list li:last-child { border-bottom: 0; }
.skills-list .num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--tomato);
  padding-top: 4px;
}
.skills-list .txt {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

/* ============== project section ============== */
.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 24px;
}
.work-head h2 {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
}
.work-head h2::after {
  content: ".";
  color: var(--tomato);
}
.work-head .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tomato);
  letter-spacing: 0.05em;
}
.work-sub {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 32px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 14px 14px 18px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 260ms var(--ease), border-color 220ms ease, box-shadow 260ms ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: 0 14px 36px -20px color-mix(in oklch, var(--ink) 35%, transparent);
}
.card:focus-visible {
  border-color: var(--tomato);
  box-shadow: 0 14px 36px -20px color-mix(in oklch, var(--ink) 35%, transparent);
}

.card-media {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}
.card-media image-slot {
  width: 100%;
  height: 100%;
  display: block;
}
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.badge.ai {
  background: var(--tomato);
  color: #fff;
  border-color: transparent;
}
.badge.ongoing {
  background: var(--tomato);
  color: #fff;
  border-color: transparent;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
}
.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.card-title-row h3 {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
  transition: color 200ms ease;
}
.card:hover .card-title-row h3 {
  color: var(--tomato);
}
.card-year {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.card-tagline {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
}
.card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.tool-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  padding: 3px 7px;
  border: 1px solid var(--tomato);
  border-radius: 5px;
  color: var(--tomato);
  background: var(--bg);
  white-space: nowrap;
}

/* ============== detail overlay ============== */
.detail {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  animation: fade-up 380ms var(--ease);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-nav {
  position: sticky;
  top: 0;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  border-bottom: 1px solid var(--line-soft);
}
.detail-back {
  background: none;
  border: 0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 180ms ease;
}
.detail-back:hover { background: var(--bg-sunken); }
.detail-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.detail-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px var(--gutter) 120px;
}
.detail-head {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  margin-bottom: 48px;
  align-items: end;
}
.detail-head h1 {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.detail-head .tagline {
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
  max-width: 40ch;
}
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  font-size: 14px;
  border-top: 1px solid var(--ink);
  padding-top: 18px;
}
.detail-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 2px;
  white-space: nowrap;
}
.detail-meta dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}
.detail-meta .tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-hero {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 56px;
  background: var(--bg-sunken);
}
.detail-hero image-slot {
  width: 100%;
  height: 100%;
  display: block;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -28px 0 48px;
}
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--font-en);
  font-size: 13px;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}
.project-links a:hover {
  color: var(--tomato);
  border-color: var(--tomato);
  transform: translateY(-2px);
}

.detail-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.detail-section .label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 4px;
}
.detail-section p {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}
.detail-section.ai-block .label { color: var(--tomato); }
.detail-section.ai-block p {
  border-left: 2px solid var(--tomato);
  padding-left: 18px;
}

.detail-feature-video {
  width: 100%;
  margin-top: 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  line-height: 0;
}
.detail-feature-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.detail-gallery {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.detail-gallery .slot {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}
.detail-gallery .slot image-slot {
  width: 100%;
  height: 100%;
  display: block;
}
.video-slot {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: zoom-in;
}
.video-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-play-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  opacity: 0;
  background: rgba(0,0,0,0.25);
  transition: opacity 160ms ease;
}
.video-slot:hover .video-play-hint { opacity: 1; }
.detail-gallery .slot.tall {
  grid-row: span 2;
  aspect-ratio: 4/5;
}

.detail-next {
  margin-top: 96px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  width: 100%;
  background: transparent;
  color: inherit;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  text-align: left;
}
.detail-next .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.detail-next .next-title {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  transition: color 180ms ease;
}
.detail-next:hover .next-title { color: var(--tomato); }
.detail-next .arrow {
  font-family: var(--font-mono);
  display: inline-block;
  transition: transform 220ms var(--ease);
}
.detail-next:hover .arrow { transform: translateX(6px); }

/* ============== footer ============== */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
}

/* ============== responsive ============== */
@media (max-width: 980px) {
  :root { --gutter: 24px; --sidebar-w: 100%; }
  .shell {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .avatar { width: 140px; height: 140px; aspect-ratio: 1 / 1; }
  .topnav-right { gap: 16px; }
  .nav-link { display: none; }
  .skills-tools { grid-template-columns: 1fr; gap: 18px; }
  .tool-group { grid-template-columns: 1fr; gap: 8px; }
  .skills-list li { grid-template-columns: 40px 1fr; gap: 14px; }
  .work-grid { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 1fr; gap: 24px; }
  .detail-section { grid-template-columns: 1fr; gap: 10px; }
  .detail-gallery { grid-template-columns: 1fr; }
  .detail-gallery .slot.tall { grid-row: span 1; aspect-ratio: 4/3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* image-slot integration */
image-slot {
  --is-bg: transparent;
  --is-fg: var(--ink-mute);
  --is-border: transparent;
}

/* ============== zoomable slot + lightbox ============== */
.zoom-wrap {
  width: 100%;
  height: 100%;
  display: block;
  cursor: zoom-in;
  position: relative;
}
.zoom-wrap image-slot {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}
.zoom-wrap[data-empty="true"] { cursor: default; }

.lightbox {
  position: fixed;
  inset: 0;
  background: color-mix(in oklch, #000 88%, transparent);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 40px;
  cursor: zoom-out;
  animation: lb-in 200ms var(--ease);
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox img,
.lightbox video {
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  cursor: default;
  user-select: none;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 180ms ease, transform 200ms var(--ease);
}
.lightbox-close:hover {
  background: var(--tomato);
  transform: scale(1.05);
}
