/* Five visible parts, in the requested narrative order.
   Loaded last on index.html only. Theme stays: white page, IBM Plex Mono,
   Poppins wordmark, #4053ff accent, photographic masthead, hairline rules. */

.five-part-home { --rule-soft: #e4e7ee; --ink-2: #1c2433; --ink-3: #596177; --tint: #f7f8fb; }

/* ---------- Masthead: tall on load, collapses to a pinned strip on scroll ---------- */
.five-part-home { --hero-max: 430px; --hero-min: 118px; --hero-p: 0; }
.five-part-home .nav { position: fixed; }
.five-part-home main { padding-top: var(--hero-max); }
.five-part-home .research-banner {
 position: fixed; top: 0; left: 0; right: 0; z-index: 40;
 height: var(--hero-max);
 align-items: flex-end; text-align: left; overflow: hidden;
 background:
  linear-gradient(180deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.50) 45%, rgba(0,0,0,.72) 100%),
  url('regenix-presentation-banner-2.jpg') center 32% / cover;
 box-shadow: 0 1px 0 rgba(0,0,0,calc(.12 * var(--hero-p)));
}
.five-part-home .research-banner .container {
 max-width: 1320px; width: 100%;
 padding: 0 24px calc(28px - 16px * var(--hero-p));
}
.five-part-home .research-banner h1.hero-logo { margin: 0 0 calc(10px - 10px * var(--hero-p)); line-height: 0; overflow: hidden; }
.five-part-home .hero-logo img {
 display: block; width: auto; height: calc(150px - 150px * min(1, var(--hero-p) * 1.6)); max-width: 100%;
 opacity: calc(1 - var(--hero-p) * 1.8);
}
.five-part-home .wordmark-logo { display: block; line-height: 0; padding: 0; opacity: calc(var(--hero-p) * 2.5 - 1); transition: opacity .15s linear; }
.five-part-home .wordmark-img { display: block; width: auto; height: 54px; }
.five-part-home .research-banner p::before { opacity: calc(1 - var(--hero-p) * 1.5); }
.five-part-home .research-banner p {
 font-size: 15px; max-width: 640px; color: rgba(255,255,255,.88);
 opacity: calc(1 - var(--hero-p) * 1.5); max-height: calc(52px * (1 - var(--hero-p)));
 overflow: hidden; margin: 0;
}
.five-part-home .research-banner p::before {
 content: ""; display: block; width: 48px; height: 2px; background: var(--accent); margin: 0 0 10px;
}
.showcase-section { scroll-margin-top: calc(var(--hero-min) + 12px); }

/* ---------- Shared section rhythm ---------- */
.five-sections { max-width: 1320px; }
.showcase-section { padding: 36px 0; border-bottom: 1px solid var(--rule-soft); }
.showcase-section:first-child { padding-top: 32px; }
.showcase-section h2 { font-size: 27px; line-height: 1.2; letter-spacing: -.3px; margin: 0 0 12px; }
.section-index {
 display: inline-flex; align-items: center; gap: 12px;
 font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
}
.section-index::after { content: ""; width: 36px; height: 1px; background: var(--accent); opacity: .6; }
.showcase-copy p { font-size: 14px; line-height: 1.65; color: var(--ink-muted); max-width: 52ch; margin: 0; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; }

/* ---------- 00 Intro: photo left, title + abstract right ---------- */
.showcase-intro { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 48px; align-items: center; padding: 44px 0 48px !important; border-bottom: 0; }
.intro-photo { margin: 0; min-width: 0; }
.intro-photo img { display: block; width: 100%; height: auto; border: 1px solid var(--rule-soft); }
.showcase-intro h2 { font-size: 36px; line-height: 1.2; letter-spacing: -.3px; margin: 0 0 22px; }
.showcase-intro p { font-size: 14.5px; line-height: 1.8; color: var(--ink-2); margin: 0; text-align: justify; }

