/* Layout: white, airy single page. Hero splits 50/50 with a rounded photo on the right;
   content sits in a 1280px column. Colors and fonts below come from the client's brief. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f4f1;
  --heading: #111111;
  --text: #505050;
  --btn: #111111;
  --btn-text: #ffffff;
  --line: #dedede;
  --scrim: rgba(17, 17, 17, 0.6);

  --font-heading: "Libre Baskerville", Baskerville, "Times New Roman", Georgia, serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 56px);
  --section-space: clamp(64px, 9vw, 120px);
  --photo-radius: 12px;

  color-scheme: light;
}

/* Dark style, set on <html> by js/theme.js. Only the colors change. */
:root[data-site-theme="dark"] {
  --bg: #2e2e2b;
  --bg-alt: #383834;
  --heading: #f5f4f1;
  --text: #d2d1cc;
  --btn: #f5f4f1;
  --btn-text: #111111;
  --line: #52524c;
  --scrim: rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-family: var(--font-heading);
  font-weight: 400;
  text-wrap: balance;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--heading);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--btn);
  color: var(--btn-text);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.eyebrow {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 32px;
  border: 1px solid var(--btn);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.7;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-solid {
  background: var(--btn);
  color: var(--btn-text);
}

.btn-outline {
  border-color: var(--line);
  background: transparent;
  color: var(--heading);
}

/* Same height as the style button beside it in the header. */
.btn-small {
  min-height: 40px;
  padding: 6px 16px;
  font-size: 0.9375rem;
}

/* Photo slot */
.photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--photo-radius);
  background: var(--line);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 1. Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 40px;
  padding-block: 22px;
}

.brand {
  display: inline-block;
  text-decoration: none;
}

.brand-name {
  display: block;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 1.3125rem;
  line-height: 1.3;
}

.brand-tagline {
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  line-height: 1.4;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 6px;
  color: var(--heading);
  text-decoration: none;
  text-underline-offset: 6px;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 36px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--heading);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.theme-toggle:hover {
  opacity: 0.7;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* 2. Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  min-width: 0;
  padding-block: clamp(56px, 8vw, 112px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  padding-right: clamp(24px, 4vw, 64px);
}

.hero h1 {
  font-size: clamp(2.5rem, 4.4vw, 4rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.hero-lead {
  max-width: 28em;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  color: var(--heading);
  font-size: 0.9375rem;
  list-style: none;
}

.trust-points li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust-points li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--heading);
}

.hero-photo {
  margin-block: clamp(16px, 2vw, 24px);
  margin-right: max(clamp(16px, 2vw, 24px), env(safe-area-inset-right, 0px));
}

.hero-photo img {
  position: absolute;
  inset: 0;
  object-position: 30% center;
}

/* 3. Services */
.services {
  padding-block: clamp(56px, 7vw, 88px);
}

.service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding-inline: clamp(24px, 4vw, 56px);
}

.service:first-child {
  padding-left: 0;
}

.service:last-child {
  padding-right: 0;
}

.service + .service {
  border-left: 1px solid var(--line);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--heading);
}

.service-icon svg {
  width: 28px;
  height: 28px;
}

.service h3 {
  font-size: 1.3125rem;
  line-height: 1.35;
}

.service p {
  max-width: 30em;
}

/* 4. Project gallery */
.work {
  padding-block: var(--section-space);
  background: var(--bg-alt);
}

.work-heading {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.work-heading h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.placeholder-note {
  max-width: 44em;
  font-size: 0.9375rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.work-card {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--photo-radius);
  border: 1px solid var(--line);
  background: var(--bg);
}

.work-card .photo {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 0;
}

.work-card .photo img {
  transition: transform 0.45s ease;
}

/* The photo sits in the card's slot on the page while its enlarged copy is open. */
.work-card.is-source .photo img {
  visibility: hidden;
}

/* Fills the whole card, so the caption strip is clickable too. */
.work-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.work-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
}

.work-trigger:focus-visible {
  outline: none;
}

.work-card:has(.work-trigger:focus-visible) {
  outline: 2px solid var(--heading);
  outline-offset: 3px;
}

.work-card figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 16px 20px;
  color: var(--heading);
  font-weight: 600;
}

.work-hint {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 400;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .work-card:hover .photo img {
    transform: scale(1.04);
  }
}

@media (hover: hover) {
  .work-card:hover .work-hint {
    color: var(--heading);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
  }
}

/* Enlarged card */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow: auto;
  border: 0;
  background: transparent;
  color: var(--text);
}

.lightbox[open] {
  display: flex;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
}

/* Sized so the photo and text fit on screen together; very short screens scroll. */
.lightbox-card {
  position: relative;
  width: min(720px, 100%, max(280px, (100vh - 240px) * 1.5));
  width: min(720px, 100%, max(280px, (100dvh - 240px) * 1.5));
  margin: auto;
  transform-origin: 0 0;
}

