/* Royal Remodeling & Design: page CSS on top of the kit (tokens, grid, section box and buttons come from system.css).
   Motion follows Emil Kowalski: strong ease-out, transform and opacity only, under 300ms except the dialog,
   :active press on every pressable, hover moves only on fine pointers. */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --lb-bg: rgb(24 24 24 / 0.94); --lb-ink: #f8f5f1; --lb-line: rgb(248 245 241 / 0.3); --lb-fill: rgb(248 245 241 / 0.08);
  --gold: #b28b5e;          /* the logo's own gold: decoration only (lines, marks) */
}

/* ---------- header ---------- */
.nav__logo { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.crest { height: 36px; width: auto; display: block; flex: none; }
.nav__name { font: 500 15px/1.1 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }
.nav__name .amp { font-style: italic; letter-spacing: 0; text-transform: none; color: var(--accent); }
.nav__phone { font: 500 var(--t-small)/1 var(--font-text); text-decoration: none; margin-right: var(--s-4); white-space: nowrap; }
@media (max-width: 1279px) { .nav__phone { display: none; } }
@media (max-width: 639px) { .nav__name { font-size: 12px; letter-spacing: 0.12em; } .crest { height: 28px; } }
@media (max-width: 380px) { .nav__name { display: none; } }
.nav .crest, .footer .crest { height: 44px; width: 88px; object-fit: contain; }
@media (max-width: 639px) { .nav .crest, .footer .crest { width: 64px; height: 32px; } }

/* ---------- hero ---------- */
.hero-kicker { font: 500 var(--t-label)/1.2 var(--font-text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-4); }
.hero-trust { margin: var(--s-5) 0 0; font: 500 var(--t-small)/1.5 var(--font-text); color: var(--muted); }
.hero-trust i { font-style: normal; color: var(--gold); margin-inline: var(--s-2); }
@media (max-width: 639px) { .hero-trust i { display: none; } .hero-trust { display: grid; gap: 2px; } }

/* ---------- about / trust ---------- */
.trust { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-6); }
.trust li { display: flex; align-items: center; gap: var(--s-3); padding-block: var(--s-4); border-bottom: 1px solid var(--line); }
.trust svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.trust b { font: 500 var(--t-body)/1.3 var(--font-text); }
.owners { margin: var(--s-5) 0 0; font: 400 var(--t-small)/1.5 var(--font-text); color: var(--muted); }
@media (max-width: 639px) { .trust { grid-template-columns: 1fr; } }

.side-photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; height: min(520px, var(--ly-fit)); background: var(--surface); }
.side-photo--tall { height: min(600px, var(--ly-fit)); }
.side-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--ly-pos, 50% 50%); }
@media (max-width: 1279px) { .side-photo, .side-photo--tall { height: auto; aspect-ratio: 16 / 9; } }
@media (max-width: 1023px) { .side-photo { margin-top: var(--s-6); } }
@media (max-width: 639px) { .side-photo, .side-photo--tall { aspect-ratio: 5 / 3; margin-top: var(--s-5); } }

/* ---------- services ---------- */
.section-head--row .t-lead { max-width: 60ch; }
.svc { display: flex; flex-direction: column; padding: 0; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
.svc__media { position: relative; flex: none; height: 188px; border-radius: 0; overflow: hidden; background: var(--surface); }
.svc__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--ly-pos, 50% 50%); }
.svc__body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); flex: 1; }
.svc h3 { margin: 0; }
.svc p { margin: 0; color: var(--ink); font-size: var(--t-small); line-height: 1.5; }
.svc__list { list-style: none; margin: var(--s-2) 0 var(--s-3); padding: 0; display: grid; gap: 2px; font: 400 var(--t-small)/1.45 var(--font-text); }
.svc__list li { padding-left: var(--s-4); position: relative; }
.svc__list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 1px; background: var(--accent); }
.svc .link { margin-top: auto; align-self: flex-start; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.svc--wide .svc__media { height: 288px; }
@media (max-width: 1023px) { .svc--wide .svc__media { height: 220px; } }


/* ---------- portfolio ---------- */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.gallery li { aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; }
.gallery button { background: var(--surface); }
.gallery button { all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; cursor: zoom-in; overflow: hidden; border-radius: inherit; }
.gallery button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 320ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .gallery button:hover img { transform: scale(1.03); } }
.work-head-cta { margin-top: var(--s-4); }
@media (max-width: 1023px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); } }

