* { box-sizing: border-box; }
:root {
  --page-gutter: clamp(32px, 4.5vw, 72px);
}
html, body { height: 100%; }
body {
  margin: 0;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  font-family: "Courier New", Courier, monospace;
  color: #111;
  background: #fff;
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

.screensaver-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1800ms cubic-bezier(0.22, 1, 0.36, 1), background-color 1800ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 1800ms;
}

.screensaver-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(255, 255, 255, 1);
  transition: opacity 1800ms cubic-bezier(0.22, 1, 0.36, 1), background-color 1800ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.screensaver-logo-wrap img {
  width: min(40vw, 440px);
  max-width: 90vw;
  height: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1400ms cubic-bezier(0.22, 1, 0.36, 1) 280ms, transform 1400ms cubic-bezier(0.22, 1, 0.36, 1) 280ms;
}

.screensaver-overlay.active .screensaver-logo-wrap img {
  opacity: 1;
  transform: translateY(0);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Times New Roman", Times, serif;
}

a { color: inherit; }
.courier { font-family: "Courier New", Courier, monospace; }

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

.site-header {
  border-bottom: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0;
}

.site-title {
  font-family: "Times New Roman", Times, serif;
  text-decoration: none;
  letter-spacing: 0.02em;
  font-size: clamp(28px, 4.6vw, 56px);
  line-height: 1.05;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  font-family: "Times New Roman", Times, serif;
  text-decoration: none;
  font-size: clamp(16px, 2.1vw, 28px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  min-height: calc(clamp(28px, 4.6vw, 56px) + 20px);
  padding: 0 14px;
  line-height: 1.2;
}

.site-nav a[aria-current="page"] {
  text-decoration: none;
}

.mail-button {
  padding: 4px;
  width: calc(clamp(28px, 4.6vw, 56px) + 20px);
  height: calc(clamp(28px, 4.6vw, 56px) + 20px);
}

.mail-button svg {
  width: 70%;
  height: 70%;
  display: block;
}

.instagram-button {
  width: calc(clamp(28px, 4.6vw, 56px) + 20px);
  height: calc(clamp(28px, 4.6vw, 56px) + 20px);
  padding: 0;
  line-height: 1;
}

@media (max-width: 1900px) {
  .site-nav a {
    font-size: 15px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
  }

  .mail-button,
  .instagram-button {
    width: 44px !important;
    height: 44px !important;
  }

  .mail-button svg {
    width: 66% !important;
    height: 66% !important;
  }

  body[data-page="home"] .project-item h2 {
    font-size: clamp(18px, 1.35vw, 24px);
  }

  body[data-page="home"] .page-title {
    font-size: clamp(20px, 1.8vw, 26px);
  }
}

main {
  padding: 28px 0 60px;
}

.about-page {
  padding: 28px 0 60px;
}

.contact-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.page-title {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 18px;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 24px;
}

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

.project-item a {
  display: block;
  border: 0;
  padding: 0;
  text-decoration: none;
}

.project-item a:hover {
  opacity: 0.92;
}

.project-item h2 {
  font-size: clamp(24px, 2.8vw, 34px);
  margin: 0 0 2px;
  font-weight: 400;
}

.project-name {
  font-weight: 700;
}

.project-meta {
  font-weight: 400;
}

.project-item p {
  margin: 0;
}

body[data-page="home"] .project-item p {
  display: none;
}

.project-thumb {
  margin-bottom: 10px;
  overflow: hidden;
}

.project-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: none;
  object-fit: cover;
}

.funeral-item .project-thumb img {
  object-position: center 38%;
  transform: scale(1.16);
  transform-origin: center;
}

.thumb-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #dcdcdc;
}

.prose p { margin: 0 0 12px; }
.prose h2 {
  margin: 18px 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.bullet-list {
  list-style: disc;
  display: block;
  padding-left: 1.25em;
}

.bullet-list li {
  margin-bottom: 8px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.about-photo {
  width: 100%;
  height: auto;
  display: block;
  max-width: 230px;
}

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

.about-col {
  break-inside: avoid;
}

.about-col > :first-child {
  margin-top: 0;
}

.about-col > h2:first-child {
  margin-top: 0;
}

.about-intro p {
  font-size: clamp(18px, 1.2vw, 22px);
  line-height: 1.55;
}

.about-articles {
  margin-top: 18px;
}

.about-articles .clean-list {
  display: block;
}

.about-articles .clean-list li {
  margin-bottom: 14px;
}

.back-link {
  display: inline-block;
  margin: 0 0 14px;
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; }

.tag-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid #e6e6e6;
  padding: 2px 8px;
  font-size: 14px;
}

.project-links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-hero {
  margin: 0 0 18px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f3f3;
}

.project-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.project-hero img.is-loading {
  opacity: 0.35;
}

.project-gallery {
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.project-gallery-item {
  margin: 0;
  padding: 0;
  border: 1px solid #d9d9d9;
  background: #fff;
  cursor: pointer;
}

.project-gallery-item.active {
  border-color: #111;
}

.project-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(22px, 4vw, 64px);
  align-items: start;
}

.project-section {
  margin-bottom: clamp(28px, 4vw, 64px);
}

.project-section:last-child {
  margin-bottom: 0;
}

.project-intro {
  margin: 0 0 clamp(22px, 3vw, 38px);
  max-width: 96ch;
}

.project-copy {
  max-width: 82ch;
}

.project-copy p {
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.6;
}

.prose h2.subproject-title {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  margin: 20px 0 18px;
}

.mobile-about-wrap {
  display: none;
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-title {
    word-break: break-word;
  }
}

@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body[data-page="project"] .site-nav {
    display: none;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-copy {
    max-width: none;
  }

  .project-copy {
    order: 1;
  }

  .project-media {
    order: 2;
  }

  .project-hero {
    display: none;
  }

  .project-gallery {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
  }

  .project-gallery-item {
    width: 100%;
    border: 0;
    background: transparent;
  }

  .project-gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
  }

  .mobile-about-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
    padding-top: 8px;
    padding-bottom: 64px;
  }

  .mobile-about-link {
    font-family: "Times New Roman", Times, serif;
    text-decoration: none;
    font-size: clamp(15px, 4.2vw, 20px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #111;
    padding: 8px 18px;
    line-height: 1.2;
  }

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

@media (max-width: 820px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

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

  .about-photo {
    max-width: 520px;
  }

  .about-page {
    padding: 22px 0 50px;
  }
}

@media (max-width: 768px) {
  :root {
    --page-gutter: 20px;
  }

  body {
    font-size: 16px;
  }

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

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: min(100%, 190px);
  }

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

@media (min-width: 1101px) and (max-width: 1480px) {
  .about-layout {
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
    gap: 22px;
  }

  .about-photo {
    max-width: 150px;
  }

  .about-columns {
    gap: 24px;
  }
}

@media (min-width: 1400px) {
  body {
    font-size: 19px;
  }

  .about-photo {
    max-width: 250px;
  }
}

/* Ingen extra kolumn på superbredda skärmar – behåll breda spalter */