:root{
  --bg:#f4eadb;
  --panel:#fff8ed;
  --text:#2e2219;
  --muted:#655247;
  --border:rgba(89,62,38,.24);
  --accent:#e4c392;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
}

a{color:inherit}
.container{width:min(1100px, 100%); margin:0 auto; padding:0 16px}
.sr-only{position:absolute;left:-9999px}
.skip{position:absolute;left:-9999px;top:auto}

.skip:focus{left:12px; top:12px; z-index:20; padding:10px 14px; background:var(--panel); border-radius:8px}

.site-header{background:#f9f1e4; border-bottom:1px solid var(--border)}
.header-row{display:grid; justify-items:center; gap:12px; padding:10px 16px 16px}
.brand{display:block; width:min(100%, clamp(200px, 60vw, 390px))}
.site-header-compact .header-row{gap:6px; padding-block:6px 10px}
.site-header-compact .brand{width:min(100%, clamp(126px, 36vw, 185px))}
.brand-logo{display:block; width:100%; height:auto}
.footer-brand{display:flex; align-items:center; gap:12px}
.footer-brand .brand-logo{width:96px}
.muted{color:var(--muted); font-size:13px}

.site-nav{display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); width:min(100%, 610px); gap:8px}
.site-nav > a{display:flex; align-items:center; justify-content:center; min-height:44px; padding:8px; border:1px solid var(--border); border-radius:9px; background:var(--panel); font-size:.95rem; font-weight:700; line-height:1.25; text-align:center; text-decoration:none; overflow-wrap:anywhere}
.site-nav > a.nav-contact{background:#e4c392; border-color:#b89058}
.site-nav > a[aria-current="page"]{background:#e9d6b8; border-color:#997444; box-shadow:inset 0 -3px #997444}
@media (hover:hover){.site-nav > a:hover{background:#e9d6b8; border-color:#997444}}
:focus-visible{outline:2px solid #735123; outline-offset:3px}

.service-map{
  display:grid;
  grid-template-columns:minmax(80px, 150px) minmax(0, 1fr);
  align-items:center;
  width:min(100%, 415px);
  gap:12px;
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--panel);
}
.service-map-preview{display:block; min-width:0; border-radius:5px}
.service-map img{display:block; width:100%; height:auto; border-radius:5px}
.service-map p{margin:0; font-size:.875rem; font-weight:700; line-height:1.3}
.service-map a{color:#724719; font-size:.875rem; text-underline-offset:3px}
.service-map a[href^="https:"]{display:inline-flex; align-items:center; min-height:44px}

@media (max-width:520px){
  .header-row{gap:8px; padding:8px 12px 12px}
  .site-nav{grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px}
  .site-nav > a{grid-column:span 2; font-size:.875rem; padding-inline:4px}
  .site-nav > a:nth-last-child(-n+2){grid-column:span 3}
  .service-map{grid-template-columns:minmax(70px, 34%) minmax(0, 1fr); gap:10px; padding:6px 10px}
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  border:1px solid var(--border);
  background:var(--accent);
  color:#2e2219;
  padding:12px 14px;
  border-radius:14px;
  text-decoration:none;
  font-weight:700;
}
.btn.small{padding:10px 12px; border-radius:12px; font-weight:700}
.btn.ghost{
  background:transparent;
  color:var(--text);
}
.link{color:var(--text); opacity:.9; text-decoration:none}
.link:hover{text-decoration:underline}

.hero{padding:28px 0 10px}
.hero-grid{display:grid; gap:16px}
.hero h1{font-size:34px; line-height:1.12; margin:0 0 10px}
.lead{color:var(--muted); font-size:16px; margin:0 0 16px}
.hero-actions{display:flex; flex-wrap:wrap; gap:10px}

.callout{
  margin-top:16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(137,93,52,.07);
}
.callout h2{font-size:16px; margin:0 0 8px}
.callout ol{margin:0; padding-left:18px; color:var(--muted)}
.callout li{margin:6px 0}

.hero-card{
  margin:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--panel);
  align-self:center;
}
.hero-card img{display:block; width:100%; height:auto}

.section{padding:26px 0}
.section.alt{background:rgba(137,93,52,.045); border-top:1px solid var(--border); border-bottom:1px solid var(--border)}
.section h2{margin:0 0 12px; font-size:22px}

.section-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap}

.cards{display:grid; gap:12px}
.card{
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  background:rgba(137,93,52,.045);
}
.card h3{margin:0 0 6px; font-size:16px}
.card p{margin:0; color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
.tile{border-radius:16px; overflow:hidden; text-decoration:none; border:1px solid var(--border)}
.thumb{
  aspect-ratio: 4/3;
  display:grid; place-items:center;
  background:rgba(137,93,52,.07);
  color:#655247;
  font-weight:700;
}

.split{display:grid; gap:12px}
.panel{
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  background:rgba(137,93,52,.045);
}
.panel h3{margin:0 0 6px; font-size:16px}
.panel p{margin:0 0 10px; color:var(--muted)}

.site-footer{
  padding:18px 0;
  border-top:1px solid var(--border);
}
.footer-row{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap}
.footer-links{display:flex; gap:12px}
.footer-links a{color:var(--muted); text-decoration:none}
.footer-links a:hover{text-decoration:underline}

@media (min-width: 860px){
  .hero-grid{grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items:stretch}
  .cards{grid-template-columns: repeat(3, minmax(0, 1fr))}
  .grid{grid-template-columns: repeat(4, minmax(0, 1fr))}
  .split{grid-template-columns: repeat(2, minmax(0, 1fr))}
}
/* --- extra components for the new pages --- */

.h1{font-size:28px; margin:0 0 8px}
.h3{font-size:15px; margin:0 0 8px}
.hr{border:0; border-top:1px solid var(--border); margin:14px 0}

.toolbar{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top:14px;
}
.field{display:grid; gap:6px}
.field-label{color:var(--muted); font-size:13px}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(137,93,52,.045);
  color:var(--text);
  outline:none;
}
.input:focus{border-color:#997444}
.textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(137,93,52,.045);
  color:var(--text);
  outline:none;
  resize:vertical;
}

.gallery-grid{margin-top:14px}
.gallery-tile{
  display:block;
  text-decoration:none;
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:rgba(137,93,52,.045);
}
.gallery-tile img{
  width:100%;
  height:auto;
  display:block;
  aspect-ratio: 4/3;
  object-fit: cover;
  background:rgba(137,93,52,.07);
}
.gallery-meta{padding:10px}
.gallery-meta strong{display:block}
.gallery-meta span{color:var(--muted); font-size:13px}

.note{
  margin-top:16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(137,93,52,.07);
}
.note h2{margin:0 0 8px; font-size:18px}
.note ol{margin:0 0 12px; padding-left:18px; color:var(--muted)}

.list{margin:0; padding-left:18px}
.list li{margin:6px 0; color:var(--muted)}
.actions{display:flex; flex-wrap:wrap; gap:10px; margin-top:10px}

.details{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:rgba(137,93,52,.045);
  margin:10px 0;
}
.details summary{
  cursor:pointer;
  font-weight:800;
}
.details p{margin:10px 0 0}

@media (min-width: 860px){
  .toolbar{grid-template-columns: 1fr 240px}
}
/* --- Before/After gallery layout --- */

.ba-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
  margin-top:14px;
}

.ba-card{
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  background:rgba(137,93,52,.045);
}

.ba-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px 0 12px;
  flex-wrap:wrap;
}
.ba-head strong{font-size:16px}
.ba-head .muted{margin:0}

.ba-pair{
  display:grid;
  grid-template-columns: 1fr; /* mobile: stacked */
  gap:10px;
  padding:12px;
}

.ba-figure{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:rgba(137,93,52,.045);
  text-decoration:none;
  color:inherit;
}

.ba-figure img{
  width:100%;
  display:block;
  aspect-ratio: 4/3;
  object-fit:cover;
  background:rgba(137,93,52,.07);
}

.ba-cap{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 10px;
  font-weight:800;
}
.ba-cap span{
  font-weight:600;
  color:var(--muted);
  font-size:13px;
}

.ba-actions{
  padding:0 12px 12px 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (min-width: 860px){
  .ba-grid{grid-template-columns: repeat(2, minmax(0, 1fr));}
  .ba-pair{grid-template-columns: 1fr 1fr;} /* desktop: side-by-side */
}
/* --- Before/After thumbnail gallery --- */

.ba-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
  margin-top:14px;
}

.ba-card{
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  background:rgba(137,93,52,.045);
}

.ba-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px 10px 12px;
  flex-wrap:wrap;
}
.ba-head strong{font-size:16px}
.ba-head .muted{margin:0}

