/* ==========================================================================
   Vivekas Tapetserarverkstad
   Inspiration: Svenskt Tenn (stor serif, helbild, lugn navigation)
                Bukowskis (katalog-rutnät med numrerade objekt)
   ========================================================================== */

:root {
  --paper: #f4f1eb;
  --paper-deep: #ebe6dd;
  --ink: #1c1b19;
  --muted: #6c6861;
  --line: rgba(28, 27, 25, 0.14);
  --studio: #5d5c5a;          /* grå studiobakgrund, tagen från hero-bilden */
  --studio-dark: #4b4a48;
  --floor: #eeeff1;           /* ljusa golvet i hero-bilden */
  --white: #fbfaf7;

  --serif: "Newsreader", "Times New Roman", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(80px, 12vw, 180px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

section[id] { scroll-margin-top: 64px; }

/* hidden-attributet ska alltid vinna över komponenternas display-regler */
[hidden] { display: none !important; }

/* ---------- Typografi-hjälpare ---------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.eyebrow--light { color: rgba(255, 255, 255, 0.78); }

.section-title {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}
.link-arrow::after { content: "→"; text-decoration: none; transition: transform 0.4s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }
.link-arrow--small { font-size: 14px; }

.button {
  display: inline-block;
  padding: 1rem 1.75rem;
  border: 1px solid var(--ink);
  font-size: 15px;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}
/* Bara hover på enheter med mus – annars "fastnar" knappen svart efter tryck på mobil */
@media (hover: hover) {
  .button:hover { background: var(--ink); color: var(--paper); }
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: var(--white);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(244, 241, 235, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 var(--gutter);
}

.nav__links { display: flex; gap: 1.75rem; font-size: 15px; }
.nav__links--right { justify-content: flex-end; }
.nav__links a { text-decoration: none; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }

/* Ordmärke i stil med Svenskt Tenns spärrade kursiva versaler */
.nav__brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-decoration: none;
  margin-right: -0.42em; /* kompenserar spärrningen så ordet centreras */
}

.nav__toggle { display: none; font-size: 15px; justify-self: end; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--paper);
  padding: 120px var(--gutter) 40px;
}
.mobile-menu li { border-bottom: 1px solid var(--line); }
.mobile-menu a {
  display: block; padding: 1rem 0;
  font-family: var(--serif); font-size: 2.25rem; line-height: 1.1; text-decoration: none;
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__inner { grid-template-columns: 1fr auto; }
  .nav__brand { justify-self: start; font-size: 18px; }
  .nav__toggle { display: block; }
  body.menu-open .nav { color: var(--ink); background: var(--paper); }
}

/* ==========================================================================
   Hero – grå studiobakgrund som förlängs från fotot
   ========================================================================== */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  max-height: 1300px;
  overflow: hidden;
  color: var(--white);
  /* Bildens bredd (bilden är 4:5 och lika hög som heron) */
  --img-w: calc(min(max(100svh, 620px), 1300px) * 0.8);
  /* Lager 1: svag vinjett längst till vänster som tonar ut till noll exakt vid bildkanten,
     så ytan ljusnar in mot fotot men möter det med exakt samma färg.
     Lager 2: färgerna är uppmätta längs bildens vänstra kant, rad för rad. */
  background:
    linear-gradient(
      90deg,
      rgba(20, 20, 18, 0.12) 0%,
      rgba(20, 20, 18, 0) calc(100% - var(--img-w))
    ),
    linear-gradient(
    180deg,
    #555452 0%, #545351 12%, #565654 20%, #5d5d5d 30%, #666666 40%,
    #696b6a 50%, #6d6d6d 55%, #6d6d6d 63%, #6b6b6b 65%, #727272 67.5%,
    #85898a 70%, #acadaf 72.5%, #cccdcf 75%, #e3e4e6 77.5%, #e9eaec 80%,
    #f0f0f2 85%, #edeef0 100%
  );
}

