/* Layout concept: one house, one line, in daylight. White and the palest sky-white,
   crisp dark type, and a single colour: the red line of the continuous thermal envelope
   drawn around a gabled house that frames the photographs. One deliberately light theme. */
:root {
  --white: #ffffff;
  --air: #f3f8fc;
  --air-2: #e6eff6;
  --ink: #13181d;
  --soft: #55606a;
  --red: #e0252e;
  --hair: rgba(19, 24, 29, 0.1);

  --f: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --t-xs: 0.76rem;
  --t-sm: 0.92rem;
  --t-md: 1.04rem;
  --t-lg: clamp(1.12rem, 1rem + 0.5vw, 1.38rem);
  --t-xl: clamp(2rem, 1.2rem + 2.8vw, 3.5rem);
  --t-2xl: clamp(2.8rem, 1.4rem + 5.2vw, 6rem);

  --house: polygon(50% 0, 100% 34%, 100% 100%, 0 100%, 0 34%);
  --wrap: 78rem;
  --gl: max(20px, env(safe-area-inset-left, 0px));
  --gr: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--white); color: var(--ink); font: 500 var(--t-md)/1.65 var(--f); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-family: var(--f); text-wrap: balance; letter-spacing: -0.035em; }
h1 { font-size: var(--t-2xl); line-height: 1; font-weight: 700; }
h2 { font-size: var(--t-xl); line-height: 1.06; font-weight: 700; }
h3 { font-size: var(--t-lg); line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h1 em, h2 em { font-style: normal; color: var(--red); }
p { margin: 0; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 40px); margin-inline: auto; padding-left: var(--gl); padding-right: var(--gr); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 60; background: var(--white); padding: 8px 12px; }
.label { font: 700 var(--t-xs)/1.4 var(--f); letter-spacing: 0.14em; text-transform: uppercase; color: var(--soft); }
.muted { color: var(--soft); }
.lede { font-size: var(--t-lg); line-height: 1.6; font-weight: 500; max-width: 34rem; color: var(--soft); }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(255, 255, 255, 0.9); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--hair); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 30px; height: 25px; flex: none; }
.brand span { display: flex; align-items: baseline; gap: 6px; }
.brand b { font: 800 0.92rem/1 var(--f); letter-spacing: 0.2em; }
.brand i { font: 500 0.92rem/1 var(--f); font-style: normal; color: var(--red); }
.mark-a { fill: none; stroke: var(--red); stroke-width: 3.4; }
.mark-b { fill: none; stroke: var(--ink); stroke-width: 3.4; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 24px; }
.nav a { text-decoration: none; font-size: var(--t-sm); font-weight: 600; color: var(--soft); padding-block: 6px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }
.nav .lang { font-size: var(--t-xs); letter-spacing: 0.12em; color: var(--ink); }
@media (max-width: 700px) { .nav { width: 100%; overflow-x: auto; } .nav ul { gap: 18px; } .nav a { white-space: nowrap; } }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; text-decoration: none; font: 700 var(--t-sm)/1 var(--f); color: var(--ink); background: var(--white); border: 1.5px solid var(--ink); cursor: pointer; transition: transform 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s; }
.btn::after { content: "→"; transition: transform 0.2s; }
.btn:hover { transform: translateY(-1px); border-color: var(--red); color: var(--red); }
.btn:hover::after { transform: translateX(4px); }
.btn--solid { background: var(--red); border-color: var(--red); color: var(--white); }
.btn--solid:hover { color: var(--white); background: #c81e27; border-color: #c81e27; }
.btn--light { background: var(--white); }

/* ===== Home: house hero in light ===== */
.house-hero { background: linear-gradient(180deg, var(--white) 0%, var(--air) 100%); }
.house-hero .wrap { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: end; padding-block: clamp(48px, 7vw, 96px) 0; }
.hh-text { display: grid; gap: 26px; align-content: end; min-width: 0; padding-bottom: clamp(48px, 7vw, 96px); }
.hh-text h1 .line { color: var(--red); display: block; }
.house-col { width: 100%; max-width: 600px; justify-self: end; min-width: 0; }
.house { display: block; width: 100%; height: auto; }
.house image { transition: opacity 0.7s ease; }
.house image.off { opacity: 0; }
.house .envelope { fill: none; stroke: var(--red); stroke-width: 5; stroke-linejoin: miter; }
.house .ground { fill: var(--air-2); }
.hh-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 16px 4px 22px; }
.hh-bar .count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--soft); }
.hh-bar .ctrl { display: flex; gap: 8px; }
.hh-bar button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); font: 700 1rem/1 var(--f); cursor: pointer; }
.hh-bar button:hover { border-color: var(--red); color: var(--red); }
.hh-cap { display: grid; text-decoration: none; }
.hh-cap b { font-weight: 700; }
.hh-cap span { color: var(--soft); font-size: var(--t-sm); }
.hh-cap:hover b { color: var(--red); }
@media (max-width: 860px) {
  .house-hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hh-text { padding-bottom: 8px; }
  .house-col { justify-self: center; }
}

