:root {
  --bg: #f5f2e8;
  --ink: #1a1a18;
  --muted: #6e6a62;
  --line: rgba(26,26,24,0.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Screen-reader-only text (visible to assistive tech + search engines, invisible on screen) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "EB Garamond", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.55; transition: opacity .2s ease; }
button { font-family: inherit; }

.sans {
  font-family: "EB Garamond", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 400;
}
.serif {
  font-family: "EB Garamond", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
}

/* ───────── Top bar ───────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 1.5rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.wordmark {
  display: inline-flex; align-items: center;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  font-style: italic;
}
.wordmark img { height: 72px; width: auto; display: block; }
.menu-toggle, .cart-btn {
  background: none; border: none; cursor: pointer; padding: .25rem .25rem;
  color: var(--ink);
}
.cart-btn .count, .top-nav .count {
  display: inline-block; min-width: 1.4em; padding: 0 .3em;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  margin-left: .35em; font-size: .65rem;
  letter-spacing: 0;
}
.top-right { display: flex; gap: 2rem; align-items: center; }
.top-nav { display: flex; gap: 2rem; align-items: center; }
.top-nav a {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 400;
}
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .top-nav { display: none; }
  .menu-toggle { display: inline-block; }
}
@media (max-width: 600px) {
  .topbar { padding: 1rem 1.25rem; }
  .top-right { gap: 1.25rem; }
  .wordmark img { height: 48px; }
}

/* ───────── Hero ───────── */
.hero {
  height: 100vh;
  height: 100svh; /* avoids iOS Safari URL-bar jump on mobile */
  min-height: 600px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0;
  background: #eee url('img/splash.jpg') center/cover no-repeat;
}

/* ───────── Intro block ───────── */
.intro {
  padding: 8rem 2rem;
  max-width: 720px; margin: 0 auto; text-align: center;
}
.intro p {
  font-size: clamp(0.98rem, 1.68vw, 1.3rem);
  line-height: 1.4;
  margin: 0 0 2.5rem;
  color: var(--ink);
}
.intro a.link {
  display: inline-block;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  font-size: 1.05rem;
  font-style: italic;
}

/* ───────── Featured projects ───────── */
.projects { padding: 2rem 0 4rem; }
.project {
  display: block;
  margin: 0 auto 3.5rem;
  max-width: 600px;
  padding: 0 2rem;
}
.project .media {
  width: 100%;
  aspect-ratio: 1/1;
  margin-bottom: 1rem;
  position: relative; overflow: hidden;
}
.project .row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem; padding: 0 .25rem;
}
.project .name {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 500;
}
.project .view {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  font-size: .9rem;
  font-style: italic;
  font-weight: 500;
}
/* project thumbnail backgrounds */
.m1 { background: #2a1410 url('img/humanbar-1.jpg') center/cover no-repeat; }
.m2 { background: #6b3a26 url('img/drinkvagn-1.jpg') center/cover no-repeat; }
.m3 { background: #4d4632 url('img/tempura-donut-1.jpg') center/cover no-repeat; }
.m4 { background: #cfc5ab url('img/fritidshus-2.jpg') center/cover no-repeat; }

.all-projects {
  text-align: center; padding: 1rem 2rem 8rem;
}
.all-projects a {
  font-style: italic; font-size: 1.1rem;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}

/* ───────── Section heading (for Shop, etc.) ───────── */
.section-head {
  text-align: center; padding: 8rem 2rem 2rem;
  max-width: 720px; margin: 0 auto;
}
.section-head .label { color: var(--muted); margin-bottom: 1.5rem; }
.section-head h2 {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 500; font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  margin: 0 0 1.5rem;
  line-height: 1.1;
}
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0 auto; max-width: 36em; }

/* ───────── Products ───────── */
.products {
  max-width: 1280px; margin: 0 auto; padding: 3rem 2rem 6rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3.5rem 2.5rem;
}
@media (max-width: 1000px) { .products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .products { grid-template-columns: 1fr; gap: 3rem; } }
.product .thumb {
  aspect-ratio: 1/1; width: 100%;
  margin-bottom: 1.25rem; position: relative; overflow: hidden;
  background: #ebe4d4;
}
.product .thumb svg, .product .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product .name {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 1.25rem; margin: 0 0 .25rem;
}
.product .desc { font-size: .95rem; color: var(--muted); margin: 0 0 .35rem; }
.product .price { font-size: .95rem; margin-bottom: .85rem; color: var(--ink); }
.product .add {
  background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 0;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
  font-style: italic; font-size: .98rem; font-weight: 500;
  font-family: inherit;
}
.product .add.added { color: var(--muted); border-color: var(--muted); }
.product .add:disabled,
.product .add[disabled] {
  color: rgba(26,26,24,0.35);
  border-color: rgba(26,26,24,0.2);
  cursor: not-allowed;
}

/* ───────── Color select (custom dropdown) ───────── */
.color-select {
  position: relative;
  margin: 0 0 1rem;
  user-select: none;
}
.color-select-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  font-weight: 400;
  font-style: normal;
  color: var(--ink);
  text-align: left;
}
.color-select-btn:focus, .color-select-btn:focus-visible { outline: none; }
.color-select-btn .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(26,26,24,0.2);
  flex-shrink: 0;
}
.color-select-btn .lbl {
  font-style: normal;
  font-weight: 400;
}
.color-select-btn .lbl.placeholder { color: var(--ink); }
.color-select-btn .chev {
  width: 8px; height: 8px;
  transition: transform .2s ease;
  flex-shrink: 0;
  color: var(--muted);
}
.color-select.open .color-select-btn .chev { transform: rotate(180deg); }

.color-menu {
  list-style: none;
  position: absolute; top: calc(100% + .5rem); left: 0;
  min-width: 200px;
  margin: 0; padding: .25rem 0;
  background: var(--bg);
  border: 1px solid var(--line);
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.color-select.open .color-menu { display: block; }
.color-option {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .82rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
}
.color-option:hover { background: rgba(26,26,24,0.05); }
.color-option.selected { background: rgba(26,26,24,0.05); }
.color-option .dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid rgba(26,26,24,0.15);
  flex-shrink: 0;
}
.color-option .name {
  flex: 1;
  font-size: .82rem;
  font-style: normal;
  font-weight: 400;
}
.color-option .extra {
  color: var(--muted);
  font-size: .72rem;
  font-style: italic;
  font-weight: 500;
}
.color-option.custom { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .55rem; }
.color-option.custom .dot {
  background: conic-gradient(from 0deg, #A04734, #C8B591, #2E4FA8, #A04734);
}

/* ───────── About / Contact ───────── */
.about {
  text-align: center;
  padding: 6rem 2rem;
  max-width: 720px; margin: 0 auto;
}
.about h2 {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 500; font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  line-height: 1.1; margin: 0 0 2rem;
}
.about p {
  font-size: 1.05rem; line-height: 1.6;
  color: var(--ink); margin: 0 auto 1.5rem;
}
.about .portrait {
  width: 100%; max-width: 268px; margin: 0 auto 1.5rem;
  aspect-ratio: 1/1; overflow: hidden;
}
.about .portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about .portrait-meta { margin-bottom: 3rem; }
.about .portrait-meta .label { color: var(--muted); margin-bottom: .5rem; }
.about .portrait-meta .name {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 1.05rem; margin: 0;
}

.contact-block {
  text-align: center; padding: 6rem 2rem 8rem;
}
.contact-block dl {
  display: inline-grid; grid-template-columns: auto;
  gap: 1.25rem; margin: 0; text-align: center;
}
.contact-block dt { color: var(--muted); margin: 0; font-size: .72rem; letter-spacing: 0.22em; text-transform: uppercase; }
.contact-block dd { margin: .25rem 0 0; font-size: 1.15rem; font-style: italic; font-weight: 500; }

/* ───────── Project page (single project view) ───────── */
.project-page {
  padding-top: 10rem;
  max-width: 880px; margin: 0 auto;
}
.project-page .head {
  text-align: center; padding: 0 2rem 3rem;
}
.project-page .head .meta { color: var(--muted); margin-bottom: 1rem; }
.project-page .head h1 {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 500; font-style: italic;
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  margin: 0 0 1rem; line-height: 1.05;
}
.project-page .body {
  max-width: 600px; margin: 0 auto; padding: 0 2rem 3rem;
  text-align: center;
}
.project-page .body p { font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.5rem; }

/* ───────── Project carousel (sideways navigation) ───────── */
.carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 3rem;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--bg);
  user-select: none;
}
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.carousel-zone {
  position: absolute; top: 0; bottom: 0;
  width: 50%;
  z-index: 5;
}
.carousel-zone.left  { left: 0;  cursor: pointer; }
.carousel-zone.right { right: 0; cursor: pointer; }
.carousel-counter {
  position: absolute;
  bottom: 1.25rem; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  color: #fff;
  font-style: italic; font-weight: 500;
  font-size: .95rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
  pointer-events: none;
}
/* Pagination dots under the carousel */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: .55rem;
  margin: -2rem auto 3rem;
  max-width: 900px;
}
.carousel-dot {
  width: 10px; height: 10px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--muted);
  cursor: pointer;
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}
/* Invisible 28×28 hit area centered on each dot — mobile only.
   Adjacent overlap doesn't matter since the click resolves to the closest dot. */
