/* Designs B and C. Design A is style.css on its own. Each design only re-points tokens and
   overrides what must differ; the pages and the calculator are shared. */

/* shared: which hero graphic shows, system diagrams, the preview switcher */
.art-b, .art-c, .art-d, .art-e, html:not([data-design=a]) .art-a { display: none; }
[data-design=b] .art-b, [data-design=c] .art-c, [data-design=d] .art-d, [data-design=e] .art-e { display: block; }

.flow { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; color: var(--cell); }
.flow svg { width: 44px; height: 44px; flex: none; }
.flow i { flex: 1; border-top: 2px dashed currentColor; opacity: .5; }

/* PREVIEW ONLY: the slow dissolve when a design or colour is picked (site.js adds .slow-vt for its duration) */
html.slow-vt::view-transition-old(root), html.slow-vt::view-transition-new(root) { animation-duration: .9s; animation-timing-function: ease-in-out; }
/* the pickers hold still while pages change, like the header */
.design-switch { view-transition-name: pick-design; }
.accent-switch { view-transition-name: pick-colour; }
html.slow-vt main, html.slow-vt .site-header, html.slow-vt .chat-float, html.slow-vt .sun, html.slow-vt .design-switch { view-transition-name: none; }
/* small floating stacks on the left edge: designs above the middle, accent colours below it */
.design-switch { position: fixed; z-index: 30; left: 8px; bottom: calc(50% + 4px); display: flex; flex-direction: column; gap: .15rem; padding: .4rem .3rem .3rem; background: #111; color: #fff; border-radius: 12px; font: 600 .68rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; text-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); white-space: nowrap; }
.design-switch a { color: #fff; text-decoration: none; padding: .3rem .55rem; border-radius: 8px; font: 500 .74rem system-ui, sans-serif; text-transform: none; letter-spacing: 0; text-align: left; }
.design-switch a[aria-current] { background: #fff; color: #111; font-weight: 700; }

/* ───────── Design B "Daylight": light, friendly, a house diagram that explains solar ───────── */
[data-design=b] {
  --cell: #0e5c45; --cell-deep: #0a3327; --sun: #ffc83d; --paper: #f3f8f5;
  --line: rgba(14, 92, 69, .17); --muted: #4a675d;
  --display: 'Plus Jakarta Sans', system-ui, sans-serif; --body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --r: 24px;
}
[data-design=b] h1 { font-weight: 800; letter-spacing: -.035em; }
[data-design=b] h2 { font-weight: 700; letter-spacing: -.03em; }
[data-design=b] .site-header { background: rgba(255, 255, 255, .93); color: var(--cell-deep); border-bottom: 1px solid var(--line); }
[data-design=b] .brand { color: var(--cell-deep); }
[data-design=b] .site-header nav a { color: var(--muted); }
[data-design=b] .site-header nav a:hover, [data-design=b] .site-header nav a[aria-current] { color: var(--cell-deep); border-color: var(--cell); }
[data-design=b] .hero, [data-design=b] .page-head { background: linear-gradient(#e2f1e8, var(--paper)); color: var(--cell-deep); }
[data-design=b] .hero .lede, [data-design=b] .page-head .lede, [data-design=b] .hero-out { color: var(--muted); }
[data-design=b] .hero-out strong { color: var(--cell); }
[data-design=b] .hero .sun { width: min(46vw, 420px); right: -6%; top: -30%; background: radial-gradient(circle, var(--sun) 0 55%, rgba(255, 200, 61, .35) 55.5% 78%, transparent 78.5%); }
[data-design=b] .page-head .sun { background: radial-gradient(circle, var(--sun) 0 55%, rgba(255, 200, 61, .35) 55.5% 78%, transparent 78.5%); }
[data-design=b] .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 1rem; }
[data-design=b] .hero h1 { max-width: 16ch; }
[data-design=b] .hero .lede { margin-inline: auto; }
[data-design=b] .bill-form { justify-content: center; max-width: 520px; margin-inline: auto; }
[data-design=b] .bill-form label { text-align: center; }
[data-design=b] .hero-art { width: min(600px, 100%); }
[data-design=b] .card { border: 0; box-shadow: 0 1px 2px rgba(10, 51, 39, .06), 0 12px 32px rgba(10, 51, 39, .08); }
[data-design=b] .stats { border-radius: 20px; }
[data-design=b] input[type=text], [data-design=b] input[type=number], [data-design=b] input[type=tel], [data-design=b] input[type=email], [data-design=b] textarea, [data-design=b] .seg span { border-radius: 14px; }

.art-b { width: 100%; height: auto; }
.art-b text { font: 600 13px var(--body); fill: var(--cell-deep); text-anchor: middle; }
.s-sun { fill: var(--sun); }
.s-roof { fill: var(--cell-deep); }
.s-wall { fill: #fff; stroke: var(--cell-deep); stroke-width: 3; }
.s-door { fill: var(--cell); }
.s-win { fill: #d9ecf7; stroke: var(--cell-deep); stroke-width: 3; }
.s-inv { fill: var(--sun); stroke: var(--cell-deep); stroke-width: 3; }
.s-line { fill: none; stroke: var(--cell-deep); stroke-width: 3; stroke-linecap: round; }
.s-flow { fill: none; stroke: var(--cell); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; animation: flow 1s linear infinite; }
.s-flow.from-sun { stroke: #e9a100; }
#house-panels rect { fill: #33574b; stroke: #6f8f84; stroke-width: 1.5; transition: fill .3s; }
#house-panels rect.on { fill: #1f6fd0; stroke: #dbe9ff; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* ───────── Design C "Blueprint": technical drawing, a live bill-and-production chart ───────── */
[data-design=c] {
  --cell: #1746e0; --cell-deep: #0b1a4a; --sun: #ffd23f; --paper: #eef3fc;
  --line: rgba(11, 26, 74, .2); --muted: #44527c;
  --display: 'Space Grotesk', system-ui, sans-serif; --body: 'IBM Plex Sans', system-ui, sans-serif;
  --r: 4px;
}
[data-design=c] h1, [data-design=c] h2 { letter-spacing: -.035em; }
[data-design=c] .site-header { background: var(--cell-deep); backdrop-filter: none; }
[data-design=c] .hero, [data-design=c] .page-head, [data-design=c] .band-dark {
  background-color: var(--cell);
  background-image: linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 32px 32px;
}
[data-design=c] .hero .lede, [data-design=c] .page-head .lede, [data-design=c] .band-dark .lede { color: #dbe4ff; }
[data-design=c] .hero .sun, [data-design=c] .page-head .sun { background: none; border: 2px dashed var(--sun); opacity: .8; }
[data-design=c] .hero .sun { width: min(40vw, 380px); right: -8%; top: -48%; }
[data-design=c] .btn, [data-design=c] input[type=text], [data-design=c] input[type=number], [data-design=c] input[type=tel], [data-design=c] input[type=email], [data-design=c] textarea, [data-design=c] .seg span { border-radius: 4px; }
[data-design=c] .card, [data-design=c] .sheet, [data-design=c] .stats { border: 2px solid var(--cell-deep); box-shadow: 6px 6px 0 var(--cell); }
[data-design=c] .stats { background: var(--cell-deep); }
[data-design=c] .steps li { border-top-style: dashed; }
@media (min-width: 861px) { [data-design=c] .hero-art { order: -1; } [data-design=c] .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 3rem; } }

.art-c { background: #fff; color: var(--cell-deep); border: 2px solid var(--cell-deep); box-shadow: 8px 8px 0 var(--sun); padding: 1.25rem; }
.art-c svg { width: 100%; height: auto; display: block; }
.art-c text { font: 500 12px var(--body); fill: var(--muted); }
.c-prod { fill: var(--sun); stroke: var(--cell-deep); stroke-width: 2; }
.c-use { fill: none; stroke: var(--cell); stroke-width: 3; stroke-dasharray: 6 6; }
.c-axis { stroke: var(--cell-deep); stroke-width: 2; }
.c-legend { display: flex; gap: 1.25rem; font-size: .85rem; color: var(--muted); margin: .25rem 0 1rem; }
.c-legend span::before { content: ''; display: inline-block; width: 14px; height: 10px; margin-right: .4rem; background: var(--sun); border: 1.5px solid var(--cell-deep); }
.c-legend span + span::before { height: 0; border: 0; border-top: 3px dashed var(--cell); vertical-align: middle; background: none; }
.c-bars { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem .75rem; align-items: center; font-size: .95rem; }
.c-bars b { font: 700 1.1rem var(--display); font-variant-numeric: tabular-nums; }
.c-bars i { display: block; height: 18px; background: var(--cell-deep); transition: width .4s ease-out; min-width: 3px; }
.c-bars i.after { background: var(--sun); outline: 2px solid var(--cell-deep); outline-offset: -2px; }

/* ───────── Design D "Sunburst": the whole hero is the sun, heavy type, a bill meter ───────── */
[data-design=d] {
  --cell: #161616; --cell-deep: #0d0d0d; --sun: #ffc400; --paper: #faf9f5;
  --line: rgba(13, 13, 13, .2); --muted: #4f4b40;
  --display: 'Syne', system-ui, sans-serif; --body: 'DM Sans', system-ui, sans-serif;
  --r: 0px;
}
[data-design=d] h1 { font-weight: 800; text-transform: uppercase; letter-spacing: -.03em; line-height: .98; font-size: clamp(1.9rem, 6.4vw, 5rem); }
[data-design=d] .page-head h1 { font-size: clamp(1.3rem, 5vw, 3.75rem); max-width: 18ch; }
[data-design=d] h2 { font-weight: 800; letter-spacing: -.03em; }
[data-design=d] h3 { font-weight: 700; }
[data-design=d] .site-header { background: var(--cell-deep); backdrop-filter: none; }
[data-design=d] .hero, [data-design=d] .page-head { background: var(--sun); color: var(--cell-deep); }
[data-design=d] .hero .lede, [data-design=d] .page-head .lede, [data-design=d] .hero-out { color: #3a3212; }
[data-design=d] .hero-out strong { color: var(--cell-deep); }
[data-design=d] .hero .sun { background: #ffb000; right: -10%; top: -20%; width: min(64vw, 680px); }
[data-design=d] .page-head .sun { background: #ffb000; }
[data-design=d] .hero .btn-sun { background: var(--cell-deep); color: #fff; }
[data-design=d] .hero .btn-sun:hover { background: #333; }
[data-design=d] .hero input { border: 3px solid var(--cell-deep); }
[data-design=d] .btn, [data-design=d] input[type=text], [data-design=d] input[type=number], [data-design=d] input[type=tel], [data-design=d] input[type=email], [data-design=d] textarea, [data-design=d] .seg span { border-radius: 0; }
[data-design=d] .card, [data-design=d] .sheet, [data-design=d] .stats { border: 3px solid var(--cell-deep); }
[data-design=d] .stats { background: var(--cell-deep); gap: 3px; }
[data-design=d] .steps li::before { color: var(--sun); }
/* yellow focus rings vanish on a yellow hero */
[data-design=d] :focus-visible { outline-color: var(--cell-deep); }
[data-design=d] :is(.site-header, .band-dark, .site-footer) :focus-visible { outline-color: var(--sun); }

.art-d { text-align: center; color: var(--cell-deep); }
.art-d svg { width: min(400px, 100%); height: auto; }
.art-d p { margin: .5rem auto 0; font-size: 1.1rem; font-weight: 500; }
.art-d p b { font: 800 1.5rem var(--display); }
.d-ticks { fill: none; stroke: var(--cell-deep); stroke-width: 10; stroke-dasharray: .35 1.65; }
.d-track { fill: #fff; stroke: rgba(13, 13, 13, .16); stroke-width: 30; }
.d-arc { fill: none; stroke: var(--cell-deep); stroke-width: 30; stroke-dasharray: 0 100; transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1); }
#d-pct { font: 800 58px var(--display); text-anchor: middle; fill: var(--cell-deep); letter-spacing: -.04em; }
.d-sub { font: 500 15px var(--body); text-anchor: middle; fill: var(--muted); }

/* ───────── Design E "Daybreak": morning street, rooftop panels light up with the bill ───────── */
[data-design=e] {
  --cell: #2a1f6b; --cell-deep: #140e36; --sun: #ffc233; --paper: #faf6f1;
  --line: rgba(42, 31, 107, .17); --muted: #554e78;
  --display: 'Plus Jakarta Sans', system-ui, sans-serif; --body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --r: 10px;
}
/* PREVIEW ONLY: accent options for comparing. Keep the chosen colour in --sun above and delete these. */
[data-design=e][data-accent=orange] { --sun: #ff8a4c; }
[data-design=e][data-accent=pink] { --sun: #ff7aa2; }
[data-design=e][data-accent=mint] { --sun: #4fd8a8; }
[data-design=e][data-accent=sky] { --sun: #4db8ff; }
.accent-switch { bottom: auto; top: calc(50% + 4px); }
html:not([data-design=e]) .accent-switch { display: none; }
.accent-switch a::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--dot); margin-right: .4rem; outline: 1px solid rgba(127, 127, 127, .6); }
[data-design=e] h1 { font-weight: 800; letter-spacing: -.035em; line-height: 1.04; }
[data-design=e] h2 { font-weight: 700; letter-spacing: -.03em; }
[data-design=e] .site-header { background: rgba(20, 14, 54, .94); }
[data-design=e] .hero { background: linear-gradient(var(--paper), color-mix(in srgb, var(--sun) 18%, var(--paper)) 55%, color-mix(in srgb, var(--sun) 45%, #fff)); color: var(--cell-deep); padding: clamp(2rem, 4vw, 3.5rem) 0 0; }
[data-design=e] .page-head { background: linear-gradient(120deg, var(--cell-deep), var(--cell) 70%, #7a3f78); }
/* same sun as Daylight, in the accent colour */
[data-design=e] .hero .sun, [data-design=e] .page-head .sun { --w: clamp(170px, 46vw, 420px); width: var(--w); right: calc(var(--w) * -.25); top: calc(var(--w) * -.45); background: radial-gradient(circle, var(--sun) 0 55%, color-mix(in srgb, var(--sun) 35%, transparent) 55.5% 78%, transparent 78.5%); }
/* inner pages carry the same sun; its halo is a solid pale tint there because a see-through one turns muddy on the dark banner */
[data-design=e] .page-head .sun { bottom: auto; background: radial-gradient(circle, var(--sun) 0 55%, color-mix(in srgb, var(--sun) 35%, var(--paper)) 55.5% 78%, transparent 78.5%); }
[data-design=e] .page-head .lede { max-width: 52ch; } /* stays clear of the sun */
[data-design=e] .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
[data-design=e] .hero h1 { max-width: 18ch; }
[data-design=e] .page-head .lede, [data-design=e] .band-dark .lede { color: #d6d0f0; }
[data-design=e] .hero .lede, [data-design=e] .hero-out { color: var(--muted); }
[data-design=e] .hero-out strong { color: var(--cell); }
[data-design=e] .bill-form { max-width: 560px; }
[data-design=e] .mission-pill { background: var(--cell-deep); color: #fff; border-color: transparent; }
[data-design=e] .mission-pill:hover { background: var(--cell); }
[data-design=e] .btn { border-radius: 10px; }
[data-design=e] .stats .big dd { color: color-mix(in srgb, var(--sun) 60%, #fff); }
[data-design=e] .btn-sun:hover { background: color-mix(in srgb, var(--sun) 80%, #fff); }
/* system diagrams: power runs along the wires; hovering a card speeds it up and lights each part in turn */
[data-design=e] .flow i { border: 0; height: 3px; opacity: .55; background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 14px); background-size: 14px 100%; animation: wire .9s linear infinite; }
[data-design=e] .flow, [data-design=e] .flow svg { transition: color .3s; }
[data-design=e] .pack:hover .flow { color: color-mix(in srgb, var(--sun) 72%, #000); } /* the plain accent is too faint on a white card */
[data-design=e] .pack:hover .flow i { opacity: 1; animation-duration: .35s; }
[data-design=e] .pack:hover .flow svg { animation: part 1.2s ease-in-out infinite; }
[data-design=e] .pack:hover .flow svg:nth-child(3) { animation-delay: .15s; }
[data-design=e] .pack:hover .flow svg:nth-child(5) { animation-delay: .3s; }
[data-design=e] .pack:hover .flow svg:nth-child(7) { animation-delay: .45s; }
@keyframes wire { to { background-position: 14px 0; } }
@keyframes part { 30% { transform: translateY(-5px) scale(1.14); } 60% { transform: none; } }

/* the banner fills the first screen exactly: text centred in the sky, street on the bottom edge.
   Sizes follow the screen height (svh) so it still fits on short windows. */
[data-design=e] .hero { min-height: calc(100svh - var(--header-h, 70px)); display: flex; flex-direction: column; padding-top: clamp(1rem, 4svh, 3.5rem); }
[data-design=e] .hero-grid { flex: 1; grid-template-rows: 1fr auto; }
[data-design=e] .hero-grid > div:first-child { align-self: center; padding-bottom: clamp(.5rem, 2svh, 1.5rem); }
[data-design=e] .hero h1 { font-size: clamp(1.8rem, min(6vw, 7.5svh), 4.4rem); margin-bottom: .25em; }
@media (min-width: 1000px) and (max-height: 700px) { [data-design=e] .hero h1 { max-width: none; } } /* one line on short, wide windows */
[data-design=e] .hero .lede { font-size: clamp(1rem, 2.6svh, 1.2rem); margin-bottom: clamp(.3rem, 1.6svh, 1rem); }
[data-design=e] .bill-form { margin-top: clamp(.5rem, 2.2svh, 1.75rem); }
[data-design=e] .hero-out { margin: clamp(.4rem, 1.6svh, 1.1rem) 0 0; min-height: 0; }
[data-design=e] .hero-art { display: flex; justify-content: center; align-self: end; }
.art-e { height: clamp(70px, 18svh, 190px); aspect-ratio: 1100 / 190; flex: none; overflow: visible; } /* sized by height; the ground runs past both edges */
/* shorter screens drop extras in steps so the street always sits on the bottom edge (checked by test.html at many sizes) */
@media (max-height: 820px), (max-width: 860px) { [data-design=e] .hero-note { display: none; } }
@media (max-height: 760px), (max-width: 860px) and (max-height: 820px) { [data-design=e] .hero .lede .more { display: none; } }
@media (max-height: 620px) { [data-design=e] .hero .chips { display: none; } }
@media (max-width: 860px) {
  [data-design=e] .hero { padding-top: 2.2rem; }
  [data-design=e] .page-head { padding-top: 4.4rem; } /* long headings would otherwise run into the sun */
  [data-design=e] .hero .sun, [data-design=e] .page-head .sun { top: calc(var(--w) * -.55); } /* top right corner, high enough to clear the heading */
  [data-design=e] .hero .chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; } /* one row, no swiping */
  [data-design=e] .hero .chips button { padding: .35rem 0; font-size: .85rem; }
  .art-e { height: clamp(70px, 15svh, 190px); }
}
@media (max-width: 360px) and (max-height: 600px) { /* tiny phones (iPhone SE 1st gen): headline, bill field, result, street */
  [data-design=e] .hero .lede { display: none; }
  [data-design=e] .bill-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 420px) { /* narrow phones: smaller result text so it wraps to fewer lines */
  [data-design=e] .hero-out { font-size: .95rem; }
  [data-design=e] .hero-out strong { font-size: 1.15rem; }
}
/* short phones: drop the extras so headline, bill field, result and houses all fit */
@media (max-width: 860px) and (max-height: 700px) { [data-design=e] .hero .chips, [data-design=e] .hero .lede .more { display: none; } }
/* street: two-tone houses with roof panels, trees, a far hill, pavement and a road */
.e-hill { fill: color-mix(in srgb, var(--sun) 60%, #fff); }
.e-wall { fill: var(--cell); }
.e-wall.alt { fill: color-mix(in srgb, var(--cell) 82%, #fff); }
.e-roof, .e-door, .e-ground { fill: var(--cell-deep); }
.e-tree { fill: color-mix(in srgb, var(--cell) 62%, #fff); }
.e-win { fill: #dce8ff; }
.e-bar { fill: none; stroke: var(--cell-deep); stroke-width: 1.5; opacity: .75; }
.e-walk { fill: color-mix(in srgb, var(--cell) 70%, #fff); }
.e-road { fill: none; stroke: color-mix(in srgb, var(--cell) 45%, #fff); stroke-width: 2.5; stroke-dasharray: 20 16; }

@media print, (max-width: 860px) { .design-switch { display: none !important; } } /* preview pickers are desktop only */
/* roof panels: dark blue cells in a silver frame, faint until the bill "installs" them */
.e-panel { opacity: .14; transition: opacity .4s, filter .4s; }
.e-panel rect { fill: #1b3d8c; stroke: #e8eefb; stroke-width: 1.6; }
.e-cell { fill: none; stroke: #7096e2; stroke-width: .8; }
.e-shine { fill: #fff; opacity: .2; }
.e-panel.on { opacity: 1; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--sun) 90%, transparent)); }
