@charset "UTF-8";

:root {
  --paper: #f6f6ea;
  --wine: #49151e;
  --ink: #514940;
  --muted: #786e65;
  --line: #ddd6cb;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
  --gutter: clamp(22px, 4vw, 76px);
  --content: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--paper); color: var(--wine); font: 400 15px/1.8 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; width: 100%; height: auto; }
p, h1, h2 { margin-top: 0; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--wine); outline-offset: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 12px; left: 18px; z-index: 100; padding: 9px 16px; background: var(--paper); transform: translateY(-170%); }
.skip:focus { transform: translateY(0); }

/* One quiet, persistent header across all four pages. */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 112px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 18px max(var(--gutter), calc((100vw - var(--content)) / 2));
  background: var(--paper);
  border-bottom: 1px solid rgba(73, 21, 30, .07);
}
.header > a { flex: 0 0 auto; }
.logo { width: 190px; }
.nav { display: flex; align-items: center; gap: 44px; }
.nav a { position: relative; display: block; padding: 14px 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5; }
.nav a::after { content: ''; position: absolute; bottom: 8px; left: 0; right: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.nav a[aria-current='page']::after, .nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

.inner-page main { padding-top: 32px; }
.inner-page:has(.contact-team) main { padding-top: 56px; }
.hero, .services, .about-image, .team, .team-divider, .portfolio-gallery, .footer {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
}
.hero { padding-top: 24px; }
.hero > img { height: min(73svh, 940px); min-height: 440px; object-fit: cover; object-position: center; }
.hero-copy { padding: 12px 20px 32px; text-align: center; }
.hero-copy > p { max-width: 680px; margin: 20px auto 0; color: var(--ink); font-size: 15px; line-height: 1.8; text-wrap: pretty; }
.hero h1 { max-width: 960px; margin: 0 auto; font: 400 clamp(33px, 3.4vw, 49px)/1.3 var(--serif); letter-spacing: -.025em; text-wrap: balance; }
.hero h1 em { font-size: .92em; font-weight: 400; }

/* Photographs explain the offer; navigation stays in the header. */
.services { max-width: 1280px; margin-top: 88px; }
.service { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 10%; margin-bottom: 88px; }
.service > img { aspect-ratio: 4 / 5; object-fit: cover; }
.service-copy { padding: 18px 0; }
.service-copy h2 { margin: 0 0 28px; font: 400 clamp(28px, 2.7vw, 39px)/1.25 var(--serif); letter-spacing: -.02em; }
.service-copy h2 em { font-weight: 400; }
.service-copy p { max-width: 440px; margin: 0 0 20px; color: var(--ink); font-size: 15px; line-height: 1.9; }
.service-copy p:last-child { margin-bottom: 0; }
.service-reverse > img { order: 2; }

/* A continuous portfolio, with the photograph's own proportions. */
.portfolio-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.portfolio-gallery.masonry-ready { grid-auto-rows: 1px; }
.image-button { display: block; width: 100%; min-width: 0; padding: 0; margin: 0; border: 0; background: transparent; cursor: zoom-in; text-align: left; }
.image-wrap { display: block; overflow: hidden; background: #e8e2d8; }
.image-button img { width: 100%; height: auto; transition: opacity .2s ease; }
.image-button:hover img { opacity: .92; }
.image-button p { display: none; }

.about-image { max-width: 1280px; }
.about-image img { height: auto; }
.prose { max-width: 720px; margin: 60px auto 0; padding: 0 24px; color: var(--ink); text-align: center; text-wrap: pretty; }
.prose h2 { margin: 0 0 26px; color: var(--wine); font: 400 clamp(28px, 2.7vw, 39px)/1.25 var(--serif); letter-spacing: -.02em; }
.prose p { margin: 0 0 24px; font-size: 15px; line-height: 1.95; }
.prose p:last-child { margin-bottom: 0; }
/* Match the visible gaps above the text and above the illustrated rooftops. */
.about-page .prose { margin-top: 96px; }
.about-page .footer { margin-top: 52px; }

/* Every person has the same image rhythm and a readable contact block. */
.team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: clamp(18px, 2.4vw, 36px); }
.person { min-width: 0; }
.person img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center; }
.person h2 { min-height: 2.6em; margin: 22px 0 5px; font: 400 clamp(19px, 1.65vw, 24px)/1.3 var(--serif); letter-spacing: -.015em; }
.person .role { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.person a { display: flex; align-items: center; width: fit-content; max-width: 100%; min-height: 44px; padding: 8px 0; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.person a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-team .person h2 { min-height: 0; margin: 16px 0 3px; }
.contact-team .person .role { margin: 0 0 6px; }
.contact-team .person a { min-height: 24px; padding: 0; line-height: 1.5; }
.team-divider { height: 0; margin-top: 56px; margin-bottom: 56px; border: 0; border-top: 1px solid var(--line); }
.team[aria-label='Hantverkare'] .person h2 { min-height: 0; }

/* A small signature from Saga, followed by practical company information. */
.footer { width: 100%; max-width: none; margin-top: 88px; }
.footer-art { width: 100%; height: 145px; margin: 0 0 2px; background: url('assets/saga-fasader.webp') repeat-x center calc(100% + 20px) / 420px auto; }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 36px; align-items: start; padding: 24px max(var(--gutter), calc((100% - var(--content)) / 2)); background: var(--wine); color: var(--paper); font-family: var(--sans); font-weight: 400; }
.footer-name { grid-column: 2; margin: 0; text-align: center; font-size: 12px; line-height: 1.5; }
.footer address { font-style: normal; color: inherit; font-size: 12px; line-height: 1.5; }
.footer-legal { grid-column: 3; margin: 0; text-align: right; color: inherit; font-size: 12px; line-height: 1.5; }
.footer-mobile { display: none; }

.dialog { width: min(94vw, 1500px); max-height: 94svh; padding: 0; border: 0; background: var(--paper); color: var(--wine); }
.dialog::backdrop { background: rgba(26, 20, 16, .86); }
.dialog-inner { padding: 54px 38px 20px; }
.dialog img { width: 100%; height: calc(88svh - 116px); object-fit: contain; touch-action: pan-y pinch-zoom; }
.dialog-close { position: absolute; top: 6px; right: 12px; width: 44px; height: 44px; padding: 0; border: 0; background: none; font: 300 28px/1 var(--sans); cursor: pointer; }
.dialog-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 12px; font-size: 12px; }
.dialog-controls button { min-height: 44px; min-width: 80px; padding: 8px 0; border: 0; background: none; font-size: 12px; cursor: pointer; }

