:root {
  color-scheme: light;
  --ink: #111;
  --paper: #fff;
  --muted: #666;
  --line: #1a1a1a;
  --soft-line: #d8d8d8;
  --wash: #f4f4f4;
  --content: 1440px;
  --text-leading: 1.65;
  --paragraph-gap: 24px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

img { display: block; width: 100%; }

a { color: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.site-header, main, .site-footer {
  width: min(var(--content), calc(100% - 64px));
  margin-inline: auto;
}

.site-header { padding-top: 22px; }

.site-header--home { padding-top: 18px; }

.home-header-top { display: flex; justify-content: flex-end; }

.site-header--home .languages { font-size: 16px; }

.home-navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.35;
  text-transform: uppercase;
}

.home-navigation a {
  text-decoration: none;
  text-underline-offset: 4px;
}

.home-navigation a:hover { text-decoration: underline; }

.header-top, .pagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-top { min-height: 40px; }

.wordmark {
  font-size: 25px;
  line-height: 1;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark strong { font-weight: 700; }

.languages { display: flex; align-items: center; gap: 8px; font-size: 18px; }

.lang-btn {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] { color: var(--ink); font-weight: 700; }

.pagebar {
  min-height: 47px;
  margin-top: 32px;
  border-bottom: 2px solid var(--line);
}

.page-label { margin: 0; font-size: 17px; font-weight: 400; text-transform: uppercase; }

.menu-toggle {
  display: inline-grid;
  gap: 5px;
  width: 40px;
  border: 0;
  padding: 8px 0 8px 8px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span { height: 3px; width: 31px; background: var(--ink); }

.site-menu {
  display: none;
  position: absolute;
  z-index: 5;
  right: max(32px, calc((100vw - var(--content)) / 2));
  top: 147px;
  min-width: 220px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.site-menu.is-open { display: grid; gap: 8px; }
.site-menu a { text-decoration: none; text-transform: uppercase; }
.site-menu a:hover, .text-link:hover { text-decoration-thickness: 2px; }

main { padding-bottom: 90px; }

.page-intro { padding-top: 22px; max-width: 1000px; }

h1, h2, h3, p { margin-top: 0; }

.page-intro h1 {
  margin-bottom: 18px;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1.18;
  font-weight: 400;
}

.page-intro p {
  max-width: 900px;
  margin-bottom: var(--paragraph-gap);
  font-size: clamp(17px, 2vw, 21px);
  line-height: var(--text-leading);
}

.italic { font-style: italic; }

.home-wordmark {
  margin: 38px 0 20px;
  font-size: clamp(42px, 6vw, 58px);
  letter-spacing: -.045em;
  line-height: 1;
  font-weight: 400;
}

.home-wordmark a { text-decoration: none; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.gallery-card { min-width: 0; margin: 0; }

.gallery-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--wash);
  filter: grayscale(100%);
}

.gallery-card figcaption { padding-top: 10px; }
.gallery-card figcaption p { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.gallery-card figcaption h2 { margin: 2px 0 0; font-size: 17px; font-weight: 400; }

.project-modal-open { overflow: hidden; scrollbar-gutter: stable; }

.project-modal {
  --modal-margin: clamp(18px, 4vw, 64px);
  position: fixed;
  inset: 0;
  width: calc(100% - 2 * var(--modal-margin));
  height: calc(100vh - 2 * var(--modal-margin));
  height: calc(100dvh - 2 * var(--modal-margin));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.project-modal::backdrop { background: rgb(0 0 0 / .5); }

.project-modal__surface {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: 0 20px 80px rgb(0 0 0 / .25);
  backface-visibility: hidden;
  transform-origin: center;
}

.project-modal__toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: var(--paper);
}

.project-modal__close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--soft-line);
  background: var(--paper);
  color: var(--ink);
  font: 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.project-modal__close:hover { background: var(--wash); }

.project-modal__content {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  padding: 0 clamp(24px, 4vw, 64px) clamp(24px, 4vw, 64px);
}

.project-modal__image {
  height: auto;
  max-height: calc(100dvh - 2 * var(--modal-margin) - 100px);
  object-fit: contain;
  background: var(--wash);
}

.project-modal__details { padding-top: 20px; overflow-wrap: anywhere; }
.project-modal__subtitle { margin-bottom: 14px; color: var(--muted); text-transform: uppercase; font-size: 13px; }
.project-modal__details h2 { margin-bottom: 32px; font-size: clamp(26px, 3vw, 42px); font-weight: 400; line-height: 1.2; }
.project-modal__contact { display: inline-block; line-height: var(--text-leading); }

.project-modal__flip {
  position: fixed;
  pointer-events: none;
  transform-style: preserve-3d;
  transform-origin: center;
  will-change: transform;
}

.project-modal__front, .project-modal__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.project-modal__front { overflow: hidden; }
.project-modal__back { transform: rotateY(180deg); }
.project-modal__crop { transform-origin: top left; }
.project-modal__crop img { width: 100%; height: 100%; object-fit: cover; }

.about-article .page-intro { max-width: none; padding-top: 32px; }
.about-article .page-intro h1 { max-width: 24ch; }
.about-article .page-intro p { margin: 18px 0 0; }

.about-opening {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  margin-top: 40px;
}

.about-portrait { margin: 0; }

.about-portrait img {
  aspect-ratio: 13 / 16;
  height: auto;
  object-fit: cover;
  object-position: center 35%;
  filter: grayscale(100%);
}

.about-portrait figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }
.about-story { font-size: 18px; line-height: var(--text-leading); }
.about-story p { margin-bottom: var(--paragraph-gap); }
.about-story p:last-child { margin-bottom: 0; }

.form-panel {
  margin-top: 28px;
  padding: clamp(20px, 4vw, 42px);
  background: var(--ink);
  color: var(--paper);
}

.form-panel--light { background: var(--wash); color: var(--ink); }

.form-intro { max-width: 800px; margin-bottom: var(--paragraph-gap); line-height: var(--text-leading); color: inherit; opacity: .8; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.field { min-width: 0; }
.field--wide { grid-column: 1 / -1; }

.field label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 9px 2px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.field select option { color: #111; }
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: currentColor; opacity: .62; }
.field small { display: block; margin-top: 7px; line-height: var(--text-leading); color: inherit; opacity: .72; }
.field[hidden] { display: none; }

.estimate-reading {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.estimate-reading p { margin: 0; }
.estimate-reading output { display: block; margin-top: 8px; font: 400 clamp(22px, 3vw, 30px) Georgia, serif; }
.estimate-reading small { display: block; margin-top: 6px; opacity: .7; }

.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.field input[type="checkbox"], .field input[type="radio"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  accent-color: var(--ink);
}
.document-options input[type="radio"] {
  appearance: none;
  border: 1px solid var(--muted);
  background: var(--paper);
  cursor: pointer;
}
.document-options input[type="radio"]:checked {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.checkbox-field label { font-size: 14px; font-weight: 400; line-height: var(--text-leading); letter-spacing: 0; text-transform: none; }

.form-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-section + .form-section { margin-top: 28px; }
.form-section legend { padding: 0 0 18px; font-size: 18px; font-weight: 400; }
.energy-contact-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  scroll-margin-top: 24px;
}
.energy-contact-section[hidden], .quote-button[hidden] { display: none; }
.energy-options { display: grid; gap: 10px; margin-top: 20px; }
.energy-options .checkbox-field label { margin-bottom: 0; }
.energy-form .estimate-reading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 3px solid var(--ink);
  border-bottom: 0;
}
.estimate-summary { min-width: 0; }
.quote-button { flex-shrink: 0; }
.energy-form .estimate-reading output { font: inherit; font-size: 20px; line-height: var(--text-leading); }
.energy-form .estimate-reading p { font-size: 12px; color: var(--muted); }
.energy-form .form-grid { gap: 18px 28px; }
.form-actions { margin-top: 24px; }
.document-options legend { padding-bottom: 12px; font-size: 14px; }
.document-options .checkbox-field + .checkbox-field { margin-top: 10px; }
.documents-help { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: var(--text-leading); }

.submit-button {
  min-height: 48px;
  border: 1px solid currentColor;
  padding: 10px 20px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.submit-button:hover:not(:disabled) { background: #fff; color: #111; }
.form-panel--light .submit-button:hover:not(:disabled) { background: #111; color: #fff; }
.submit-button:disabled { background: #e5e5e5; border-color: #ccc; color: #666; cursor: not-allowed; }

.form-status { margin: 16px 0 0; line-height: var(--text-leading); }
.form-status[hidden] { display: none; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 35px;
  border-top: 2px solid var(--line);
}

.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { text-decoration: none; }

@media (max-width: 720px) {
  .site-header, main, .site-footer { width: calc(100% - 36px); }
  .site-header { padding-top: 14px; }
  .wordmark { font-size: 20px; }
  .languages { font-size: 16px; }
  .pagebar { margin-top: 24px; }
  .site-menu { right: 18px; top: 130px; }
  main { padding-bottom: 58px; }
  .site-header--home { padding-top: 14px; }
  .home-navigation { margin-top: 18px; font-size: 15px; }
  .home-wordmark { margin: 30px 0 18px; font-size: clamp(38px, 10vw, 52px); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .project-modal { --modal-margin: 12px; }
  .project-modal__content { grid-template-columns: 1fr; gap: 24px; padding: 0 20px 32px; }
  .project-modal__image { max-height: none; }
  .project-modal__details { padding-top: 0; }
  .about-article .page-intro { padding-top: 24px; }
  .about-opening { grid-template-columns: 1fr; gap: 28px; margin-top: 28px; }
  .about-portrait { width: min(100%, 280px); }
  .about-story { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .energy-form .estimate-reading { align-items: flex-start; flex-direction: column; }
  .field--wide { grid-column: auto; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
