/* Autokirurg v3 — mobile first. Breakpoints: 640px, 960px. */

:root {
  --red: #bb1010;
  --red-dark: #8f0c0c;
  --ink: #1d1d1f;
  --muted: #5f6368;
  --line: #e6e4e1;
  --tint: #f4f2ef;
  --dark: #0f1f36; /* deep steel blue: hero, gallery header, contacts */
  --dark-deep: #0a1628; /* footer bar */
  --dark-glow: #1f4f8f;
  --radius: 8px;
  --wrap: 1040px;
  --callbar-h: 58px;
  /* Carbon-like diagonal weave, tinted blue */
  --stripes: repeating-linear-gradient(135deg, rgba(140, 185, 255, 0.06) 0 10px, transparent 10px 20px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: var(--callbar-h);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}

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

a {
  color: var(--red);
}

h1,
h2 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.65rem;
}

h2 {
  position: relative;
  font-size: 1.2rem;
  padding-bottom: 8px;
}

/* Short red underline under section headings */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}

p {
  margin: 0 0 0.8em;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.muted {
  color: var(--muted);
}

.icon {
  flex: none;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

.langs {
  margin-left: auto;
  display: flex;
  padding: 2px;
  background: var(--tint);
  border-radius: 999px;
}

.langs a {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
}

.langs a[aria-current] {
  color: #fff;
  background: var(--red);
}

.topbar__phone {
  display: none;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(187, 16, 16, 0.3);
}

.btn--primary:hover {
  background: var(--red-dark);
}

.btn--light {
  background: #fff;
  color: var(--ink);
}

.btn--ghost {
  border-color: currentColor;
  color: var(--red);
}

/* Hero: dark with fine diagonal stripes, the 2014 site's old car as a line drawing */

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 0 34px;
  color: #fff;
  background: var(--stripes), radial-gradient(120% 90% at 100% 100%, var(--dark-glow) 0%, transparent 60%), var(--dark);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 0 100%);
}

.hero__inner {
  position: relative;
}

.hero__text {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff8a8a;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--red);
}

.hero__lead {
  font-size: 0.98rem;
  color: #d9d9d9;
  max-width: 36em;
}

/* Invert the black-on-white engraving and let the black melt into the dark hero */
.hero__car {
  position: absolute;
  right: -40px;
  bottom: -30px;
  width: 260px;
  height: auto;
  filter: invert(1) grayscale(1) contrast(1.1);
  mix-blend-mode: screen;
  opacity: 0.3;
  pointer-events: none;
}

/* Sections */

.section {
  padding: 26px 0;
}

.section--tint {
  background: var(--tint);
}

.section--dark {
  background: var(--stripes), var(--dark);
  color: #eee;
}

.section--dark a {
  color: #fff;
  text-decoration: none;
}

.section--dark a:hover {
  text-decoration: underline;
}

.split {
  display: grid;
  gap: 18px;
}

.ticks,
.chips,
.contacts,
.carousel__track {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticks {
  margin-bottom: 10px;
}

.ticks li {
  position: relative;
  padding: 4px 0 4px 26px;
  font-weight: 600;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.7em;
  width: 11px;
  height: 6px;
  border-left: 3px solid var(--red);
  border-bottom: 3px solid var(--red);
  transform: rotate(-45deg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips li {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 6px;
}

/* Work carousel: native horizontal scroll with snap, auto-advanced by carousel.js */

.carousel {
  position: relative;
}

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

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

.carousel__slide {
  scroll-snap-align: start;
}

.carousel__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--line);
  aspect-ratio: 4 / 3;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.carousel__slide span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel__nav {
  display: none;
  position: absolute;
  top: calc(50% - 30px);
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.carousel__nav--prev {
  left: 8px;
}

.carousel__nav--prev .icon {
  transform: rotate(180deg);
}

.carousel__nav--next {
  right: 8px;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.carousel__dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #cfcac4;
  transition: width 0.3s, background 0.3s;
}

.carousel__dots span.is-active {
  width: 18px;
  background: var(--red);
}

/* Contacts */

.contacts {
  display: grid;
  gap: 12px;
}

.contacts li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contacts__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.contacts__icon .icon {
  width: 18px;
  height: 18px;
}

.contacts small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9a;
}

/* Footer and mobile call bar */

.footer {
  padding: 14px 0;
  font-size: 0.78rem;
  color: #9fb0c8;
  background: var(--stripes), var(--dark-deep);
  border-top: 3px solid var(--red);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.brand--light {
  color: #fff;
}

.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  height: var(--callbar-h);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
}

.callbar .btn {
  min-height: 0;
}

/* Tablet and up */

@media (min-width: 640px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .hero {
    padding: 44px 0 52px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), 0 100%);
  }

  .hero__car {
    right: 0;
    bottom: -10px;
    width: 340px;
    opacity: 0.35;
  }

  .carousel__track {
    grid-auto-columns: calc((100% - 16px) / 3);
  }

  .carousel__nav {
    display: grid;
  }

  .contacts {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
  }
}