/* ---------- 01 Video: full-bleed grey band, centered title ---------- */
.showcase-video {
 margin-inline: calc(50% - 50vw); padding: 44px calc(50vw - 50%) 56px; background: #f3f4f7; border-bottom: 0;
 min-height: calc(100svh - var(--hero-min)); display: grid; align-content: start; gap: 28px;
}
.video-heading { font-size: 38px; text-align: center; margin: 0; letter-spacing: -.3px; }
.video-slot { min-width: 0; width: 100%; max-width: min(100%, calc((100svh - 240px - var(--hero-min)) * 16 / 9), 1245px); margin: 0 auto; }
.five-part-home .film-frame { margin: 0 !important; background: transparent; }
.five-part-home .film-embed { aspect-ratio: 16/9; width: 100%; height: auto; background: #000; }

/* ---------- 02 How it works ---------- */
.showcase-how { display: grid; grid-template-columns: 1fr; gap: 0; }
.showcase-how .showcase-copy p { max-width: 70ch; }
.showcase-how .mode-summary { max-width: 760px; }
.how-visual { min-width: 0; }
.five-part-home .research-diagram { background: #fff; border: 1px solid var(--rule-soft); padding: 10px; }
.five-part-home .diagram-link { transition: border-color .2s; }
.five-part-home .diagram-link:hover .research-diagram { border-color: var(--accent); }
.mode-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; margin-top: 20px; padding: 0; border: 1px solid var(--rule-soft); }
.mode-summary span { display: block; padding: 11px 14px; font-size: 12px; color: var(--ink-3); border-right: 1px solid var(--rule-soft); }
.mode-summary span:last-child { border-right: 0; }
.mode-summary strong { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.showcase-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 16px; font-size: 13px; }
.showcase-links .text-button { font-size: 13px; padding: 0; }
.showcase-links a, .showcase-links .text-button { border-bottom: 1px solid transparent; transition: border-color .15s; }
.showcase-links a:hover, .showcase-links .text-button:hover { border-bottom-color: currentColor; }

/* second row: assembly diagram left, reserved space right */
.how-assembly { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 44px; align-items: start; }
.pub-line { margin: 18px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-3); max-width: none; }
.pub-line a { color: var(--accent); font-weight: 600; border-bottom: 1px solid currentColor; }
.pub-line a:hover { background: var(--accent-soft); }
.assembly-figure { margin: 0; min-width: 0; }
.assembly-figure .diagram-link { display: block; width: fit-content; max-width: 100%; }
.assembly-figure img { display: block; width: auto; max-width: 100%; height: 440px; object-fit: contain; background: #fff; border: 1px solid var(--rule-soft); padding: 12px; transition: border-color .2s; }
.assembly-figure .diagram-link:hover img { border-color: var(--accent); }
.assembly-figure figcaption { margin-top: 12px; font-size: 12px; line-height: 1.55; color: var(--ink-3); max-width: 52ch; }
.assembly-figure strong { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.how-electronics { min-width: 0; }
.how-electronics h3 { font-size: 22px; line-height: 1.2; margin: 0 0 18px; }
.how-electronics .electronics-list { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.how-electronics .electronics-list img { height: 110px; padding: 10px; }
.how-electronics .electronics-list figcaption { padding-top: 8px; font-size: 11.5px; }
.how-electronics .electronics-list strong { font-size: 12.5px; }

/* ---------- 03 Electronics ---------- */
.electronics-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 20px; }
.electronics-list figure { margin: 0; min-width: 0; }
.electronics-list img {
 display: block; width: 100%; height: 118px; object-fit: contain; padding: 12px;
 background: #fff; border: 1px solid var(--rule-soft);
 transition: border-color .2s, transform .2s, box-shadow .2s;
}
.electronics-list figure:hover img { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px -14px rgba(28,36,51,.35); }
.electronics-list figcaption { padding-top: 10px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.electronics-list strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 2px; }

/* ---------- 04 Presentations: image beside text, two across ---------- */
.presentation-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.presentation-photos figure { margin: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 0 22px; align-items: center; }
.presentation-photos a { display: block; overflow: hidden; height: 200px; background: var(--tint); border: 1px solid var(--rule-soft); }
.presentation-photos img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.presentation-photos figure:last-child img { object-position: 50% 12%; }
.presentation-photos a:hover img { transform: scale(1.025); }
.presentation-photos figcaption { font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.presentation-photos strong { display: block; font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.presentation-photos strong::after { content: ""; display: block; width: 28px; height: 1px; background: var(--accent); margin-top: 8px; }

.business-copy { font-size: 15px; line-height: 1.8; color: var(--ink-2); margin: 0 0 26px; max-width: 100ch; text-align: justify; }
.business-photos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.business-photos figure { margin: 0; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--rule-soft); background: var(--tint); }
.business-photos img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform .5s ease; }
.business-photos figure:hover img { transform: scale(1.025); }

/* ---------- 05 Recognition ---------- */
.showcase-awards { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; padding: 28px 0; }
.showcase-awards .section-heading { margin: 0; }
.awards-slot { min-width: 0; }
.showcase-awards .compact-awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.showcase-awards .compact-awards > div { display: flex; gap: 14px; align-items: center; padding: 10px 14px; min-height: 64px; border: 1px solid var(--rule-soft); background: #fff; }
.showcase-awards .compact-awards img { width: 64px; height: 40px; object-fit: contain; flex: none; }
.showcase-awards .compact-awards p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.showcase-awards .compact-awards strong { color: var(--ink-2); font-size: 13px; }
.five-part-home .btn { padding: 13px 20px; font-size: 14px; }
/* ---------- 05 Resources: paper + code ---------- */
.showcase-resources { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; padding: 28px 0; }
.showcase-resources .section-heading { margin: 0; }
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.paper-title { font-size: 20px; line-height: 1.5; font-weight: 600; color: var(--accent); border-bottom: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.paper-title:hover { background: var(--accent-soft); }
.resource-actions .btn { padding: 20px 32px; font-size: 17px; font-weight: 600; gap: 12px; }
.resource-actions .btn-icon { width: 24px; height: 24px; }
.five-part-home .btn { display: inline-flex; align-items: center; gap: 10px; line-height: 1.2; }
.five-part-home .btn-github { background: #fff; color: var(--ink-2); border: 1px solid #c9cedb; }
.five-part-home .btn-github:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-icon { flex: none; display: block; }

.five-part-home footer.foot { margin: 0; padding: 18px 0; font-size: 12px; color: var(--ink-3); }
#prototype-view .viewer-wrap { height: 65dvh; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
 .showcase-awards, .showcase-resources { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 900px) {
 .showcase-section { padding: 32px 0; }
 .showcase-how { grid-template-columns: 1fr; gap: 28px; }
 .showcase-intro { grid-template-columns: 1fr; gap: 18px; padding: 28px 0 32px !important; }
 .showcase-intro .intro-copy { display: contents; }
 .showcase-intro h2 { order: 1; margin: 0; font-size: 26px; }
 .intro-photo { order: 2; }
 .showcase-intro p { order: 3; }
 .intro-photo img { max-height: 280px; }
 .showcase-video { min-height: 0; padding-top: 32px; padding-bottom: 40px; gap: 20px; }
 .video-heading { font-size: 30px; }
 .video-slot { max-width: 100%; }
 .showcase-how .how-visual { order: 2; }
 .how-assembly { grid-template-columns: 1fr; gap: 0; }
 .assembly-figure img { height: 380px; }
 .how-electronics { margin-top: 28px; }
 .showcase-copy p { max-width: none; }
 .electronics-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
 .electronics-list img { height: 120px; }
 .business-photos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
 .five-part-home .research-banner { background-position: 0 30%, 0 30%; }
 .five-part-home .research-banner .container { padding: 0 20px calc(20px - 10px * var(--hero-p)); }
 .five-part-home .hero-logo img { height: calc(96px - 96px * min(1, var(--hero-p) * 1.6)); }
 .five-part-home .wordmark-img { height: 44px; }
 .five-part-home .research-banner p { font-size: 13px; }
 .five-part-home .research-banner p::before { margin-bottom: 8px; }
 .showcase-section { padding: 26px 0; }
 .showcase-intro h2 { font-size: 22px; }
 .showcase-intro p { font-size: 13.5px; line-height: 1.7; text-align: left; }
 .showcase-section h2 { font-size: 23px; margin: 10px 0 12px; }
 .section-index { font-size: 11px; }
 .showcase-copy p { font-size: 14px; }
 .showcase-video { gap: 14px; }
 .video-heading { font-size: 24px; }
 .quick-facts strong { font-size: 20px; }
 .quick-facts span { font-size: 10px; padding-left: 10px; }
 .showcase-how { gap: 16px; }
 .showcase-how .showcase-copy { display: contents; }
 .showcase-how .section-index { order: 1; }
 .showcase-how h2 { order: 2; margin: 0; }
 .showcase-how .how-visual { order: 3; }
 .showcase-how .showcase-copy > p { order: 4; }
 .showcase-how .mode-summary { order: 5; margin-top: 4px; }
 .showcase-how .showcase-links { order: 6; margin-top: 4px; }
 .showcase-how .pub-line { order: 7; }
 .assembly-figure img { height: auto; width: 100%; padding: 8px; }
 .how-electronics { margin-top: 22px; }
 .how-electronics h3 { font-size: 19px; margin-bottom: 12px; }
 .how-electronics .electronics-list { gap: 10px; }
 .how-electronics .electronics-list img { height: 80px; padding: 8px; }
 .five-part-home .research-diagram { padding: 10px; }
 .mode-summary span { padding: 10px 10px; font-size: 11px; }
 .mode-summary strong { font-size: 12px; }
 .showcase-links { font-size: 13px; gap: 8px 20px; }
 .showcase-links .text-button { font-size: 13px; }
 .section-heading { margin-bottom: 18px; }
 .electronics-list { gap: 12px 10px; }
 .electronics-list img { height: 96px; padding: 10px; }
 .electronics-list figcaption { font-size: 11px; padding-top: 8px; }
 .electronics-list strong { font-size: 12px; }
 .business-photos { grid-template-columns: 1fr; gap: 12px; }
 .business-copy { font-size: 14px; text-align: left; }
 .presentation-photos figure { grid-template-columns: 132px 1fr; gap: 0 14px; }
 .presentation-photos a { height: 100px; }
 .presentation-photos figcaption { font-size: 11px; }
 .presentation-photos strong { font-size: 13px; margin-bottom: 4px; }
 .presentation-photos strong::after { margin-top: 5px; }
 .showcase-awards { gap: 18px; }
 .showcase-awards .compact-awards { grid-template-columns: 1fr; gap: 10px; }
 .showcase-awards .compact-awards > div { padding: 12px 14px; }
 .showcase-awards .compact-awards img { width: 48px; height: 40px; }
 .showcase-awards .compact-awards p { font-size: 11px; }
 .showcase-awards .compact-awards strong { font-size: 13px; }
 .resource-actions { gap: 10px 12px; }
 .paper-title { font-size: 16px; }
 .five-part-home .btn { padding: 11px 16px; font-size: 13px; }
 .five-part-home footer.foot { font-size: 11px; padding: 18px 0; }
}
