:root {
  color-scheme: light dark;
  scrollbar-gutter: stable;
  --light-background: #f3f2ed;
  --light-text: #181825;
  --light-accent: #4e36b6;
  --dark-background: #12121a;
  --dark-text: #f1f0f8;
  --dark-accent: #c2b3ff;
  --background: var(--light-background);
  --text: var(--light-text);
  --accent: var(--light-accent);
  --muted: var(--light-muted, #53515f);
  --line: #b6b3c0;
  --diagram: #e6dff8;
  --on-accent: var(--light-on-accent, #fff);
  --font: "Instrument Sans", "Segoe UI", Arial, sans-serif;
  --heading: "Bricolage Grotesque", "Inter", "Segoe UI", Arial, sans-serif;
  --hero-title-size-base: clamp(3.2rem, 7.3vw, 7.4rem);
  --gutter: clamp(1.1rem, 4vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: var(--dark-background);
    --text: var(--dark-text);
    --accent: var(--dark-accent);
    --muted: var(--dark-muted, #bbb8cc);
    --line: #514e60;
    --diagram: #282039;
    --on-accent: var(--dark-on-accent, #1b1233);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .js-control, .owner-only { display: none !important; }
.site-enhanced .js-control:not([hidden]) { display: inline-flex !important; }
.site-enhanced .no-js-detail { display: none; }
.config-mode .owner-only:not([hidden]) { display: flex !important; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 1rem/1.56 var(--font);
}

button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .62; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: #7763d94d; }
img, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
[data-edit] { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--heading); font-weight: 760; line-height: 1.02; }
h2 { font-size: clamp(2.15rem, 4.55vw, 4.2rem); letter-spacing: -.065em; }
h3 { font-size: clamp(1.25rem, 2.1vw, 1.85rem); letter-spacing: -.045em; }

.shell { width: min(calc(100% - 2 * var(--gutter)), 82rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; inset: .6rem auto auto .6rem; padding: .65rem 1rem; background: var(--text); color: var(--background); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header { min-height: 5.2rem; border-bottom: 1px solid var(--line); position: relative; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font: 760 clamp(1.05rem, 2.2vw, 1.45rem)/1 var(--heading); letter-spacing: -.055em; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; gap: 2px; padding-inline: 3px; color: var(--accent); }
.brand-mark i { width: 6px; height: 17px; background: currentColor; transform: skewX(-27deg) skewY(-13deg); }
.site-header nav, .site-footer nav { display: flex; align-items: center; gap: clamp(.85rem, 3.2vw, 2.85rem); }
.site-header nav a, .site-footer nav a { font-weight: 650; font-size: .94rem; text-decoration: none; }
.site-header nav .nav-contact { padding: .68rem .95rem; background: var(--text); color: var(--background); display: inline-flex; gap: .75rem; }
.site-enhanced .menu-toggle:not([hidden]) { display: none !important; }
.menu-toggle { align-items: center; gap: .55rem; min-height: 2.75rem; padding: .48rem .7rem; border: 1px solid var(--muted); background: var(--background); font-weight: 700; }
.menu-toggle span { width: .85rem; height: .48rem; border-block: 1px solid currentColor; }

.hero { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(1.9rem, 4.5vw, 4.5rem); align-items: center; padding-block: clamp(1.6rem, 4vw, 3.6rem) clamp(2.3rem, 5.3vw, 4.8rem); }
.hero-copy { padding-bottom: 1rem; min-width: 0; }
.hero h1 { color: var(--accent); font-size: var(--hero-title-size-base); letter-spacing: -.06em; line-height: .92; white-space: pre-line; overflow-wrap: anywhere; }
.hero h1::first-line { color: var(--text); }
.hero-copy p { margin-block: 1.65rem 1.8rem; max-width: 30ch; font-size: clamp(1.04rem, 1.7vw, 1.38rem); line-height: 1.38; }
.button { display: inline-flex; gap: 1.15rem; align-items: center; justify-content: center; min-height: 3rem; padding: .65rem 1rem; background: var(--accent); color: var(--on-accent); border: 1px solid transparent; text-decoration: none; font-size: .95rem; font-weight: 720; }
.button span, .nav-contact span { font-size: 1.12em; }
.hero-figure { min-width: 0; }
.hero-art {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1.36;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 47%, #23204a 0%, #111126 55%, #0a0a19 100%);
}
.hero-poster, #hero-canvas-host { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-poster { object-fit: cover; }
.hero-art[data-custom-size] .hero-poster { object-fit: contain; }
#hero-canvas-host { visibility: hidden; pointer-events: none; }
#hero-canvas-host canvas { width: 100%; height: 100%; }
.has-3d #hero-canvas-host { visibility: visible; }
.has-3d .hero-poster { visibility: hidden; }
figcaption { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.75rem; margin-top: .25rem; color: var(--muted); font-size: .8rem; font-weight: 660; }
.caption-mark { display: inline-block; width: .6rem; height: .6rem; border: 1px solid var(--accent); border-radius: 50%; margin-right: .3rem; }
.hero-motion { min-height: 2.75rem; padding: .25rem .6rem; background: transparent; border: 1px solid var(--muted); color: var(--text); font-size: .8rem; font-weight: 660; }

.section { border-top: 1px solid var(--line); padding-block: clamp(1.8rem, 4.6vw, 4rem) clamp(3.2rem, 7vw, 6.4rem); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1.15rem; margin-bottom: clamp(1.4rem, 3.5vw, 2.9rem); }
.layout-control { align-items: stretch; border: 1px solid var(--muted); }
.layout-control button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-width: 4.65rem; min-height: 2.65rem; padding: .4rem .68rem; border: 0; background: transparent; font-size: .84rem; font-weight: 700; }
.layout-control button + button { border-left: 1px solid var(--line); }
.layout-control button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 -2px currentColor; }
.grid-icon, .list-icon { width: .78rem; height: .78rem; }
.grid-icon { background: linear-gradient(currentColor, currentColor) 0 0 / 42% 42%, linear-gradient(currentColor, currentColor) 100% 0 / 42% 42%, linear-gradient(currentColor, currentColor) 0 100% / 42% 42%, linear-gradient(currentColor, currentColor) 100% 100% / 42% 42%; background-repeat: no-repeat; }
.list-icon { background: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 4px); }

#service-cards { container: service-area / inline-size; }
.service-zone { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.service-zone:empty { display: none; }
.service-zone + .service-zone:not(:empty) { margin-top: 1rem; }
.service-zone:empty + .service-zone:not(:empty) { margin-top: 0; }
.service-card { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; min-width: 0; padding: clamp(.85rem, 1.5vw, 1.35rem); border: 1px solid var(--line); background: var(--background); }
.card-copy { min-width: 0; overflow-wrap: anywhere; }
.card-copy p { margin-top: .55rem; color: var(--muted); line-height: 1.45; }
.details-link, .text-link { color: var(--accent); font-weight: 720; text-decoration: none; background: transparent; border: 0; padding: 0; }
.details-link { min-height: 2.5rem; margin-top: auto; display: inline-flex; align-items: center; gap: .55rem; }

@media (hover: hover) {
  .site-header nav a:hover, .site-footer nav a:hover, .button:hover,
  .hero-motion:hover, .layout-control button:hover, .details-link:hover, .text-link:hover {
    text-decoration: underline;
    text-underline-offset: .22em;
  }
}
.is-list .service-zone { grid-template-columns: minmax(0, 1fr); }
.is-list .service-card {
  display: grid;
  grid-template: "art copy" auto "art action" auto / minmax(4rem, .42fr) minmax(0, 1fr);
  align-items: start;
  gap: .35rem .85rem;
}
.is-list .diagram { grid-area: art; height: 5rem; }
.is-list .card-copy { grid-area: copy; }
.is-list .details-link { grid-area: action; justify-self: start; margin-top: 0; }
.is-list .move-controls { grid-column: 1 / -1; }
@container service-area (min-width: 36rem) {
  .is-list .service-card { grid-template: "art copy action" auto / minmax(8rem, .75fr) minmax(0, 2fr) auto; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
  .is-list .details-link { white-space: nowrap; }
  .is-list .diagram { height: 6.5rem; }
}

.diagram { width: 100%; height: clamp(6rem, 10vw, 9.1rem); position: relative; overflow: hidden; color: var(--accent); background: var(--diagram); }
.diagram::before { position: absolute; inset: 0; content: ""; opacity: .14; background: repeating-linear-gradient(to right, currentColor 0 1px, transparent 1px 18px), repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 18px); }
.diagram-map i { position: absolute; left: 4%; top: 15%; width: 90%; height: 86%; border: 1px solid currentColor; border-radius: 56% 44% 44% 56% / 60% 42% 58% 40%; transform: rotate(-13deg) scale(var(--ring-scale, 1)); }
.diagram-map i:nth-child(2) { --ring-scale: .86; }
.diagram-map i:nth-child(3) { --ring-scale: .72; }
.diagram-map i:nth-child(4) { --ring-scale: .58; }
.diagram-map i:nth-child(5) { --ring-scale: .44; }
.diagram-map i:nth-child(6) { --ring-scale: .30; }
.diagram-map::after { content: "+"; position: absolute; top: 50%; left: 49%; transform: translate(-50%, -50%); font: 700 1.15rem/1 monospace; }
.diagram-air i { position: absolute; top: calc(14% + var(--lane, 0) * 14%); left: 4%; width: 90%; height: 21%; border-bottom: 1px solid currentColor; border-radius: 0 0 46% 35%; transform: skewY(-8deg); }
.diagram-air i:nth-child(2) { --lane: 1; }
.diagram-air i:nth-child(3) { --lane: 2; }
.diagram-air i:nth-child(4) { --lane: 3; }
.diagram-air i:nth-child(5) { --lane: 4; }
.diagram-air i::after { position: absolute; content: ""; width: 5px; height: 5px; right: 0; bottom: 4px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.diagram-retrofit i:first-child { position: absolute; inset: 24% 19%; border: 1px solid currentColor; background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 5px); }
.diagram-retrofit i:nth-child(2), .diagram-retrofit i:nth-child(3) { position: absolute; inset: 16% auto 16% 17%; width: 6%; background: var(--diagram); border: 1px solid currentColor; }
.diagram-retrofit i:nth-child(3) { left: auto; right: 17%; }
.diagram-retrofit i:nth-child(2)::before, .diagram-retrofit i:nth-child(3)::before { position: absolute; content: ""; top: 31%; left: -135%; height: 38%; width: 135%; border: 1px solid currentColor; }
.diagram-retrofit i:nth-child(3)::before { left: 100%; }

.faq { display: grid; grid-template-columns: minmax(12rem, .76fr) minmax(0, 1.24fr); gap: clamp(1.55rem, 6vw, 6rem); }
.faq h2 { max-width: 10ch; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; position: relative; cursor: pointer; font: 740 clamp(1rem, 1.8vw, 1.3rem)/1.32 var(--heading); letter-spacing: -.023em; padding: 1.1rem 2rem 1.1rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .4rem; top: 1.4rem; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.faq details[open] summary { color: var(--accent); }
.faq details[open] summary::after { transform: rotate(225deg); top: 1.6rem; }
.faq details p { max-width: 65ch; color: var(--muted); padding: 0 1.3rem 1.25rem 0; }
.info-tip { position: relative; vertical-align: baseline; margin-left: .23em; }
.info-tip button { width: 1.55rem; height: 1.55rem; border: 1px solid var(--accent); border-radius: 50%; background: transparent; color: var(--accent); font-weight: 780; line-height: 1; padding: 0; }
.info-panel { position: absolute; z-index: 1; top: 100%; left: 50%; transform: translateX(-50%); width: 13rem; max-width: 64vw; padding: .65rem .8rem; color: var(--background); background: var(--text); font-size: .86rem; line-height: 1.4; box-shadow: 0 .3rem 1rem #0002; }

.contact { background: #171428; color: #f6f3ff; padding-block: clamp(2.4rem, 6.5vw, 5.8rem); }
.contact :focus-visible { outline-color: #c2b3ff; }
.contact-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 8vw, 8rem); }
.contact h2 { font-size: clamp(2.9rem, 5.8vw, 5.25rem); letter-spacing: -.06em; color: #c2b3ff; white-space: pre-line; overflow-wrap: anywhere; }
.contact h2::first-line { color: #f6f3ff; }
.contact-copy p { color: #d6d0e8; max-width: 31ch; margin-top: 1.25rem; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: .3rem; }
.field label { font-size: .9rem; font-weight: 650; }
.field label span { color: #d6d0e8; font-weight: 400; }
.field input, .field textarea { width: 100%; min-width: 0; padding: .55rem .7rem; border: 1px solid #d6d0e8; border-radius: 0; background: #f5f2fc; color: #181825; }
.field textarea { resize: vertical; min-height: 6rem; }
.field [aria-invalid="true"] { border-color: #c72c45; box-shadow: inset 0 0 0 1px #c72c45; }
.field-error { color: #ffc0cc; font-size: .87rem; }
.contact .button { margin-top: 1rem; border-color: currentColor; }

.site-footer { min-height: 6.4rem; padding-block: 1.5rem; flex-wrap: wrap; }
.site-footer .brand { font-size: 1.12rem; }

.service-dialog { position: fixed; inset: 0; margin: auto; width: min(35rem, calc(100% - 2.5rem)); max-height: calc(100% - 2.5rem); overflow: auto; overscroll-behavior: contain; padding: clamp(1.25rem, 4vw, 2.25rem); border: 1px solid var(--line); background: var(--background); color: var(--text); }
.service-dialog:not([open]) { display: none; }
html:not(.site-enhanced) .service-dialog:target { display: block; position: static; margin-block: 1rem; }
.modal-fallback-scrim { position: fixed; inset: 0; z-index: 10; background: #090716a3; }
.service-dialog.is-modal-fallback { z-index: 11; }
.service-dialog::backdrop { background: #090716a3; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { font-size: clamp(1.8rem, 5vw, 2.85rem); }
.close-dialog { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.65rem; height: 2.65rem; padding: 0; border: 1px solid var(--line); background: transparent; text-decoration: none; font-size: 1.55rem; line-height: 1; }
.service-dialog p { margin-block: 1rem; }

.config-shell { padding-top: 1rem; }
.config-panel { padding: 1rem; border: 1px solid var(--line); }
.config-panel summary { cursor: pointer; font-weight: 760; }
.config-panel p { font-size: .9rem; color: var(--muted); margin-top: .65rem; }
.config-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .7rem; margin-block: 1rem; }
.config-panel fieldset { min-width: 0; border: 1px solid var(--line); }
.config-panel legend { padding-inline: .35rem; font-weight: 680; }
.config-controls label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.25rem; font-size: .88rem; }
.config-controls input[type="range"] { width: min(50%, 9rem); accent-color: var(--accent); }
.head-form { display: grid; gap: .6rem; }
.head-form label { display: grid; gap: .25rem; font-size: .88rem; }
.head-form input, .head-form textarea { width: 100%; background: var(--background); color: var(--text); border: 1px solid var(--muted); border-radius: 0; padding: .4rem .55rem; }
.head-form p { margin-top: 0; }
#config-contrast:not(:empty) { margin: .4rem 0 .9rem; padding: .5rem .7rem; border-inline-start: 2px solid currentColor; color: var(--text); }
.head-form button { justify-self: start; }
.utility-button { border: 1px solid var(--line); background: var(--background); color: var(--text); padding: .53rem .8rem; min-height: 2.65rem; font-weight: 680; }
.config-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: 1rem; }
.config-actions p { margin: 0; }
.config-mode [contenteditable="true"] { outline: 1px dashed var(--accent); outline-offset: 4px; }
.config-mode [contenteditable="true"]:focus { outline: 2px solid var(--accent); }
.config-mode .hero-art { resize: both; overflow: auto; min-width: min(240px, 100%); min-height: 220px; max-height: 700px; }
.config-mode .service-zone { display: grid; min-height: 4.8rem; padding: .6rem; border: 1px dashed var(--line); margin-bottom: .6rem; }
.config-mode .service-zone::before { content: attr(aria-label); grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 680; }
.move-controls { gap: .35rem; align-items: center; flex-wrap: wrap; width: 100%; border-top: 1px solid var(--line); padding-top: .55rem; }
.move-controls button { border: 1px solid var(--line); background: var(--background); font-size: .77rem; min-height: 2.25rem; padding: .25rem .45rem; }
.move-controls button:disabled { opacity: .5; cursor: default; }
[data-drag-handle] { cursor: grab; font-size: 1.2rem; min-width: 2rem; text-align: center; }

@media (max-width: 850px) {
  .contact-inner, .faq { gap: 2rem; }
}

@media (max-width: 720px) {
  .site-header { min-height: 4.1rem; flex-wrap: wrap; }
  .site-header nav { flex-wrap: wrap; }
  .site-enhanced .menu-toggle:not([hidden]) { display: inline-flex !important; }
  .site-enhanced #site-nav { display: none; }
  .site-enhanced #site-nav.is-open { position: absolute; z-index: 4; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: min(17rem, 100%); top: 100%; right: 0; padding: .45rem; background: var(--background); border: 1px solid var(--line); box-shadow: 0 .5rem 1rem #0002; }
  .site-enhanced #site-nav a { padding: .65rem .8rem; }
  .hero, .faq, .contact-inner { grid-template-columns: minmax(0, 1fr); }
  .hero { --hero-title-size-base: clamp(3.35rem, 11.2vw, 5.55rem); gap: 1.4rem; }
  .hero-copy { padding-bottom: 0; }
  .hero-copy p { margin-block: 1rem 1.3rem; }
  .hero-art { aspect-ratio: 1.48; }
  .faq h2 { max-width: none; }
  .info-panel { position: fixed; top: auto; right: var(--gutter); bottom: 1rem; left: var(--gutter); transform: none; width: auto; max-width: none; }
}

@media (max-width: 420px) {
  .contact-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  :focus-visible, .contact :focus-visible { outline-color: Highlight; }
  .button { border-color: ButtonText; }
  .layout-control button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
  .field [aria-invalid="true"] { border: 2px solid MarkText; }
}