/* Desktop: phone moves to the top bar, call bar goes away */

@media (min-width: 960px) {
  body {
    padding-bottom: 0;
  }

  .callbar {
    display: none;
  }

  .topbar__phone {
    display: inline;
  }

  .topbar__inner {
    min-height: 68px;
  }

  .brand {
    font-size: 1.5rem;
  }

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

  .hero__inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 24px;
  }

  .hero__car {
    position: static;
    width: 100%;
    max-width: 420px;
    justify-self: end;
    opacity: 0.85;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .section {
    padding: 40px 0;
  }

  .contacts {
    grid-template-columns: repeat(4, 1fr);
  }

  .carousel__track {
    grid-auto-columns: calc((100% - 24px) / 4);
  }
}

/* Top bar gallery link */

.topbar__link {
  margin-left: auto;
  padding: 4px 2px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.topbar__link:hover,
.topbar__link[aria-current] {
  border-bottom-color: var(--red);
}

.topbar__link + .langs {
  margin-left: 0;
}

/* Gallery: dark page header like the landing hero, sidebar album list, card and photo grids */

.pagehead {
  padding: 20px 0 26px;
  color: #fff;
  background: var(--stripes), radial-gradient(120% 90% at 100% 100%, var(--dark-glow) 0%, transparent 60%), var(--dark);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), 0 100%);
}

.pagehead h1 {
  margin-bottom: 0.25em;
  overflow-wrap: anywhere;
}

.pagehead .eyebrow a {
  color: inherit;
}

.pagehead__meta {
  margin: 0;
  color: #d9d9d9;
}

.gallery {
  display: grid;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 32px;
}

.gallery__side {
  display: none;
}

.gallery__search {
  width: 100%;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 0 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
}

.gallery__search:focus {
  outline: 2px solid var(--red);
  outline-offset: -1px;
  background: #fff;
}

.gallery__search[hidden] {
  display: none;
}

.gallery__text {
  max-width: 44em;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--red);
  color: var(--muted);
}

.albumlist,
.albumcards,
.photogrid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.albumlist a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
}

.albumlist a:hover {
  background: var(--tint);
}

.albumlist a[aria-current] {
  border-left-color: var(--red);
  background: var(--tint);
  font-weight: 700;
}

.albumlist small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.albumcards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 10px;
}

.albumcards a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.albumcards__img {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--line);
}

.albumcards__img img,
.photogrid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.albumcards a:hover img,
.photogrid a:hover img {
  transform: scale(1.05);
}

.albumcards__title {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.albumcards a:hover .albumcards__title {
  color: var(--red);
}

.albumcards small {
  color: var(--muted);
  font-size: 0.75rem;
}

.photogrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.photogrid a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--line);
}

.albumnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.albumnav .btn {
  max-width: 100%;
}

.albumnav span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.albumnav__prev .icon {
  transform: rotate(180deg);
}

.albumnav__all {
  border-color: var(--line);
}

/* Lightbox */

body.is-locked {
  overflow: hidden;
}

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: rgba(12, 11, 11, 0.96);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
}

.lightbox__figure {
  position: relative;
  align-self: center;
  justify-self: center;
  min-width: 0;
  margin: 0;
}

.lightbox__img {
  max-width: 100vw;
  max-height: calc(100dvh - 56px);
  object-fit: contain;
}

/* Copyright over the photo while viewing (CSS only, the image files stay clean) */
.lightbox__mark {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 3px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  user-select: none;
}

.lightbox__bar {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  font-size: 0.85rem;
  border-top: 3px solid var(--red);
}

.lightbox__counter {
  font-weight: 700;
  white-space: nowrap;
}

.lightbox__caption {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #bbb;
}

.lightbox__btn,
.lightbox__close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.lightbox__btn:hover,
.lightbox__close:hover {
  background: var(--red);
}

.lightbox__btn:disabled {
  opacity: 0.25;
  cursor: default;
  background: rgba(255, 255, 255, 0.12);
}

.lightbox__btn {
  top: calc(50% - 50px);
}

.lightbox__btn--prev {
  left: 10px;
}

.lightbox__btn--prev .icon {
  transform: rotate(180deg);
}

.lightbox__btn--next {
  right: 10px;
}

.lightbox__close {
  top: 10px;
  right: 10px;
  font-size: 1.8rem;
  line-height: 1;
}

@media (min-width: 640px) {
  .pagehead {
    padding: 30px 0 38px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 0 100%);
  }

  .albumcards,
  .photogrid {
    grid-template-columns: repeat(3, 1fr);
  }

  .photogrid {
    gap: 8px;
  }
}

@media (min-width: 960px) {
  .gallery {
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 48px;
  }

  .gallery__side {
    display: block;
    align-self: start;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
  }

  /* The sidebar search covers the album cards on wide screens. */
  .gallery__search--cards {
    display: none;
  }

  .photogrid {
    grid-template-columns: repeat(4, 1fr);
  }

  .lightbox__btn--prev {
    left: 24px;
  }

  .lightbox__btn--next {
    right: 24px;
  }
}