/* ---------- why ---------- */
.why { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-6); }
.why > div { padding-block: var(--s-4); border-top: 1px solid var(--line-strong, var(--line)); }
.why dt { font: 500 var(--t-card, 20px)/1.25 var(--font-display); margin: 0 0 var(--s-2); }
.why dd { margin: 0; color: var(--ink); font-size: var(--t-small); line-height: 1.55; }
@media (max-width: 639px) { .why { grid-template-columns: 1fr; } }

/* ---------- process ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); counter-reset: none; }
.steps li { position: relative; padding-top: var(--s-5); border-top: 1px solid var(--line-strong, var(--line)); }
.steps li::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.steps__n { display: block; font: 400 36px/1 var(--font-display); color: var(--accent); margin-bottom: var(--s-3); }
.steps h3 { margin: 0 0 var(--s-2); }
.steps p { margin: 0; color: var(--ink); font-size: var(--t-small); line-height: 1.55; }
.process-photo { margin: var(--s-7) 0 0; height: 200px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.process-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--ly-pos, 50% 50%); }
@media (max-width: 1023px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); } .process-photo { height: 160px; } }
@media (max-width: 639px) {
  .steps { grid-template-columns: 1fr; gap: 0; border-left: 1px solid var(--line-strong, var(--line)); margin-left: 3px; }
  .steps li { border-top: 0; padding: 0 0 var(--s-5) var(--s-5); }
  .steps li::before { top: 8px; left: -4px; }
  .steps__n { font-size: 28px; margin-bottom: var(--s-1); }
  .process-photo { height: 120px; margin-top: var(--s-5); }
}

/* ---------- 3D statement ---------- */
#design-3d .btn-row { margin-top: var(--s-6); }

/* ---------- reviews ---------- */
.reviews { display: grid; gap: 0; }
.review { margin: 0; padding-block: var(--s-5); border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; padding-top: 0; }
.review blockquote { margin: 0 0 var(--s-3); font: 400 clamp(18px, 0.6vw + 15px, 22px)/1.4 var(--font-display); }
.review figcaption { font: 400 var(--t-small)/1.4 var(--font-text); color: var(--muted); display: flex; gap: var(--s-3); flex-wrap: wrap; }
.review figcaption b { color: var(--ink); font-weight: 500; }

/* ---------- final CTA ---------- */
.cta-photo { position: relative; isolation: isolate; overflow: clip; }
.cta-photo .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--ly-pos, 50% 50%); z-index: -1; }
.cta-photo > .wrap { display: grid; align-content: center; }
.cta-box { background: var(--bg); color: var(--ink); border-radius: var(--r-lg); padding: var(--s-7); max-width: 560px; display: grid; gap: var(--s-4); }
.cta-box h2 { margin: 0; }
.cta-box .t-lead { margin: 0; }
@media (max-width: 639px) { .cta-box { padding: var(--s-5); } }

