/* ------------------------------------------------
   Portfolio — product cases
   Page-specific styles on top of style.css.
   The page is a summary of cards; each case opens as
   a sheet laid over it (URL anchor, no animation).
   ------------------------------------------------ */

.portfolio.article-page { padding-top: 0; }

/* Sticky top bar: reuses .topbar from style.css, sized like the home page */
.portfolio .topbar { font-size: 0.8125rem; }

.portfolio .topbar > a.header-title {
  pointer-events: auto;
  text-decoration: none;
}

.portfolio .topbar > a.header-title:hover { color: var(--light); }

.portfolio .menu-dropdown .menu-home { color: var(--light); }

.portfolio .topbar .lang-toggle { margin-bottom: 0; }

.portfolio .article-body {
  font-size: 16px;
  color: var(--mid);
}

.portfolio .article-body p { font-size: inherit; }

/* ---------- Summary: one card per case ---------- */
.portfolio .cases {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.portfolio .case-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  padding: 0.8rem 1rem 0.7rem;
  margin: 0;
  cursor: pointer;
}

.portfolio .case-card .case-header { margin-bottom: 0; }
.portfolio .case-card .case-title { margin-top: 0; }

.portfolio .case-card:hover { border-color: var(--subtle); }


/* Case header: logo + name, one-line thesis, role line, outcome chips */
.portfolio .case-header { margin-bottom: 0.25rem; }

.portfolio .case-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  font-variation-settings: 'GEOM' 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.2rem;
  position: relative;
  isolation: isolate;
}

.portfolio .case-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
}

.portfolio .case-title a:focus-visible { outline: 2px solid var(--subtle); outline-offset: 3px; border-radius: 3px; }

.portfolio .case-title .entry-logo { height: 0.72em; }

/* Kind of outcome: zero to one, feature, pattern, consulting, software, prototype */
.portfolio .case-kind {
  display: inline-block;
  vertical-align: 0.35em;
  margin-left: 0.5rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--light);
  font-variation-settings: 'GEOM' 0;
  white-space: nowrap;
}

.glow-enabled .portfolio [style*="--glow"] .case-title::before {
  content: '';
  position: absolute;
  inset: -0.5rem -1.5rem;
  background: rgba(var(--glow), 0.065);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(30px);
}

.portfolio .case-deck {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.35;
  margin: 0 0 0.4rem;
  max-width: 620px;
}

.portfolio .case-role {
  color: var(--light);
  font-weight: 300;
  font-size: 0.7rem;
  margin: 0 0 0.5rem;
  max-width: 620px;
}

.portfolio .case-header .milestone-tags { margin: 0; }

/* TL;DR block */
.portfolio .tldr {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  max-width: 660px;
}

.portfolio .tldr-label {
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--light);
  font-variation-settings: 'GEOM' 0;
}

.portfolio .article-body .tldr p {
  margin: 0;
  color: var(--dark);
}

/* ---------- Before, and elsewhere: plain section on the summary ---------- */
.portfolio .elsewhere {
  padding-top: 2rem;
}

.portfolio .elsewhere h3,
.portfolio .sheet h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  font-variation-settings: 'GEOM' 0;
  margin: 1.75rem 0 0.5rem;
}

.portfolio .elsewhere p,
.portfolio .sheet p,
.portfolio .elsewhere li,
.portfolio .sheet li {
  max-width: 620px;
}

.portfolio .elsewhere ul,
.portfolio .sheet ul { margin: 0 0 1rem 1.1rem; }

.portfolio .elsewhere li,
.portfolio .sheet li { margin-bottom: 0.3rem; }

/* Mini entries: the earlier roles, laid out like the home page entries */
.portfolio .mini-entry { margin-bottom: 1.5rem; }

.portfolio .mini-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.portfolio .mini-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  isolation: isolate;
}

.portfolio .mini-head .entry-company {
  font-weight: 600;
  color: var(--black);
  font-variation-settings: 'GEOM' 0;
}

.portfolio .mini-head .entry-role { margin: 0; }