.hero__img {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: auto;
  max-width: none;
  /* Övergång mot den grå ytan:
     - ovanför stolen (övre ~35 %) finns bara bakgrund, så där tonar fotot in brett (halva bildbredden)
     - längre ner, där stolen står, är övergången smal så att stolen inte bleks */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, rgba(0,0,0,.12) 10%, rgba(0,0,0,.4) 22%, rgba(0,0,0,.78) 36%, #000 52%),
    linear-gradient(180deg, transparent 0, transparent 30%, #000 40%),
    linear-gradient(90deg, transparent 0, #000 7%);
          mask-image:
    linear-gradient(90deg, transparent 0, rgba(0,0,0,.12) 10%, rgba(0,0,0,.4) 22%, rgba(0,0,0,.78) 36%, #000 52%),
    linear-gradient(180deg, transparent 0, transparent 30%, #000 40%),
    linear-gradient(90deg, transparent 0, #000 7%);
  -webkit-mask-composite: source-over, source-in;
          mask-composite: add, intersect;
  animation: heroIn 1.6s var(--ease) both;
}

.hero__content {
  position: absolute;
  left: var(--gutter);
  bottom: 50%;
  z-index: 1;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(3.25rem, min(7.4vw, 11.5vh), 9rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  animation: rise 1.2s 0.2s var(--ease) both;
}
.hero .eyebrow { animation: rise 1.2s 0.1s var(--ease) both; }

.hero__foot {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(24px, 5vh, 56px);
  z-index: 1;
  max-width: 30rem;
  color: var(--ink);
  display: grid;
  gap: 0.9rem;
  animation: rise 1.2s 0.45s var(--ease) both;
}
.hero__foot p { font-size: 16px; color: #3b3a37; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 0.4rem; }


@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Smalare / stående skärmar: bilden längst ner, rubriken på det grå ovanför */
@media (max-aspect-ratio: 5/4), (max-width: 860px) {
  .hero {
    height: auto;
    min-height: 100svh;
    max-height: none;
    display: flex;
    flex-direction: column;
    background: #575654;
  }
  .hero__content {
    position: relative;
    left: auto; bottom: auto;
    padding: 120px var(--gutter) 0;
    flex: 1;
    order: 0;
  }
  .hero__img { order: 1; }
  .hero__foot { order: 2; }
  .hero__title { font-size: clamp(3rem, 13vw, 6.5rem); }
  .hero__img {
    position: relative;
    width: 100%;
    height: auto;
    max-width: 720px;
    margin: -4vh auto 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%);
            mask-image: linear-gradient(180deg, transparent 0, #000 14%);
    -webkit-mask-composite: source-over;
            mask-composite: add;
  }
  /* Texten står på en yta som fortsätter fotots golv – färgerna är uppmätta
     längs bildens nedersta rad (ljusare till vänster, mörkare till höger) */
  .hero__foot {
    position: relative;
    left: auto; bottom: auto;
    max-width: none;
    margin-top: -1px;
    padding: 0.25rem var(--gutter) 40px;
    background:
      linear-gradient(90deg, #ebecee 0%, #eaebed 10%, #ebecee 20%, #ebebed 30%, #e9e9eb 40%,
        #e7e7e9 50%, #e4e4e6 60%, #e1e1e3 70%, #dcdddf 80%, #d7d8da 90%, #d6d7d9 100%)
        center / min(100%, 720px) 100% no-repeat,
      #e6e6e8;
  }
  .hero__actions { margin-top: 0.6rem; }
}

/* Telefon: "Anno 1995" på egen rad */
@media (max-width: 560px) {
  .hero__sep { display: none; }
  .hero__anno { display: block; margin-top: 0.35em; }
}

/* ==========================================================================
   Intro
   ========================================================================== */

.intro {
  padding: var(--section) var(--gutter);
  max-width: 1200px;
  margin: 0 auto;
}
.intro__text {
  font-family: var(--serif);
  font-weight: 330;
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-align: center;
  text-wrap: balance;
}

/* ==========================================================================
   Arbeten – katalogrutnät à la Bukowskis
   ========================================================================== */

.works { padding: 0 var(--gutter) var(--section); }

.section-head {
  display: flex;
  flex-direction: column;
  margin-bottom: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.works__grid {
  --cols: 1;
  --gap: 20px;
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 48px var(--gap);
  grid-auto-flow: dense;
}
@media (min-width: 640px)  { .works__grid { --cols: 2; --gap: 20px; } }
@media (min-width: 1024px) { .works__grid { --cols: 3; --gap: 28px; } }

.work { min-width: 0; }
@media (min-width: 640px) { .work--wide { grid-column: span 2; } }

.work__btn { display: block; width: 100%; text-align: left; }

.work__media {
  display: block;
  overflow: hidden;
  background: var(--paper-deep);
  aspect-ratio: 4 / 5;
}
.work--wide .work__media { aspect-ratio: 4 / 3; }

/* Fler kolumner: alla bilder i en rad får samma höjd (kolumnbredd × 1,25) */
@container (min-width: 600px) {
  .work__media,
  .work--wide .work__media {
    aspect-ratio: auto;
    height: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols) * 1.25);
  }
}

.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.work__btn:hover img { transform: scale(1.035); }

.work__cap {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  padding-top: 1rem;
}
.work__no {
  grid-row: span 2;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.work__cap h3 { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; }
.work__cap p { font-size: 14px; color: var(--muted); }

/* "Visa alla" (bara när JS körs):
   mobil visar de 6 första arbetena, större skärmar de 11 första + kontaktrutan (ger hela rader) */
.works__more { display: none; }
.js .works__more { display: flex; justify-content: center; margin-top: 56px; }
.js .works__grid.is-expanded + .works__more { display: none; }
@media (min-width: 640px) {
  .js .works__grid:not(.is-expanded) .work:not(.work--cta):nth-child(n + 12) { display: none; }
}
@media (max-width: 639px) {
  .js .works__grid:not(.is-expanded) .work:nth-child(n + 7) { display: none; }
  .js .works__more { margin-top: 48px; }
  .works__more .button { width: 100%; }
}

.work--cta { display: flex; }
.work__cta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(28px, 3vw, 44px);
  background: var(--studio);
  color: var(--white);
  text-decoration: none;
  min-height: 320px;
  transition: background 0.4s;
}
.work__cta:hover { background: var(--studio-dark); }
.work__cta .eyebrow { color: rgba(255, 255, 255, 0.7); margin: 0; }
.work__cta-text {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Klassiker
   ========================================================================== */

.classics {
  padding: clamp(48px, 6vw, 80px) var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.classics__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem clamp(1.5rem, 4vw, 4rem);
}
.classics__list li { display: flex; flex-direction: column; align-items: center; }
.classics__list span { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.2; }
.classics__list em { font-family: var(--serif); font-size: 15px; color: var(--muted); }

/* ==========================================================================
   Tjänster
   ========================================================================== */

.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: var(--section) var(--gutter);
}
@media (min-width: 960px) {
  .services { grid-template-columns: 5fr 7fr; gap: 6vw; }
  .services__aside { position: sticky; top: 120px; align-self: start; }
}
.services__lead { margin-top: 1.75rem; max-width: 26rem; color: var(--muted); }

.services__list { border-top: 1px solid var(--line); }
.service { border-bottom: 1px solid var(--line); }

.service summary {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: baseline;
  padding: 1.5rem 0;
  cursor: pointer;
  list-style: none;
}
.service summary::-webkit-details-marker { display: none; }
.service summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.5s cubic-bezier(0.33, 0, 0.2, 1);
}
.service details.is-open summary::after,
html:not(.js) .service details[open] summary::after { transform: rotate(45deg); }
.service__no { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.service__name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  transition: transform 0.4s var(--ease);
}
.service summary:hover .service__name { transform: translateX(6px); }
.service details p { padding: 0 2.5rem 1.75rem 3rem; max-width: 40rem; color: #47443f; }

/* ==========================================================================
   Om
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 0 var(--gutter) var(--section);
  align-items: center;
}
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; gap: 7vw; } }
.about__media { margin: 0; }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__text { max-width: 34rem; }
.about__text .section-title { margin-bottom: 2rem; }
.about__text p:not(.eyebrow) { margin-bottom: 1.1rem; font-size: 17px; color: #3e3b37; }
.about__text .link-arrow { margin-top: 1rem; }

/* ==========================================================================
   Process – grå sektion som knyter an till heron
   ========================================================================== */

.process {
  background: var(--studio);
  color: var(--white);
  padding: var(--section) var(--gutter);
}
.process .section-head { border-top-color: rgba(255, 255, 255, 0.22); }
.process__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 700px)  { .process__steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .process__steps { grid-template-columns: repeat(4, 1fr); gap: 32px; } }
.process__steps li { border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 1.25rem; }
.process__no { font-family: var(--serif); font-style: italic; font-size: 15px; color: rgba(255, 255, 255, 0.6); }
.process__steps h3 { font-family: var(--serif); font-size: 1.9rem; margin: 0.5rem 0 0.75rem; }
.process__steps p { color: rgba(255, 255, 255, 0.82); max-width: 22rem; }

/* ==========================================================================
   Kontakt
   ========================================================================== */

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  padding: var(--section) var(--gutter);
}
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; gap: 7vw; } }
.contact__intro p:not(.eyebrow) { margin: 1.75rem 0 2.25rem; max-width: 28rem; color: var(--muted); font-size: 17px; }
.contact__info { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; align-content: start; }
@media (max-width: 480px) { .contact__info { grid-template-columns: 1fr; } }
.contact__info div { border-top: 1px solid var(--line); padding-top: 1rem; }
.contact__info dt { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.contact__info dd { margin: 0 0 0.6rem; font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; }
.contact__info dd a { text-decoration: none; }
.contact__info dd .link-arrow { font-family: var(--sans); font-size: 14px; text-decoration: underline; }
.contact__hours { grid-column: 1 / -1; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button--ghost { border-color: var(--line); }
@media (hover: hover) { .button--ghost:hover { border-color: var(--ink); } }
.hours { border-collapse: collapse; width: 100%; max-width: 26rem; }
.hours th, .hours td { padding: 0.15rem 0; font-weight: 400; text-align: left; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.footer__bottom a { text-decoration: none; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 6vw, 80px) var(--gutter) 28px;
  background: var(--paper);
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}
.footer__logo { width: clamp(120px, 14vw, 170px); mix-blend-mode: multiply; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-size: 15px; }
.footer__nav a { text-decoration: none; }
.footer__nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(28, 27, 25, 0.96);
  color: var(--white);
}
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 64px 0 32px; height: 100%; justify-content: center; min-width: 0; }
.lightbox__figure img { max-height: calc(100dvh - 160px); width: auto; max-width: 100%; object-fit: contain; }
.lightbox__figure figcaption { font-family: var(--serif); font-size: 1.15rem; text-align: center; }
.lightbox__close { position: absolute; z-index: 2; top: 12px; right: calc(var(--gutter) - 8px); padding: 8px; font-size: 15px; text-decoration: underline; text-underline-offset: 0.3em; }
.lightbox__nav { font-size: 26px; height: 100%; opacity: 0.7; transition: opacity 0.3s; }
.lightbox__nav:hover { opacity: 1; }

/* ==========================================================================
   Scroll-animationer (aktiveras bara när JS körs)
   ========================================================================== */

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

.nowrap { white-space: nowrap; }

/* Lenis (mjuk scroll) – krävs av biblioteket */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
