.reference-page {
  background: var(--bg);
}

.reference-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  background: linear-gradient(180deg, rgb(7 8 8 / 88%), transparent);
}

.header-inner {
  display: flex;
  height: 80px;
  align-items: center;
  gap: 24px;
}

.brand {
  display: block;
  flex: 0 0 auto;
  width: 168px;
}

.brand img {
  width: 100%;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  padding-block: 28px 25px;
  color: #d0d0cc;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 180ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
  height: 2px;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  transition: transform 200ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
}

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

.header-cta {
  min-height: 42px;
  margin-left: 4px;
  padding: 10px 17px;
  font-size: 0.74rem;
}

.menu-toggle {
  display: none;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(11 12 12 / 72%);
  cursor: pointer;
}

.menu-close-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-open-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-close-icon {
  display: inline-block;
}

.reference-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100dvh;
  align-items: center;
  overflow: hidden;
}

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

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

.reference-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgb(7 8 8 / 98%) 0%, rgb(7 8 8 / 90%) 24%, rgb(7 8 8 / 52%) 52%, rgb(7 8 8 / 8%) 82%),
    linear-gradient(0deg, rgb(7 8 8 / 58%) 0%, transparent 42%, rgb(7 8 8 / 24%) 100%);
}

.hero-content {
  padding-top: 80px;
  padding-bottom: 54px;
}

.hero-content h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 6.7rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-content h1 span:last-child {
  display: block;
  color: var(--accent);
}

.hero-summary {
  max-width: 570px;
  margin-bottom: 30px;
  color: #d4d4cf;
  font-size: 0.98rem;
  line-height: 1.75;
}

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

.advantages {
  position: relative;
  z-index: 2;
  border-block: 1px solid var(--line);
  background: #0e1010;
}

.advantages-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.advantages-list li {
  display: flex;
  min-height: 116px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 22px 16px;
  color: #d8d8d3;
  font-size: 0.77rem;
  font-weight: 650;
  line-height: 1.5;
}

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

.advantage-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.reference-section {
  padding-block: 72px;
}

.reference-section-header {
  margin-bottom: 32px;
}

.reference-section-header .section-intro {
  max-width: 58ch;
  font-size: 0.86rem;
}

.services-section {
  background: var(--bg);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.service-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), border-color 260ms ease;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
}

.service-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.15 / 1;
  background: var(--surface-raised);
}

.photo-note {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: rgb(11 12 12 / 72%);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.4;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-image img {
  transform: scale(1.04);
}

.service-body {
  position: relative;
  display: flex;
  min-height: 232px;
  flex-direction: column;
  padding: 34px 18px 9px;
}

.service-icon {
  position: absolute;
  top: -23px;
  left: 16px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #101212;
  color: var(--accent);
  box-shadow: 0 8px 22px rgb(0 0 0 / 26%);
}

.service-icon .icon {
  width: 25px;
  height: 25px;
}

.service-body h3 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.service-body p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.65;
}

.service-link {
  min-height: 44px;
  margin-top: auto;
  font-size: 0.7rem;
}

.projects-section {
  padding-top: 24px;
  background: var(--bg);
}

.projects-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.projects-heading .section-heading {
  margin-bottom: 10px;
}

.projects-heading .section-intro {
  font-size: 0.84rem;
}

.example-note {
  flex: 0 0 auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent);
  color: var(--muted);
  font-size: 0.7rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.project-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.2 / 1;
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.project-item::after {
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  content: "";
  pointer-events: none;
  transition: border-color 200ms ease;
}

.project-item:hover::after {
  border-color: var(--accent);
}

.project-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), filter 300ms ease;
}

.project-item:hover img {
  transform: scale(1.045);
  filter: brightness(1.08);
}

.project-item[hidden] {
  display: none;
}

.projects-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

@media (prefers-reduced-motion: no-preference) {
  .project-item.is-new {
    animation: project-enter 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes project-enter {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.before-after-section {
  border-top: 1px solid var(--line);
  background: #0e1010;
}

.before-after-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
}

.before-after-pair {
  height: 100%;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ba-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface-raised);
  cursor: ew-resize;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ba-after,
.ba-after-inner {
  position: absolute;
  inset: 0;
}

.ba-after {
  z-index: 1;
  overflow: hidden;
  transform: translateX(calc(var(--ba-pos, 50%) - 100%));
}

.ba-after-inner {
  transform: translateX(calc(100% - var(--ba-pos, 50%)));
}

.ba-handle {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: translateX(var(--ba-pos, 50%));
  pointer-events: none;
}

.ba-handle::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  content: "";
  background: var(--text);
  box-shadow: 0 0 0 1px rgb(11 12 12 / 22%);
}

.ba-knob {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px rgb(0 0 0 / 38%);
  transform: translate(-50%, -50%);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), background-color 160ms ease;
}

