:root {
  --bg: #0b1622;
  --ink: #eaf2f8;
  --muted: #acc1d1;
  --surface: #112437;
  --surface-2: #172f46;
  --line: #29445c;
  --brand: #7ed0ff;
  --brand-2: #4ca6d8;
  --accent: #f4b37a;
  --shadow: 0 20px 50px rgba(2, 8, 14, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1000px 540px at 90% -10%, rgba(76, 166, 216, 0.2), transparent 62%),
    radial-gradient(900px 540px at 5% 108%, rgba(244, 179, 122, 0.2), transparent 66%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.2rem 1rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 34, 52, 0.95), rgba(10, 24, 38, 0.95));
}

.brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 0.7rem;
  align-items: center;
}

.brand img {
  width: 56px;
  height: 56px;
}

.brand strong {
  display: block;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav {
  margin-top: 2rem;
  display: grid;
  gap: 0.5rem;
}

.nav a {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.54rem 0.7rem;
  color: #d7e8f4;
  font-weight: 600;
  transition: all 180ms ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(126, 208, 255, 0.44);
  transform: translateX(3px);
}

.rail-actions {
  margin-top: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-actions > * {
  margin: 0 12px;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #446781;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  background: rgba(31, 71, 98, 0.72);
}

.quick-link svg {
  width: 24px;
  height: 24px;
  fill: #e7f4ff;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  width: 42px;
  height: 42px;
  border: 1px solid #446781;
  border-radius: 12px;
  background: rgba(31, 71, 98, 0.72);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #e7f4ff;
}

.main {
  padding: 1.2rem;
}

.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 440px;
  background: #0f2235;
}

.hero-short {
  min-height: 320px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(114deg, rgba(8, 21, 33, 0.95), rgba(11, 28, 43, 0.68) 44%, rgba(11, 28, 43, 0.35) 68%),
    url("assets/images/handmade-grandfather-clock-movement-with-wooden-gears.webp");
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.hero.contact::before {
    background-image:
    linear-gradient(114deg, rgba(8, 21, 33, 0.65), rgba(11, 28, 43, 0.18) 44%, rgba(11, 28, 43, 0.05) 68%),
    url("assets/images/long-pond-danville-nh.jpg");
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 440px;
  padding: 1.6rem;
  gap: 1rem;
}

.hero-short .hero-inner {
  min-height: 320px;
}

.eyebrow {
  width: fit-content;
  border: 1px solid #6fa8c7;
  color: #dff2fe;
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.18em 0.7em;
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(76, 166, 216, 0.24);
}

.hero h1 {
  margin: 0.5em 0;
  max-width: 11ch;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.96;
}

.hero p {
  margin: 0.8rem 0 0;
  color: #d4e5f1;
  font-size: 1.1rem;
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #4b6d85;
  background: linear-gradient(160deg, #2c6689, #1d4964);
  color: #f3fbff;
  border-radius: 10px;
  padding: 0.74rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 170ms ease, box-shadow 240ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(5, 13, 21, 0.32);
}

.section {
  margin-top: 1rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(20, 42, 62, 0.98), rgba(16, 34, 52, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  padding: 1rem 1rem 0.6rem;
}

.panel-head h2 {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.55rem;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-top-pad {
  padding-top: 1rem;
}

.grid-2.grid-top-pad .card {
  display: flex;
  flex-direction: column;
}

.grid-2.grid-top-pad:not(.testimonial-single) .footer-note {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.grid-2.grid-top-pad.testimonial-single .footer-note {
  margin-top: 0.62rem;
  display: block;
  text-align: left;
}

.card {
  border: 1px solid #35506a;
  border-radius: 16px;
  padding: 0.92rem;
  background: linear-gradient(170deg, rgba(26, 50, 73, 0.96), rgba(20, 40, 60, 0.96));
  transition: transform 220ms ease, border-color 220ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #4d7090;
}

.card h3,
.card h4 {
  margin: 0 0 0.4rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.28rem;
}

.card p,
.card li {
  color: #c8d9e8;
  font-size: 1rem;
}

.core-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.core-card {
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: auto 210px 1fr auto;
  gap: 0.6rem;
}

.core-card h3 {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.24rem;
}

.core-card figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #3d5a73;
  cursor: pointer;
}

.core-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
  cursor: pointer;
}

.core-card:hover img {
  transform: scale(1.06);
}

.core-card .btn {
  justify-self: end;
}

.quote {
  border-left: 4px solid #65a9d1;
  border-radius: 10px;
  background: rgba(30, 58, 83, 0.72);
  padding: 0.8rem;
  margin: 0;
}

.footer-note {
  margin-top: 0.62rem;
  color: #b1c6d7;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.project-card {
  border: 1px solid #35506a;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(170deg, rgba(24, 48, 71, 0.98), rgba(17, 35, 53, 0.98));
  box-shadow: 0 10px 26px rgba(3, 9, 16, 0.35);
}

.project-card figure {
  margin: 0;
  cursor: pointer;
}

.project-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 440ms ease;
  cursor: pointer;
}

.zoomable:focus-visible {
  outline: 3px solid rgba(126, 208, 255, 0.86);
  outline-offset: 3px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(4, 12, 20, 0.86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.image-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.image-modal__dialog {
  position: relative;
  display: grid;
  gap: 0.7rem;
  max-width: min(1120px, 94vw);
  max-height: 90vh;
}

.image-modal__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  border: 1px solid #43647f;
  box-shadow: 0 20px 50px rgba(1, 6, 10, 0.64);
  background: #091926;
  will-change: transform, opacity;
}

.image-modal__caption {
  margin: 0;
  color: #d6e7f3;
  text-align: center;
  font-size: 0.98rem;
  will-change: transform, opacity;
}

.image-modal__close {
  position: absolute;
  top: -0.9rem;
  right: -0.9rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid #56758e;
  border-radius: 999px;
  background: #1a3f58;
  color: #e6f3fd;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
}

.image-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid #56758e;
  border-radius: 999px;
  background: rgba(18, 47, 68, 0.9);
  color: #e6f3fd;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-modal__nav:hover {
  background: rgba(31, 71, 98, 0.96);
}

.image-modal__nav.prev {
  left: -3.4rem;
}

.image-modal__nav.next {
  right: -3.4rem;
}

.image-modal__nav.hidden {
  display: none;
}

.image-modal__nav:focus-visible,
.image-modal__close:focus-visible {
  outline: 3px solid rgba(126, 208, 255, 0.86);
  outline-offset: 2px;
}

body.modal-open {
  overflow: hidden;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card figcaption {
  padding: 0.58rem 0.7rem;
  color: #c8d9e8;
  font-size: 0.95rem;
}

.contact-photo {
  width: min(100%, 400px);
  margin: 0 auto;
  border: 1px solid #35506a;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(170deg, rgba(24, 48, 71, 0.98), rgba(17, 35, 53, 0.98));
}

.contact-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.contact-photo figcaption {
  padding: 0.58rem 0.7rem;
  color: #c8d9e8;
  font-size: 0.95rem;
  text-align: center;
}

.form-wrap {
  padding: 0 1rem 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.full {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #3d5d76;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: rgba(14, 31, 46, 0.86);
  color: #e7f2fa;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #9fb6c8;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #6fa8c7;
  box-shadow: 0 0 0 4px rgba(111, 168, 199, 0.2);
}

.contact-method-group {
  margin: 0;
  border: 1px solid #3d5d76;
  border-radius: 10px;
  padding: 0.72rem;
  background: rgba(14, 31, 46, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.contact-method-group legend {
  padding: 0 0.35rem;
  font-weight: 700;
}

.contact-method-group label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 0.4rem;
  font-size: 1.3em;
}

.contact-method-group input[type="radio"] {
  width: auto;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: center;
}

button {
  font: inherit;
}

button[type="submit"] {
  border: 1px solid #4b6d85;
  background: linear-gradient(160deg, #2c6689, #1d4964);
  color: #f3fbff;
  border-radius: 10px;
  padding: 0.74rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.form-status {
  margin: 0;
  color: #9fb6c8;
  font-weight: 600;
  min-height: 1.3rem;
}

.form-status.is-success {
  color: #86d6a6;
}

.form-status.is-error {
  color: #ff9a8a;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.grid-single {
  grid-template-columns: 1fr;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 640ms ease, transform 640ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.on {
  opacity: 1;
  transform: translateY(0);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: 99;
  background: linear-gradient(90deg, #69b4df, #f4b37a);
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: sticky;
    overflow: visible;
    top: 0;
    z-index: 120;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.7rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0.85rem;
  }

  .brand {
    grid-template-columns: 44px 1fr;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0.85rem;
    left: auto;
    width: min(320px, calc(100vw - 1.7rem));
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 34, 52, 0.98), rgba(10, 24, 38, 0.98));
    box-shadow: 0 18px 40px rgba(2, 8, 14, 0.34);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.35rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a {
    padding: 0.44rem 0.62rem;
  }

  .rail-actions {
    margin-top: 0;
    gap: 0.38rem;
    justify-self: end;
  }

  .quick-link {
    width: 40px;
    height: 40px;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .main {
    padding: 0.85rem;
  }
}

@media (max-width: 860px) {
  .rail {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.6rem;
  }

  .brand {
    grid-template-columns: 40px 1fr;
    column-gap: 0.5rem;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .brand small {
    font-size: 0.64rem;
    letter-spacing: 0.09em;
  }

  .rail-actions {
    gap: 0.26rem;
  }

  .rail-actions > * {
    margin: 0;
  }

  .quick-link,
  .nav-toggle {
    width: 36px;
    height: 36px;
  }

  .quick-link svg {
    width: 20px;
    height: 20px;
  }

  .hero-actions {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .core-strip {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-wrap {
    padding-bottom: 5rem;
  }

  .form-actions {
    justify-content: center;
  }

  .contact-method-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .image-modal__nav.prev {
    left: -0.55rem;
  }

  .image-modal__nav.next {
    right: -0.55rem;
  }
}
