:root {
  --green: #123324;
  --green-2: #1e4a34;
  --orange: #d9822b;
  --cream: #f7f3ea;
  --paper: #fffaf1;
  --charcoal: #1e211f;
  --muted: #657063;
  --line: #ded6c8;
  --radius: 8px;
  --header-h: 73px;
  --page-progress: 0;
  --hero-copy-y: 0px;
  --hero-copy-opacity: 1;
  --hero-overlay-opacity: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.5;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

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

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.45rem;
}

section[id] {
  scroll-margin-top: var(--header-h);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(247, 243, 234, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: padding .28s ease, background .28s ease, box-shadow .28s ease;
}

.scroll-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--orange);
  transform: scaleX(var(--page-progress));
  transform-origin: left center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: width .28s ease, height .28s ease;
}

nav {
  display: flex;
  gap: clamp(12px, 3vw, 30px);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

nav a {
  position: relative;
  text-decoration: none;
  transition: color .2s ease;
}

nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  background: var(--orange);
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .24s ease;
}

nav a:hover,
nav a.is-active {
  color: #a85c12;
}

nav a:hover::after,
nav a.is-active::after {
  transform: scaleX(1);
}

/* Hero */

.hero {
  position: relative;
  display: flex;
  min-height: calc(100svh - var(--header-h));
  overflow: hidden;
  isolation: isolate;
  background: var(--green);
  color: white;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 980px);
  padding: clamp(70px, 12vw, 150px) clamp(20px, 6vw, 78px) clamp(70px, 10vw, 130px);
}

.hero h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 6.4vw, 5.9rem);
  line-height: .94;
}

.hero-lede {
  max-width: 34ch;
  margin-bottom: 0;
  color: rgba(255, 255, 255, .9);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.4;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 900;
  text-decoration: none;
  transition: transform .28s ease, box-shadow .28s ease, background-color .28s ease;
}

.button.primary {
  background: var(--orange);
  color: #151515;
}

.button.secondary {
  border-color: rgba(255, 255, 255, .42);
  color: white;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 22, 17, .9) 0%, rgba(12, 22, 17, .68) 38%, rgba(12, 22, 17, .2) 72%),
    linear-gradient(180deg, rgba(18, 51, 36, .1), rgba(18, 51, 36, .76));
  content: "";
  opacity: calc(.72 + var(--hero-overlay-opacity));
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
}

/* Photo panels (intro + contact) */

.photo-panel,
.work {
  padding: clamp(54px, 8vw, 108px) clamp(18px, 5vw, 72px);
}

.photo-panel {
  position: relative;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(28px, 6vw, 90px);
  align-items: end;
  overflow: hidden;
  color: white;
  isolation: isolate;
}

.photo-panel::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(10, 18, 14, .88) 0%, rgba(10, 18, 14, .7) 42%, rgba(10, 18, 14, .24) 78%),
    linear-gradient(180deg, rgba(10, 18, 14, .12), rgba(10, 18, 14, .86));
  content: "";
  pointer-events: none;
}

.panel-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.panel-copy {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.panel-copy p {
  max-width: 650px;
  color: rgba(255, 255, 255, .8);
  font-size: 1.2rem;
}

.photo-panel-what {
  min-height: min(96vh, 900px);
}

.photo-panel-what .panel-bg {
  object-position: 62% center;
}

.photo-panel-contact {
  min-height: min(82vh, 780px);
  background: var(--charcoal);
}

.photo-panel-contact .panel-bg {
  object-position: center 42%;
}

/* Services */

.services {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: clamp(34px, 6vw, 76px);
  overflow: hidden;
  background: var(--charcoal) url("images/opt/working2-720.jpg") center 48% / cover no-repeat;
  isolation: isolate;
}

.services::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(14, 25, 19, .9), rgba(14, 25, 19, .64)),
    linear-gradient(180deg, rgba(14, 25, 19, .12), rgba(14, 25, 19, .82));
  content: "";
  pointer-events: none;
}

.services article {
  position: relative;
  z-index: 1;
  min-height: 250px;
  padding: clamp(24px, 4vw, 44px);
  color: white;
  background: rgba(255, 250, 241, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, background-color .28s ease;
}

.services p {
  color: rgba(255, 255, 255, .78);
  font-size: 1.12rem;
}

/* Work gallery */

.work {
  background: #111713;
  color: white;
}

.section-heading {
  max-width: 780px;
  margin-bottom: clamp(28px, 5vw, 54px);
}

.section-heading p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 1.25rem;
}

figure {
  margin: 0;
}

.projects {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
}

.project h3 {
  margin-bottom: 16px;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 20px);
}

.stages figure {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f1511;
  border-radius: var(--radius);
}

.stages img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.05) saturate(1.06);
  transition: transform .5s ease;
}

.stages figcaption {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 23, 19, .86);
  color: white;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stages figure:last-child figcaption {
  background: var(--orange);
  color: #151515;
}

/* Photo viewer */

.stage-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.stage-link picture {
  display: block;
  height: 100%;
}

.has-lightbox {
  overflow: hidden;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b100d;
  color: white;
  outline: none;
}

.lightbox::backdrop {
  background: rgba(8, 12, 10, .97);
}

.lightbox-frame {
  display: grid;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 64px 72px 28px;
  pointer-events: none;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  border-radius: var(--radius);
  pointer-events: auto;
}