.ba-knob svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ba-range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  appearance: none;
}

html:not(.js-ready) .ba-range {
  display: none;
}

.ba-slider:has(.ba-range:focus-visible) .ba-knob {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.before-after-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 6px 10px;
  border: 1px solid rgb(245 243 239 / 20%);
  border-radius: var(--radius);
  background: rgb(11 12 12 / 78%);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.before-after-label-after {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.ba-label-before {
  right: 10px;
  left: auto;
}

.before-after-pair figcaption {
  padding: 12px 4px 2px;
  color: #d0d0cc;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

@media (hover: hover) {
  .ba-slider:hover .ba-knob {
    background: var(--accent-hover);
    transform: translate(-50%, -50%) scale(1.06);
  }
}

.ba-slider.is-dragging .ba-knob {
  transform: translate(-50%, -50%) scale(0.95);
}

.quality-strip {
  border-block: 1px solid var(--line);
  background: #0a0c0c;
}

.quality-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.quality-list li {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

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

.quality-list .icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.quality-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
}

.about-contact-section {
  padding-block: 72px;
  background:
    linear-gradient(90deg, rgb(241 141 60 / 4%), transparent 38%),
    var(--bg);
}

.about-contact-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.15fr 1.25fr;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--surface);
}

.about-figure {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--surface-raised);
}

.about-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.about-content,
.contact-panel {
  min-width: 0;
  padding: 38px 30px;
}

.about-content {
  border-left: 1px solid var(--line);
}

.about-content .section-heading,
.contact-panel .section-heading {
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.1;
}

.about-copy p {
  margin-bottom: 15px;
  color: #c5c6c1;
  font-size: 0.81rem;
  line-height: 1.7;
}

.about-copy p:last-child {
  margin-bottom: 0;
  color: var(--text);
}

.contact-panel {
  border-left: 1px solid var(--line);
  background: #101212;
}

.contact-panel .form-grid {
  gap: 12px;
}

.contact-panel .form-field input,
.contact-panel .form-field select {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 0.75rem;
}

.contact-panel .form-field textarea {
  min-height: 116px;
  padding: 11px 12px;
  font-size: 0.75rem;
}

.contact-panel .form-field label {
  font-size: 0.68rem;
}

