/* Homepage composition. Shared scenes and detail pages keep their own styles. */
.portfolio-home {
  --home-paper: #f8f5ed;
  --home-card: #fffdf8;
  --home-rule: #d9d2c4;
  --home-soft: #eee9de;
  --home-muted: #6b6255;
}
.portfolio-home .site-header { box-shadow: none; }
.portfolio-home .nav-shell { max-width: 1320px; padding-inline: 32px; }
.portfolio-home .home-nav { display: flex; gap: 30px; align-items: center; margin-left: auto; }
.portfolio-home .home-nav a { color: var(--manual-ink); font: 700 13px/1.5 var(--sans); text-decoration: none; }
.portfolio-home .home-nav a:hover { color: var(--manual-red); }
.portfolio-home .nav-tools { margin-left: 24px; }

/* Pixel world: an introduction on the left and a project window on the right. */
.portfolio-home .home-hero {
  display: block; min-height: min(790px, calc(100svh - 74px));
  padding: 74px 32px 72px;
}
.home-hero-shell { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, 1fr); gap: clamp(38px, 5vw, 88px); align-items: center; max-width: 1240px; margin: auto; }
.portfolio-home .hero-content { max-width: none; }
.portfolio-home .hero .eyebrow { font-size: 10px; letter-spacing: .04em; padding: 6px 10px; margin-bottom: 24px; box-shadow: none; }
.hero-greeting { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 0 0 15px; color: #f2f5ff; font-size: 18px; }
.hero-greeting strong { color: var(--gold); font-weight: 800; }
.hero-greeting > span { margin-left: 9px; color: #a7d7de; font: 10px/1.5 var(--mono); letter-spacing: .12em; }
.portfolio-home .hero h1 { font: 900 clamp(40px, 4.4vw, 65px)/1.2 var(--sans); letter-spacing: -.045em; text-shadow: 3px 4px 0 #040b1b99; }
.portfolio-home .hero h1 > .hero-line { display: block; color: #f2f5ff; }
.portfolio-home .hero h1 .highlight { color: #77dce8; }
.portfolio-home .hero-role { margin: 18px 0 0; color: #f4d77a; font: 700 13px/1.6 var(--mono); letter-spacing: .02em; }
.portfolio-home .hero-role > span { margin: 0 8px; color: #9db8c7; }
.portfolio-home .hero-lead { max-width: 610px; margin-top: 18px; font-size: 15.5px; line-height: 1.9; color: #dce9f4; }
.portfolio-home .hero-actions { gap: 14px; margin-top: 27px; }
.portfolio-home .hero-actions .button { min-height: 48px; padding: 12px 21px; font-size: 14px; border-width: 1px; box-shadow: 4px 4px 0 #040b1a; }
.portfolio-home .hero-actions .button--outline { background: #0714246b; color: #b9edf1; border-color: #86cbd5; }
.portfolio-home .hero-proof { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 26px; color: #c9d8e6; font: 11px/1.6 var(--mono); }
.portfolio-home .hero-proof a { display: inline-flex; align-items: baseline; gap: 7px; color: inherit; text-decoration: none; }
.portfolio-home .hero-proof a:hover { color: #fff; }
.portfolio-home .hero-proof b { color: #f9d56e; font-size: 17px; }
.portfolio-home .hero-proof > span { border-left: 1px solid #91aebf66; padding: 0 0 0 16px; }
.portfolio-home .hero .scroll-cue { position: static; display: inline-flex; flex-direction: row; align-items: center; margin-top: 25px; transform: none; letter-spacing: .1em; }
.portfolio-home .scroll-cue > span { padding: 0; color: #f5d478; background: none; border: none; box-shadow: none; font-size: 10px; }
.portfolio-home .scroll-cue i { margin-left: 10px; font-style: normal; }
.portfolio-home .scroll-cue:hover > span { color: #fff; }
.portfolio-home .hero-bottom { max-width: 1240px; left: 32px; right: 32px; margin: auto; font-size: 9px; color: #bbccd8; }
.hero-feature { min-width: 0; color: #eef7fa; }
.hero-feature-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: #b2d0da; font: 10px/1.5 var(--mono); letter-spacing: .12em; }
.hero-feature-heading b { color: #f4d77a; font-weight: 500; }
.hero-feature-main { display: block; border: 1px solid #a5c9d680; background: #071323d9; box-shadow: 7px 7px 0 #040b1a80; text-decoration: none; transition: border-color .2s, transform .2s; }
.hero-feature-main:hover { transform: translateY(-3px); border-color: #c9edf2; }
.hero-feature-art { position: relative; overflow: hidden; border-bottom: 1px solid #a5c9d640; }
.hero-feature-art > img { width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; }
.hero-feature-live { position: absolute; z-index: 1; left: 12px; top: 12px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; background: #081725e8; color: #a2e4ba; border: 1px solid #5a9d7a; font: 9px/1.4 var(--mono); letter-spacing: .06em; }
.hero-feature-live i { width: 5px; height: 5px; background: currentColor; }
.hero-feature-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; }
.hero-feature-copy p { margin: 0 0 7px; font: 11px/1.5 var(--mono); color: #f4d77a; }
.hero-feature-copy h2 { margin: 0; font: 700 clamp(18px, 1.8vw, 25px)/1.45 var(--sans); letter-spacing: -.015em; }
.hero-feature-arrow { flex: none; font-size: 29px; color: #a3e3ea; }
.hero-feature-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; border-top: 1px solid #8aaaba3d; margin: 0 22px; padding: 13px 0; color: #a9c0d0; font: 9px/1.5 var(--mono); }
.hero-feature-note > span { color: #dbeaf2; }
.hero-feature-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 21px; }
.hero-feature-links a { display: flex; justify-content: space-between; align-items: center; gap: 9px; min-height: 55px; padding-bottom: 8px; border-bottom: 1px solid #aac9d464; color: #e9f4fa; text-decoration: none; }
.hero-feature-links strong { display: block; font: 700 15px/1.4 var(--mono); }
.hero-feature-links small { display: block; margin-top: 5px; color: #a8bfce; font-size: 10px; }
.hero-feature-links b { color: #e9ce7d; font-size: 17px; }
.hero-feature-links a:hover strong { color: #f5d478; }

/* Selected work gets the full page width; the remaining chapters keep the paper index. */
.portfolio-home #projects { padding: 70px 32px 36px; border: 0; background: var(--home-paper); color: var(--manual-ink); }
.projects-shell { max-width: 1240px; margin: auto; }
.project-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 36px; margin-bottom: 31px; }
.project-kicker { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; color: var(--home-muted); font: 700 10px/1.5 var(--mono); letter-spacing: .12em; }
.project-kicker > span { padding: 3px 5px; background: var(--manual-ink); color: var(--home-paper); font-weight: 500; }
.project-section-head h2 { margin: 0; color: var(--manual-ink); font: 800 clamp(30px, 3.1vw, 45px)/1.3 var(--sans); letter-spacing: -.04em; }
.project-section-head h2 em { color: var(--manual-red); font-style: normal; }
.project-section-intro { flex: 0 1 360px; margin: 0 0 4px; color: var(--home-muted); font-size: 13px; line-height: 1.9; }
.portfolio-home #projects .prints { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.portfolio-home #projects .print { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--home-card); border: 1px solid var(--home-rule); border-radius: 2px; box-shadow: 4px 4px 0 var(--home-soft); }
.portfolio-home #projects .print:hover { transform: translateY(-4px); box-shadow: 5px 9px 0 var(--home-soft); border-color: var(--manual-ink-3); }
.project-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 47px; padding: 12px 16px; border-bottom: 1px solid var(--home-rule); }
.portfolio-home #projects .print .tab { position: static; display: block; padding: 0; color: var(--home-muted); background: none; font: 700 9px/1.4 var(--mono); letter-spacing: .035em; }
.project-status { display: inline-flex; flex: none; align-items: center; gap: 6px; color: #486b47; font: 600 11px/1.5 var(--sans); }
.project-status > i { width: 5px; height: 5px; background: currentColor; }
.project-twin .project-status { color: #496588; }
.portfolio-home #projects .print .plate { width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0; border: 0; border-bottom: 1px solid var(--home-rule); background: #18263a; }
.portfolio-home #projects .print .plate::after { display: none; }
.portfolio-home #projects .print .plate img { width: 100%; height: 100%; object-fit: cover; filter: none; opacity: 1; transition: transform .35s; }
.portfolio-home #projects .print:hover .plate img { transform: scale(1.025); }
.portfolio-home #projects .print .pad { display: flex; flex: 1; flex-direction: column; padding: 23px 22px 18px; }
.portfolio-home #projects .print h3 { margin: 0; color: var(--manual-ink); font: 800 29px/1.25 var(--mono); letter-spacing: -.035em; }
.portfolio-home #projects .print h3 small { display: block; margin-top: 7px; color: var(--manual-red-dk); font: 700 13px/1.5 var(--sans); letter-spacing: 0; }
.portfolio-home #projects .print .sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; min-height: 78px; margin: 16px 0 0; color: var(--manual-ink-2); font-size: 14px; line-height: 1.85; }
.project-ownership { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--home-rule); font-size: 12px; line-height: 1.8; }
.project-ownership b { color: var(--home-muted); font-weight: 500; white-space: nowrap; }
.project-ownership span { color: var(--manual-ink-2); }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 17px 0 22px; padding: 0; list-style: none; }
.project-tags li { padding: 3px 7px; background: var(--home-soft); color: var(--manual-ink-2); font: 500 10px/1.5 var(--mono); }
.portfolio-home #projects .print .acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--home-rule); }
.project-delivery { color: var(--home-muted); font: 10px/1.5 var(--mono); }
.portfolio-home #projects .print .acts .go { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 32px; gap: 8px; padding: 0; color: var(--manual-red-dk); background: none; box-shadow: none; transform: none; font: 700 12px/1.5 var(--sans); }
.portfolio-home #projects .print .acts .go::after { display: none; }
.portfolio-home #projects .print .hit { z-index: 5; }
.portfolio-home #projects .print:focus-within { outline: 2px solid var(--manual-red-dk); outline-offset: 4px; }
.project-section-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding: 19px 0 0; border-top: 1px solid var(--home-rule); color: var(--home-muted); font-size: 12px; }
.project-section-foot p { margin: 0; }
.project-section-foot p span { margin-right: 8px; color: var(--manual-red); }
.project-section-foot a { color: var(--manual-red-dk); font-weight: 700; text-decoration: none; }
.project-section-foot a span { margin-left: 8px; }

@media (min-width: 701px) and (max-width: 1050px) and (min-height: 521px) {
  .portfolio-home .home-nav { gap: 19px; }
  .portfolio-home .nav-tools { margin-left: 8px; }
  .portfolio-home .hero-greeting > span { display: none; }
  .portfolio-home .home-hero { min-height: 0; padding-top: 55px; padding-bottom: 65px; }
  .home-hero-shell { grid-template-columns: minmax(0, 1.3fr) minmax(270px, 1fr); gap: 28px; }
  .portfolio-home .hero h1 { font-size: clamp(33px, 4.2vw, 44px); }
  .portfolio-home .hero-lead { font-size: 14px; line-height: 1.8; }
  .portfolio-home .hero-role { font-size: 11px; }
  .portfolio-home .hero-actions .button { padding-inline: 13px; font-size: 12px; }
  .portfolio-home .hero-proof { gap: 7px 13px; }
  .portfolio-home .hero-proof > span { display: none; }
  .hero-feature-copy { padding-inline: 16px; }
  .hero-feature-copy h2 { font-size: 19px; }
  .hero-feature-note { margin-inline: 16px; font-size: 8px; }
  .hero-feature-links { gap: 11px; }
  .hero-feature-links strong { font-size: 13px; }
  .hero-feature-links small { font-size: 9px; }
  .project-section-head { align-items: flex-start; gap: 24px; }
  .project-section-head h2 { font-size: 31px; }
  .project-section-intro { flex-basis: 280px; font-size: 12px; }
  .portfolio-home #projects .prints { gap: 14px; }
  .project-card-meta { flex-wrap: wrap; padding: 10px 12px; gap: 5px; }
  .portfolio-home #projects .print .pad { padding: 18px 15px 14px; }
  .portfolio-home #projects .print h3 { font-size: 24px; }
  .portfolio-home #projects .print h3 small { min-height: 39px; font-size: 12px; }
  .portfolio-home #projects .print .sum { min-height: 100px; font-size: 13px; }
  .project-ownership { grid-template-columns: 1fr; gap: 3px; min-height: 84px; }
  .project-delivery { display: none; }
}

/* Tablet portrait: readable horizontal cards, rather than narrow desktop columns. */
@media (min-width: 701px) and (max-width: 900px) and (min-height: 521px) {
  .project-section-head { display: block; }
  .project-section-intro { max-width: 520px; margin-top: 14px; font-size: 14px; }
  .portfolio-home #projects .prints { grid-template-columns: 1fr; gap: 20px; }
  .portfolio-home #projects .print { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .project-card-meta { grid-column: 1 / -1; padding: 12px 16px; }
  .portfolio-home #projects .print .plate { grid-column: 1; grid-row: 2; height: 100%; aspect-ratio: auto; border: 0; border-right: 1px solid var(--home-rule); }
  .portfolio-home #projects .print .plate img { object-fit: contain; }
  .portfolio-home #projects .print .pad { grid-column: 2; grid-row: 2; padding: 22px; }
  .portfolio-home #projects .print h3 { font-size: 26px; }
  .portfolio-home #projects .print h3 small { min-height: 0; }
  .portfolio-home #projects .print .sum { min-height: 0; margin-top: 13px; }
  .project-ownership { grid-template-columns: auto minmax(0, 1fr); min-height: 0; margin-top: 13px; gap: 8px; }
  .project-tags { margin: 13px 0 17px; }
  .portfolio-home #projects .print .acts .go { min-height: 44px; }
}

/* Phones have a reading-first introduction and compact project rows. */
@media (max-width: 700px), (max-width: 950px) and (orientation: landscape) and (max-height: 520px) {
  .portfolio-home { --home-paper: var(--phone-bg); --home-card: var(--phone-surface); --home-rule: var(--phone-line); --home-soft: var(--phone-soft); --home-muted: var(--phone-muted); }
  .portfolio-home .nav-shell { padding-inline: 14px; }
  .portfolio-home .home-nav { display: none; }
  .portfolio-home .nav-tools { margin-left: 0; }
  .portfolio-home .home-hero { min-height: 0; padding: 25px 20px 28px; }
  .home-hero-shell { display: block; }
  .hero-feature { display: none; }
  .portfolio-home .hero .eyebrow { margin-bottom: 20px; padding: 5px 7px; font-size: 11px; letter-spacing: 0; }
  .hero-greeting { margin-bottom: 11px; font-size: 16px; line-height: 1.5; }
  .hero-greeting > span { display: none; }
  .portfolio-home .hero h1 { font-size: clamp(28px, 8.1vw, 34px); line-height: 1.3; letter-spacing: -.045em; text-shadow: 2px 3px 0 #040b1a88; }
  .portfolio-home .hero-role, .portfolio-home .hero-lead { display: none; }
  .portfolio-home .hero-mobile-summary { display: block; margin: 17px 0 0; font-size: 15px; line-height: 1.75; color: #e5eff8; }
  .portfolio-home .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .portfolio-home .hero-actions .button { min-height: 46px; padding: 10px 8px; font-size: 14px; border-radius: 8px; box-shadow: none; }
  .portfolio-home .hero-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 19px; font-size: 11px; }
  .portfolio-home .hero-proof b { font-size: 15px; }
  .portfolio-home .hero-proof a { gap: 5px; }
  .portfolio-home .hero-proof > span { display: none; }
  .portfolio-home .hero .scroll-cue { display: inline-flex; margin-top: 21px; }
  .portfolio-home .scroll-cue > span { font-size: 11px; }
  .portfolio-home .hero-bottom { display: none; }
  .portfolio-home #projects { padding: 29px 16px 20px; }
  .project-section-head { display: block; margin-bottom: 20px; }
  .project-kicker { gap: 8px; margin-bottom: 11px; font-size: 10px; letter-spacing: .07em; }
  .project-kicker > span { padding: 2px 5px; }
  .project-section-head h2 { font-size: 24px; line-height: 1.4; letter-spacing: -.025em; }
  .project-section-intro { margin-top: 10px; font-size: 14px; line-height: 1.7; }
  .project-section-intro br { display: none; }
  .portfolio-home #projects .prints { grid-template-columns: 1fr; gap: 12px; }
  .portfolio-home #projects .print, .portfolio-home #projects .print:hover { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 9px 12px; padding: 14px; border-radius: 12px; box-shadow: none; transform: none; }
  .project-card-meta { display: contents; }
  .portfolio-home #projects .print .tab { display: none; }
  .project-status { grid-column: 1; grid-row: 3; align-self: center; gap: 5px; white-space: nowrap; color: var(--phone-success-ink); font-size: 12px; }
  .project-twin .project-status { color: var(--manual-indigo); }
  .portfolio-home #projects .print .plate { grid-column: 1; grid-row: 1; width: 64px; height: 64px; aspect-ratio: 1; border: 0; border-radius: 8px; }
  .portfolio-home #projects .print .plate img, .portfolio-home #projects .print:hover .plate img { transform: none; }
  .portfolio-home #projects .print .pad { display: contents; }
  .portfolio-home #projects .print h3 { grid-column: 2; grid-row: 1; align-self: center; font: 750 19px/1.3 var(--phone-font); letter-spacing: -.02em; }
  .portfolio-home #projects .print h3 small { min-height: 0; margin-top: 5px; font: 600 13px/1.5 var(--phone-font); }
  .portfolio-home #projects .print .sum { grid-column: 1 / -1; grid-row: 2; -webkit-line-clamp: 2; min-height: 0; margin: 0; font-size: 14px; line-height: 1.65; }
  .project-ownership, .project-tags, .project-delivery { display: none; }
  .portfolio-home #projects .print .acts { grid-column: 2; grid-row: 3; display: flex; justify-content: flex-end; margin: 0; padding: 0; border: 0; }
  .portfolio-home #projects .print .acts .go { min-height: 44px; gap: 7px; font: 700 14px/1.5 var(--phone-font); }
  .project-section-foot { gap: 12px; margin-top: 20px; padding-top: 17px; font-size: 12px; }
  .project-section-foot a { min-height: 32px; line-height: 32px; }
}

@media (max-width: 340px) {
  .portfolio-home .nav-shell { padding-inline: 10px; }
  .portfolio-home .home-hero { padding-inline: 16px; }
  .portfolio-home #projects { padding-inline: 12px; }
  .project-section-head h2 { font-size: 23px; }
  .portfolio-home #projects .print { grid-template-columns: 58px minmax(0, 1fr); padding: 12px; gap: 9px 10px; }
  .portfolio-home #projects .print .plate { width: 58px; height: 58px; }
}
@media (max-width: 950px) and (orientation: landscape) and (max-height: 520px) {
  .portfolio-home .home-hero { padding-block: 24px; }
  .portfolio-home .hero-content { max-width: 620px; }
  .portfolio-home #projects .prints { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
html[data-reduce-motion="1"] .portfolio-home .print,
html[data-reduce-motion="1"] .portfolio-home .plate img,
html[data-reduce-motion="1"] .portfolio-home .hero-feature-main { transition: none; }
