@import url('/portfolio/portfolio.css');

:root {
  --ink: #292724;
  --muted: #716b64;
  --line: #cfc5b8;
  --paper: #f2eadf;
  --accent: #963c2e;
  --soft-paper: #f9f4eb;
  color: var(--ink);
  background: var(--paper);
}

html { scrollbar-gutter: auto; }
body.portfolio-index {
  min-width: 0; overflow-x: clip;
  background: linear-gradient(#f5eee4dc, #f5eee4dc), url('/assets/textures/paper-continuous.webp') center top / 900px auto repeat;
}
.portfolio-index .shell { max-width: 1280px; padding: 0 clamp(20px, 3vw, 42px); }
.portfolio-index .masthead {
  display: flex; align-items: center; gap: 24px; min-height: 94px;
  border-bottom: 1px solid var(--line);
}
.portfolio-index .brand { display: block; width: 112px; margin: 0; line-height: 0; }
.portfolio-index .brand img { display: block; width: 100%; height: auto; }
.portfolio-index .masthead-note,
.portfolio-index .home-link,
.portfolio-index .eyebrow,
.portfolio-index .section-index,
.portfolio-index .section-count,
.portfolio-index .work-action,
.portfolio-index .work-detail-heading > span {
  font-family: Arial, 'Malgun Gothic', sans-serif;
  letter-spacing: .12em;
}
.portfolio-index .masthead-note { color: var(--muted); font-size: 11px; margin-right: auto; }
.portfolio-index .home-link { font-size: 12px; text-decoration: none; }
.portfolio-index .page-header {
  position: relative; padding: 42px 0 22px; border: 0;
}
.portfolio-index .eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; margin: 0 0 12px; }
.portfolio-index .title-mask { overflow: hidden; padding-bottom: 5px; }
.portfolio-index h1 {
  font-family: 'Noto Serif KR', 'Batang', serif;
  font-size: clamp(35px, 5.1vw, 66px); font-weight: 500;
  line-height: 1.2; letter-spacing: -.075em; margin: 0;
  word-break: keep-all;
}
.portfolio-index .intro {
  font-size: clamp(13px, 1.45vw, 16px); line-height: 1.75;
  color: var(--muted); margin: 16px 0 0; word-break: keep-all;
}
.portfolio-index .intro-rule {
  width: 100%; height: 2px; margin-top: 28px;
  background: var(--ink); transform-origin: left center;
}
.portfolio-index .navigation {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch; min-height: 64px;
  isolation: isolate; background: transparent; backdrop-filter: none;
  border: 0;
}
.portfolio-index .navigation::before {
  content: ''; position: absolute; z-index: -1;
  top: 0; bottom: 0; left: 50%; width: 100vw;
  transform: translateX(-50%);
  background: #f5eee4f2; backdrop-filter: blur(16px);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  pointer-events: none;
}
.portfolio-index .navigation nav { display: flex; gap: 0; flex-wrap: nowrap; min-width: 0; }
.portfolio-index .navigation nav a {
  display: flex; align-items: center; gap: 8px; position: relative;
  padding: 0 18px; color: var(--muted); font-size: 13px;
  text-decoration: none; white-space: nowrap;
}
.portfolio-index .navigation nav a:first-child { padding-left: 0; }
.portfolio-index .navigation nav a span { font-size: 10px; color: var(--accent); }
.portfolio-index .navigation nav a[aria-current='location'] { color: var(--ink); font-weight: 700; }
.portfolio-index .navigation nav a[aria-current='location']::after {
  content: ''; position: absolute; left: 18px; right: 18px; bottom: -1px;
  height: 3px; background: var(--accent);
}
.portfolio-index .navigation nav a:first-child[aria-current='location']::after { left: 0; }
.portfolio-index #content { padding-top: 40px; }
.portfolio-section { scroll-margin-top: 80px; margin: 0; }
.portfolio-section + .portfolio-section { margin-top: 42px; }
.section-heading {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px; align-items: center; padding: 24px 0 26px;
}
.section-heading::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  top: 0; bottom: 0; left: 50%; width: 100vw;
  transform: translateX(-50%);
  background: linear-gradient(100deg, #e5d5c5b8, #f0e5d8ab 52%, #e4d2bfb8);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  box-shadow: 0 12px 22px #4e39210a;
}
.section-heading-main, .section-count { position: relative; z-index: 1; }
.section-index { display: block; color: var(--accent); font-size: 13px; }
.index-rule { display: block; width: 35px; height: 1px; margin: 9px 0 12px; background: var(--accent); }
.section-heading h2 {
  font-family: 'Noto Serif KR', 'Batang', serif;
  font-size: clamp(25px, 2.5vw, 34px); font-weight: 500;
  letter-spacing: -.055em; line-height: 1.3; margin: 0; word-break: keep-all;
}
.section-heading h2 .section-name { white-space: nowrap; }
.section-heading p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; word-break: keep-all; }
.section-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.work-list { --work-indent: 70px; margin-left: calc(var(--work-indent) * .5); }
.anchor-alias { display: block; height: 0; scroll-margin-top: 84px; }
.work-item { border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.work-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 272px) 52px;
  gap: 14px; align-items: center; min-height: 154px;
  cursor: pointer; list-style: none; padding: 16px 0 16px calc(var(--work-indent) * .5);
  position: relative;
}
.work-summary::-webkit-details-marker { display: none; }
.work-summary::marker { content: ''; }
.work-summary::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 0;
  background: #963c2e0d; pointer-events: none; transition: width .45s ease;
}
.work-summary:hover::before, .work-item[open] .work-summary::before { width: 100%; }
.work-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; z-index: 1; }
.work-project {
  color: var(--accent); font: 700 10px/1.35 Arial, 'Malgun Gothic', sans-serif;
  letter-spacing: .12em; word-break: keep-all;
}
.work-copy strong {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: clamp(16px, 1.7vw, 22px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.45; word-break: keep-all;
}
.work-deck { color: var(--muted); font-size: 13px; line-height: 1.55; word-break: keep-all; }
.work-preview {
  display: grid; place-items: center; min-width: 0; height: 120px;
  overflow: hidden; background: #e4d9c9a6; border: 1px solid #cdbfaf;
  z-index: 1; transition: border-color .25s ease;
}
.work-summary:hover .work-preview, .work-item[open] .work-preview { border-color: var(--accent); }
.work-preview-image { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; }
.work-preview-image img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.work-preview-type {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 100%; height: 100%; padding: 12px;
  background: linear-gradient(130deg, #eee5d8, #f8f1e6);
}
.work-preview-type span { color: var(--accent); font: 700 10px Arial, sans-serif; letter-spacing: .13em; }
.work-preview-type strong {
  align-self: flex-end; max-width: 100%; color: #655b50;
  font: 500 16px 'Noto Serif KR', 'Batang', serif;
  letter-spacing: -.05em; text-align: right; word-break: keep-all;
}
.work-action { display: flex; align-items: center; justify-content: flex-end; color: var(--ink); z-index: 1; }
.work-action-icon {
  display: grid; place-items: center; width: 35px; height: 35px;
  border: 1px solid var(--ink); border-radius: 50%;
  transition: background .3s, border-color .3s, transform .3s;
}
.work-action-icon img { display: block; width: 20px; height: 20px; transition: filter .3s; }
.work-summary:hover .work-action-icon, .work-summary:focus-visible .work-action-icon, .work-item[open] .work-action-icon { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.work-summary:hover .work-action-icon img, .work-summary:focus-visible .work-action-icon img, .work-item[open] .work-action-icon img { filter: brightness(0) invert(1); }
.work-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.work-detail { overflow: hidden; }
.work-detail-inner {
  padding: 26px 0 42px calc(var(--work-indent) * .5); border-top: 1px solid var(--accent);
  display: grid; grid-template-columns: minmax(210px, .34fr) minmax(0, .66fr);
  gap: clamp(25px, 4vw, 64px);
}
.work-detail-heading { min-width: 0; }
.work-detail-heading > span { color: var(--accent); font-size: 10px; font-weight: 700; }
.work-detail-heading p { color: var(--ink); font-size: 15px; line-height: 1.9; word-break: keep-all; overflow-wrap: anywhere; margin: 18px 0 0; }
.work-detail .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; min-width: 0; max-width: none; }
.work-detail .gallery.single { grid-template-columns: minmax(0, 1fr); }
.work-detail .gallery.clan-crop .thumbnail { aspect-ratio: 1200 / 875; }
.work-detail .gallery.club-rental-crop > figure:nth-child(-n+2) .thumbnail { aspect-ratio: 1200 / 590; }
.work-detail .gallery.club-rental-crop > figure:nth-child(n+3) .thumbnail { aspect-ratio: 1200 / 530; }
.work-detail .gallery.clan-crop .thumbnail img,
.work-detail .gallery.club-rental-crop .thumbnail img { height: 100%; object-fit: cover; object-position: center top; }
.work-detail .gallery.nanami-gallery > figure:first-child { grid-column: 1 / -1; width: min(100%, 58%); justify-self: center; }
.work-detail .gallery.nanami-gallery > figure:last-child { grid-column: 1 / -1; width: min(100%, 58%); justify-self: center; }
.work-detail .gallery.storyboard-gallery > figure { grid-column: 1 / -1; justify-self: center; }
.work-detail .gallery.storyboard-gallery > figure:first-child { width: min(100%, 72%); }
.work-detail .gallery.storyboard-gallery > figure:last-child { width: 100%; }
.work-detail .gallery.character-gallery > figure:first-child { grid-column: 1 / -1; width: min(100%, 58%); justify-self: center; }
.work-detail .gallery.character-gallery > figure:nth-last-child(2):nth-child(even) { grid-column: 1 / -1; width: min(100%, 58%); justify-self: center; }
.work-detail .gallery.character-gallery > .character-skill-link { grid-column: 1 / -1; width: 100%; }
.work-detail .gallery.riichi-gallery > figure:nth-child(3) { width: min(100%, 85%); justify-self: center; }
.work-detail .gallery.riichi-gallery > figure:last-child { width: min(100%, 72%); justify-self: center; align-self: center; }
.character-skill-link .file-link { align-items: center; padding: 20px 22px; border: 1px solid var(--accent); background: #963c2e0d; color: var(--accent); font-weight: 700; }
.character-skill-link .file-link:hover { background: #963c2e1a; }
.character-skill-link small { color: var(--accent); }
.work-detail .thumbnail { background: #e5dacb; border-color: var(--line); }
.work-detail .thumbnail:has(img.portrait) { width: 100%; }
.work-detail .thumbnail img { display: block; width: 100%; height: auto; object-fit: contain; }
.work-detail .video-poster { background: #27221e; aspect-ratio: 16 / 9; }
.work-detail .video-poster img { height: 100%; }
.work-detail .file-link { gap: 12px; }
.work-detail figcaption { align-items: flex-start; flex-wrap: wrap; }
.portfolio-index footer { margin-top: 72px; }
.portfolio-index dialog { border: 1px solid #796b5e; }
.portfolio-index .viewer-navigation { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 0 20px 20px; }
.portfolio-index .viewer-navigation button { background: transparent; color: white; border: 1px solid #ffffff65; padding: 9px 13px; min-height: 42px; }
.portfolio-index .viewer-navigation button:disabled { opacity: .35; }
.portfolio-index .viewer-navigation span { color: #ddd; font: 13px Georgia, serif; letter-spacing: .12em; }
.portfolio-index .viewer-stage.is-zoomed { overflow: auto; max-height: 75dvh; }
.portfolio-index .viewer-stage.is-zoomed img { max-width: none; cursor: zoom-out; }
.portfolio-index #viewer-image { cursor: zoom-in; }
.portfolio-index #viewer-close, .portfolio-index #viewer-zoom { cursor: pointer; }

.motion-ready:not(.reduce-motion) .title-mask h1 { animation: title-enter .85s cubic-bezier(.2,.7,.2,1) both; }
.motion-ready:not(.reduce-motion) .intro-rule { animation: ink-draw 1.1s .25s cubic-bezier(.2,.7,.2,1) both; }
.motion-ready:not(.reduce-motion) .motion-reveal { opacity: 0; }
.motion-ready:not(.reduce-motion) .motion-reveal.is-visible { animation: row-rise .75s cubic-bezier(.18,.75,.2,1) both; }
.motion-ready:not(.reduce-motion) .section-heading.motion-reveal.is-visible { animation-duration: .9s; }
.motion-ready:not(.reduce-motion) .work-item.motion-reveal.is-visible { animation-delay: .07s; }
.motion-ready:not(.reduce-motion) .work-item.motion-reveal.is-visible .work-copy { animation: copy-enter .8s .1s cubic-bezier(.18,.75,.2,1) both; }
.motion-ready:not(.reduce-motion) .work-item.motion-reveal.is-visible .work-preview { animation: preview-enter .9s .13s cubic-bezier(.18,.75,.2,1) both; }
@keyframes title-enter { from { opacity: .25; transform: translateY(105%); } to { opacity: 1; transform: translateY(0); } }
@keyframes ink-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes row-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes copy-enter { from { opacity: .3; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes preview-enter { from { opacity: .3; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes preview-enter-mobile { from { opacity: .3; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes section-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes preview-depth { from { transform: translateY(13px) scale(.98); } to { transform: translateY(-8px) scale(1); } }
@supports (animation-timeline: view()) {
  .motion-ready:not(.reduce-motion) .index-rule {
    transform-origin: left center;
    animation: section-draw linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
  .motion-ready:not(.reduce-motion) .work-preview-image img {
    animation: preview-depth linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
}
@media (max-width: 1050px) {
  .work-list { --work-indent: 58px; }
  .work-summary { grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) 44px; }
}
@media (max-width: 900px) {
  .portfolio-index .navigation { display: block; min-height: 0; }
  .portfolio-index .navigation nav { height: 56px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .portfolio-index .navigation nav a { flex: 0 0 auto; min-height: 56px; padding: 0 14px; }
  .section-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .work-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0; gap: 12px; padding: 20px 0 20px calc(var(--work-indent) * .5);
  }
  .work-copy { grid-column: 1; grid-row: 1; }
  .work-action { grid-column: 2; grid-row: 1; align-self: start; }
  .work-preview { grid-column: 1 / 3; grid-row: 2; width: min(100%, 420px); height: auto; min-height: 150px; max-height: 245px; justify-self: start; }
  .work-preview-image { min-height: 150px; }
  .work-preview-image img { max-height: 245px; }
  .work-preview-type { min-height: 150px; }
  .work-detail-inner { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 0 35px calc(var(--work-indent) * .5); }
}
@media (max-width: 560px) {
  .portfolio-index .shell { padding: 0 18px; }
  .portfolio-index .masthead { min-height: 76px; gap: 12px; }
  .portfolio-index .brand { width: 86px; }
  .portfolio-index .masthead-note { font-size: 9px; letter-spacing: .08em; }
  .portfolio-index .home-link { display: none; }
  .portfolio-index .page-header { padding-top: 30px; }
  .portfolio-index h1 { font-size: clamp(30px, 8.6vw, 44px); }
  .portfolio-index .intro br { display: none; }
  .portfolio-index .navigation nav a { font-size: 11px; padding: 0 12px; }
  .portfolio-index .navigation nav a span { font-size: 9px; }
  .section-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 20px 0 22px; }
  .section-index { font-size: 11px; }
  .index-rule { width: 24px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading p { font-size: 12px; }
  .section-count { align-self: start; padding-top: 4px; }
  .work-list { --work-indent: 45px; }
  .work-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 18px 0 18px calc(var(--work-indent) * .5); }
  .work-copy strong { font-size: 17px; }
  .work-project { font-size: 9px; }
  .work-deck { font-size: 12px; }
  .work-preview { grid-column: 1 / 3; width: 100%; max-height: 235px; justify-self: stretch; }
  .motion-ready:not(.reduce-motion) .work-item.motion-reveal.is-visible .work-preview { animation-name: preview-enter-mobile; }
  .work-preview-image img { max-height: 235px; }
  .work-detail-heading p { font-size: 13px; }
  .work-detail .gallery { grid-template-columns: minmax(0, 1fr); }
  .work-detail .gallery.clan-crop .thumbnail,
  .work-detail .gallery.club-rental-crop > figure:nth-child(-n+2) .thumbnail,
  .work-detail .gallery.club-rental-crop > figure:nth-child(n+3) .thumbnail { aspect-ratio: auto; }
  .work-detail .gallery.clan-crop .thumbnail img,
  .work-detail .gallery.club-rental-crop .thumbnail img { height: auto; object-fit: contain; }
  .work-detail .gallery.nanami-gallery > figure:first-child,
  .work-detail .gallery.nanami-gallery > figure:last-child { width: 100%; }
  .work-detail .gallery.storyboard-gallery > figure:first-child { width: 100%; }
  .work-detail .gallery.character-gallery > figure:first-child,
  .work-detail .gallery.character-gallery > figure:nth-last-child(2):nth-child(even) { width: 100%; }
  .work-detail .gallery.riichi-gallery > figure:nth-child(3) { width: min(100%, 78%); }
  .work-detail .gallery.riichi-gallery > figure:last-child { width: min(100%, 76%); }
  .character-skill-link .file-link { align-items: flex-start; flex-direction: column; gap: 5px; padding: 16px; }
  .portfolio-index footer { margin-top: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portfolio-index *, .portfolio-index *::before, .portfolio-index *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
  .motion-ready .motion-reveal { opacity: 1 !important; transform: none !important; }
}
