/* Review fixes, 10 November 2026.
   Loaded after every other stylesheet. Presentation and function only: no
   project copy lives here. To undo, remove this file's <link> and the
   review-fixes.js <script> from index.html (the prior state is kept in
   snapshots/before-claude-review-20261110/). */

/* 1. Phones: the three lead cards.
   Below 721px they kept their desktop offsets, rotation and fixed height,
   so they ran off the right edge and clipped their own text. */
@media (max-width:720px) {
  #portfolio-table-study .table-scene:not(.reading) .project-card[data-slot] {
    left:auto; top:auto; transform:none;
    height:auto; min-height:300px; padding-bottom:76px;
  }
  /* The first card of an open case clipped its organisation and dates. */
  #portfolio-table-study .table-scene.reading .project-card.anchored {
    height:auto; min-height:0;
  }
}

/* 2. CV viewer.
   The page was capped at 500px wide and scaled to fit the window height,
   which put body text near 8px on a laptop and 6px on a phone. It now fits
   the width, scrolls, and offers the PDF itself. */
#portfolio-table-study .profile-panel {
  width:min(880px,calc(100vw - 32px));
  max-height:calc(100svh - 48px);
  padding:0 12px 12px;
  overflow:auto; overscroll-behavior:contain;
}
#portfolio-table-study .cv-dialog-head {
  position:sticky; top:0; z-index:2;
  height:auto; min-height:58px; gap:10px;
  margin:0 -12px 12px; padding:10px 12px 10px 20px;
  background:#fffaf1; border-bottom:1px solid #e3d5cb;
}
#portfolio-table-study .cv-dialog-head h2 { margin:0 auto 0 0; font-size:18px; }
#portfolio-table-study .cv-download {
  display:inline-flex; align-items:center; min-height:36px; padding:8px 15px;
  border-radius:999px; background:var(--ink); color:var(--ivory);
  font:600 13px/1.2 var(--type-text); letter-spacing:0; text-decoration:none;
  transition:background-color 140ms ease;
}
#portfolio-table-study .cv-download:hover { background:#4b2a5c; }
#portfolio-table-study .profile-panel .panel-close {
  min-height:36px; padding:8px 13px;
  border:1px solid #b6a3b1; border-radius:999px;
}
#portfolio-table-study .cv-document { overflow:visible; box-shadow:0 0 0 1px #e3d5cb; }
@media (max-width:720px) {
  #portfolio-table-study .profile-panel { width:calc(100vw - 16px); padding:0 8px 8px; }
  #portfolio-table-study .cv-dialog-head { margin:0 -8px 8px; padding:8px 8px 8px 14px; }
}

/* 3. Shared links.
   Opening a project or panel by URL moves focus to its Back or Close
   button, and the browser drew the full focus ring before the visitor had
   touched anything. The ring returns with the first key press. */
html[data-quiet-focus] #portfolio-table-study :focus-visible { outline-color:transparent !important; }

/* Reduced motion for the CV download control. */
@media (prefers-reduced-motion:reduce) {
  #portfolio-table-study .cv-download { transition:none; }
}

/* 5. Card order.
   The cards of a case are a sequence, but a free deal does not show which
   comes next. A small corner numeral, as on a playing card, settles it. */
#portfolio-table-study .card-index { display:none; }
#portfolio-table-study .reading .info-card > .card-index {
  display:block; position:absolute; top:19px; right:20px; z-index:3;
  pointer-events:none; user-select:none;
  font:600 12px/1 var(--type-display); letter-spacing:0; color:#7a6577;
  font-variant-numeric:tabular-nums;
}
#portfolio-table-study .reading .info-card.learn-mini > .card-index,
#portfolio-table-study .reading .info-card.timescale-original > .card-index { top:17px; right:16px; }
@media (max-width:720px) {
  #portfolio-table-study .reading .info-card > .card-index { top:24px; right:26px; }
  #portfolio-table-study .reading .info-card.learn-mini > .card-index,
  #portfolio-table-study .reading .info-card.timescale-original > .card-index { top:17px; right:16px; }
}

/* 6. Who each project was for, on the card fronts.
   The table showed what each project was but not where it was done. Dates
   stay inside the case: a second line crowded the longest lead card. */
#portfolio-table-study .card-footer { align-items:flex-end; }
#portfolio-table-study .card-footer > .card-org {
  margin-right:auto; max-width:64%;
  white-space:normal; text-align:left; line-height:1.25; color:#6d5669;
}
#portfolio-table-study .reserve-card .card-footer > .card-org { display:block; max-width:62%; }
@media (min-width:721px) {
  /* In the fanned pile only the front card and a raised card show it, like
     their summaries; otherwise clipped fragments show between the cards. */
  #portfolio-table-study .reserve-card:not(.anchored):not([data-depth='3']) .card-org { visibility:hidden; }
  #portfolio-table-study .reserve-card:not(.anchored):is(.is-hovered,:has(.card-pick:focus-visible)) .card-org { visibility:visible; }
}

/* 7. Tablets and half-width windows (721px to 1023px).
   The table is drawn in container units, so the cards shrink with the
   window, but its type had fixed pixel floors. Below 1024px the intro
   wrapped into the Selected work label and card text ran past the card
   edges. Here the type follows the same scale as the cards (values are the
   1024px sizes expressed in container units). */
@media (min-width:721px) and (max-width:1023px) {
  #portfolio-table-study .table-scene:not(.reading) .hero-copy h1 { font-size:6cqw; }
  #portfolio-table-study .table-scene:not(.reading) .hero-copy .hero-role { font-size:2.4cqw; margin-top:1.17cqw; }
  #portfolio-table-study .table-scene:not(.reading) .hero-copy .hero-intro { font-size:1.76cqw; margin-top:1.27cqw; }
  #portfolio-table-study .table-scene:not(.reading) .featured-label { font-size:max(11px,1.37cqw); }
  #portfolio-table-study .table-scene:not(.reading) .project-card:not(.anchored):not(.reserve-card) { min-height:32.8cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-title { font-size:2.5cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-domain { font-size:1.17cqw; margin-bottom:.59cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-summary { font-size:1.37cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-descriptor { margin-top:1.17cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-descriptor,
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-descriptor p { font-size:1.27cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .project-descriptor p + p { margin-top:.88cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card .card-footer { font-size:1.075cqw; }
  #portfolio-table-study .table-scene:not(.reading) .project-card[data-project='2'] .project-title { font-size:2.1cqw; }
  #portfolio-table-study .table-scene:not(.reading) .reserve-card .project-title { font-size:1.75cqw; }
  #portfolio-table-study .table-scene:not(.reading) .reserve-card[data-project='4'] .project-title { font-size:1.46cqw; }
  #portfolio-table-study .table-scene:not(.reading) .reserve-card .project-domain { font-size:1.075cqw; margin:1.37cqw 0 .78cqw; }
  #portfolio-table-study .table-scene:not(.reading) .reserve-card .project-summary { font-size:1.27cqw; }
  #portfolio-table-study .table-scene:not(.reading) .resume-back .contact-title { font-size:max(11px,1.37cqw); }
}

/* 8. Phones: the small CV card sat in the gap that the lead cards now
   fill. CV stays one tap away in the header. */
@media (max-width:720px) {
  #portfolio-table-study .resume-back { display:none; }
}
