@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --background: #090b10;
  --surface: #11151d;
  --text: #f4f6fb;
  --muted: #a0a8b8;
  --blue: #2785ff;
  --line: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

header {position: relative;
  height: 76px;
  padding: 0 2%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.logo span {
  color: var(--blue);
}

nav {
  display: flex;
  gap: clamp(32px, 10vw, 160px);
  color: var(--muted);
  font-size: 16px;
  position: absolute;
left: 50%;
top: 0;
bottom: 0;
transform: translateX(-50%);
align-items: center;
}

nav a {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(39, 133, 255, 0.9),
               0 0 18px rgba(39, 133, 255, 0.65);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

nav a:hover {
  color: var(--blue);
  text-shadow: 0 0 12px rgba(39, 133, 255, 1),
               0 0 24px rgba(39, 133, 255, 0.85);
}

.hero {
  min-height: 650px;
  padding: 150px 10% 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(9, 11, 16, 0.96), rgba(9, 11, 16, 0.38)),
    linear-gradient(0deg, var(--background), transparent 35%),
    url('Bilder/Bilar/IMG_2383.jpg') center 42% / cover;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

h1,
h2,
h3 {
  font-family: 'Space Grotesk', sans-serif;
}

h1 {
  margin: 18px 0;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h1 span {
  color: var(--blue);
}

.intro {
  max-width: 420px;
  color: #d0d5df;
  line-height: 1.7;
}

.button {
  display: inline-block;
  margin-top: 22px;
  padding: 15px 22px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.button:hover {
  background: transparent;
}

.portfolio,
.about,
.contact {
  padding: 100px 10%;
}

.portfolio h2,
.about h2,
.contact h2 {
  margin: 10px 0 28px;
  font-size: clamp(36px, 5vw, 58px);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.categories button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.categories button.active,
.categories button:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.photo {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  background: var(--surface);
}

.photo img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
  object-fit: cover;
  transition: transform 0.5s;
}

.photo:hover img {
  transform: scale(1.04);
}

.photo h3 {
  position: absolute;
  right: 22px;
  bottom: 14px;
  left: 22px;
  margin: 0;
  text-shadow: 0 2px 12px #000;
}


.gallery.all-view .photo img {object-fit: cover;
  pointer-events: none;
}

.gallery.all-view .photo h3 {
  top: 50%;
  right: 0;
  bottom: auto;
  left: 0;
  transform: translateY(-50%);
  text-align: center;
  font-size: clamp(32px, 4vw, 52px);
  text-shadow: 0 2px 12px #000, 0 0 18px rgba(39, 133, 255, 0.75);
  transition: transform 0.25s ease;
}

.gallery.all-view .photo h3:hover {
  transform: translateY(-50%) scale(1.12);
}
.gallery:not(.all-view) .photo h3 {
  display: none;
}
.about {
  background: var(--surface);
}

.about p:last-child {
  max-width: 550px;
  color: var(--muted);
  line-height: 1.8;
}

.contact {
  text-align: center;
}

footer {
  padding: 24px 10%;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.contact .eyebrow {
  font-size: 18px;
}
@media (max-width: 650px) {
  header {
    height: auto;
  padding: 22px 6%;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  flex-direction: column;
  }

  nav {
  position: static;
  transform: none;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 20px;
}

.logo {
  flex-basis: 100%;
  justify-content: center;
}

  .hero {
    min-height: 580px;
    padding: 110px 7% 80px;
  }

  .portfolio,
  .about,
  .contact {
    padding: 72px 7%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}
.logo img {
  display: block;
  height: 48px;
  width: auto;
}
header {
  height: auto;
  min-height: 104px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo img {
  height: 78px;
  width: auto;
}
@media (min-width: 651px) and (max-width: 1000px) {
  header {
    height: auto;
    padding: 16px 4%;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  nav {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
    gap: 48px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 40px;
  background: #090b10;
  place-items: center;
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 26px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 42px;
  cursor: pointer;
}

/* Stående omslagsbilder under Alla */
.gallery.all-view .photo {
  aspect-ratio: 3 / 4;
  min-height: 0;
}

.gallery.all-view .photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

/* Originalproportioner inne i en kategori */
.gallery:not(.all-view) {
  align-items: start;
}

.gallery:not(.all-view) .photo {
  height: auto;
  min-height: 0;
  background: transparent;
}

.gallery:not(.all-view) .photo img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
}
.gallery:not(.all-view) {
  display: block;
  column-count: 3;
  column-gap: 18px;
}

.gallery:not(.all-view) .photo {
  display: inline-block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 0 18px;
  break-inside: avoid;
}

.gallery:not(.all-view) .photo img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
}

@media (max-width: 900px) {
  .gallery:not(.all-view) {
    column-count: 2;
  }
}

@media (max-width: 650px) {
  .gallery:not(.all-view) {
    column-count: 1;
  }
}
.back-to-portfolio {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: none;
  padding: 12px 16px;
  border: 1px solid var(--blue);
  border-radius: 30px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.back-to-portfolio.visible {
  display: block;
}

.back-to-portfolio:hover {
  background: var(--blue);
}
