/* A generous, tactile exhibition strip across the shared paper canvas.
   Editorial typography, risograph specimen art direction, and physical card craft. */
.portfolio-scene {
  --portfolio-width: clamp(720px, 72vw, 920px);
  --portfolio-height: clamp(380px, 56svh, 450px);
  --card-gap: 56px;
  color: var(--study-paperInk);
}

.is-scroll-story .scroll-canvas {
  overflow: visible;
  clip-path: inset(0 -100vw);
}

html[data-ticket-scene="apps"] .scroll-canvas::after,
html[data-ticket-scene="skills"] .scroll-canvas::after {
  display: none;
}

[data-journey].is-scroll-story .scroll-canvas .portfolio-scene {
  height: 100%;
  padding: 42px 36px 24px;
  box-sizing: border-box;
}

.is-scroll-story .portfolio-scene > .scroll-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-scene .scene-kicker {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.portfolio-scene .scene-kicker .kicker-tag {
  font: 700 11px/1.2 var(--mono);
  letter-spacing: 0.1em;
}

.portfolio-scene .scene-kicker .kicker-tag i {
  font-style: normal;
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  background: var(--study-paperInk);
  color: var(--study-paper);
  border-radius: 2px;
}

.portfolio-scene .scene-kicker .kicker-edition {
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 0.14em;
  opacity: 0.55;
  text-transform: uppercase;
}

.portfolio-scene .scene-kicker .kicker-note {
  font: 500 12px/1.2 var(--sans);
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.portfolio-gallery {
  position: relative;
  flex: none;
  min-width: 0;
  min-height: 0;
  width: 100vw;
  height: var(--portfolio-height);
  left: 50%;
  margin: auto 0 0 -50vw;
  outline-offset: 6px;
}

.portfolio-track {
  display: flex;
  gap: var(--card-gap);
  height: 100%;
  width: max-content;
  padding-inline: calc((100vw - var(--portfolio-width)) / 2);
  position: relative;
  will-change: transform;
}

.portfolio-item {
  flex: 0 0 var(--portfolio-width);
  width: var(--portfolio-width);
  height: 100%;
  min-width: 0;
  position: relative;
  transform-origin: 50% 50%;
  transition: opacity 0.3s ease;
}

.card-underlay {
  position: absolute;
  inset: -6px -8px 6px 8px;
  background: var(--study-paper);
  border: 1.5px solid rgba(25, 23, 31, 0.16);
  transform: rotate(-2.2deg);
  box-shadow: 4px 6px 0 rgba(25, 23, 31, 0.12);
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 14px;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--study-paperInk);
  opacity: 0.65;
}

.blueprint-underlay {
  background-image: radial-gradient(circle, currentColor 0.65px, transparent 0.65px);
  background-size: 14px 14px;
  transform: rotate(2.2deg) translate(4px, 4px);
}

.portfolio-card {
  --btn-bg: var(--study-noteInk);
  --btn-ink: var(--study-note);
  height: 100%;
  overflow: clip;
  border: 1.5px solid rgba(25, 23, 31, 0.18);
  background: var(--study-note);
  color: var(--study-noteInk);
  box-shadow: 7px 8px 0 rgba(25, 23, 31, 0.18);
  position: relative;
  isolation: isolate;
  z-index: 1;
}

.portfolio-card-inner {
  position: relative;
  display: grid;
  grid-template-columns: 48% 1fr;
  align-items: stretch;
  gap: 28px;
  padding: 26px 30px;
  height: 100%;
  box-sizing: border-box;
}

/* Watermark */
.portfolio-art-mark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font: 900 145px/0.8 'Archivo Black', sans-serif;
  letter-spacing: -0.1em;
  left: -20px;
  top: -6px;
  opacity: 0.11;
  color: currentColor;
  z-index: 0;
  transition: transform 0.4s ease;
}

/* Copy Column */
.portfolio-scene .portfolio-copy {
  min-width: 0;
  position: relative;
  color: inherit;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.portfolio-eyebrow .eyebrow-id {
  padding: 2px 6px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-radius: 2px;
}

.portfolio-eyebrow .eyebrow-dot {
  opacity: 0.5;
}

.portfolio-copy .portfolio-title {
  margin: 6px 0 8px;
  color: inherit;
  outline: none;
}

.portfolio-title .title-pill {
  display: inline-block;
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 4px;
}

.portfolio-title .title-main {
  display: block;
  font: 900 clamp(26px, 2.4vw, 34px)/1.1 'Archivo Black', sans-serif;
  letter-spacing: -0.04em;
}

.portfolio-description {
  font-size: 13px;
  line-height: 1.65;
  text-wrap: pretty;
  color: inherit;
  opacity: 0.88;
  max-width: 320px;
  margin: 0;
}

.specimen-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin: 8px 0 6px;
  padding: 5px 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
  border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

.specimen-matrix span {
  display: inline-block;
}

/* Tags List */
.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 10px 0 12px;
}