.contact-panel .form-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  html.js-ready .hero-enter {
    opacity: 0;
    animation: reference-hero-enter 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  html.js-ready .hero-enter:nth-child(2) { animation-delay: 100ms; }
  html.js-ready .hero-enter:nth-child(3) { animation-delay: 180ms; }
  html.js-ready .hero-enter:nth-child(4) { animation-delay: 260ms; }

  @keyframes reference-hero-enter {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1180px) {
  .header-inner {
    gap: 18px;
  }

  .site-nav {
    gap: 20px;
  }

  .brand {
    width: 148px;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-image {
    aspect-ratio: 1.6 / 1;
  }

  .service-body {
    min-height: 190px;
  }

  .project-item {
    aspect-ratio: 1.55 / 1;
  }

  .about-contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-figure {
    grid-column: 1 / -1;
    height: 440px;
  }

  .about-figure img {
    object-position: center 42%;
  }
}

@media (max-width: 900px) {
  .reference-header {
    position: absolute;
  }

  .header-inner {
    position: relative;
  }

  .brand {
    width: 148px;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    right: 0;
    left: 0;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 12px;
    transform: translateY(-8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgb(14 16 16 / 98%);
    box-shadow: 0 24px 50px rgb(0 0 0 / 34%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 13px 14px;
    font-size: 0.85rem;
  }

  .nav-link::after {
    display: none;
  }

  .header-cta {
    margin-left: auto;
  }

  .menu-toggle {
    display: grid;
  }

  .reference-hero {
    min-height: min(100dvh, 760px);
  }

  .hero-content h1 {
    font-size: clamp(4rem, 10vw, 5.8rem);
  }

  .hero-summary {
    max-width: 540px;
  }

  .advantages-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .advantages-list li:nth-child(4) {
    border-left: 0;
  }

  .advantages-list li:nth-child(n+4) {
    border-top: 1px solid var(--line);
  }

  .advantages-list li:nth-child(4),
  .advantages-list li:nth-child(5) {
    min-height: 96px;
  }

  .advantages-list li:nth-child(4) {
    grid-column: 1 / 2;
  }

  .advantages-list li:nth-child(5) {
    grid-column: 2 / 4;
  }

  .before-after-grid {
    max-width: 680px;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-inline: auto;
  }

  .about-contact-section {
    padding-block: 56px;
  }

  .about-contact-grid {
    grid-template-columns: 1fr;
  }

  .about-content,
  .contact-panel {
    padding: 36px;
  }

  .about-content,
  .contact-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .about-copy {
    columns: 2;
    column-gap: 32px;
  }

  .about-copy p {
    break-inside: avoid;
  }
}

@media (max-width: 640px) {
  .header-inner {
    gap: 10px;
  }

  .brand {
    width: 164px;
  }

  .header-cta {
    display: none;
  }

  .menu-toggle {
    margin-left: auto;
  }

  .reference-hero {
    min-height: 0;
    align-items: flex-start;
  }

  .reference-hero::before {
    background:
      linear-gradient(90deg, rgb(7 8 8 / 94%) 0%, rgb(7 8 8 / 76%) 70%, rgb(7 8 8 / 42%) 100%),
      linear-gradient(0deg, rgb(7 8 8 / 76%) 0%, transparent 55%, rgb(7 8 8 / 36%) 100%);
  }

  .hero-media img {
    object-position: 62% center;
  }

  .hero-content {
    padding-top: 108px;
    padding-bottom: 56px;
  }

  .hero-content .eyebrow {
    max-width: 32ch;
    margin-bottom: 14px;
    font-size: 0.61rem;
  }

  .hero-content h1 {
    margin-bottom: 20px;
    font-size: clamp(3.2rem, 15vw, 4.7rem);
    line-height: 1;
  }

  .hero-summary {
    margin-bottom: 24px;
    font-size: 0.88rem;
    line-height: 1.7;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 310px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .advantages-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advantages-list li {
    min-height: 102px;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 14px;
    font-size: 0.7rem;
  }

  .advantages-list li:nth-child(3),
  .advantages-list li:nth-child(5) {
    border-left: 0;
  }

  .advantages-list li:nth-child(3) {
    border-top: 1px solid var(--line);
  }

  .advantages-list li:nth-child(4) {
    grid-column: auto;
    border-left: 1px solid var(--line);
  }

  .advantages-list li:nth-child(5) {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .advantage-icon {
    width: 31px;
    height: 31px;
  }

  .reference-section {
    padding-block: 56px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .service-image {
    aspect-ratio: 1.7 / 1;
  }

  .service-body {
    min-height: 0;
    padding-bottom: 13px;
  }

  .service-body p {
    font-size: 0.82rem;
  }

  .projects-section {
    padding-top: 8px;
  }

  .projects-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-item {
    aspect-ratio: 1 / 1;
  }

  .projects-grid:not(.is-expanded) .project-item:nth-child(5),
  .projects-grid.is-expanded .project-item:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 1.8 / 1;
  }

  .before-after-pair {
    padding: 8px;
  }

  .before-after-label {
    top: 8px;
    left: 8px;
    padding: 5px 8px;
  }

  .ba-label-before {
    right: 8px;
    left: auto;
  }

  .ba-knob {
    width: 42px;
    height: 42px;
  }

  .before-after-pair figcaption {
    padding-top: 10px;
  }

  .quality-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quality-list li {
    min-height: 100px;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 14px;
  }

  .quality-list li:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .quality-list li:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .quality-list .icon {
    width: 28px;
    height: 28px;
  }

  .quality-list strong {
    font-size: 1.45rem;
  }

  .about-contact-section {
    padding-block: 48px;
  }

  .about-contact-grid {
    width: 100%;
    border-inline: 0;
  }

  .about-figure {
    height: 340px;
  }

  .about-content,
  .contact-panel {
    padding: 32px 20px;
  }

  .about-copy {
    columns: 1;
  }

  .about-copy p {
    font-size: 0.88rem;
  }
}

@media (max-width: 370px) {
  .brand {
    width: 150px;
  }

  .hero-content h1 {
    font-size: 3.15rem;
  }
}