.lightbox-photo {
  aspect-ratio: 3 / 2;
  border-radius: var(--photo-radius) var(--photo-radius) 0 0;
}

.lightbox-body {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 0 0 var(--photo-radius) var(--photo-radius);
  background: var(--bg);
}

.lightbox-body h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--heading);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

/* Customer reviews: hidden until the first real review is added */
.reviews {
  padding-top: var(--section-space);
}

.reviews h2 {
  margin-bottom: clamp(32px, 4vw, 48px);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(16px, 2.5vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.review {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--photo-radius);
}

.review blockquote {
  margin: 0 0 16px;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  line-height: 1.6;
}

.review-name {
  color: var(--heading);
  font-weight: 600;
}

.review-job {
  font-size: 0.9375rem;
}

/* 5. Contact */
.contact {
  padding-block: var(--section-space);
}

.contact .wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(40px, 7vw, 96px);
}

.contact-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}

.contact h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.contact-lead {
  max-width: 30em;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 8px;
}

.contact-actions .btn {
  min-width: 160px;
}

.contact-details {
  display: grid;
  gap: 4px;
  font-size: 0.9375rem;
}

/* Asks before calling or opening the visitor's email app. */
.contact-confirm {
  width: min(460px, 100% - 32px);
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--photo-radius);
  background: var(--bg);
  color: var(--text);
}

.contact-confirm::backdrop {
  background: var(--scrim);
}

.contact-confirm-panel {
  display: grid;
  gap: 12px;
  padding: clamp(24px, 5vw, 32px);
}

.contact-confirm h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.contact-confirm p {
  overflow-wrap: anywhere;
}

.contact-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.contact-confirm-actions .btn {
  flex: 1 1 140px;
  padding-inline: 20px;
}

/* Estimate form */
.estimate {
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--photo-radius);
  background: var(--bg-alt);
  scroll-margin-top: 24px;
}

.estimate h3 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  line-height: 1.3;
}

.estimate-form {
  display: grid;
  gap: 16px;
}

.estimate-form:focus {
  outline: none;
}

/* Kept off screen by the stylesheet, so simple bots still see an ordinary field in the HTML. */
.estimate-honeypot {
  display: none;
}

.estimate-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
}

.estimate-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.estimate-field label {
  color: var(--heading);
  font-size: 0.9375rem;
  font-weight: 600;
}

.estimate-field input,
.estimate-field select,
.estimate-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--bg);
  color: var(--heading);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.estimate-field textarea {
  display: block;
  resize: vertical;
}

.estimate-field textarea::placeholder {
  color: var(--text);
  opacity: 1;
}

/* Two small triangles drawn in the heading color, so the arrow follows the light and dark styles. */
.estimate-field select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--heading) 50%), linear-gradient(135deg, var(--heading) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.estimate-field [aria-invalid="true"] {
  border-color: var(--heading);
  box-shadow: inset 0 0 0 1px var(--heading);
}

.estimate-hint {
  margin-top: -8px;
  font-size: 0.9375rem;
}

.estimate-contact-error {
  margin-top: -8px;
  color: var(--heading);
  font-size: 0.9375rem;
  font-weight: 600;
}

.estimate-submit {
  width: 100%;
}

.estimate-status p {
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--heading);
  overflow-wrap: anywhere;
}

.estimate-failure-detail {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.estimate-status:not(:has(p:not([hidden]))) {
  display: none;
}

/* 6. Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 48px;
  padding-block: 32px;
}

.footer-group {
  min-width: 0;
}

.footer-name {
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 1.0625rem;
}

.site-footer a {
  display: inline-block;
  padding-block: 4px;
  overflow-wrap: anywhere;
}

/* Tablet and phone */
@media (max-width: 860px) {
  .hero,
  .contact .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-text {
    padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .hero-photo {
    margin-top: 0;
    margin-bottom: var(--gutter);
    margin-left: max(var(--gutter), env(safe-area-inset-left, 0px));
    margin-right: max(var(--gutter), env(safe-area-inset-right, 0px));
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 760px) {
  .service-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .service,
  .service:first-child,
  .service:last-child {
    padding-inline: 0;
    padding-block: 32px;
  }

  .service:first-child {
    padding-top: 0;
  }

  .service:last-child {
    padding-bottom: 0;
  }

  .service + .service {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tools {
    gap: 8px 16px;
  }

  .site-nav ul {
    column-gap: 20px;
  }

  .hero-actions,
  .hero-actions .btn,
  .contact-actions,
  .contact-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .theme-toggle,
  .work-card .photo img,
  .lightbox-close {
    transition: none;
  }
}
