/* The original homepage and ticker use styles.css without experiment overrides. */
:root { --overview-title-size: clamp(32px, 2.65vw, 48px); }
.casebook {
  --book-width: var(--focus-width);
  --slide-width: calc(var(--book-width) * .9);
  --slide-gap: clamp(18px, 2.25vw, 48px);
  color: var(--ink); background: var(--section-page-background); padding-block: clamp(24px, 4vh, 44px);
}
.book-inner { width: var(--book-width); margin-inline: auto; }
.book-heading { display: flex; justify-content: space-between; margin: 0 0 16px; }
.book-mast { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: clamp(20px, 2.5vw, 42px); }
.products-section h2, .book-mast h2 { font-size: var(--overview-title-size); }
.book-mast h2 { position: relative; width: fit-content; margin: 0; line-height: 1.16; letter-spacing: -.045em; }
.book-summary, .story-copy :is(dd, p) { margin: 0; font-size: clamp(14px,.92vw,16px); line-height: 1.72; text-wrap: pretty; }
.book-summary:lang(en) { font-size: clamp(13px,.8vw,14px); line-height: 1.45; }
.book-result { display: grid; align-self: center; text-align: right; }
/* Preserve the original masthead footprint while centering the visible metric. */
.book-result-space, .book-result-content { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-end; }
.book-result-space { visibility: hidden; pointer-events: none; }
.book-result-content { align-self: center; }
.book-result-space .conversion-legend { font-size: 10px; letter-spacing: .12em; margin-bottom: 10px; font-weight: 700; }
.book-result strong { display: flex; align-items: baseline; color: var(--red); font-size: clamp(48px,4.2vw,72px); letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.book-result .percent { font-size: .48em; }
.book-result b { display: block; max-width: none; white-space: nowrap; margin-top: 0; font-size: 13px; }
.book-result-space b { margin-top: 6px; }
.book-result .case-digits { display: inline-grid; }
.book-result .case-digits::before { content: "80"; visibility: hidden; }
.book-result .case-digits > span, .book-result .case-digits::before { grid-area: 1/1; position: static; }

.story-stage {
  --title-lift: 12px;
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0,1fr); position: relative;
  grid-template-rows: 1fr auto 1fr;
  isolation: isolate; overflow-x: clip; margin-block: clamp(22px,3.7vh,42px) 0; touch-action: pan-y;
}
.book-panel {
  position: relative; isolation: isolate; grid-area: 1 / 1 / span 3; width: var(--slide-width); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0,1.19fr) minmax(0,.81fr); grid-template-rows: subgrid;
  grid-template-areas: "art ." "art copy" "art .";
  align-items: center; column-gap: clamp(24px,3.3vw,62px); row-gap: 0; padding: clamp(18px,2.1vw,37px);
  color: var(--ink); background: var(--section-page-background); overflow: hidden;
  min-width: 0;
}
.book-panel:is([data-slot="current"], .is-leaving) { z-index: 2; color: white; background: var(--section-red-background); }
.book-panel.is-leaving { z-index: 3; pointer-events: none; background: transparent; }
.book-panel.is-leaving .plate-media { background: transparent; }
.book-panel:not([data-slot="current"]):not(.is-leaving) { visibility: hidden; pointer-events: none; }
.book-panel:not([data-slot="current"]):not(.is-leaving) .engineering-plate, .book-panel:not([data-slot="current"]):not(.is-leaving) .story-copy { opacity: 0; visibility: hidden; }
/* Crop the neighboring part at the outer edge of its gray tile. */
.book-panel {
  --preview-width: clamp(0px, calc((100cqw - var(--slide-width)) / 2 - var(--slide-gap)), var(--slide-width));
  --preview-gutter: clamp(6px, 1.5cqw, 30px);
  --preview-frame: calc(var(--preview-width) - var(--preview-gutter));
}
.book-panel .adjacent-product { display: none; }
.story-preview {
  position: absolute; top: 0; bottom: 0; z-index: 3; overflow: hidden; pointer-events: none;
  --preview-gutter: clamp(6px, 1.5cqw, 30px);
  width: max(0px, calc((100% - var(--slide-width)) / 2 - var(--slide-gap) - var(--preview-gutter)));
  background: var(--section-page-background);
}
.story-preview-previous { left: var(--preview-gutter); }
.story-preview-next { right: var(--preview-gutter); }
.story-preview::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--ink); opacity: .43; }
.story-preview-layer { position: absolute; inset: 0; }
.story-preview img { position: absolute; top: 50%; height: 64%; width: auto; max-width: 144%; object-fit: contain; }
.story-preview-previous img { left: 0; transform: translate(-50%, -50%); }
.story-preview-next img { right: 0; transform: translate(50%, -50%); }
.story-copy {
  position: relative; grid-area: copy; min-width: 0; align-self: stretch; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: space-between;
  --paragraph-gap: 15px; --link-gap: 16px;
}
@media (min-width: 701px) {
  .book-panel:is([data-slot="current"], .is-leaving) {
    margin-block-start: calc(0px - var(--title-lift));
    border-block-start: var(--title-lift) solid transparent;
    background-origin: border-box;
    translate: 0 calc(var(--title-lift) / 2);
  }
  /* Match the enlarged current panel to the unchanged arrow center. */
  .casebook .book-tabs { translate: 0 6px; }
  .story-copy p:lang(en) { font-size: clamp(13px, .82vw, 14px); line-height: 1.55; }
}
.story-copy h3 { margin: 0 0 var(--paragraph-gap); translate: 0 calc(0px - var(--title-lift)); font-size: clamp(24px,1.93vw,34px); letter-spacing: -.04em; line-height: 1.17; }
.story-copy p { margin: 0 0 var(--paragraph-gap); }
.story-copy p:last-of-type { margin-bottom: var(--link-gap); }
/* Use the aluminum card's original spacing; longer text can occupy part of each gap. */
.book-panel:not(#story-aluminum) .story-copy { --paragraph-gap: 6px; --link-gap: 6px; }
.book-panel:not(#story-aluminum) .story-copy p { line-height: 1.5; }
.book-panel:not(#story-aluminum) .story-copy:lang(en) { --paragraph-gap: 3px; --link-gap: 3px; }
.book-panel:not(#story-aluminum) .story-copy p:lang(en) { font-size: 13px; line-height: 1.4; }
.story-copy dt { margin: 12px 0 4px; color: inherit; font-size: 12px; font-weight: 700; letter-spacing: .07em; }
.story-copy .text-link { margin: 0; color: inherit; border-color: currentColor; font-size: 13px; }
.story-copy .text-link:hover, .story-copy .text-link:focus-visible { text-decoration: underline; }
.engineering-plate { grid-area: art; min-width: 0; margin: 0; --caption-lines: 1; }
.engineering-plate:lang(en) { --caption-lines: 2; }
@media (min-width: 701px) {
  .engineering-plate { display: grid; font-size: 11px; line-height: 1.45; grid-template-rows: auto minmax(calc(8px + var(--caption-lines) * 1lh), auto); }
  .engineering-plate figcaption { align-self: start; }
}
.plate-media { display: grid; place-items: center; height: clamp(244px,34svh,380px); padding: clamp(8px,1.2vw,18px); background: white; }
.plate-media img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
.plate-media.aluminum {
  grid-template: minmax(0,1fr) / minmax(0,.68fr) minmax(0,1.32fr);
  gap: clamp(5px,.65vw,12px); padding: clamp(5px,.5vw,10px);
}
.drawing-link { position:relative; display:block; width:100%; height:100%; min-width:0; min-height:0; cursor:zoom-in; }
.drawing-link:focus-visible { outline:2px solid var(--red); outline-offset:1px; }
.drawing-hint { position:absolute; right:0; top:0; color:var(--red); background:white; font-size:15px; line-height:1; }
.drawing-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.plate-media.hub { grid-template: repeat(2,minmax(0,1fr)) / minmax(0,1.25fr) repeat(2,minmax(0,.65fr)); gap: 8px; }
.plate-media.hub img:first-child { grid-row: 1 / 3; }
.plate-media.hub img:last-child { grid-column: 2 / 4; }
.plate-media.valve { display: flex; justify-content: center; align-items: center; gap: 10%; }
.plate-media.valve img { width: auto; max-width: 38%; }
.plate-media.valve img:last-child { height: 87%; max-width: 52%; }
.engineering-plate figcaption { display:flex; flex-wrap:wrap; gap: 3px 10px; align-items:baseline; margin-top:8px; color:inherit; font-size:11px; line-height:1.45; }
.engineering-plate small { font:inherit; }
.story-arrow {
  display:grid; place-items:center; position:absolute; top:0; bottom:0; z-index:4;
  width:calc((100% - var(--slide-width)) / 2 - var(--slide-gap)); border:0; padding:0;
  color:white; background:transparent; cursor:pointer;
}
.story-prev { left:0; }
.story-next { right:0; }
.story-arrow::after { content:""; width:clamp(15px,1.25vw,25px); aspect-ratio:1; border-top:4px solid currentColor; border-right:4px solid currentColor; }
.story-prev::after { transform:rotate(-135deg); }
.story-next::after { transform:rotate(45deg); }
.story-arrow:hover::after { color:white; filter:drop-shadow(0 0 3px var(--ink)); }
.story-arrow:focus-visible { outline:3px solid var(--red); outline-offset:-4px; }
.story-arrow .visually-hidden { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.book-tabs { display:flex; justify-content:center; align-items:center; margin:clamp(12px,1.65vh,24px) auto 0; }
.book-tabs button { position:relative; border:0; background:none; color:var(--muted); font:inherit; font-weight:500; line-height:1.45; padding:9px 15px; }
.book-tabs button + button::before { content:"/"; position:absolute; left:-3px; color:var(--muted); font-weight:400; }
.book-tabs button[aria-selected="true"] { color:var(--red);font-weight:750; }
.book-tabs button:focus-visible { outline:2px solid var(--red); }
@media(prefers-reduced-motion:reduce) { .book-panel,.book-panel .engineering-plate,.book-panel .story-copy { transition:none; } }

/* The source crop excludes the west yard on every viewport, even beneath the red panel. */
.roof-profile, .contact-section {
  --flyby-height:clamp(74px,8vw,132px);
  --closing-section-gap:calc(var(--section-gap) * 1.3);
}
.roof-profile {
  --roof-width: var(--focus-width);
  background: var(--roof-photo-background, none) center 48% / cover no-repeat;
  position:relative; isolation:isolate; overflow:clip; color:white;
  margin-block:var(--closing-section-gap) calc(var(--closing-section-gap) - var(--flyby-height));
}
.roof-profile.photo-ready { --roof-photo-background:url("assets/campus-roofs.webp"); }
.roof-photo { position:absolute; inset:0 auto 0 0; width:calc(50% - var(--roof-width) * .02); height:100%; object-fit:cover; object-position: center top; z-index:-2; }
.roof-inner { display:grid; grid-template-columns:minmax(0,.96fr) minmax(0,1.04fr); width:var(--focus-width); margin-inline:auto; }
.roof-facts { position:relative; min-height:0; }
.roof-facts > span { position:absolute; display:grid; gap:3px; background:var(--ink); color:white; padding:10px 15px; }
.roof-facts > span:first-child { left:0; bottom:10%; }
.roof-facts > span:last-child { right:8%; top:13%; }
.roof-facts b { font-size:clamp(28px,2.75vw,45px); letter-spacing:-.045em; line-height:1; }
.roof-facts span span { font-size:12px; line-height:1.45; }
.roof-copy { position:relative; isolation:isolate; padding:clamp(28px,4.5vh,56px) 0 clamp(28px,4.5vh,56px) clamp(26px,3vw,55px); }
.roof-copy::before { content:""; position:absolute; z-index:-1; inset:0 calc((var(--focus-width) - 100vw) / 2) 0 0; background:rgba(125,29,35,.89); }
.roof-copy .eyebrow, .roof-copy .muted-h2 { color:white; }
.roof-copy .eyebrow { margin-bottom:clamp(15px,2.5vh,28px); }
/* Adjust for the eyebrow's font metrics. */
.roof-copy .eyebrow > span { transform:translateY(-.3em); }
.roof-copy h2 { margin:0 0 19px; color:white; font-size:clamp(36px,3.15vw,57px); line-height:1.12; }
/* Both translations occupy the same grid cell so text wrapping sets one shared height. */
.roof-bilingual { display:grid; }
.roof-bilingual > [lang] { grid-area:1 / 1; min-width:0; visibility:hidden; }
html:lang(zh) .roof-bilingual > [lang="zh-CN"], html:lang(en) .roof-bilingual > [lang="en"] { visibility:visible; }
.roof-description > div { display:flex; flex-direction:column; justify-content:space-evenly; gap:12px; }
.roof-description { font-size:clamp(14px,1vw,17px); line-height:1.76; }
.roof-description p { margin:0; }
.roof-description [lang="zh-CN"] p { font-size:calc(1em + 2px); }
.roof-copy .campus-location {
  display:grid; grid-template-columns:minmax(0,1.24fr) minmax(0,.76fr); align-items:end;
  gap:clamp(15px,1.8vw,30px); margin:clamp(20px,3vh,36px) 0 0;
  translate:0 clamp(-16px,-1vw,-8px);
}
.roof-copy .campus-location .campus-map-frame { max-width:100%; }
.roof-copy .about-values { margin:0; padding:0; border:0; grid-template-columns:1fr; gap:15px; text-align:left; }
.roof-copy .about-values strong { color:white; font-size:clamp(25px,2.22vw,41px); }
.roof-copy .about-values > div > span { color:white; font-size:clamp(12px,.91vw,15px); line-height:1.2; }
@media(min-width:901px) and (max-height:740px) {
  .casebook { padding-block:16px; } .book-heading { margin-bottom:10px; }
  :root { --overview-title-size: clamp(29px, 2.4vw, 39px); }
  .book-summary, .story-copy :is(dd, p) { font-size:14px; line-height:1.58; }
  .story-stage { margin-top:15px; } .book-panel { padding-block:16px; padding-inline:22px; column-gap:24px; }
  .story-copy { --paragraph-gap:9px; --link-gap:9px; }
  .book-tabs { margin-top:6px; }
  .roof-copy { padding-block:18px; } .roof-copy .eyebrow { margin-bottom:12px; }
  .roof-copy h2 { font-size:clamp(32px,2.65vw,44px);margin-bottom:12px; }
  .roof-description {font-size:14px;line-height:1.65} .roof-copy .campus-location {margin-top:15px;}
}
@media(max-width:1100px) and (min-width:901px) {
  :root { --overview-title-size: 29px; }
  .book-mast { gap:15px; } .book-panel { column-gap:16px; padding-inline:18px; }
  .story-copy h3 {font-size:23px;} .story-copy :is(dd, p),.book-summary { font-size:14px; }
}
@media (min-width:901px) and (max-width:1100px) and (min-height:741px) {
  /* Preserve the original aluminum card's centered layout at narrow desktop widths. */
  .story-stage { min-height: 336px; }
  .story-stage:lang(en) { min-height: 359px; }
}
@media(max-width:900px) {
  .engineering-plate:lang(en) { --caption-lines: 3; }
  .casebook { --book-width:calc(100vw - 108px); --slide-width:calc(100vw - 148px); --slide-gap:12px; }
  .book-mast { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
  .book-result {grid-area:1/2;}
  .book-panel {column-gap:18px;padding:17px;} .book-tabs button {padding-inline:11px;}
  .roof-profile {--roof-width:calc(100vw - 56px);} .roof-inner {width:var(--roof-width);} .roof-copy::before {right:-28px;}
}
@media(max-width:700px) {
  .casebook { --slide-width:calc(100vw - clamp(80px,22vw,104px));--slide-gap:6px; }
  .book-inner {width:calc(100% - 36px);} .book-heading {margin-bottom:13px;}
  :root { --overview-title-size: clamp(23px, 5.9vw, 36px); }
  .book-result-space .conversion-legend { font-size: 8px; letter-spacing: .04em; }
  .book-result strong {font-size:clamp(34px,9vw,50px);} .book-result b {max-width:none;font-size:11px;}
  .story-stage { --title-lift:6px; grid-template-rows:auto auto; }
  .book-panel {grid-row:1 / span 2;grid-template-columns:minmax(0,1fr);grid-template-areas:"art" "copy";align-items:start;padding:14px;}
  .engineering-plate { margin-bottom:16px; }
  .story-copy { --paragraph-gap:8px; --link-gap:12px; } .story-copy h3 {font-size:23px;}
  .book-panel:not(#story-aluminum) .story-copy p:lang(en) { font-size:clamp(13px,3.6vw,14px); }
  .plate-media {height:clamp(142px,45vw,250px);padding:4px;}
  .plate-media.aluminum { padding:4px; gap:4px; }
  .engineering-plate figcaption {display:block;font-size:10px;} .engineering-plate small {display:block;}
  .engineering-plate:lang(en) figcaption {min-height:calc(var(--caption-lines) * 1lh);}
  .story-arrow {width:44px;} .story-arrow::after {width:12px;border-width:3px;}
  .book-tabs {width:calc(100% - 24px);text-align:center;} .book-tabs button {padding:8px 9px;font-size:13px;}
  .roof-profile {--roof-window:clamp(180px,47vw,265px);}
  .roof-inner {display:block;width:100%;} .roof-photo {width:100%;height:var(--roof-window);}
  .roof-facts {height:var(--roof-window);}
  .roof-facts > span:first-child {left:6%;bottom:10%;} .roof-facts > span:last-child {right:6%;top:12%;}
  .roof-copy {padding:24px 6vw;} .roof-copy::before {right:0;background:rgba(125,29,35,.92);}
  .roof-copy h2 {font-size:33px;} .roof-copy .campus-location {gap:16px;}
}

/* Each whole arrow fades as it travels; no gradient crosses its stroke. */
.case-arrow-stream {
  position: absolute; top: 50%; left: calc(100% - 4px);
  width: var(--flow-width, 176px); height: var(--arrow-height, 48px);
  transform: translateY(-50%); pointer-events: none;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='48' viewBox='0 0 42 48'%3E%3Cpath d='M9 5 L28 24 L9 43' fill='none' stroke='black' stroke-width='8' stroke-linejoin='miter'/%3E%3C/svg%3E");
}
.case-arrow-stream i {
  position: absolute; inset: 0 auto 0 0;
  width: var(--arrow-width, 42px); height: 100%;
  background: var(--red); opacity: 0;
  mask: var(--chevron) center / 100% 100% no-repeat;
  animation: case-arrow-travel var(--flow-duration, 5600ms) linear infinite;
  animation-delay: var(--arrow-delay, 0ms);
}
.case-arrow-stream i[hidden] { display: none; }
@keyframes case-arrow-travel {
  0% { transform: translateX(0); opacity: 0; }
  8% { opacity: 1; }
  35% { opacity: .72; }
  60% { opacity: .38; }
  85% { opacity: .1; }
  100% { transform: translateX(var(--arrow-travel, 134px)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .case-arrow-stream i {
    animation: none; opacity: var(--still-opacity, .7);
    transform: translateX(var(--still-x, 0px));
  }
}