/* Facts */
.facts-band { background: var(--white); border-top: 1px solid var(--hair); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: clamp(56px, 8vw, 104px); }
.facts div { display: grid; gap: 8px; align-content: start; }
.facts b { font: 700 clamp(2.8rem, 1.6rem + 4vw, 5rem)/0.95 var(--f); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.facts b small { font-size: 0.3em; font-weight: 700; letter-spacing: 0; margin-left: 4px; color: var(--soft); }
.facts b .r { color: var(--red); }
.facts span { color: var(--soft); max-width: 17rem; }
@media (max-width: 760px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Services */
.list2 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.list2 li { display: grid; grid-template-columns: 18px minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4px 18px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--hair); }
.list2 li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); transform: translateY(-2px); }
.list2 p { color: var(--soft); font-size: var(--t-sm); }
@media (max-width: 860px) { .list2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .list2 li { grid-template-columns: 18px minmax(0, 1fr); } .list2 p { grid-column: 2; } }

/* Contact */
.big-contact-band { background: var(--air); }
.big-contact { display: grid; gap: 10px; padding-block: clamp(64px, 9vw, 128px); }
.big-contact a:not(.btn) { font: 700 clamp(2rem, 1rem + 4.2vw, 4.8rem)/1.06 var(--f); letter-spacing: -0.04em; text-decoration: none; overflow-wrap: anywhere; }
.big-contact a:not(.btn):hover { color: var(--red); }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 128px); }
.section + .section { border-top: 1px solid var(--hair); }
.head { display: grid; gap: 14px; max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.page-head { background: linear-gradient(180deg, var(--white) 0%, var(--air) 100%); }
.page-head .wrap { display: grid; gap: 22px; padding-block: clamp(56px, 8vw, 112px); }
.page-head h1 { max-width: 15ch; }
.strip, .photo-hero, .services, .cards { display: none; }

.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.numbers > div { display: grid; gap: 10px; align-content: start; padding: 28px; border-radius: 24px; background: var(--air); }
.numbers b { font: 700 clamp(2.4rem, 1.6rem + 3vw, 4rem)/1 var(--f); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.numbers b small { font-size: 0.32em; font-weight: 700; letter-spacing: 0; margin-left: 4px; color: var(--soft); }
.numbers span { color: var(--soft); font-size: var(--t-sm); max-width: 16rem; }
@media (max-width: 760px) { .numbers { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 104px); align-items: center; }
.split.flip > :first-child { order: 2; }
.split figure { margin: 0; padding: 10px; background: var(--red); clip-path: var(--house); }
.split figure img { aspect-ratio: 1 / 1.02; object-fit: cover; width: 100%; clip-path: var(--house); }
.split figcaption { display: none; }
.stack { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .split.flip > :first-child { order: 0; } .split figure { max-width: 480px; } }

.principles { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: p; }
.principles li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 2px 14px; padding: 14px 0; border-top: 1px solid var(--hair); counter-increment: p; }
.principles li::before { content: "0" counter(p); grid-row: span 2; font-weight: 700; font-size: var(--t-sm); color: var(--red); font-variant-numeric: tabular-nums; padding-top: 2px; }
.principles b { font-weight: 700; }
.principles span { color: var(--soft); font-size: var(--t-sm); }

.band { background: var(--air); }
.band .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 72px; padding-block: clamp(64px, 9vw, 120px); align-items: center; }
@media (max-width: 860px) { .band .wrap { grid-template-columns: minmax(0, 1fr); } }

.news { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post { display: grid; gap: 10px; padding: 28px; border-radius: 24px; background: var(--air); text-decoration: none; align-content: start; transition: transform 0.2s; }
.post:hover { transform: translateY(-3px); }
.post:hover h3 { color: var(--red); }
.post h3 { font-size: var(--t-lg); }
.post p { color: var(--soft); font-size: var(--t-sm); }
.post .more { font-weight: 700; font-size: var(--t-sm); color: var(--red); }
@media (max-width: 760px) { .news { grid-template-columns: minmax(0, 1fr); } }

/* Projects page */
.project { scroll-margin-top: 90px; display: grid; gap: 28px; }
.project + .project { margin-top: clamp(80px, 11vw, 150px); }
.project-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 56px; align-items: end; }
.project-head p { color: var(--soft); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: var(--t-xs); font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--air); }
@media (max-width: 760px) { .project-head { grid-template-columns: minmax(0, 1fr); } }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gallery a { display: block; overflow: hidden; border-radius: 14px; background: var(--air); }
.gallery a:first-child { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.5s ease; }
.gallery a:hover img { transform: scale(1.04); }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jump { display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { text-decoration: none; font-size: var(--t-sm); font-weight: 700; padding: 9px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--hair); }
.jump a:hover { border-color: var(--red); color: var(--red); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(255, 255, 255, 0.97); display: grid; grid-template-rows: 1fr auto; padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); color: var(--ink); }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; align-self: center; }
.lightbox .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; font-size: var(--t-sm); color: var(--soft); }
.lightbox button { background: var(--white); border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); padding: 10px 16px; font: 700 var(--t-sm)/1 var(--f); cursor: pointer; }
.lightbox button:hover { border-color: var(--red); color: var(--red); }