@media (max-width: 600px) {
  .carousel-dot::after {
    content: "";
    position: absolute;
    inset: -9px;
  }
}
.carousel-dot:hover { background: var(--muted); }
.carousel-dot.active {
  background: var(--ink);
  border-color: var(--ink);
}
.project-page .links {
  text-align: center; padding: 2rem 2rem 8rem;
  display: flex; flex-direction: column; gap: 1rem; align-items: center;
}
.project-page .links a {
  font-style: italic; font-size: 1.1rem; font-weight: 500;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}

/* ───────── Footer ───────── */
footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap; gap: 1rem;
}

/* ───────── Menu overlay ───────── */
.menu-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: var(--bg);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
  display: flex; flex-direction: column;
  padding: 1.5rem 2.5rem;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.menu-overlay .top {
  display: flex; justify-content: space-between; align-items: center;
}
.menu-overlay nav {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem;
}
.menu-overlay nav a {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: clamp(1.75rem, 4.2vw, 3.15rem);
  line-height: 1;
}
.menu-overlay .footer {
  color: var(--muted);
  font-size: .72rem; letter-spacing: 0.2em; text-transform: uppercase;
  text-align: center;
}
@media (max-width: 600px) {
  .menu-overlay { padding: 1rem 1.25rem; }
}

