/* In-depth sections of /infinity/ (build_infinity_details.py): flat blocks between the scroll scenes, above the
   fixed 3D stage. Night blocks are black with the laser green; day blocks are paper with the storefront green. */
.d-block { position: relative; z-index: 3; padding-block: clamp(84px, 10vw, 140px); scroll-margin-top: var(--nav-h); }
.d-qa { scroll-margin-top: calc(var(--nav-h) + 20px); }
.d-night { background: var(--black); color: var(--white); --d-accent: var(--laser); --d-soft: var(--soft); --d-line: rgba(255, 255, 255, .14); --d-panel: #0f1110; }
.d-day { background: var(--paper); color: var(--ink); --d-accent: var(--green); --d-soft: var(--muted); --d-line: var(--line); --d-panel: var(--white); }
.d-wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.d-eyebrow { margin: 0 0 14px; color: var(--d-accent); font: 600 .8rem/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
/* Headings follow the story's type (.infinity-story h2) but sit left-aligned in the reading column. */
.infinity-story .d-block .d-title { margin: 0; max-width: 18ch; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.04; }
.infinity-story .d-block h3, .infinity-story .d-dialog h3 { letter-spacing: -.02em; font-synthesis: none; }
.d-lead { margin: 22px 0 0; max-width: 62ch; color: var(--d-soft); font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.5; }
.d-note { margin: 28px 0 0; max-width: 80ch; color: var(--d-soft); font-size: .86rem; }
.d-points { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.d-points li { position: relative; padding-left: 22px; }
.d-points li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--d-accent); }
.d-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0b0b0b; }