.glow-enabled .portfolio .mini-entry[style*="--glow"] .mini-name::before {
  content: '';
  position: absolute;
  inset: -0.5rem -1.5rem;
  background: rgba(var(--glow), 0.065);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(30px);
}

.portfolio .mini-entry p { margin-bottom: 0.4rem; }

/* ---------- Sheets: one case laid over the summary ---------- */
.portfolio .sheet { display: none; }

.portfolio .sheet:target {
  display: block;
  position: fixed;
  inset: 0;
  margin: 0;
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(253, 254, 253, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 2.25rem 1rem 3rem;
}

html:has(.portfolio .sheet:target) { overflow: hidden; }

.portfolio .sheet:focus,
.portfolio .sheet:focus-visible { outline: none; }

.portfolio .sheet-paper {
  outline: none;
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(26, 29, 26, 0.10), 0 2px 6px rgba(26, 29, 26, 0.05);
  padding: 1.25rem 2.25rem 2rem;
}

.portfolio .sheet-bar,
.portfolio .sheet-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.65rem;
}

.portfolio .sheet-bar {
  margin-bottom: 1.5rem;
  padding-bottom: 0.7rem;
}

.portfolio .sheet-foot {
  margin-top: 2.5rem;
  padding-top: 0.8rem;
}

.portfolio .sheet-close,
.portfolio .sheet-next {
  color: var(--light);
  text-decoration: none;
  font-variation-settings: 'GEOM' 0;
}

.portfolio .sheet-close:hover,
.portfolio .sheet-next:hover { color: var(--dark); }

.portfolio .sheet-close:focus-visible,
.portfolio .sheet-next:focus-visible { outline: 2px solid var(--subtle); outline-offset: 3px; border-radius: 3px; }

.portfolio .sheet-next { color: var(--mid); }

.portfolio .sheet-count {
  color: var(--subtle);
  font-weight: 300;
}

.portfolio .sheet .case-header { margin-bottom: 0.25rem; }

/* ---------- Facts: the business problem, the people, the start, the money ---------- */
.portfolio .facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.5rem;
  margin: 1.5rem 0 0.5rem;
  padding: 1rem 0 1.1rem;
}

.portfolio .facts div { min-width: 0; }

.portfolio .facts dt,
.portfolio .rubrics dt {
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--light);
  font-variation-settings: 'GEOM' 0;
  margin-bottom: 0.25rem;
}

.portfolio .facts dd,
.portfolio .rubrics dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--dark);
}

/* What I did: verbs first, method after */
.portfolio .did {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.portfolio .did li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.55rem;
  max-width: 660px;
}

.portfolio .did li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 2px;
  background: var(--subtle);
}

.portfolio .did-verb {
  font-weight: 500;
  color: var(--black);
  font-variation-settings: 'GEOM' 0;
}

/* User journeys: steps in a row, before muted, after plain */
.portfolio .journey {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0 0.5rem;
}

.portfolio .journey-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.portfolio .journey-label {
  flex: 0 0 4rem;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--light);
  font-variation-settings: 'GEOM' 0;
  padding-top: 0.55rem;
}

.portfolio .journey-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: stretch;
}

.portfolio .journey-steps li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: none;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  padding: 0.4rem 0.6rem;
}

.portfolio .journey-steps li:not(:last-child)::after {
  content: '→';
  color: var(--subtle);
  margin-left: 0.15rem;
}

.portfolio .journey-row.muted .journey-steps li {
  color: var(--light);
  border-style: dashed;
  background: none;
}

.portfolio .journey-note {
  color: var(--light);
  font-weight: 300;
  font-size: 14px;
  margin: 0.25rem 0 1.25rem;
}

/* Rubrics: tools, technical expertise, management, ecosystem */
.portfolio .rubrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.5rem;
  margin: 2rem 0 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.portfolio .rubrics div { min-width: 0; }


/* Tables: decision / alternative, before / after */
.portfolio .tablewrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
}

.portfolio table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  line-height: 1.5;
}

.portfolio th,
.portfolio td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.portfolio th {
  font-weight: 500;
  color: var(--black);
  font-variation-settings: 'GEOM' 0;
}

