/* Folder labels select cards; project links navigate to their cases. */
.notebook-home .portfolio-stack {
  display:block;
  position:relative;
  isolation:isolate;
  padding:0;
  margin:0;
}
.portfolio-stack .stack-item { --stack-index:0; position:relative; z-index:1; scroll-margin-top:32px; pointer-events:none; }
.portfolio-stack .stack-item-2 { --stack-index:1; z-index:2; }
.portfolio-stack .stack-item-3 { --stack-index:2; z-index:3; }
.portfolio-stack .stack-item-4 { --stack-index:3; z-index:4; }
.portfolio-stack .stack-item-5 { --stack-index:4; z-index:5; }
.portfolio-stack .stack-item+.stack-item { margin-top:-44px; }
.notebook-home .portfolio-stack .portfolio-project {
  --folder-color:var(--ink);
  --folder-ink:var(--surface);
  display:block;
  height:auto;
  padding-top:44px;
  position:relative;
  color:var(--folder-ink);
  /* Exposed tabs on earlier folders remain clickable through the empty tab row. */
  pointer-events:none;
}
.notebook-home .portfolio-stack .project-resume { --folder-color:var(--note-yellow); --folder-ink:var(--ink); }
.notebook-home .portfolio-stack .project-mofang { --folder-color:var(--blue); --folder-ink:var(--surface); }
.notebook-home .portfolio-stack .project-petloo { --folder-color:var(--note-mint); --folder-ink:var(--ink); }
.notebook-home .portfolio-stack .project-visual { --folder-color:var(--note-lilac); --folder-ink:var(--ink); }
.notebook-home .portfolio-stack .project-tab {
  position:absolute;
  top:0;
  left:calc(var(--stack-index)*20%);
  width:20%;
  min-width:0;
  height:45px;
  padding:0 18px;
  display:flex;
  justify-content:center;
  align-items:center;
  background:var(--folder-color);
  color:var(--folder-ink);
  clip-path:polygon(0 100%,22px 0,calc(100% - 22px) 0,100% 100%);
  font:11px/1.4 "SFMono-Regular",Consolas,monospace;
  letter-spacing:.08em;
  pointer-events:auto;
  appearance:none;
  border:0;
  margin:0;
  cursor:pointer;
}
.notebook-home .portfolio-stack .project-tab:hover,
.notebook-home .portfolio-stack .project-tab[aria-pressed="true"] { text-decoration:underline; text-underline-offset:4px; }
.notebook-home .portfolio-stack .project-tab:focus-visible { outline:2px solid currentColor; outline-offset:-7px; }
.notebook-home .portfolio-stack .stack-item:first-child .project-tab { clip-path:polygon(0 0,calc(100% - 22px) 0,100% 100%,0 100%); }
.portfolio-stack .project-panel {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr);
  align-items:center;
  gap:36px;
  min-height:430px;
  padding:36px 40px 52px;
  background:var(--folder-color);
  color:var(--folder-ink);
  box-shadow:0 -1px 0 #faf9f526;
  pointer-events:auto;
}
.portfolio-stack .project-copy { min-width:0; padding-block:8px; }
.portfolio-stack .project-index { font:10px/1.6 "SFMono-Regular",Consolas,monospace; letter-spacing:.06em; }
.notebook-home .portfolio-stack .project-heading { display:block; margin-top:18px; }
.notebook-home .portfolio-stack .project-heading h3 { color:var(--folder-ink); font-size:clamp(26px,2.7vw,38px); line-height:1.35; letter-spacing:-.045em; }
.notebook-home .portfolio-stack .project-summary { max-width:370px; margin-top:14px; color:var(--folder-ink); font-size:14px; line-height:1.9; }
.notebook-home .portfolio-stack .project-role { gap:6px; margin-top:20px; }
.portfolio-stack .role-tag { background:var(--note-cream); color:var(--ink); font-size:11px; padding:3px 8px; }
.portfolio-stack .role-tag:nth-of-type(2) { background:var(--note-cream); }
.portfolio-stack .role-tag:nth-of-type(3) { background:var(--note-lilac); }
.portfolio-stack .role-tag:nth-of-type(4) { background:var(--note-mint); }
.project-open { display:flex; justify-content:space-between; align-items:center; gap:32px; min-height:56px; width:min(100%,240px); padding:12px 14px; margin-top:24px; border-bottom:1px solid currentColor; font-size:13px; }
.project-open:hover,.project-open:focus-visible { background:color-mix(in srgb,currentColor 8%,transparent); }
.project-open>span { font:21px/1 var(--display); transition:transform 180ms var(--ease); }
.project-open:hover>span,.project-open:focus-visible>span { transform:translate(2px,-2px); }
.portfolio-stack a.project-panel:focus-visible { outline:3px solid currentColor; outline-offset:-6px; }
.portfolio-stack a.project-panel:hover .project-open,
.portfolio-stack a.project-panel:focus-visible .project-open { background:color-mix(in srgb,currentColor 8%,transparent); }
.portfolio-stack a.project-panel:hover .project-open>span,
.portfolio-stack a.project-panel:focus-visible .project-open>span { transform:translate(2px,-2px); }
/* Concept illustrations are covers; actual product UI remains in each case. */
.notebook-home .portfolio-stack .project-cover {
  display:block;
  position:relative;
  height:360px;
  width:100%;
  aspect-ratio:auto;
  overflow:hidden;
  background:var(--folder-color);
  border:0;
  border-radius:0;
  padding:0;
}
.notebook-home .portfolio-stack .cover-artwork>img {
  display:block;
  width:100%;
  height:100%;
  max-height:none;
  object-fit:contain;
  object-position:center;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  transform:none;
  transition:transform 240ms var(--ease);
}
.notebook-home .portfolio-stack .cover-artwork::before,
.notebook-home .portfolio-stack .cover-artwork::after { content:none; }
.notebook-home .portfolio-stack .portfolio-project:hover .cover-artwork>img { transform:scale(1.025); }
/* Generated stationery surrounds an unchanged product screenshot. */
.notebook-home .portfolio-stack .cover-resume-crafted>img { object-fit:cover; }
/* A typeset product fragment stays crisp instead of shrinking a whole screen. */
.notebook-home .portfolio-stack .cover-talent-interface { container-type:size; }
.talent-interface-art { position:absolute; inset:0; color:var(--ink); text-align:left; }
.talent-interface-composer {
  position:absolute;
  inset:7% 6% auto 3%;
  padding:clamp(18px,4cqw,22px);
  background:var(--canvas);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:7px 7px 0 var(--note-lilac);
  transform:rotate(-3deg);
}
.talent-interface-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:clamp(11px,3cqw,14px); font-weight:600; }
.talent-interface-agent { margin-left:6px; color:var(--secondary); font:9px/1.4 "SFMono-Regular",Consolas,monospace; letter-spacing:.1em; }
.talent-interface-spark { display:grid; place-items:center; width:28px; height:28px; background:var(--note-yellow); border-radius:50%; font-size:23px; line-height:1; }
.talent-interface-prompt { margin-top:clamp(14px,4cqw,18px); font-size:clamp(23px,7cqw,32px); line-height:1.3; letter-spacing:-.05em; }
.talent-interface-prompt strong { font-weight:650; }
.talent-interface-criteria { display:flex; align-items:center; gap:6px; margin-top:16px; font-size:clamp(9px,2.5cqw,11px); white-space:nowrap; }
.talent-interface-criteria>span { padding:4px 7px; background:var(--note-cream); }
.talent-interface-criteria>span:nth-child(2) { background:var(--note-lilac); }
.talent-interface-criteria>.talent-interface-send { display:grid; place-items:center; flex:0 0 32px; height:32px; margin-left:auto; padding:0; background:var(--ink); color:var(--canvas); font-size:23px; }
.talent-interface-match {
  position:absolute;
  right:2%;
  bottom:5%;
  width:86%;
  display:flex;
  align-items:center;
  gap:clamp(10px,3cqw,16px);
  padding:clamp(12px,3.5cqw,18px);
  background:var(--note-mint);
  border:1px solid var(--note-mint);
  border-radius:6px;
  box-shadow:0 8px 20px #0003;
  transform:rotate(2deg);
}
.talent-interface-avatar { display:grid; place-items:center; flex:0 0 clamp(32px,10cqw,48px); aspect-ratio:1; border-radius:50%; background:var(--canvas); font:clamp(14px,4cqw,19px)/1 "SFMono-Regular",Consolas,monospace; letter-spacing:-.06em; }
.talent-interface-match>div { min-width:0; }
.talent-interface-match-label { display:block; margin-bottom:5px; font-size:clamp(9px,2.5cqw,11px); line-height:1.3; }
.talent-interface-match strong { display:block; font-size:clamp(13px,3.6cqw,18px); line-height:1.35; font-weight:600; white-space:nowrap; }
.talent-interface-check { margin-left:auto; font-size:22px; }
@container (max-height:250px) {
  .talent-interface-composer { top:4%; padding:14px 16px; }
  .talent-interface-heading { font-size:10px; }
  .talent-interface-spark { width:20px; height:20px; font-size:18px; }
  .talent-interface-prompt { margin-top:10px; font-size:24px; }
  .talent-interface-criteria { display:none; }
  .talent-interface-match { bottom:3%; padding:12px; }
  .talent-interface-match-label { display:none; }
  .talent-interface-match strong { font-size:12px; }
}
@container (max-height:180px) {
  .talent-interface-heading { display:none; }
  .talent-interface-composer { top:5%; padding:12px 16px; }
  .talent-interface-prompt { margin-top:0; font-size:21px; }
  .talent-interface-match { padding:8px 10px; }
  .talent-interface-avatar { flex-basis:26px; font-size:12px; }
  .talent-interface-check { font-size:17px; }
}
.notebook-home .portfolio-stack .stack-item.is-selected { z-index:10; }
.notebook-home .portfolio-stack .stack-item:has(.project-open:focus-visible, a.project-panel:focus-visible) { z-index:11; }
/* The first sticky item carries the title so the whole stack shares its exit. */
@media screen and (min-width:761px) and (min-height:720px) and (prefers-reduced-motion:no-preference), screen and (max-width:760px) and (min-height:640px) and (prefers-reduced-motion:no-preference) {
  .notebook-home .portfolio-work {
    --work-sticky-top:48px;
    --work-heading-height:clamp(108px,10vw,132px);
    --work-heading-gap:18px;
    position:relative;
    isolation:isolate;
  }
  .notebook-home .work-heading {
    height:var(--work-heading-height);
    margin-bottom:var(--work-heading-gap);
    padding-bottom:18px;
    background-color:var(--canvas);
    background-image:repeating-linear-gradient(transparent 0 27px,var(--paper-rule) 27px 28px);
  }
  .portfolio-stack .stack-item {
    position:sticky;
    top:calc(var(--work-sticky-top) + var(--work-heading-height) + var(--work-heading-gap));
  }
  .portfolio-stack .stack-item-1 { top:var(--work-sticky-top); }
}
@media(max-width:1000px) {
  .portfolio-stack .project-panel { gap:24px; padding:30px 28px 48px; min-height:414px; }
  .notebook-home .portfolio-stack .project-cover { height:300px; }
  .notebook-home .portfolio-stack .project-heading h3 { font-size:28px; }
  .notebook-home .portfolio-stack .project-summary { font-size:13px; }
  .portfolio-stack .project-index { font-size:9px; }
  .notebook-home .portfolio-stack .project-tab { font-size:10px; padding-inline:12px; }
}
@media(max-width:760px) {
  .notebook-home .portfolio-stack { display:block; }
  .portfolio-stack .stack-item { position:relative; top:auto; scroll-margin-top:24px; }
  .portfolio-stack .stack-item+.stack-item { margin-top:20px; }
  .notebook-home .portfolio-stack .portfolio-project { padding-top:38px; }
  .notebook-home .portfolio-stack .project-tab { left:calc(var(--stack-index)*8%); width:60%; max-width:240px; height:39px; font-size:10px; }
  .portfolio-stack .project-panel { grid-template-columns:minmax(0,1fr); min-height:0; gap:24px; padding:26px 24px 30px; }
  .portfolio-stack .project-copy { padding:0; }
  .notebook-home .portfolio-stack .project-heading { margin-top:12px; }
  .notebook-home .portfolio-stack .project-heading h3 { font-size:28px; }
  .notebook-home .portfolio-stack .project-summary { max-width:none; font-size:14px; margin-top:12px; }
  .notebook-home .portfolio-stack .project-role { margin-top:16px; }
  .project-open { margin-top:14px; font-size:12px; gap:24px; }
  .notebook-home .portfolio-stack .project-cover { height:auto; min-height:0; aspect-ratio:1.2; padding:0; }
}
@media(max-width:380px) {
  .portfolio-stack .project-panel { padding:24px 18px 26px; }
  .notebook-home .portfolio-stack .project-heading h3 { font-size:25px; }
  .notebook-home .portfolio-stack .project-summary { font-size:13px; }
}
/* Phone folders fit below the shared heading, with five separate touch tabs. */
@media screen and (max-width:760px) and (min-height:640px) and (prefers-reduced-motion:no-preference) {
  .notebook-home .portfolio-work {
    --work-sticky-top:16px;
    --work-heading-height:96px;
    --work-heading-gap:12px;
  }
  .portfolio-stack .stack-item {
    position:sticky;
    top:calc(var(--work-sticky-top) + var(--work-heading-height) + var(--work-heading-gap));
  }
  .portfolio-stack .stack-item-1 { top:var(--work-sticky-top); }
  .portfolio-stack .stack-item+.stack-item { margin-top:-44px; }
  .notebook-home .portfolio-stack .portfolio-project { padding-top:44px; }
  .notebook-home .portfolio-stack .project-tab {
    left:calc(var(--stack-index)*20%);
    width:20%;
    height:45px;
    padding:0 6px;
    font-size:12px;
    clip-path:polygon(0 100%,10px 0,calc(100% - 10px) 0,100% 100%);
  }
  .notebook-home .portfolio-stack .stack-item:first-child .project-tab { clip-path:polygon(0 0,calc(100% - 10px) 0,100% 100%,0 100%); }
  .project-tab-prefix { display:none; }
  .portfolio-stack .project-panel {
    grid-template-rows:auto minmax(0,1fr);
    align-items:stretch;
    height:clamp(432px,calc(100svh - 188px),560px);
    min-height:0;
    gap:12px;
    padding:20px;
  }
  .notebook-home .portfolio-stack .project-heading h3 { font-size:25px; }
  .notebook-home .portfolio-stack .project-role { margin-top:12px; }
  .notebook-home .portfolio-stack .project-summary { font-size:13px; line-height:1.7; }
  .notebook-home .portfolio-stack .project-cover { height:100%; aspect-ratio:auto; }
  .project-open { margin-top:10px; }
}
/* Space between grid rows creates reading travel without a trailing spacer. */
@media screen and (min-width:761px) and (min-height:720px) and (prefers-reduced-motion:no-preference), screen and (max-width:760px) and (min-height:640px) and (prefers-reduced-motion:no-preference) {
  .notebook-home .portfolio-stack {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-items:start;
    row-gap:clamp(200px,32svh,320px);
  }
}
@media(prefers-reduced-motion:reduce) {
  .portfolio-stack .stack-item { position:relative; top:auto; }
  .notebook-home .portfolio-stack .cover-artwork>img { transition:none; }
  .notebook-home .portfolio-stack .portfolio-project:hover .cover-artwork>img { transform:none; }
}
@media print {
  .notebook-home .portfolio-stack .stack-item { position:static; break-inside:avoid; margin:0 0 24px; }
  .notebook-home .portfolio-stack .project-tab { left:0; width:200px; }
  .notebook-home .portfolio-stack .project-panel { min-height:0; padding:24px; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .notebook-home .portfolio-stack .project-cover { height:220px; }
  .project-open { display:none; }
}