.lightbox-frame figcaption {
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.lightbox-btn {
  position: fixed;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(17, 23, 19, .8);
  color: white;
  font: 400 2.2rem/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: var(--orange);
  color: #151515;
  outline: none;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.lightbox-close {
  top: 14px;
  right: 14px;
}

@media (max-width: 880px) {
  .lightbox-frame {
    padding: 70px 12px 96px;
  }

  .lightbox-frame img {
    max-height: calc(100dvh - 200px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 64px);
  }

  .lightbox-next {
    right: calc(50% - 64px);
  }
}

/* Contact card */

.contact-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: clamp(22px, 4vw, 36px);
  background: rgba(255, 250, 241, .94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  color: var(--charcoal);
}

.contact-card a {
  width: fit-content;
  color: var(--green-2);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-weight: 900;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-card a:hover {
  color: #a85c12;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 4px;
}

.contact-card .contact-phone {
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: var(--orange);
  color: #151515;
  border: 2px solid rgba(21, 21, 21, .14);
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(217, 130, 43, .24);
  transition: transform .28s ease, box-shadow .28s ease;
}

.contact-card .contact-phone:hover {
  color: #151515;
  text-decoration: none;
}

.contact-card .contact-facebook {
  font-size: 1.1rem;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 4px;
}

.contact-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Phone call bar (phones only, shown by script.js) */

.call-bar {
  display: none;
}

/* Desktop hover and motion */

@media (min-width: 881px) and (prefers-reduced-motion: no-preference) {
  .is-scrolled .site-header {
    padding-top: 8px;
    padding-bottom: 8px;
    background: rgba(247, 243, 234, .98);
    box-shadow: 0 10px 28px rgba(30, 33, 31, .1);
  }

  .is-scrolled .brand img {
    width: 40px;
    height: 40px;
  }

  .hero-copy {
    opacity: var(--hero-copy-opacity);
    transform: translate3d(0, var(--hero-copy-y), 0);
    will-change: opacity, transform;
  }

  .hero-copy h1,
  .hero-copy .actions {
    animation: heroRise .72s ease both;
  }

  .hero-copy h1 {
    animation-delay: .08s;
  }

  .hero-copy .hero-lede {
    animation: heroRise .72s ease both;
    animation-delay: .15s;
  }

  .hero-copy .actions {
    animation-delay: .22s;
  }

  .button:hover,
  .contact-card .contact-phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  }

  .button.secondary:hover {
    background-color: rgba(255, 255, 255, .1);
  }

  .services article:hover {
    transform: translateY(-6px);
    background-color: rgba(255, 250, 241, .18);
    border-color: rgba(217, 130, 43, .82);
    box-shadow: 0 24px 54px rgba(0, 0, 0, .28);
  }

  .stages figure:hover img {
    transform: scale(1.035);
  }

  @keyframes heroRise {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Tablet and phone */

@media (max-width: 880px) {
  :root {
    --header-h: 60px;
  }

  .site-header {
    gap: 12px;
    padding: 8px 16px;
  }

  .scroll-progress {
    display: none;
  }

  .brand {
    gap: 8px;
    font-size: 1rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  nav {
    gap: 14px;
    font-size: .86rem;
  }

  nav a {
    padding: 10px 0;
  }

  nav a::after {
    bottom: 4px;
  }

  .hero-copy {
    justify-content: flex-end;
    padding: 96px 24px clamp(64px, 12vh, 120px);
  }

  .hero-media::after {
    background:
      linear-gradient(180deg, rgba(12, 22, 17, .48), rgba(12, 22, 17, .84)),
      linear-gradient(90deg, rgba(12, 22, 17, .68), rgba(12, 22, 17, .2));
  }

  .photo-panel {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .services {
    display: block;
    padding: 28px 24px 34px;
    background-image:
      linear-gradient(180deg, rgba(11, 19, 15, .92), rgba(11, 19, 15, .97)),
      url("images/opt/working2-720.jpg");
  }

  .services::after {
    display: none;
  }

  .services article {
    min-height: 0;
    padding: 16px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .services article:last-child {
    border-bottom: 0;
  }

  .services h3 {
    margin-bottom: 4px;
    font-size: 1.4rem;
  }

  .services p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 1.15rem;
  }

  /* Each project becomes a swipe row so photos stay large. */
  .stages {
    display: flex;
    gap: 12px;
    margin: 0 calc(-1 * clamp(18px, 5vw, 72px));
    padding: 0 clamp(18px, 5vw, 72px) 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 clamp(18px, 5vw, 72px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .stages::-webkit-scrollbar {
    display: none;
  }

  .stages figure {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .stages figcaption {
    font-size: 1.05rem;
  }

  /* Bigger type on phones: client said it was too small to read. */
  body {
    font-size: 1.125rem;
  }

  .section-heading p,
  .panel-copy p {
    font-size: 1.22rem;
  }

  .project h3 {
    font-size: 1.5rem;
  }

  .contact-card p {
    font-size: 1.12rem;
  }

  /* Room so the call bar never covers the end of the page. */
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .call-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(17, 23, 19, .96);
    border-top: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(110%);
    transition: transform .25s ease;
  }

  .call-bar.is-visible {
    transform: translateY(0);
  }

  .call-bar a {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 4px;
    font-weight: 900;
    text-decoration: none;
  }

  .call-bar-call {
    background: var(--orange);
    color: #151515;
  }

  .call-bar-email {
    border: 1px solid rgba(255, 255, 255, .42);
    color: white;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    max-width: 10.5ch;
    font-size: clamp(2.45rem, 11vw, 3.15rem);
    line-height: .96;
  }

  .actions,
  .button {
    width: min(100%, 370px);
  }

  .button {
    min-height: 52px;
    padding: 12px 16px;
  }
}

/* Phones: put the name on two lines so the header stays one row. */
@media (max-width: 480px) {
  .brand span {
    max-width: 7.5em;
    font-size: .92rem;
    line-height: 1.1;
    white-space: normal;
  }
}

@media (max-width: 350px) {
  nav {
    gap: 10px;
    font-size: .74rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