.ba-thumbs{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  padding:0 12px 12px 12px;
}

.ba-thumb{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:rgba(137,93,52,.045);
  text-decoration:none;
  color:inherit;
  display:block;
}

.ba-thumb img{
  width:100%;
  height:160px;          /* thumbnail height */
  object-fit:cover;
  display:block;
  background:rgba(137,93,52,.07);
}

.ba-cap{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 10px;
  font-weight:800;
}
.ba-cap span{
  font-weight:600;
  color:var(--muted);
  font-size:13px;
}

.ba-actions{
  padding:0 12px 12px 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* --- Lightbox --- */



.lightbox-panel{
  width:min(980px, calc(100% - 24px));
  margin:auto;
  max-height:calc(100dvh - 24px);
  padding:0;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:auto;
  background:var(--panel);
}

.lightbox-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
.lightbox-title{font-weight:900}
.lightbox-close{
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  border-radius:12px;
  padding:8px 10px;
  font-size:16px;
}

.lightbox-body{
  padding:12px;
}

.lightbox-img{
  width:100%;
  height:auto;
  max-height:60dvh;
  object-fit:contain;
  display:block;
  background:rgba(137,93,52,.045);
  border-radius:14px;
}

.lightbox-controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

@media (min-width: 860px){
  .ba-grid{grid-template-columns: repeat(2, minmax(0, 1fr));}
  .ba-thumb img{height:190px;}
}
.ba-thumbs.single { grid-template-columns: 1fr; }
/* thumbnail box */
.thumb-box{
  aspect-ratio: 4 / 3;         /* or 16/9, or remove if you want natural height */
  overflow: hidden;
}

/* give the tile a consistent box */
.tile {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(89,62,38,.24);
  text-decoration: none;
}

/* make sure the image has a box to fit into */
.tile-img {
  width: 100%;
  height: 160px;          /* adjust */
  display: block;
  object-fit: cover;      /* use contain if you don't want cropping */
  object-position: center;
}.showcase-img {
  width: 1000px;
  height: 500px;          /* adjust */
  display: block;
  object-fit: contain;      /* use contain if you don't want cropping */
  object-position: center;
}
.ba-thumb{padding:0; font:inherit; cursor:pointer}
.ba-thumb img{object-fit:contain}
.gallery-dialog::backdrop{background:rgba(45,30,17,.58)}
.gallery-dialog .lightbox-close{cursor:pointer}
.gallery-dialog .lightbox-body > a{margin-top:10px}
.lightbox-controls [aria-pressed="true"]{border-color:currentColor}
.guide-image{display:block; max-width:100%; height:auto}
.anatomy-guide{max-width:800px; margin-top:12px}
.anatomy-bottom{display:grid; grid-template-columns:431fr 369fr}
.anatomy-guide img{width:100%}
.product-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 126px), 1fr)); gap:12px; margin-block:12px}
.product-card{margin:0; padding:8px; border:1px solid var(--border); border-radius:12px; text-align:center}
.product-card a{display:block; background:white; border-radius:8px; padding:6px}
.product-image{display:block; width:100%; height:145px; object-fit:contain}
.product-card figcaption{padding-top:6px; overflow-wrap:anywhere}