.portfolio-tags li {
  font: 600 10px/1.3 var(--mono);
  letter-spacing: 0.02em;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  color: inherit;
}

/* Buttons */
.portfolio-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.portfolio-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  min-height: 40px;
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.04em;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
}

.portfolio-action-btn:hover {
  transform: translate(-1px, -2px);
  box-shadow: 2px 4px 0 rgba(0, 0, 0, 0.25);
}

.portfolio-action-btn .btn-label {
  color: var(--btn-ink);
}

.portfolio-action-btn .action-arrow {
  color: var(--btn-ink);
  font-size: 16px;
  transition: transform 0.2s ease;
}

.portfolio-action-btn:hover .action-arrow {
  transform: translate(2px, -2px);
}

.portfolio-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 40px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.02em;
  border: 1.5px dashed currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.portfolio-code-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.portfolio-code-btn .code-bracket {
  font-weight: 900;
  color: inherit;
  opacity: 0.7;
}

/* Artwork Column */
.portfolio-scene .portfolio-card .work-visual,
.tool-art {
  position: relative;
  align-self: stretch;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  isolation: isolate;
}

.work-art-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-specimen-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.1em;
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}

.card-specimen-ruler {
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 2px;
}

.perforated-strip {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  padding-bottom: 3px;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.12em;
  opacity: 0.8;
  pointer-events: none;
}

.cad-crosshair {
  position: absolute;
  font: 900 12px/1 var(--mono);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.cad-crosshair.top-left {
  top: 6px;
  left: 8px;
}

.cad-axis {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  opacity: 0.55;
  pointer-events: none;
}

.opal-spectrum-sheen {
  position: absolute;
  inset: 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 120, 180, 0.09), rgba(100, 220, 255, 0.09), rgba(255, 230, 100, 0.08));
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Card 1: Cat 09 */
.portfolio-item[data-item-id="cat"] .app-card {
  border-radius: 0 0 0 36px;
}

.portfolio-item[data-item-id="cat"] .work-visual::before {
  content: '';
  position: absolute;
  inset: 18px 8px 22px;
  background: var(--study-paper);
  border: 1.5px solid currentColor;
  border-radius: 28px;
  transform: rotate(-3deg);
  opacity: 0.9;
  z-index: -1;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.1);
}

.portfolio-scene .portfolio-card .cat-art {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-scene .portfolio-card .cat-art picture {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-scene .portfolio-card .cat-art picture img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
  transform: rotate(-2deg);
}

.portfolio-scene .portfolio-card .motion-toggle {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--study-paper);
  color: inherit;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.portfolio-scene .portfolio-card .art-caption,
.portfolio-scene .portfolio-card .art-note,
.portfolio-scene .portfolio-card .orbit-line {
  display: none;
}

/* Card 2: Travel Stickers */
.portfolio-item[data-item-id="travel"] .app-card {
  --btn-bg: var(--portfolio-on-accent, var(--study-paper));
  --btn-ink: var(--study-paperAccent);
  background: var(--study-paperAccent);
  color: var(--portfolio-on-accent, var(--study-paper));
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%, 0 55%, 12px 50%, 0 45%);
}

.portfolio-item[data-item-id="travel"] .portfolio-tags li {
  background: rgba(255, 255, 255, 0.15);
  border: 0;
}

.portfolio-item[data-item-id="travel"] .portfolio-title .title-serif {
  display: block;
  font: 400 clamp(34px, 3vw, 44px)/0.95 'DM Serif Display', serif;
  letter-spacing: -0.02em;
}

.portfolio-item[data-item-id="travel"] .portfolio-title .title-serif em {
  font-style: italic;
  display: inline-block;
  margin-left: 8px;
}

.portfolio-scene .portfolio-card .travel-art {
  position: relative;
  width: 100%;
  height: 100%;
}

.portfolio-scene .portfolio-card .travel-art .sticker {
  position: absolute;
  filter: drop-shadow(3px 8px 12px rgba(25, 23, 31, 0.28));
  transition: transform 0.3s ease;
}

.portfolio-scene .portfolio-card .travel-art .sticker-gallery {
  width: 78%;
  height: 90%;
  left: 20%;
  top: -4%;
  transform: rotate(-7deg);
}

.portfolio-scene .portfolio-card .travel-art .sticker-rome {
  width: 62%;
  height: 68%;
  left: -10%;
  top: 24%;
  transform: rotate(-18deg);
}

.portfolio-scene .portfolio-card .travel-art .sticker-airport {
  width: 54%;
  height: 60%;
  left: 54%;
  top: 44%;
  transform: rotate(14deg);
}

/* Tool Card 1: House (Exploded View) */
.portfolio-item[data-item-id="house"] .tool-card {
  --btn-bg: var(--study-paperInk);
  --btn-ink: var(--study-paper);
  background: var(--study-paper);
  color: var(--study-paperInk);
}

