@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  color-scheme: light;
  --paper: #f6f4eb;
  --surface: #fcfbf6;
  --ink: #172b24;
  --muted: #4e5c53;
  --line: #d9d9ca;
  --accent: #f5aa72;
  --rust: #a74820;
  --heading: "Instrument Serif", Georgia, serif;
  --body: "Instrument Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #b65227; outline-offset: 4px; }
.wrap { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: absolute; top: 10px; left: 10px; z-index: 5; transform: translateY(-200%); padding: 8px 15px; background: var(--surface); }
.skip:focus { transform: translateY(0); }

.header { background: var(--surface); }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 13px; align-items: center; font-size: 18px; line-height: 1.12; font-weight: 700; letter-spacing: .065em; white-space: nowrap; }
.brand small { display: block; margin-top: 5px; font-size: 9px; font-weight: 600; letter-spacing: .14em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; background: var(--ink); border-radius: 4px; }
.brand-mark i { position: relative; width: 19px; height: 19px; border: 1px solid #f6e6cf; border-radius: 50%; }
.brand-mark i::before, .brand-mark i::after { content: ""; position: absolute; background: #f6e6cf; inset: 8px -5px auto; height: 1px; }
.brand-mark i::after { transform: rotate(90deg); }
nav { display: flex; gap: clamp(18px, 4vw, 54px); align-items: center; font-size: 14px; font-weight: 600; }
nav a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 17px; min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; font-size: 14px; line-height: 1.3; cursor: pointer; transition: background-color .2s, color .2s; }
.button span { font-size: 19px; line-height: 1; }
.button-header { border-color: var(--ink); }
.button-header:hover, .button-dark { color: var(--surface); background: var(--ink); }

.hero { color: #fff9eb; background: var(--ink); position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(90deg, #11251f 0%, #122720ee 19%, #142821aa 44%, #14282123 75%), linear-gradient(0deg, #1328214d, transparent 55%), url("hero-santier.webp"); background-position: center, center, center 52%; background-size: cover; }
.hero-inner { min-height: clamp(505px, 45vw, 680px); display: flex; align-items: center; padding-block: 72px; }
.hero-copy { max-width: 630px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: var(--rust); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.accent-line { width: 25px; height: 1px; background: currentColor; }
.hero .eyebrow { color: var(--accent); }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2 { font-family: var(--heading); font-weight: 400; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(74px, 8.2vw, 124px); line-height: .91; }
.hero-services { margin-top: 23px; }
.hero-services p { margin: 0 0 8px; font-weight: 700; }
.hero-services ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.hero-services a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 12px; border: 1px solid #fff9eb9c; border-radius: 4px; background: #11251fed; color: #fff9eb; font-size: 14px; font-weight: 600; text-align: center; }
.hero-services a:hover, .hero-services a:focus-visible { border-color: var(--accent); color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 29px; }
.button-accent { background: var(--accent); color: #22261e; }
.button-accent:hover { background: #ffc59b; }
.text-link { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.light { color: #fff9eb; }

.facts { border-bottom: 1px solid var(--line); background: #ececde; }
.facts-inner { display: grid; grid-template-columns: repeat(3, 1fr); }
.facts-inner > div { display: flex; gap: 14px; align-items: center; padding: 20px clamp(12px, 3vw, 40px); }
.facts-inner > div:first-child { padding-left: 0; }
.facts-inner > div + div { border-left: 1px solid var(--line); }
.fact-icon { flex: 0 0 35px; height: 35px; display: grid; place-items: center; border: 1px solid #b9c0b1; border-radius: 50%; color: var(--ink); font-size: 19px; }
.facts strong, .facts small { display: block; }
.facts strong { font-size: 14px; }
.facts small { color: var(--muted); font-size: 13px; }

.section { padding-block: clamp(55px, 7vw, 100px); scroll-margin-top: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 32px; }
h2 { margin: 0; font-size: clamp(45px, 6vw, 76px); line-height: .98; }
.section-heading > p { max-width: 320px; margin: 0 0 4px; color: var(--muted); }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.service-group { display: flex; flex-direction: column; padding: clamp(20px, 2.5vw, 32px); border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 20px; }
.service-group-primary { border-top: 3px solid var(--rust); background: #ececde; }
.service-group h3 { margin: 0; font-size: clamp(21px, 2.15vw, 30px); line-height: 1.18; }
.service-group p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.service-group ul { display: grid; gap: 6px; margin: 20px 0 22px; padding: 0; list-style: none; font-size: 15px; }
.service-group li a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.service-group li a:hover, .service-group li a:focus-visible { border-color: var(--rust); text-decoration: underline; text-underline-offset: 3px; }
.service-group .text-link { align-self: flex-start; margin-top: auto; }
.all-services { display: none; }
.services:has(.service-group:target) { grid-template-columns: minmax(0, 1fr); }
.services:has(.service-group:target) .service-group:not(:target) { display: none; }
.service-group:target .all-services { display: inline-flex; align-self: flex-start; align-items: center; min-height: 44px; margin-top: 8px; text-decoration: underline; }
@media (min-width: 621px) {
  .service-group:target ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.experience { color: #fff9eb; background: var(--ink); }
.experience-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(28px, 6vw, 85px); }
.experience-inner p { color: #e0e3d6; max-width: 450px; margin: 20px 0 0; }
.experience-stats { display: grid; grid-template-columns: 2fr 3fr; margin: 0; border-block: 1px solid #587064; }
.experience-stats > div { display: flex; flex-direction: column-reverse; justify-content: center; gap: 8px; padding: 16px clamp(10px, 2.2vw, 28px); }
.experience-stats > div + div { border-left: 1px solid #587064; }
.experience-stats dt { color: #e0e3d6; font-size: 14px; }
.experience-stats dd { margin: 0; color: var(--accent); font: clamp(35px, 4.9vw, 72px)/1 var(--heading); white-space: nowrap; }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(35px, 7vw, 100px); }
address { margin-block: 23px 13px; font-style: normal; color: var(--muted); }
address strong { color: var(--ink); }
.quote { padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 18px; }
.quote h3 { font-size: 23px; line-height: 1.2; margin: 0 0 8px; }
.quote p { font-size: 14px; margin: 0 0 16px; color: var(--muted); }
.quote label { display: block; margin: 11px 0 4px; font-size: 14px; font-weight: 700; }
.quote label span { font-weight: 400; }
.quote input, .quote select, .quote textarea, .contact-dialog input, .contact-dialog textarea { display: block; width: 100%; padding: 9px 10px; background: #fff; border: 1px solid #a5ad9f; border-radius: 3px; color: var(--ink); font-size: 16px; }
.quote textarea, .contact-dialog textarea { resize: vertical; }
.contact-actions, .quote-actions, .contact-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-actions { margin-top: 24px; }
.quote-actions { margin-top: 17px; }
.button-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.button-outline:hover { background: var(--ink); color: var(--surface); }
.button-dark:hover { background: #2e4e40; }
.contact-dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: clamp(16px, 4vw, 28px); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.contact-dialog::backdrop { background: #172b2499; }
.contact-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.contact-dialog h3 { margin: 0; font-size: 23px; line-height: 1.2; }
.contact-dialog p { margin: 12px 0; font-size: 14px; color: var(--muted); }
.contact-dialog label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 700; }
.contact-dialog-header .button { min-height: 40px; padding: 6px 10px; }
.contact-dialog-actions { margin-top: 16px; }
footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding-block: 24px; color: var(--muted); font-size: 13px; }
.footer-inner strong { color: var(--ink); }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 52px); }
  .facts-inner > div { padding-inline: 15px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 0; flex-wrap: wrap; gap: 0 10px; padding-top: 14px; }
  .header-inner nav { order: 3; width: 100%; min-height: 44px; gap: 26px; }
  .button-header { min-height: 38px; padding-inline: 10px; gap: 6px; font-size: 12px; }
  .brand { flex: 1; min-width: 0; font-size: 15px; gap: 8px; }
  .brand-mark { flex-shrink: 0; width: 34px; height: 34px; }
  .brand small { font-size: 8px; white-space: normal; }
  .hero-inner { min-height: 520px; align-items: flex-end; padding-block: 68px 48px; }
  .hero::before { background-image: linear-gradient(0deg, #132821 0%, #132821ed 20%, #13282169 64%, #1328210a 100%), url("hero-santier.webp"); background-position: center, right center; }
  h1 { font-size: clamp(59px, 13vw, 79px); }
  .hero-services { margin-top: 17px; }
  .hero-services ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { gap: 17px; margin-top: 22px; }
  .facts-inner { grid-template-columns: 1fr; padding-block: 6px; }
  .facts-inner > div, .facts-inner > div:first-child { padding: 11px 0; }
  .facts-inner > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 14px; }
  .experience-inner, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .services { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.hero-copy { max-width: 790px; }
h1 { font-size: clamp(46px, 5.7vw, 84px); }
.online { padding-top: 0; }
.online-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.online-cards article, .online-panel { background: var(--surface); border: 1px solid var(--line); padding: clamp(18px, 3vw, 32px); }
.online-cards article { display: flex; flex-direction: column; align-items: flex-start; }
.online-cards h3, .online-panel h3 { margin: 0; font-size: clamp(19px, 2.2vw, 28px); line-height: 1.2; }
.online-cards p, .online-panel > p { color: var(--muted); margin: 10px 0 16px; }
.online-cards .text-link { margin-top: auto; }
.online-panel { margin-top: 20px; scroll-margin-top: 16px; }
.house-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(225px, .7fr); gap: clamp(16px, 4vw, 48px); }
.drawing-column { min-width: 0; }
.house-drawing { position: relative; width: 100%; background-color: #e5e9dd; border: 2px solid #52675b; overflow: hidden; }
.house-room-shape { position: absolute; display: grid; align-content: center; justify-items: center; gap: 2px; background: #fbf8e7; border: 1px solid #4e685a; color: var(--ink); text-align: center; padding: 0; overflow: hidden; font-size: clamp(9px, 1.3vw, 14px); cursor: pointer; }
.house-room-shape.selected { background: #f8c6a1; box-shadow: inset 0 0 0 2px #a74820; z-index: 1; }
.house-room-shape strong, .house-room-shape span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-room-shape:focus-visible { outline-offset: -3px; }
.house-summary, .online-note, .permit-file-list { color: var(--muted); font-size: 14px; }
.house-summary { margin: 8px 0 0; }
.house-controls fieldset { border: 1px solid var(--line); padding: 10px 14px 14px; margin: 0 0 12px; min-width: 0; }
.house-controls legend { padding-inline: 5px; font-weight: 700; }
.online-panel label { display: block; font-size: 14px; font-weight: 700; min-width: 0; }
.online-panel label span { font-weight: 400; }
.online-panel input, .online-panel select, .online-panel textarea { display: block; width: 100%; min-width: 0; margin: 3px 0 8px; padding: 7px 8px; color: var(--ink); background: #fff; border: 1px solid #a5ad9f; border-radius: 3px; font-size: 16px; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.small-button { border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); color: var(--surface); padding: 7px 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.small-button.secondary { background: transparent; color: var(--ink); }
.room-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-status:not(:empty) { background: #f5e9d5; padding: 8px 12px; }
.permit-fields { max-width: 650px; }
.permit-fields .button { margin-top: 6px; }
@media (max-width: 700px) {
  .online-cards { grid-template-columns: 1fr; }
  .house-editor { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  h1 { font-size: clamp(29px, 8.2vw, 49px); }
  .hero-actions { gap: 12px; }
}

.house-room-shape { cursor: grab; touch-action: none; }
.house-room-shape.dragging { cursor: grabbing; z-index: 2; box-shadow: inset 0 0 0 2px #a74820; }
.house-room-shape.invalid-position { background: #ffdbd3; box-shadow: inset 0 0 0 2px #a92721; }
.house-tools, #house-movement:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; }
.house-tools { margin-top: 10px; }
.house-tools .small-button { min-height: 44px; }
#house-movement .small-button { min-width: 44px; font-size: 18px; }
.house-tools button:disabled { opacity: .5; cursor: default; }