/* ───────── Cart drawer ───────── */
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 100%);
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .35s ease;
  z-index: 90; display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-head h3 {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-weight: 500; font-size: 1.05rem; margin: 0;
}
.cart-head button {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  color: var(--ink); font-family: inherit;
}
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.75rem; }
.cart-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-item .thumb { width: 64px; height: 64px; background: #ebe4d4; flex-shrink: 0; position: relative; overflow: hidden; }
.cart-item .thumb svg, .cart-item .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cart-item .meta { flex: 1; }
.cart-item .meta .n { font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: 1.1rem; }
.cart-item .meta .pr { color: var(--muted); font-size: .9rem; }
.cart-item .remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .82rem;
  border-bottom: 1px solid var(--muted); padding: 0 0 1px;
  align-self: flex-start; font-style: italic;
  font-family: inherit;
}
.cart-notice {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.45;
}
.cart-notice a { border-bottom: 1px solid var(--muted); color: var(--ink); }
.cart-foot { padding: 1.5rem 1.75rem; border-top: 1px solid var(--line); }
.cart-foot .total {
  display: flex; justify-content: space-between;
  font-size: 1rem; margin-bottom: 1.25rem;
}
.cart-foot .checkout {
  width: 100%; padding: 1rem; background: var(--ink); color: var(--bg);
  border: none; cursor: pointer;
  font-size: .72rem; letter-spacing: 0.24em; text-transform: uppercase;
}
.cart-empty {
  color: var(--muted); padding: 2.5rem 0; text-align: center;
  font-style: italic; font-size: 1rem;
}
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  z-index: 85;
}
.scrim.show { opacity: 1; pointer-events: auto; }

html { scroll-behavior: smooth; }

/* ───── Sans (Inter) overrides for nav, labels, footer ───── */
.sans,
.top-nav a,
.cart-btn .count,
.top-nav .count,
.contact-block dt,
footer,
.menu-overlay .footer,
.cart-foot .checkout {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* ───── Lower the menu a bit so it aligns with the logo's bottom ───── */
.top-right { transform: translateY(8px); }

/* ───────── Mobile-only tweaks (tighter spacing, smaller chrome) ───────── */
@media (max-width: 600px) {
  .intro          { padding: 4rem 1.5rem 3rem; }
  .section-head   { padding: 4rem 1.5rem 1rem; }
  .about          { padding: 3.5rem 1.5rem; }
  .contact-block  { padding: 3.5rem 1.5rem 5rem; }
  .project-page   { padding-top: 5rem; }
  .projects       { padding: 1rem 0 2rem; }
  .all-projects   { padding: 1rem 1.5rem 5rem; }
  .products       { padding: 2rem 1.5rem 4rem; }
  .project        { margin: 0 auto 2.5rem; padding: 0 1.5rem; }

  /* Narrower side zones so a tap mid-image doesn't trigger nav (swipe handles it) */
  .carousel-zone        { width: 25%; }
  .carousel-zone.left   { left: 0; }
  .carousel-zone.right  { right: 0; }

  /* Compact, centered footer */
  footer {
    padding: 1rem 1.25rem;
    justify-content: center;
    text-align: center;
  }
}