.faq { display: grid; gap: 10px; }
.faq details { border-radius: 20px; background: var(--air); padding-inline: 24px; border: 1px solid transparent; }
.faq details[open] { background: var(--white); border-color: var(--hair); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; font: 700 var(--t-lg)/1.3 var(--f); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--red); font-size: 1.5rem; font-weight: 500; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 22px; color: var(--soft); max-width: 46rem; display: grid; gap: 12px; }

.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
.details > div { display: grid; gap: 2px; padding-block: 16px; border-top: 1px solid var(--hair); }
.details .v { font: 700 var(--t-lg)/1.3 var(--f); overflow-wrap: anywhere; text-decoration: none; }
.row-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.copy { font: 700 var(--t-xs)/1 var(--f); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--hair); background: var(--white); color: var(--soft); cursor: pointer; }
.copy:hover { color: var(--red); border-color: var(--red); }
.form { display: grid; gap: 20px; padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--air); }
.f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 560px) { .f-row { grid-template-columns: minmax(0, 1fr); } }
.f { display: grid; gap: 6px; }
.f label { font: 700 var(--t-xs)/1.3 var(--f); letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); }
.f input, .f select, .f textarea { width: 100%; font: 500 1rem/1.4 var(--f); color: var(--ink); background: var(--white); border: 1px solid var(--hair); border-radius: 12px; padding: 13px 14px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--red); }
.f textarea { min-height: 8rem; resize: vertical; }
.note { font-size: var(--t-sm); color: var(--soft); }
.result { background: var(--white); border-radius: 16px; padding: 18px; display: grid; gap: 12px; border: 1px solid var(--hair); }
.result pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 500 0.86rem/1.55 ui-monospace, Consolas, monospace; }

.cta { background: var(--air); }
.cta > img { display: none; }
.cta .wrap { display: grid; gap: 22px; padding-block: clamp(72px, 10vw, 140px); }
.cta h2 { max-width: 16ch; }
.cta p { color: var(--soft); max-width: 34rem; }

.site-footer { padding-block: 40px 28px; background: var(--white); border-top: 1px solid var(--hair); }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 28px; padding-bottom: 28px; font-size: var(--t-sm); }
.foot .k { display: block; margin-bottom: 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--soft); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--red); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: var(--t-xs); color: var(--soft); padding-top: 18px; border-top: 1px solid var(--hair); }
@media (max-width: 860px) { .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot > div:first-child { grid-column: 1 / -1; } }

/* News and articles */
.news-list { display: grid; gap: 16px; }
.news-list .post { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 8px 32px; padding: 32px; }
.news-list .post .label { grid-row: span 3; }
@media (max-width: 700px) { .news-list .post { grid-template-columns: minmax(0, 1fr); } .news-list .post .label { grid-row: auto; } }
.article { max-width: 44rem; display: grid; gap: 20px; }
.article p { font-size: 1.08rem; line-height: 1.75; }
.article h2 { font-size: var(--t-lg); line-height: 1.3; letter-spacing: -0.01em; margin-top: 20px; }
.article blockquote { margin: 12px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--red); font: 700 clamp(1.25rem, 1rem + 1vw, 1.7rem)/1.35 var(--f); letter-spacing: -0.02em; }
.article .who { font-weight: 800; }
.article .meta { display: grid; gap: 4px; padding: 22px 24px; border-radius: 20px; background: var(--air); font-size: var(--t-sm); }
.article-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--hair); max-width: 44rem; }

@media (prefers-reduced-motion: reduce) { .house image, .btn, .btn::after, .post, .gallery img { transition: none; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Every page is its own document, so hidden UI (lightbox, prepared email) must stay hidden. */

/* Article figures and tables */
.article figure { margin: 8px 0; }
.article figure img { width: 100%; height: auto; border-radius: 14px; }
.article figcaption { margin-top: 8px; font-size: 0.8rem; opacity: 0.7; }
.article ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.6; }
.article .table-scroll { overflow-x: auto; }
.article table.units { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.article table.units th, .article table.units td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid rgba(127, 127, 127, 0.28); }
.article table.units th { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
[hidden] { display: none !important; }