@media (max-width: 1100px) {
  .portfolio-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { gap: 7%; }
  .service-copy p { font-size: 14px; }
  .person a { font-size: 12px; }
}

@media (max-width: 760px) {
  .header { height: auto; min-height: 108px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 12px var(--gutter) 6px; }
  .logo { width: 124px; }
  .nav { width: 100%; justify-content: center; }
  .hero-copy, .prose { text-align: left; }
  .hero h1, .hero-copy > p { margin-left: 0; margin-right: 0; }
  .image-button { cursor: default; }
  .image-button:hover img { opacity: 1; }
  .hero-copy { padding-top: 8px; }
  .hero > img { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .services { margin-top: 60px; }
  .service { grid-template-columns: 1fr; gap: 30px; margin-bottom: 60px; }
  .service > img { max-height: 680px; }
  .service > img { order: 2; }
  .service-copy { padding: 0; }
  .service-copy h2 { margin-bottom: 22px; font-size: 31px; }
  .service-copy p { max-width: none; font-size: 15px; }
  .prose { margin-top: 38px; padding: 0 var(--gutter); }
  .prose h2 { font-size: 31px; }
  .about-page .prose { margin-top: 64px; }
  .about-page .footer { margin-top: 20px; }
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .person h2 { font-size: 20px; margin-top: 17px; }
  .person a { font-size: 12px; }
  .team-divider { margin-top: 40px; margin-bottom: 40px; }
  .inner-page:has(.contact-team) main { padding-top: 40px; }
  .footer { margin-top: 60px; }
  .footer-inner { grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .footer-name, .footer address, .footer-legal { display: none; }
  .footer-mobile { display: block; margin: 0; font-size: 12px; line-height: 1.8; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: 130px; }
  .nav { gap: 32px; }
  .nav a { padding: 12px 0; font-size: 10px; letter-spacing: .12em; }
  .nav a::after { bottom: 7px; }
  .inner-page main { padding-top: 22px; }
  .hero { padding-top: 18px; }
  .hero-copy { padding: 4px 0 28px; }
  .hero-copy > p { margin-top: 16px; font-size: 14px; }
  .hero-copy > p br { display: none; }
  .hero h1 { font-size: 32px; line-height: 1.35; }
  .portfolio-gallery { grid-template-columns: minmax(0, 1fr); }
  .person h2 { font-size: 19px; }
  .person .role { font-size: 11px; margin-bottom: 11px; }
  .person a { font-size: 11px; }
  .footer-inner { grid-template-columns: 1fr; row-gap: 16px; }
  .footer-name, .footer-legal { grid-column: auto; }
  .footer-name, .footer address, .footer-legal { font-size: 11px; }
  .dialog-inner { padding: 50px 12px 12px; }
  .dialog img { height: calc(86svh - 115px); }
  .dialog-controls, .dialog-controls button { font-size: 11px; }
  .dialog-controls button { min-width: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav a::after, .image-button img { transition: none; }
}