.portfolio th:first-child,
.portfolio td:first-child {
  color: var(--light);
  font-weight: 300;
  width: 15%;
  min-width: 4.5rem;
}

.portfolio td:last-child,
.portfolio th:last-child { padding-right: 0; }

/* Figures: reuse .article-figure from style.css */
.portfolio .article-figure { margin: 1.25rem 0 1.5rem; }

/* Closing */
.portfolio .closing {
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.portfolio .closing p { margin-bottom: 0.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .portfolio .case-card { padding: 0.7rem 0.8rem 0.6rem; border-radius: 6px; }
  .portfolio .facts,
  .portfolio .rubrics { grid-template-columns: 1fr; }
  .portfolio .journey-row { flex-direction: column; gap: 0.3rem; }
  .portfolio .journey-label { padding-top: 0; }
  .portfolio .journey-steps { flex-direction: column; }
  .portfolio .journey-steps li:not(:last-child)::after { content: '↓'; margin-left: auto; }
  .portfolio .sheet:target { padding: 0.5rem 0.5rem 2rem; }
  .portfolio .sheet-paper { padding: 0.9rem 1.1rem 1.4rem; border-radius: 8px; }
  .portfolio .sheet-bar { margin-bottom: 1.1rem; }

  /* Phones: each table row becomes a card, headers carried as labels */
  .portfolio table,
  .portfolio tbody,
  .portfolio tr,
  .portfolio td { display: block; width: auto; }
  .portfolio thead { display: none; }
  .portfolio tr { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
  .portfolio tr:last-child { border-bottom: 0; }
  .portfolio td { border: 0; padding: 0.1rem 0; min-width: 0; }
  .portfolio td:first-child {
    color: var(--black);
    font-weight: 500;
    font-variation-settings: 'GEOM' 0;
    padding-bottom: 0.25rem;
  }
  .portfolio td:first-child:empty { display: none; }
  .portfolio td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 300;
    color: var(--light);
    margin-top: 0.25rem;
  }
}

/* ---------- Print: summary first, then one case per page ---------- */
@media print {
  html:has(.portfolio .sheet:target) { overflow: visible; }
  .portfolio { display: block; font-size: 0.65rem; }
  .portfolio .article-page-header,
  .portfolio header { display: block; }
  .portfolio footer { display: block; margin-top: 1.5rem; }
  .portfolio .article-body { font-size: 11px; }
  .portfolio .cases { gap: 0.5rem; margin-bottom: 1rem; }
  .portfolio .case-card { break-inside: avoid; padding: 0.5rem 0.7rem; border-radius: 0; }
  .portfolio .case-title { font-size: 0.9rem; }
  .portfolio .case-title::before, .portfolio .mini-name::before { display: none !important; }
  .portfolio .case-deck { font-size: 0.7rem; }
  .portfolio .case-role { font-size: 0.55rem; }
  .portfolio .elsewhere { border-top: 0; padding-top: 0; break-before: page; }
  .portfolio .sheet,
  .portfolio .sheet:target {
    display: block;
    position: static;
    background: none;
    backdrop-filter: none;
    padding: 0;
    break-before: page;
  }
  .portfolio .sheet-paper { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .portfolio .sheet-bar,
  .portfolio .sheet-foot { display: none; }
  .portfolio .sheet h3,
  .portfolio .elsewhere h3 { break-after: avoid; font-size: 0.7rem; margin-top: 0.9rem; }
  .portfolio table { font-size: 10px; }
  .portfolio .tldr { break-inside: avoid; }
  .portfolio .article-body .tldr p { font-size: 10.5px; }
  .portfolio .tablewrap,
  .portfolio .facts,
  .portfolio .rubrics,
  .portfolio .journey,
  .portfolio .article-figure { break-inside: avoid; }
  .portfolio .facts dd, .portfolio .rubrics dd { font-size: 10.5px; }
  .portfolio .journey-steps li { font-size: 9.5px; }
  .portfolio .article-figure figcaption { font-size: 9.5px; }
  .portfolio .closing { border: none; }
  .portfolio a { color: inherit; text-decoration: none; }
}