/* ---------- form ---------- */
.reach { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-4); }
.reach li { display: grid; gap: 2px; }
.reach .t-label { color: var(--muted); }
.reach a { font: 500 var(--t-body)/1.4 var(--font-text); }
.lead-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.lead-form .field--full { grid-column: 1 / -1; }
.lead-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23f3eee6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; font: 400 var(--t-small)/1.5 var(--font-text); cursor: pointer; }
.check { min-height: 44px; align-items: center; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--ink); }
.privacy-note { margin: 0; font-size: var(--t-small); color: var(--muted); line-height: 1.5; }
.lead-form .btn { width: 100%; }
.lead-form .btn[disabled] { opacity: 0.7; cursor: progress; }
#lead-status:empty { display: none; }
.status { padding: var(--s-4); border-radius: var(--r-md); font: 500 var(--t-body)/1.5 var(--font-text); border: 1px solid var(--line-strong, var(--line)); }
.status--ok { background: color-mix(in oklab, var(--accent) 10%, var(--bg)); border-color: var(--accent); }
.status--err { background: color-mix(in oklab, #d92d20 8%, var(--bg)); border-color: color-mix(in oklab, #d92d20 60%, var(--ink)); }
.status a { text-decoration: underline; text-underline-offset: 0.2em; }
.status b { display: block; font-family: var(--font-display); font-size: var(--t-card, 20px); font-weight: 500; margin-bottom: 2px; }
@media (max-width: 639px) { .lead-form { grid-template-columns: 1fr; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--lb-bg); color: var(--lb-ink); }
.lightbox[open] { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; animation: lb-in 200ms var(--ease-out); }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: var(--s-3); min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100svh - 140px); width: auto; height: auto; object-fit: contain; border-radius: 4px; transition: opacity 160ms var(--ease-out); }
.lightbox img.is-swap { opacity: 0; }
.lightbox figcaption { font: 400 var(--t-small)/1.4 var(--font-text); text-align: center; color: #d9d5cd; min-height: 1.4em; padding-inline: var(--s-4); }
.lightbox__btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lb-line); background: var(--lb-fill); color: var(--lb-ink); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; justify-self: center; transition: background-color 150ms ease, transform 160ms var(--ease-out); }
.lightbox__btn:hover { background: rgb(248 245 241 / 0.18); }
.lightbox__btn:active { transform: scale(0.95); }
.lightbox__btn:focus-visible { outline: 2px solid #c9a27a; outline-offset: 2px; }
.lightbox__close { position: absolute; top: var(--s-4); right: var(--s-4); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
@media (max-width: 639px) {
  .lightbox[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .lightbox figure { grid-row: 1; padding: 64px var(--s-3) 0; }
  .lightbox__prev, .lightbox__next { position: absolute; bottom: var(--s-5); }
  .lightbox__prev { left: var(--s-5); } .lightbox__next { right: var(--s-5); }
}
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } .lightbox img, .gallery img { transition: none; } }

/* hero headline: the brief's own line is long, so it sets smaller than the kit's 80px to keep three lines */
.hero--photo h1 { font-size: calc(var(--ly-h1-xl) * 0.78); max-width: none; }
@media (min-width: 640px) { .hero--photo h1 { font-size: calc(var(--ly-h1-xl) * 0.62); } }
@media (max-width: 639px) { .hero-kicker, .hero-trust { display: none; } }
.about-lead { margin: 0 0 var(--s-5); color: var(--ink); max-width: 52ch; }
.benefits { list-style: none; margin: var(--s-8) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.benefits li { border-top: 1px solid rgba(248, 245, 241, 0.28); padding-top: var(--s-4); display: grid; gap: var(--s-2); align-content: start; }
.benefits b { font: 500 var(--t-card, 20px)/1.25 var(--font-display); color: var(--ink); }
.benefits span { color: var(--ink); font-size: var(--t-small); line-height: 1.55; }
@media (max-width: 639px) { .benefits { grid-template-columns: 1fr; gap: var(--s-4); margin-top: var(--s-6); } }
.closing__cta .btn-row, .cta-box .btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.work-head .grid { align-items: start; }
.work-head .t-lead { margin: 0; }
.footer__col li, .footer__col a, .footer__legal > * { overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .svc__media, .svc--wide .svc__media { height: 148px; }
  .svc__list { display: none; }
  .svc__body { padding: var(--s-4); }
  .svc-row { row-gap: var(--s-3); }
  .process-photo { height: 200px; }
}

.side-photo--short { height: 232px; margin-top: var(--s-6); }
@media (max-width: 1023px) { .side-photo--short { height: auto; aspect-ratio: 16 / 9; } }
@media (max-width: 639px) { .side-photo--tall { aspect-ratio: 4 / 3; } }


.legal-note { color: var(--muted); }
.footer__legal { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter, 24px); row-gap: var(--s-2); }
.footer__legal > :first-child { grid-column: 1 / span 6; }
.footer__legal > :last-child { grid-column: 7 / -1; }
@media (max-width: 639px) { .footer__legal > * { grid-column: 1 / -1; } }
.lightbox figure, .lightbox img { touch-action: pan-y pinch-zoom; }

/* adapt: from 640 to 1279 the services read as one column of wide rows (a 3-up row is too narrow, a 2-up one strands the odd card),
   the portfolio flows as one block, and the contact form takes two screens */
@media (min-width: 640px) and (max-width: 1279px) {
  #services.g2 > .wrap, #work.g2 > .wrap { display: block; }
  #services .group + .group, #work .group + .group { margin-top: var(--s-5); }
  .svc-row, .svc-row--two { grid-template-columns: 1fr; row-gap: var(--s-5); }
  .svc-row > .svc { grid-column: 1 / -1; flex-direction: row; }
  .svc__media, .svc--wide .svc__media { width: 38%; height: auto; min-height: 100%; flex: none; }
  .svc__list { columns: 2; column-gap: var(--s-5); }
  .svc__list li { break-inside: avoid; }
  #work { --h: 2; }
  #contact { --h: 2; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #work { --h: 1; }
  .side-photo { aspect-ratio: 4 / 3; }
}

.work-head { width: 100%; max-width: none; }

/* dark theme details */
.lead-form select option { background: var(--bg); color: var(--ink); }
.status--ok { background: color-mix(in oklab, var(--accent) 14%, var(--bg)); }
.status--err { background: color-mix(in oklab, #d92d20 18%, var(--bg)); border-color: #e5645a; }
.nav { border-bottom: 1px solid var(--line); }
.crest { mix-blend-mode: lighten; }