.portfolio-item[data-item-id="house"] .tool-card::before {
  content: '';
  position: absolute;
  inset: 0 46% 0 0;
  background: var(--study-note);
  clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
  z-index: -1;
}

.portfolio-item[data-item-id="house"] .tool-art {
  background-image: radial-gradient(circle, currentColor 0.75px, transparent 0.75px);
  background-size: 16px 16px;
  background-position: center;
  border-radius: 12px;
}

.portfolio-scene .portfolio-card .skill-visual {
  position: relative;
  flex: 1;
  display: block;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 200px;
  margin: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.portfolio-scene .portfolio-card .skill-visual img {
  width: 108%;
  max-width: 108%;
  height: 100%;
  position: absolute;
  inset: 0 auto 0 -4%;
  object-fit: contain;
}

.portfolio-item[data-item-id="house"] .skill-visual {
  transform: rotate(-4deg);
}

/* Tool Card 2: Opal (Shader / Gem) */
.portfolio-item[data-item-id="opal"] .tool-card {
  --btn-bg: var(--study-ink);
  --btn-ink: var(--study-bg);
  background: var(--study-bg);
  color: var(--study-ink);
  border-radius: 0 32px 0 0;
}

.portfolio-item[data-item-id="opal"] .tool-art::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--study-paper) 0%, transparent 72%);
  border: 1px dashed currentColor;
  opacity: 0.85;
  z-index: -1;
}

.portfolio-item[data-item-id="opal"] .portfolio-title .title-main {
  font-family: 'Songti SC', 'STSong', serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portfolio-item[data-item-id="opal"] .skill-visual {
  transform: rotate(6deg);
}

/* Bottom Caption & Architectural Progress Bar */
.portfolio-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: var(--portfolio-width);
  max-width: 100%;
  min-height: 24px;
  margin: 16px auto 0;
  color: var(--study-paperInk);
  font: 11px/1.4 var(--mono);
}

.portfolio-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.portfolio-step {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.portfolio-step.active {
  font-weight: 700;
}

.portfolio-step.total {
  opacity: 0.45;
}

.portfolio-bar {
  display: inline-block;
  width: 64px;
  height: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.portfolio-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 50%;
  background: currentColor;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.portfolio-hint {
  font-family: var(--sans);
  font-size: 11px;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 1000px) {
  .portfolio-scene {
    --portfolio-width: 560px;
    --card-gap: 36px;
  }
  [data-journey].is-scroll-story .scroll-canvas .portfolio-scene {
    padding: 40px 28px 22px;
  }
  .portfolio-card-inner {
    padding: 22px 24px;
    gap: 22px;
  }
}

@media (max-width: 700px) {
  .portfolio-scene {
    --portfolio-width: clamp(240px, calc(100vw - 90px), 310px);
    --portfolio-height: clamp(340px, 50svh, 390px);
    --card-gap: 20px;
  }
  [data-journey].is-scroll-story .scroll-canvas .portfolio-scene {
    padding: 36px 18px 20px;
  }
  .portfolio-card-inner {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    gap: 12px;
  }
  .portfolio-scene .portfolio-card .work-visual,
  .tool-art {
    height: 130px;
    flex: none;
  }
  .portfolio-description {
    font-size: 12px;
    line-height: 1.6;
  }
  .portfolio-tags {
    margin: 6px 0 10px;
  }
  .portfolio-tags li {
    font-size: 9px;
    padding: 2px 6px;
  }
  .portfolio-actions {
    margin-top: 4px;
  }
  .portfolio-action-btn {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 11px;
  }
  .portfolio-code-btn {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 10px;
  }
  .portfolio-scene .scene-kicker .kicker-edition {
    display: none;
  }
  .card-specimen-ruler,
  .cad-axis {
    display: none;
  }
  .portfolio-scene .portfolio-card .motion-toggle {
    bottom: 2px;
    font-size: 8px;
    padding: 2px 8px;
  }
}

/* Natural flow fallback */
html:not(.is-scroll-story) .portfolio-gallery {
  width: 100%;
  max-width: 760px;
  height: auto;
  left: auto;
  margin: 28px auto 0;
}
html:not(.is-scroll-story) .portfolio-track {
  display: grid;
  gap: 28px;
  width: 100%;
  height: auto;
  padding: 0;
  transform: none !important;
}
html:not(.is-scroll-story) .portfolio-item {
  width: 100%;
  height: auto;
  transform: none !important;
}
html:not(.is-scroll-story) .portfolio-card {
  height: auto;
}
html:not(.is-scroll-story) .portfolio-card-inner {
  transform: none !important;
  min-height: 300px;
}
html:not(.is-scroll-story) .portfolio-caption {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-track {
    will-change: auto;
  }
}
