/* Portfolio index: a compact, single-line file-tab navigation. */
.mobile-category-label{display:none}
.project-archive{padding-top:0;overflow:visible}
.category-index{position:static;inset:auto;width:auto;z-index:auto;animation:none;display:flex;align-items:flex-end;gap:4px;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;padding:9px 14px 0;border-bottom:1px solid var(--line);scrollbar-color:var(--accent) transparent}
.category-index-item{position:relative;isolation:isolate;box-sizing:border-box;flex:1 0 0;min-width:0;height:88px;display:flex;flex-direction:column;justify-content:space-between;gap:7px;padding:18px 16px 18px;border:1px solid var(--line);border-bottom:0;border-radius:0 18px 0 0;background:#210e0d;color:#bfb3b1;font:inherit;text-align:left;cursor:pointer;transition:color .22s,background-color .22s,border-color .22s}
.category-index-item::before{content:'';position:absolute;z-index:-1;top:-12px;left:-1px;width:68px;height:13px;border:1px solid var(--line);border-bottom:0;border-radius:14px 14px 0 0;background:inherit;transition:border-color .22s,background-color .22s}
.category-number{display:block;height:39px;font-size:26px;line-height:1;font-weight:600;letter-spacing:-.06em;transition:font-size .22s,color .22s}
.category-name{font-size:13px;line-height:1.1;font-weight:700;letter-spacing:-.03em;white-space:nowrap}
.category-index-item:hover{color:var(--accent);border-color:rgba(255,110,97,.6)}
.category-index-item:hover::before{border-color:rgba(255,110,97,.6)}
.category-index-item[aria-pressed="true"],.category-index-item[aria-pressed="true"]:hover{z-index:1;background:var(--accent);border-color:var(--accent);color:#170909}
.category-index-item[aria-pressed="true"]::before{background:var(--accent);border-color:var(--accent)}
.category-index-item[aria-pressed="true"] .category-number{font-size:39px}
.category-index-item:focus-visible,.work-project:focus-visible{outline:2px solid var(--accent);outline-offset:5px}
.category-gallery{margin-top:52px}
.active-category{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.work-category-label{font-size:14px;color:#aaa;margin:0 0 30px}
.work-projects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:40px 24px;align-items:start}
.work-project{border:0;background:none;color:#fff;font:inherit;padding:0;cursor:pointer;text-align:left;min-width:0}
.work-project-cover{aspect-ratio:4/3;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;background:#210e0d;overflow:hidden}
.work-project-cover img{width:100%;height:100%;object-fit:contain;display:block}
.work-project-cover span{font-size:10px;letter-spacing:.08em;color:#aaa;text-align:center;line-height:2;white-space:pre-line}
.work-project:hover .work-project-cover{border-color:var(--accent)}
.work-project-title{display:block;font-size:14px;margin-top:15px}.work-project-year{display:block;font-size:11px;color:#aaa;margin-top:6px}
.work-empty{grid-column:1 / -1;padding:48px 0;color:#bfb3b1;font-size:14px}
.detail-placeholder{min-height:240px;display:grid;place-items:center;border:1px solid var(--line);color:#aaa;font-size:12px;letter-spacing:.1em;text-align:center}
.project-viewer [hidden]{display:none}.project-viewer:has(.detail-placeholder:not([hidden])){grid-template-columns:1fr}
@media(max-width:1200px){.category-index-item{flex:0 0 142px}.work-projects{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.category-index{gap:3px;padding-inline:10px}.category-index-item{flex:0 0 124px;height:78px;border-radius:0 14px 0 0;padding:15px 13px 15px}.category-index-item::before{left:-1px;width:54px;height:10px;top:-9px;border-radius:11px 11px 0 0}.category-number{height:34px;font-size:23px}.category-index-item[aria-pressed="true"] .category-number{font-size:34px}.category-name{font-size:12px}.category-gallery{margin-top:36px}.work-projects{grid-template-columns:1fr;gap:32px}}
@media(prefers-reduced-motion:reduce){.category-index-item,.category-index-item::before,.category-number{transition:none}}

/* Single-piece folder shape; full-size typography in fixed text rows. */
.page-work .category-index{gap:2px;padding:6px 0 0;border-bottom:1px solid var(--line);align-items:stretch}
.page-work .category-index-item{
  flex:1 0 0;min-width:0;height:154px;
  display:grid;grid-template-rows:60px 44px;gap:8px;
  justify-content:initial;align-content:start;
  padding:18px 24px 24px;border:0;border-radius:0;background:transparent;text-align:center;
}
.page-work .category-index-item::before{
  content:'';position:absolute;inset:0;z-index:-1;width:auto;height:auto;
  /* Match the immediate stacking-order change on selection. */
  border:0;border-radius:0;background:#422623;transition:none;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M0 130C10 130 13 122 16 108L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L184 108C187 122 190 130 200 130V154H0Z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M0 130C10 130 13 122 16 108L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L184 108C187 122 190 130 200 130V154H0Z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.page-work .category-number{height:60px;display:flex;align-items:center;justify-content:center;font-size:38px;line-height:1;transform:none}
.page-work .category-name{display:flex;align-items:center;justify-content:center;height:44px;white-space:normal;overflow-wrap:normal;font-size:18px;line-height:22px}
.page-work .category-index-item[aria-pressed="true"],
.page-work .category-index-item[aria-pressed="true"]:hover{background:transparent}
.page-work .category-index-item[aria-pressed="true"]::before{background:var(--accent)}
.page-work .category-index-item[aria-pressed="true"] .category-number{font-size:60px}
@media(max-width:1400px){.page-work .category-index-item{flex:0 0 190px}}
@media(max-width:760px){.page-work .category-index-item{flex:0 0 190px}}

/* Overlapping file tabs: the selected tab shares the foreground sheet's colour. */
.page-work .category-index-scroll{overflow-x:auto;scrollbar-color:var(--accent) transparent;padding:6px 0}
.page-work .category-index{
  position:relative;isolation:isolate;min-width:1174px;
  --file-edge:calc((100% + 156px) / 140);
  overflow:visible;gap:0;padding:0;border:0;
}
.page-work .category-index::after{
  /* The SVG shoulder ends at y=130 of 154: the bar begins at that same point. */
  content:'';position:absolute;inset:auto var(--file-edge) 0;height:calc(100% * 24 / 154);
  background:var(--accent);z-index:10;pointer-events:none;
}
.page-work .category-index-item{
  flex:1 0 0;min-width:0;height:142px;padding:10px 28px 26px;
  grid-template-rows:60px 44px;gap:2px;
  z-index:1;
}
.page-work .category-index-item + .category-index-item{margin-left:-26px}
.page-work .category-index-item:first-child::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M10 154V130L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L184 108C187 122 190 130 200 130V154Z'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M10 154V130L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L184 108C187 122 190 130 200 130V154Z'/%3E%3C/svg%3E");
}
.page-work .category-index-item:last-child::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M0 130C10 130 13 122 16 108L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L190 130V154H0Z'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 154' preserveAspectRatio='none'%3E%3Cpath d='M0 130C10 130 13 122 16 108L29 20C31 7 39 0 51 0H149C161 0 169 7 171 20L190 130V154H0Z'/%3E%3C/svg%3E");
}
.page-work .category-index-item:nth-child(2){z-index:2}
.page-work .category-index-item:nth-child(3){z-index:3}
.page-work .category-index-item:nth-child(4){z-index:4}
.page-work .category-index-item:nth-child(5){z-index:5}
.page-work .category-index-item:nth-child(6){z-index:6}
.page-work .category-index-item:nth-child(7){z-index:7}
.page-work .category-index-item[aria-pressed="true"]{
  z-index:11;display:grid;grid-template-rows:60px 44px;
  align-items:center;justify-content:initial;align-content:start;gap:2px;
  padding:10px 28px 26px;
}
.page-work .category-index-item[aria-pressed="true"] .category-number{
  flex:0 0 auto;height:60px;
}
.page-work .category-index-item[aria-pressed="true"] .category-name{
  height:44px;min-height:0;width:100%;
}
.page-work .category-index-item[aria-pressed="false"]{
  grid-template-rows:38px 44px;gap:4px;padding:22px 28px 34px;
}
.page-work .category-index-item[aria-pressed="false"] .category-number{height:38px}
.page-work .category-index-item:first-child[aria-pressed="true"] .category-number,
.page-work .category-index-item:first-child[aria-pressed="true"] .category-name{transform:translateX(-6px)}
.page-work .category-index-item:focus-visible{outline:none}
.page-work .category-index-item:focus-visible .category-name{
  text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;
}

/* Phones use a clear folder list instead of a horizontally scrolled tab strip. */
@media(max-width:760px){
  .page-work .category-index-scroll{overflow:visible;padding:0}
  .page-work .category-index{
    min-width:0;display:flex;flex-direction:column;gap:8px;padding:0;
  }
  .page-work .category-index::after{display:none}
  .page-work .category-index-item,
  .page-work .category-index-item[aria-pressed="true"],
  .page-work .category-index-item[aria-pressed="false"]{
    flex:0 0 76px;width:100%;height:76px;margin:0!important;
    display:grid;grid-template-columns:54px minmax(0,1fr);grid-template-rows:1fr;
    align-items:center;align-content:center;gap:12px;padding:0 26px 5px;
  }
  .page-work .category-index-item .category-number,
  .page-work .category-index-item[aria-pressed="true"] .category-number,
  .page-work .category-index-item[aria-pressed="false"] .category-number{
    width:auto;height:auto;justify-content:flex-start;font-size:27px;
  }
  .page-work .category-index-item[aria-pressed="true"] .category-number{font-size:38px}
  .page-work .category-index-item .category-name,
  .page-work .category-index-item[aria-pressed="true"] .category-name{
    width:auto;height:auto;justify-content:flex-start;text-align:left;font-size:15px;line-height:1.15;
  }
  .page-work .category-index-item:first-child[aria-pressed="true"] .category-number,
  .page-work .category-index-item:first-child[aria-pressed="true"] .category-name{transform:none}
  .page-work .category-gallery{margin-top:34px}
}

/* Two-column mobile index uses the existing category buttons and interactions. */
@media(max-width:900px){
  .page-work .mobile-category-label{display:none}
  .page-work .category-index-scroll{display:block;overflow:visible;padding:0}
  .page-work .category-index{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    min-width:0;width:100%;gap:8px;padding:0;border:0;
  }
  .page-work .category-index::after,.page-work .category-index-item::before{display:none}
  .page-work .category-index-item,
  .page-work .category-index-item[aria-pressed="false"],
  .page-work .category-index-item[aria-pressed="true"]{
    width:100%;min-width:0;height:78px;margin:0!important;padding:19px 10px 10px;
    display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:1fr;
    align-content:stretch;align-items:center;gap:7px;
    border:0;border-radius:0;background:transparent;
    color:#e6dbd8;text-align:left;z-index:auto;
    transition:background-color .16s,color .16s,border-color .16s;
  }
  .page-work .category-index-item[aria-pressed="true"],
  .page-work .category-index-item[aria-pressed="true"]:hover{
    background:transparent;border-color:var(--accent);color:#170909;
  }
  .page-work .category-index-item::before,
  .page-work .category-index-item:first-child::before,
  .page-work .category-index-item:last-child::before{
    display:block;inset:0;border:0;border-radius:0;background:#422623;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 78' preserveAspectRatio='none'%3E%3Cpath d='M0 12Q0 2 10 2H70Q77 2 81 9L85 15Q88 20 95 20H190Q200 20 200 30V68Q200 78 190 78H10Q0 78 0 68Z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 78' preserveAspectRatio='none'%3E%3Cpath d='M0 12Q0 2 10 2H70Q77 2 81 9L85 15Q88 20 95 20H190Q200 20 200 30V68Q200 78 190 78H10Q0 78 0 68Z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  }
  .page-work .category-index-item[aria-pressed="true"]::before{background:var(--accent)}
  .page-work .category-index-item .category-number,
  .page-work .category-index-item[aria-pressed] .category-number{
    width:auto;height:auto;font-size:16px;line-height:18px;justify-content:flex-start;
    color:inherit;transform:none;transition:none;
  }
  .page-work .category-index-item .category-name,
  .page-work .category-index-item[aria-pressed] .category-name{
    width:100%;height:auto;min-height:0;font-size:12px;line-height:1.25;
    justify-content:flex-start;text-align:left;white-space:normal;transform:none;
  }
  .page-work .category-index-item:first-child[aria-pressed="true"] .category-number,
  .page-work .category-index-item:first-child[aria-pressed="true"] .category-name{transform:none}
  .page-work .category-index-item:focus-visible{
    outline:2px solid var(--accent);outline-offset:3px;
  }
  .page-work .category-gallery{margin-top:28px}
}