/* ---------- highlights: large film cards in a horizontal rail, one plays at a time */
.d-rail { display: flex; gap: 22px; margin: 48px 0 0; padding: 0 max(var(--gut-l), calc((100vw - 1240px) / 2)); list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.d-rail::-webkit-scrollbar { display: none; }
.d-film { flex: 0 0 min(86vw, 1100px, (100vh - var(--nav-h) - 230px) * 16 / 9); scroll-snap-align: center; border-radius: 26px; overflow: hidden; background: #0b0b0b; opacity: .42; transition: opacity .5s; cursor: pointer; }
.d-film.is-current { opacity: 1; cursor: default; }
.d-film-media { aspect-ratio: 16 / 9; }
.d-film-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 40px; align-items: start; padding: 26px 32px 30px; }
.d-film-copy h3 { margin: 0; font: 600 clamp(1.35rem, 2.4vw, 1.9rem)/1.15 var(--font-heading); }
.d-film-copy p { margin: 0; color: var(--soft); }
.d-film-copy .d-more { grid-column: 2; }
.d-more { color: var(--d-accent); font-weight: 600; text-decoration: none; }
.d-more:hover { text-decoration: underline; }
.d-rail-controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; }
.d-paddle, .d-playpause { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #1c1f1d; color: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.d-paddle:hover, .d-playpause:hover { background: #2a2e2b; }
.d-dots { display: flex; gap: 10px; padding: 0 14px; height: 44px; align-items: center; border-radius: 22px; background: #1c1f1d; }
.d-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: #6b706c; cursor: pointer; transition: width .3s, background .3s; }
.d-dots button[aria-selected="true"] { width: 34px; background: var(--white); }
.d-playpause span { display: block; width: 12px; height: 14px; margin: auto; border-inline: 4px solid var(--white); }
.d-playpause.is-paused span { width: 0; height: 0; border: 0; border-left: 13px solid var(--white); border-block: 8px solid transparent; margin-left: 17px; }

/* ---------- will it fit: CAD fronts to scale beside a door, the customer's own wall */
.d-fit-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(28px, 4vw, 64px); margin-top: 48px; align-items: stretch; }
.d-fit-stage { position: relative; min-height: 460px; border-radius: 26px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.d-fit-drawing { position: absolute; inset: 40px 28px 34px 28px; display: flex; align-items: flex-end; gap: 48px; border-bottom: 2px solid #c9ccc4; }
.d-door { flex: none; position: relative; border: 2px dashed #b7bdb4; border-bottom: 0; border-radius: 4px 4px 0 0; }
.d-door span { position: absolute; top: 10px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: .72rem; }
.d-towers { position: relative; display: flex; align-items: flex-end; }
.d-towers img { display: block; object-fit: fill; filter: drop-shadow(0 10px 14px rgba(17, 24, 20, .12)); }
/* Height line on the left side of the main tower. */
.d-dim { position: absolute; left: -16px; bottom: 0; width: 1px; background: var(--ink); }
.d-dim::before, .d-dim::after { content: ''; position: absolute; left: -5px; width: 11px; height: 1px; background: var(--ink); }
.d-dim::before { top: 0; } .d-dim::after { bottom: 0; }
.d-dim span { position: absolute; top: 50%; left: -12px; transform: translate(-50%, -50%) rotate(-90deg); font-size: .72rem; white-space: nowrap; }
.d-fit-panel { display: flex; flex-direction: column; }
.d-label { margin: 0 0 10px; font-weight: 600; }
.d-stepper { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.d-stepper button { height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); font: 600 1rem var(--font-body); cursor: pointer; }
.d-stepper button[aria-checked="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.d-fit-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 22px 0 26px; border-radius: 16px; overflow: hidden; background: var(--line); }
.d-fit-facts div { padding: 14px 16px; background: var(--white); }
.d-fit-facts dt { color: var(--muted); font-size: .8rem; }
.d-fit-facts dd { margin: 3px 0 0; font-weight: 600; }
.d-room { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-room label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.d-room input { width: 100%; min-width: 0; box-sizing: border-box; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); font: 500 1rem var(--font-body); }
.d-verdict { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: #e7eae2; font-size: .95rem; }
.d-verdict[data-state="ok"] { background: #dcefe2; color: #0a4a2e; }
.d-verdict[data-state="no"] { background: #f6e1dd; color: #7d2a22; }
.d-verdict[data-state="maybe"] { background: #f5ecd6; color: #6b4a0c; }
.d-fit-panel .d-note { margin-top: 14px; }

/* ---------- features and tabs: film or clip beside the text */
.d-feature-grid, .d-tabs-grid { display: grid; gap: clamp(28px, 4vw, 64px); margin-top: 48px; align-items: start; }
.d-feature-grid.has-media, .d-tabs-grid:has(.d-feature-media) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.d-feature-media { aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #0b0b0b; }
.d-day .d-feature-media { background: #e3e5de; }
.d-feature-copy p, .d-tabpanel p { margin: 0 0 14px; max-width: 60ch; }
.d-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 40px; }
.d-tile { padding: 24px 22px; border-radius: 20px; background: var(--d-panel); border: 1px solid var(--d-line); }
.d-tile strong { display: block; color: var(--d-accent); font: 600 clamp(1.8rem, 3.2vw, 2.5rem)/1 var(--font-heading); }
.d-tile span { display: block; margin-top: 8px; font-weight: 600; }
.d-tile p { margin: 8px 0 0; color: var(--d-soft); font-size: .92rem; }
.d-tabpanel .d-tiles { margin-top: 22px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.d-tablist { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; margin-bottom: 26px; border-radius: 999px; background: var(--d-panel); border: 1px solid var(--d-line); width: fit-content; max-width: 100%; }
.d-tablist button { padding: 10px 18px; border: 0; border-radius: 999px; background: none; color: inherit; font: 600 .92rem var(--font-body); cursor: pointer; }
.d-tablist button[aria-selected="true"] { background: var(--d-accent); color: var(--black); }
.d-day .d-tablist button[aria-selected="true"] { color: var(--white); }
.d-tabpanel h3 { margin: 0 0 14px; font: 600 1.6rem/1.2 var(--font-heading); }

/* ---------- cards: a rail of short facts that open into the full explanation */
.d-card-rail { display: flex; gap: 18px; margin: 48px 0 0; padding: 0 max(var(--gut-l), calc((100vw - 1240px) / 2)) 8px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.d-card-rail::-webkit-scrollbar { display: none; }
.d-card { flex: 0 0 clamp(270px, 28vw, 340px); scroll-snap-align: start; }
.d-card-open { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 360px; padding: 30px 28px 80px; border: 1px solid var(--d-line); border-radius: 26px; background: var(--d-panel); color: inherit; text-align: left; font: inherit; cursor: pointer; transition: transform .25s; }
.d-card-open:hover { transform: translateY(-3px); }
.d-card-kicker { color: var(--d-accent); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.d-card-open h3 { margin: 14px 0 12px; font: 600 1.55rem/1.15 var(--font-heading); }
.d-card-open p { margin: 0; color: var(--d-soft); }
.d-card-plus { position: absolute; right: 22px; bottom: 22px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--d-accent); color: var(--black); font-size: 1.5rem; line-height: 1; }
.d-day .d-card-plus { color: var(--white); }
.d-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 26px; background: var(--white); color: var(--ink); }
.d-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.d-dialog-body { padding: clamp(30px, 5vw, 56px); --d-accent: var(--green); --d-soft: var(--muted); }
.infinity-story .d-dialog-body .d-title { margin: 0; max-width: 20ch; font: 500 clamp(1.8rem, 4vw, 2.6rem)/1.1 var(--font-heading); }
.d-dialog-body p { margin: 16px 0 0; }
.d-dialog-close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #e7eae2; color: var(--ink); font-size: 1.5rem; cursor: pointer; z-index: 1; }

/* ---------- data sheet and FAQ */
.d-sheet { margin-top: 14px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); }
.d-sheet:first-of-type { margin-top: 44px; }
.d-sheet summary, .d-qa summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 26px; cursor: pointer; list-style: none; }
.d-sheet summary::-webkit-details-marker, .d-qa summary::-webkit-details-marker { display: none; }
.d-sheet summary::after, .d-qa summary::after { content: '+'; flex: none; color: var(--green); font-size: 1.6rem; line-height: 1; transition: transform .25s; }
.d-sheet[open] summary::after, .d-qa[open] summary::after { transform: rotate(45deg); }
.d-sheet h3 { margin: 0; font: 600 1.35rem/1.2 var(--font-heading); }
.d-sheet table { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.d-sheet th, .d-sheet td { padding: 12px 26px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .95rem; }
.d-sheet th { width: 42%; color: var(--muted); font-weight: 500; }
.d-faq-tools { display: grid; gap: 16px; margin: 40px 0 24px; }
.d-faq-tools input { height: 54px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: 500 1.05rem var(--font-body); max-width: 560px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.d-chips button { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: 600 .88rem var(--font-body); cursor: pointer; }
.d-chips button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.d-faq-group { margin-top: 40px; }
.d-faq-group > h3 { margin: 0 0 12px; font: 600 1.6rem/1.2 var(--font-heading); }
.d-qa { border-top: 1px solid var(--line); }
.d-qa:last-child { border-bottom: 1px solid var(--line); }
.d-qa summary { padding: 20px 4px; }
.d-qa h4 { margin: 0; font: 600 1.08rem/1.35 var(--font-body); }
.d-answer { padding: 0 4px 20px; max-width: 75ch; }
.d-answer p { margin: 0 0 12px; color: #2f3a33; }
.d-faq-empty { margin-top: 30px; color: var(--muted); }

@media (max-width: 860px) {
  .d-fit-grid, .d-feature-grid.has-media, .d-tabs-grid:has(.d-feature-media) { grid-template-columns: 1fr; }
  .d-fit-stage { min-height: 380px; }
  .d-film-copy { grid-template-columns: 1fr; padding: 22px 22px 26px; }
  .d-film-copy .d-more { grid-column: 1; }
}
@media (max-aspect-ratio: 4/5) {
  .d-film { flex-basis: min(82vw, 520px); }
  .d-film-media { aspect-ratio: 9 / 16; max-height: 68vh; }
}
@media (max-width: 600px) {
  .d-film { border-radius: 20px; }
  .d-stepper { grid-template-columns: repeat(4, 1fr); }
  .d-fit-drawing { inset: 34px 16px 28px 16px; }
  .d-room { grid-template-columns: 1fr; }
  .d-sheet th, .d-sheet td { display: block; width: auto; padding: 4px 20px; border: 0; }
  .d-sheet th { padding-top: 12px; border-top: 1px solid var(--line); }
  .d-sheet summary { padding: 18px 20px; }
  .d-tablist { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .d-film, .d-card-open, .d-dots button { transition: none; } }

/* ---------- will it fit: the required space between the two towers */
.d-gap { position: relative; align-self: stretch; flex: none; }
.d-gap::before { content: ''; position: absolute; left: 0; right: 0; bottom: 34%; border-top: 1px solid var(--green); }
.d-gap::after { content: ''; position: absolute; left: 0; right: 0; bottom: calc(34% - 5px); height: 11px; border-inline: 1px solid var(--green); }
.d-gap span { position: absolute; left: 50%; bottom: calc(34% + 8px); transform: translateX(-50%); color: var(--green); font-size: .7rem; font-weight: 600; white-space: nowrap; }

/* ---------- frequency regulation: FCR-D capacity at 0.5C and 0.8C */
.d-chart { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin: 56px 0 0; padding: clamp(26px, 4vw, 44px); border-radius: 26px; background: var(--d-panel); border: 1px solid var(--d-line); }
.d-chart h3 { margin: 0; font: 500 clamp(1.7rem, 3.2vw, 2.6rem)/1.1 var(--font-heading); letter-spacing: -.03em; }
.d-chart-copy p { margin: 16px 0 0; color: var(--d-soft); }
.d-chart figcaption { grid-column: 1 / -1; margin-top: 0; }
.d-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; font-size: .86rem; }
.d-legend span[class^="d-key"] { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; }
.d-key-a { background: #5b625d; } .d-key-b { background: var(--d-accent); }
.d-unit { margin-left: auto; color: var(--d-soft); }
.d-chart-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.d-bar-a { fill: #5b625d; } .d-bar-b { fill: var(--d-accent); }
.d-bar-v { fill: currentColor; font-size: 15px; font-weight: 600; text-anchor: middle; }
.d-bar-x { fill: var(--d-soft); font-size: 14px; text-anchor: middle; }
.d-bar-base { stroke: var(--d-line); }
.d-bar-cap { stroke: var(--d-soft); stroke-dasharray: 5 5; }
.d-bar-capt { fill: var(--d-soft); font-size: 12px; }
@media (max-width: 860px) { .d-chart { grid-template-columns: 1fr; } }

/* ---------- backup wiring diagram */
.d-wiring-wrap { aspect-ratio: auto; display: grid; gap: 16px; padding: clamp(16px, 3vw, 28px); background: var(--d-panel) !important; border: 1px solid var(--d-line); }
.d-wiring { display: block; width: 100%; height: auto; font-family: var(--font-body); }
.d-wiring .w-t { fill: var(--d-soft); font-size: 14px; } .d-wiring .w-t.s { font-size: 12px; } .d-wiring .w-t.b { fill: currentColor; font-weight: 600; } .d-wiring .w-t.g { fill: var(--d-accent); font-weight: 600; }
.d-wiring .w-pylon { stroke: var(--d-soft); stroke-width: 2.5; fill: none; }
.d-wiring .w-box { fill: none; stroke: var(--d-line); stroke-width: 2; }
.d-wiring .w-brk { fill: #3b413d; transition: fill .5s; } .d-wiring .w-brk-b { fill: var(--d-accent); }
.d-wiring .w-sep { stroke: var(--d-accent); stroke-dasharray: 4 4; }
.d-wiring .w-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .5s, opacity .5s; }
.d-wiring .w-grid-line, .d-wiring .w-house-line { stroke: var(--amber); stroke-dasharray: 8 8; animation: w-flow 1s linear infinite; }
.d-wiring .w-eps { stroke: var(--d-accent); stroke-dasharray: 8 8; animation: w-flow 1s linear infinite; }
.d-wiring .w-hl { fill: var(--amber); transition: fill .5s, opacity .5s; }
.d-wiring .w-load { fill: var(--d-accent); }
.d-wiring .w-inf rect { fill: #f3f3ef; } .d-wiring .w-inf circle { fill: #0b0b0b; stroke: var(--d-accent); stroke-width: 2; } .d-wiring .w-inf path { stroke: #c9ccc6; }
.d-wiring .w-cut { stroke: var(--alert); stroke-width: 4; stroke-linecap: round; opacity: 0; transition: opacity .4s; }
.d-wiring .w-opt { opacity: 0; transition: opacity .4s; }
.d-wiring-wrap[data-wiring-state="a"] .w-opt-a, .d-wiring-wrap[data-wiring-state="b"] .w-opt-b { opacity: 1; }
.d-wiring-wrap.is-out .w-grid-line, .d-wiring-wrap.is-out .w-house-line { stroke: #5b625d; animation: none; opacity: .5; }
.d-wiring-wrap.is-out .w-hl { fill: #3b413d; }
.d-wiring-wrap.is-out .w-cut { opacity: 1; }
@keyframes w-flow { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .d-wiring .w-line { animation: none; } }
.d-wiring-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.d-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--d-line); }
.d-seg button, .d-outage { border: 0; border-radius: 999px; padding: 8px 14px; background: none; color: inherit; font: 500 .86rem var(--font-body); cursor: pointer; }
.d-seg button[aria-checked="true"] { background: var(--d-accent); color: var(--black); }
.d-outage { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--d-line); }
.d-outage i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.d-outage[aria-pressed="true"] i { background: var(--alert); }