.rights-notice{margin:12px 0 0; padding-top:12px; border-top:1px solid var(--border); color:var(--muted); font-size:.875rem}
.rights-notice strong{color:var(--text)}

.ba-card, .product-card, main h2[id], main details[id], #installation-video{scroll-margin-top:1rem}
.product-card:target{border-color:var(--muted)}

/* Homepage feature */
.hero{padding-block:clamp(16px, 3.5vw, 44px) 24px}
.hero-grid{gap:clamp(14px, 4vw, 48px)}
.hero-copy{align-self:center; min-width:0}
.hero h1{font-size:clamp(1.8rem, 5vw, 3.6rem); letter-spacing:-.03em; line-height:1.1; text-wrap:balance}
.hero-location{margin:0 0 12px; color:#724719; font-weight:700}
.hero .lead{font-size:clamp(1rem, 2vw, 1.2rem); max-width:34ch}
.hero-primary{background:#efca8c; color:#1c1408; border-color:#724719}
.hero-primary:hover{background:#f8dba9}
.hero-license{margin:8px 0 0; color:var(--muted); font-size:.875rem}
.hero-card figcaption{padding:12px 16px; font-size:.9rem}
.hero-card figcaption a{color:#724719; text-underline-offset:.2em}

/* Project comparisons and saved styles */
.project-view{margin-top:12px}
.project-photo{margin:0; min-width:0}
.project-photo img{display:block; width:100%; height:auto; max-height:53dvh; object-fit:contain; background:var(--panel); border-radius:10px}
.project-photo figcaption{margin-top:6px; font-weight:700}
.project-pair{display:grid; gap:16px}
.comparison-slider{--photo-ratio:1.3333; width:min(100%, 640px); margin-inline:auto}
.comparison-slider[hidden], .project-pair[hidden]{display:none}
.comparison-layout{margin-bottom:12px}
.comparison-frame{position:relative; cursor:ew-resize; touch-action:pan-y; overflow:hidden; width:min(100%, calc(54dvh * var(--photo-ratio))); margin-inline:auto; aspect-ratio:var(--photo-ratio); border-radius:10px; background:var(--panel)}
.comparison-frame img{pointer-events:none; position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:var(--panel)}
.comparison-after{clip-path:inset(0 calc(100% - var(--split, 50%)) 0 0)}
.comparison-line{position:absolute; inset-block:0; left:var(--split, 50%); width:3px; transform:translateX(-50%); background:#fff; box-shadow:0 0 5px #000}
.comparison-controls{display:grid; grid-template-columns:auto minmax(0, 1fr) auto; align-items:center; gap:10px; margin-top:8px}
.comparison-controls input{width:100%; margin:0; min-height:44px; accent-color:#724719}
.comparison-links{display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-top:8px; font-size:.875rem}
.shortlist-toggle{position:fixed; z-index:9; right:16px; bottom:max(16px, env(safe-area-inset-bottom)); box-shadow:0 6px 24px #0008; background:#efca8c; color:#1c1408}
.shortlist-toggle[hidden], .lightbox-controls[hidden]{display:none}
body:has(.shortlist-toggle:not([hidden])) .site-footer{padding-bottom:76px}
.save-style{min-height:44px}
.save-style[aria-pressed="true"]{color:#724719; border-color:#724719}
.shortlist-dialog{max-width:540px}
.shortlist-items{list-style:none; padding:0; margin:0}
.shortlist-items li{display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--border); padding:8px 0}
@media (min-width:860px){
  .hero-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1.12fr)}
  .project-pair{grid-template-columns:repeat(2,minmax(0,1fr))}
  .shortlist-toggle{position:static; margin-top:12px; box-shadow:none}
  body:has(.shortlist-toggle:not([hidden])) .site-footer{padding-bottom:18px}
}

.gallery-filter{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px}
.gallery-filter[hidden]{display:none}
.gallery-filter-sub{padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--panel)}
.gallery-filter .btn{min-height:44px; text-align:center}
.gallery-filter a[aria-current="page"]{background:#e9d6b8; border-color:#997444; box-shadow:inset 0 -2px #997444}
@media (hover:hover){.gallery-filter a:hover{background:#e9d6b8}}
.category-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px}
.category-card{display:flex; flex-direction:column; background:var(--panel); font-weight:700}
.category-card .tile-img{height:auto; aspect-ratio:4 / 3}
.category-card span{padding:10px 12px; overflow-wrap:anywhere}
@media (hover:hover){.category-card:hover{border-color:#997444; background:#e9d6b8}}
@media (min-width:680px){.category-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:960px){.category-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}

.email-actions{display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center}
.email-action{min-height:44px; font:inherit; font-weight:700; cursor:pointer}
.email-actions .copy-email[hidden]{display:none}
.email-actions .email-address, .email-actions .email-status{flex-basis:100%; margin:0; overflow-wrap:anywhere}
.email-status:empty{position:absolute}
.email-address{user-select:all}

.gallery-preview{grid-column:1 / -1}
