/*
 * Kjærverk shop styles.
 * Every colour and font comes from the active theme as a CSS variable
 * (see public_html/themes/<theme>/theme.json). Do not hard-code colours here.
 *
 *   --bg --card --ink --mute --line     surfaces and text
 *   --accent                            headings' second colour (moss)
 *   --band --band-text --band-accent    the dark «om oss» band
 *   --measure                           measurement lines on photos
 *   --water                             water on the map
 *   --heart                             the red: hours dot, map dots
 *   --font-display --font-mono --font-serif
 */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-display); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--measure); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p, figure, dl, dd, ul { margin: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Building blocks ---------- */
.wrap { max-width: 1200px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.narrow { max-width: 760px; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
/* Scanned paper pieces: white paper disappears into the page colour. */
.scan { mix-blend-mode: multiply; filter: brightness(1.08) contrast(1.08); }
.h2 { font-weight: 800; font-variation-settings: "wdth" 80; font-size: clamp(2rem, 4.4vw, 3.3rem); letter-spacing: -.025em; line-height: 1; }
.h2.sm { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.h2 em { font-family: var(--font-serif); font-weight: 400; color: var(--accent); letter-spacing: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; padding: 9px 14px; border: 1px solid var(--ink); background: none; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--card); }
.btn.solid { background: var(--ink); color: var(--card); }
.btn.solid:hover { background: var(--band); }
.btn.big { padding: 14px 20px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--mute); }

/* Monstera: corners grow out of a framed box; dividers are a paper stem. */
/* The leaves sit behind the box's content (z-index -1). The box isolates itself and has
   its own background, so the scanned paper (multiply) still blends into that background.
   Never put z-index on the content itself: that cuts the blend and shows white boxes. */
.corner { position: absolute; width: 230px; pointer-events: none; z-index: -1; }
/* Every corner is the same top-left leaf, mirrored. The others are placed just outside the box
   with their top-left point on the box's corner, and mirrored around that point back inside, so
   that point is also where they turn and sway from. The leaf reaches 11% past the corner
   (cut off by the box), so its straight edges never pull away from the box's edges as it sways. */
.corner.tl { left: 0; top: 0; }
.corner.tr { left: 100%; top: 0; transform: scaleX(-1); }
.corner.bl { left: 0; top: 100%; transform: scaleY(-1); }
.corner.br { left: 100%; top: 100%; transform: scale(-1, -1); }
/* Each page turns and sizes its leaves a little differently (--leaf-* are set from the page
   address in layout.php), so the corners never look copy-pasted. They turn around the corner they grow from. */
.corner.tl { transform-origin: 11% 11%; translate: -11% -11%; rotate: var(--leaf-a, 0deg); scale: var(--leaf-s, 1); }
.corner.tr { transform-origin: 11% 11%; translate: -11% -11%; rotate: var(--leaf-b, 0deg); scale: var(--leaf-t, 1); }
.corner.bl { transform-origin: 11% 11%; translate: -11% -11%; rotate: var(--leaf-b, 0deg); scale: var(--leaf-s, 1); }
.corner.br { transform-origin: 11% 11%; translate: -11% -11%; rotate: var(--leaf-a, 0deg); scale: var(--leaf-t, 1); }
.divider img { rotate: var(--leaf-c, 0deg); }
.leaf { rotate: var(--leaf-c, 0deg); }
/* The leaves sway a little, each at its own pace, around the point they grow from.
   --base is the page's own turn from above; the animation swings ±--amp around it. */
@keyframes sway { from { rotate: calc(var(--base, 0deg) - var(--amp, 2.6deg)); } to { rotate: calc(var(--base, 0deg) + var(--amp, 2.6deg)); } }
.corner, .leaf, .divider img { animation: sway var(--dur, 7s) ease-in-out var(--delay, 0s) infinite alternate; }
.corner.tl { --base: var(--leaf-a, 0deg); --dur: 7.4s; }
.corner.tr { --base: var(--leaf-b, 0deg); --dur: 8.6s; --delay: -3s; }
.corner.bl { --base: var(--leaf-b, 0deg); --dur: 9.2s; --delay: -5s; }
.corner.br { --base: var(--leaf-a, 0deg); --dur: 8s; --delay: -2s; }
.leaf { --base: var(--leaf-c, 0deg); --amp: 6deg; --dur: 5.2s; transform-origin: 50% 100%; }
.divider img { --base: var(--leaf-c, 0deg); --amp: 1.3deg; --dur: 9s; --delay: -4s; }
.leaf { width: 46px; transform: rotate(-12deg); }
.divider { display: flex; align-items: center; gap: 14px; padding-block: 28px; }
.divider span { flex: 1; border-top: 1.5px solid var(--accent); opacity: .55; }
.divider img { width: min(420px, 58%); }
.divider .flip { transform: scaleX(-1); }

/* ---------- Header and footer ---------- */
.preview-bar { background: var(--measure); color: var(--card); text-align: center; padding: 6px 16px; }
.top { background: var(--band); color: var(--band-text); }
.top .wrap { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding-block: 6px; }
.header { border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; flex-wrap: wrap; }
.logo img { height: 44px; width: auto; }
.nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.tb-wrap { padding-block: 40px 48px; }
.tb { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 150px; border: 1.5px solid var(--ink); background: var(--card); }
.tb > div { padding: 10px 14px; display: grid; gap: 2px; align-content: start; min-width: 0; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); overflow-wrap: break-word; }
.tb > div > * { display: block; }
.tb > div:nth-last-child(-n+4) { border-bottom: 0; }
.tb small { color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.tb b { font-weight: 600; }
.tb .big { grid-row: span 2; border-bottom: 0; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; align-items: end; }
.tb .big > div { display: grid; gap: 4px; }
.tb .big b { font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.tb .big img { width: 90px; }
.tb-tagline { display: block; margin-top: 6px; }
.tb .leafcell { grid-column: 5; grid-row: 1 / span 2; position: relative; overflow: hidden; isolation: isolate; background: var(--card); border: 0; padding: 0; min-height: 120px; }
.tb .leafcell .corner { width: 100%; }

/* ---------- Front page ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding-block: 44px 8px; }
.hero h1 { font-weight: 800; font-variation-settings: "wdth" 78; font-size: clamp(3rem, 8.4vw, 7rem); line-height: .88; letter-spacing: -.035em; }
.hero h1 span { display: block; color: var(--accent); }
.lede { margin-block: 22px 26px; font-size: 1.2rem; max-width: 36ch; }
.hero-art { position: relative; }
.hero-note { margin-top: 6px; text-align: center; font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--mute); }

.section { padding-block: 24px 8px; }
.sechead { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.sub { margin-top: 8px; color: var(--mute); }
.head-art { display: flex; align-items: end; gap: 8px; }
.head-art .handmade { width: 150px; margin-bottom: -12px; }
/* The single leaf grows from the end of the heading. */
.leaf.title-leaf { display: inline-block; width: .9em; margin-left: .38em; vertical-align: -.08em; }
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding-block: 40px; }
.empty img { width: 180px; }

.items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.item { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 16px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.item.on { background: var(--card); }
.item h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; margin-top: 4px; }
.item h3 a { text-decoration: none; }
.item h3 span { font-family: var(--font-mono); font-size: 14px; font-weight: 500; white-space: nowrap; }
.who { font-size: 1.02rem; }
.hours { display: inline-flex; align-items: center; gap: 7px; color: var(--band); }
.hours::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--heart); }
.extra { color: var(--mute); }
.item form { margin-top: 4px; }

/* Photo frame with optional measurement lines (from the technical drawing idea). */
.frame { position: relative; display: block; }
/* Room for the lines outside the photo: below for the width, to the right for the height. */
.frame.has-w { margin-bottom: 26px; }
.frame.has-h { margin-right: 26px; }
.frame img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--card); }
.dim { position: absolute; color: var(--measure); font-family: var(--font-mono); font-size: 11px; }
.dim.w { left: 0; right: 0; bottom: -18px; border-top: 1px solid var(--measure); }
.dim.w::before, .dim.w::after { content: ""; position: absolute; top: -6px; height: 11px; border-left: 1px solid var(--measure); }
.dim.w::before { left: 0; } .dim.w::after { right: 0; }
.dim.w span { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: var(--bg); padding-inline: 6px; white-space: nowrap; }
.dim.h { top: 0; bottom: 0; right: -18px; border-left: 1px solid var(--measure); }
.dim.h::before, .dim.h::after { content: ""; position: absolute; left: -6px; width: 11px; border-top: 1px solid var(--measure); }
.dim.h::before { top: 0; } .dim.h::after { bottom: 0; }
.dim.h span { position: absolute; top: 50%; left: -8px; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; background: var(--bg); padding-block: 6px; white-space: nowrap; }
.item.on .dim span { background: var(--card); }
/* In the shop grid the measurements stay hidden until you hover (or tab to) a card, and are drawn
   just inside the photo, so every photo in the grid is the same size. The product page always shows them. */
.item .frame.measured { margin: 0; }
.item .frame:not(.has-h) .dim.w { right: 12px; }   /* alone, a line is centred on the photo */
.item .frame:not(.has-w) .dim.h { bottom: 34px; }
.item .dim { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.item:hover .dim, .item:focus-within .dim { opacity: 1; }
.item .dim.w { left: 12px; right: 34px; bottom: 14px; }
.item .dim.h { top: 34px; bottom: 34px; right: 14px; }
.item .dim span { background: var(--card); }
.item .dim.w span { padding: 1px 6px; }
.item .dim.h span { padding: 6px 1px; }
/* Catalogue number: a small label in the photo's corner, like a drawing number. */
.catno { position: absolute; top: 0; right: 0; background: var(--bg); color: var(--mute); font-size: 11px; padding: 2px 7px; letter-spacing: .04em; }
.item.on .catno { background: var(--card); }
.catno-line { color: var(--mute); font-size: 13px; letter-spacing: .04em; margin-bottom: -10px; }
/* «Solgt» as a rubber stamp: red ink, a little crooked, worn by a noise mask. */
.frame.is-sold img { filter: saturate(.55); opacity: .85; }
.stamp {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-9deg);
    font-family: var(--font-mono); font-weight: 600; font-size: 22px; letter-spacing: .22em; text-transform: uppercase;
    color: var(--heart); border: 3px solid var(--heart); outline: 1.5px solid var(--heart); outline-offset: 3px;
    padding: 4px 10px 4px 16px; border-radius: 3px; mix-blend-mode: multiply; opacity: .9;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); -webkit-mask-size: 180px 90px; mask-size: 180px 90px;
}
.stamp.big { font-size: 40px; border-width: 4px; outline-width: 2px; outline-offset: 5px; padding: 6px 16px 6px 26px; }
.frame.detail .stamp { display: none; }

/* Origin map */
.origin { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 40px; margin-top: 22px; align-items: center; }
.origin-lead { font-family: var(--font-display); font-size: 1.08rem; max-width: 52ch; }
.head-art .pose-map { width: 120px; }
.map { background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.map .corner { width: 30%; z-index: 1; }
#map { display: block; width: 100%; height: auto; }
.map-credit { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: var(--mute); background: var(--card); padding: 0 4px; z-index: 2; }
.map-credit a { text-decoration: none; }
.origin-side { display: grid; gap: 16px; align-content: start; }
.places { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.places li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.places li.on { color: var(--heart); }
.places b { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.places span { color: var(--mute); }

/* Delivery, with the mascot */
.ways-card { position: relative; overflow: hidden; isolation: isolate; margin-top: 26px; background: var(--card); border: 1px solid var(--line); padding: 24px; }
.ways-card .corner { width: 190px; }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.way { display: grid; gap: 8px; align-content: start; }
.way img { height: 170px; width: auto; max-width: 100%; object-fit: contain; justify-self: start; }
.way h3 { font-size: 1.4rem; font-weight: 700; border-top: 1px solid var(--ink); padding-top: 10px; }

.about { margin-top: 56px; background: var(--band); color: var(--band-text); }
.about .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding-block: 56px; }
.about .art { background: var(--card); padding: 18px; transform: rotate(-1.5deg); }
.about .h2 em { color: var(--band-accent); }
.about p { font-size: 1.12rem; max-width: 50ch; margin-top: 14px; }

.toast { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--card); border: 1px solid var(--ink); display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; z-index: 20; box-shadow: 4px 4px 0 var(--ink); text-decoration: none; animation: toast 4s forwards; }
.toast img { width: 52px; height: 52px; object-fit: cover; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---------- Kjærverkerne ---------- */
.makers-intro { max-width: 60ch; font-size: 1.05rem; font-family: var(--font-display); }
.makers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 8px; }
.maker-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding-block: 22px; border-bottom: 1px solid var(--line); align-items: start; }
.maker-card h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.maker-card h2 a { text-decoration: none; }
.maker-card > div { display: grid; gap: 6px; min-width: 0; }
.portrait { display: block; background: var(--card); border: 1px solid var(--line); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.portrait .fallback { object-fit: contain; padding: 12px; }
.where { color: var(--mute); }
.maker-page { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.maker-bio { display: grid; gap: 14px; align-content: start; }
.maker-bio p:not(.mono) { font-size: 1.1rem; max-width: 60ch; }
/* A kjærverker's earlier work: a photo grid with captions, opening in the lightbox. */
.work-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.work-gallery figure { margin: 0; display: grid; gap: 12px; }
.work-gallery figure > a { display: block; border: 1px solid var(--line); background: var(--card); }
.work-gallery figure > a:hover { border-color: var(--ink); }
.work-gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.work-gallery figcaption { font-size: 13px; color: var(--mute); }
.lightbox { border: 0; padding: 0; background: none; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: color-mix(in srgb, var(--ink) 88%, transparent); }
.lightbox figure { margin: 0; height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 56px 64px; pointer-events: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; background: var(--card); pointer-events: auto; }
.lightbox figcaption { color: var(--card); font-size: 14px; }
.lightbox button { position: fixed; background: var(--card); color: var(--ink); border: 1px solid var(--ink); padding: 8px 14px; font-size: 14px; cursor: pointer; }
.lightbox .lb-close { top: 14px; right: 14px; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; transform: translateY(-50%); font-size: 18px; }
.lightbox .lb-prev { left: 12px; } .lightbox .lb-next { right: 12px; }
.join { margin-top: 40px; }
.join .way { grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; align-items: center; padding-right: 140px; }
.join .way img { grid-row: 1 / span 2; }
.join .way h3 { align-self: end; }
.join .way p { align-self: start; max-width: 60ch; }

/* ---------- Bli en kjærverker ---------- */
.join-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 32px; align-items: center; border-bottom: 1px solid var(--ink); padding-bottom: 20px; }
.join-hero .lede { margin-bottom: 0; max-width: 52ch; }
.terms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: term; }
.terms li { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.terms li:nth-child(3n+2), .terms li:nth-child(3n) { padding-left: 22px; border-left: 1px solid var(--line); }
.terms h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.terms h2::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--heart); margin-right: 10px; vertical-align: middle; }
.contact .way { grid-template-columns: auto minmax(0, 1fr); column-gap: 32px; align-items: center; padding-right: 140px; }
.contact .way img { grid-row: 1 / span 3; height: 150px; }
.contact .way h2 { border-top: 0; padding-top: 0; align-self: end; }
.contact-lines { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }

/* ---------- Product page ---------- */
.crumbs { margin-bottom: 16px; }
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: start; }
.product-info { display: grid; gap: 16px; align-content: start; }
.price { font-size: 18px; }
.specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.specs dt { color: var(--mute); }
.sold-note { color: var(--mute); }
/* More photos: thumbnails under the main one; detail photos hide the measurement lines. */
.gallery { display: grid; gap: 12px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.thumb { display: block; border: 1px solid var(--line); }
.thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumb.on { border-color: var(--ink); outline: 1px solid var(--ink); }
.frame.detail .dim { visibility: hidden; }
/* The story of a special thing, written with Text::format and drawn in the theme's fonts. */
.story { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; justify-items: center; gap: 18px; }
.prose { max-width: 64ch; font-size: 1.1rem; line-height: 1.65; display: grid; gap: 1em; }
.prose > p:first-child { font-size: 1.25rem; }
.prose h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin-top: .6em; }
.prose strong { font-weight: 700; }
.prose em { font-family: var(--font-serif); font-size: 1.06em; }
.prose ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35em; }
.prose li { display: flex; gap: 10px; align-items: baseline; }
.prose li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--heart); transform: translateY(-2px); }
.prose blockquote { margin: .4em 0; padding-left: 18px; border-left: 2px solid var(--accent); font-family: var(--font-serif); font-style: italic; font-size: 1.4rem; line-height: 1.4; color: var(--accent); }
/* Variants (size, colour): chips; the chosen one is filled in, sold-out ones are struck through. */
.variants { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.variants legend { color: var(--mute); font-size: 13px; margin-bottom: 8px; padding: 0; }
.variant { position: relative; }
.variant input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.variant span { display: inline-block; font-family: var(--font-mono); font-size: 14px; padding: 8px 14px; border: 1px solid var(--ink); background: var(--card); }
.variant small { color: var(--mute); font-size: 12px; margin-left: 4px; }
.variant input:checked + span { background: var(--ink); color: var(--card); }
.variant input:checked + span small { color: inherit; opacity: .75; }
.variant input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.variant.sold-out span { border-color: var(--line); color: var(--mute); text-decoration: line-through; }
.variant.sold-out input { cursor: not-allowed; }
.item > .btn { justify-self: start; margin-top: 4px; }
.btn.ask { border-style: dashed; }
/* «Spør om en til» page */
.ask-page { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.ask-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.ask-page > div { display: grid; gap: 14px; }
.ask-page .subject { color: var(--mute); font-size: 13px; }
@media (max-width: 640px) { .ask-page { grid-template-columns: 1fr; } .ask-photo { width: 140px; } }
.work-gallery figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
/* «spør om en lignende»: a small dashed button, like «spør om en til» on sold things. */
.work-gallery figcaption a { color: var(--ink); white-space: nowrap; text-decoration: none; border: 1px dashed var(--ink); padding: 5px 12px; transition: background-color .2s ease, color .2s ease; }
.work-gallery figcaption a:hover { background: var(--ink); color: var(--card); border-style: solid; }

/* ---------- Cart and checkout ---------- */
.lines { list-style: none; padding: 0; margin-top: 16px; }
.lines li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.lines img { width: 64px; height: 64px; object-fit: cover; }
.lines li div { display: grid; }
.lines .mono { color: var(--mute); }
.total { text-align: right; padding-block: 14px; font-size: 16px; }
.total .hint { color: var(--mute); font-size: 13px; }
.checkout { display: grid; gap: 14px; margin-top: 28px; background: var(--card); border: 1px solid var(--line); padding: 24px; }
.checkout .note { color: var(--mute); }
.checkout label { display: grid; gap: 4px; font-weight: 600; }
.checkout label .mono { font-weight: 400; color: var(--mute); }
.checkout input, .checkout textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); font-weight: 400; }
.checkout fieldset { border: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 6px; }
.checkout legend { font-weight: 600; padding-inline: 4px; }
.checkout .choice { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.checkout .choice input { width: auto; }
.choice-note { color: var(--mute); margin: -4px 0 4px 28px; }
/* Gift: the extras show when «Dette er en gave» is ticked (browsers without :has show them always). */
.gift { border: 1px dashed var(--line); padding: 12px 14px; display: grid; gap: 10px; }
.gift legend { padding-inline: 4px; }
.gift-extra { display: grid; gap: 10px; padding-left: 28px; }
.gift:has(#gift:not(:checked)) .gift-extra { display: none; }
.remember { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--mute); }
.remember .choice { font-size: 13px; }
.gift-note { border-left: 2px solid var(--heart); padding-left: 12px; color: var(--ink); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-error { color: var(--heart); font-family: var(--font-mono); font-size: 13px; margin-top: -6px; }
.thanks { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 24px; }
.thanks > div { display: grid; gap: 14px; }
.summary { list-style: none; padding: 0; display: grid; gap: 4px; }

/* ---------- Åpner snart ---------- */
.soon-page { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.soon { width: 100%; max-width: 640px; }
.soon-card { position: relative; overflow: hidden; isolation: isolate; background: var(--card); border: 1px solid var(--line); padding: 48px clamp(24px, 6vw, 64px); display: grid; justify-items: center; gap: 16px; text-align: center; }
.soon-card .corner { width: 170px; }
.soon-logo { width: min(320px, 80%); }
.soon-art { width: min(380px, 100%); }
.soon h1 { font-weight: 800; font-variation-settings: "wdth" 78; font-size: clamp(2.4rem, 7vw, 4rem); line-height: .95; letter-spacing: -.03em; }
.soon p { max-width: 42ch; font-size: 1.1rem; }
.soon-note { color: var(--measure); font-size: 15px !important; }
.soon-sign { font-family: var(--font-serif); font-style: italic; font-size: 1.4rem !important; color: var(--accent); }
.soon-place { color: var(--mute); font-size: 12px !important; }

/* ---------- Movement ----------
   Everything here is extra: without it (old browsers, «reduce motion») the pages work the same. */

/* Going from a card to its page (and back), the photo glides into place.
   Each photo is named ting-<id> in the templates; the header stays put. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
.header { view-transition-name: header; }

/* The header follows you down. Its background must be solid, or the scanned logo shows its paper. */
html { scroll-padding-top: 96px; }
.header { position: sticky; top: 0; z-index: 30; background: var(--bg); transition: transform .3s ease, box-shadow .3s ease; }
.header.scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px color-mix(in srgb, var(--ink) 45%, transparent); }
.logo img { transform-origin: left center; transition: scale .3s ease; }
.header.scrolled .logo img { scale: .84; }
.header.tuck { transform: translateY(-100%); box-shadow: none; }

.btn { transition: background-color .2s ease, color .2s ease, transform .15s ease; }
.btn:active { transform: translateY(1px); }
.nav a { text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .2s ease; }
.nav a:hover { text-decoration: underline; text-decoration-color: currentColor; }
.item .frame img { transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.item:hover .frame img { transform: scale(1.02); }

/* Things rise gently into view as you scroll (browsers that tie animations to scrolling).
   Only boxes without scanned paper inside: fading a box would show the paper's white. */
@keyframes rise { from { opacity: 0; translate: 0 26px; } }
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .item, .work-gallery li, .ways-card, .map, .places li, .lines li, .checkout {
            animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%;
        }
        .items .item:nth-child(3n+2) { animation-range: entry 8% entry 63%; }
        .items .item:nth-child(3n+3) { animation-range: entry 16% entry 71%; }
    }
}

/* Product page on phones: price and button at the bottom (site.js shows it). */
.buybar { display: none; }
@media (max-width: 920px) {
    .buybar:not([hidden]) {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
        padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        background: var(--card); border-top: 1px solid var(--line);
        box-shadow: 0 -10px 24px -18px color-mix(in srgb, var(--ink) 45%, transparent);
        transition: transform .3s ease;
    }
    .buybar.away { transform: translateY(110%); }
    .buybar div { display: grid; min-width: 0; }
    .buybar b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .buybar .btn { flex: none; }
    .has-buybar .tb-wrap { padding-bottom: 110px; }
    .has-buybar .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* «Del»: the catalogue card in a small window (computers; phones use the share sheet). */
.share-row { margin: 0; }
.share-dialog { border: 1px solid var(--ink); background: var(--bg); color: var(--ink); padding: 18px; width: min(560px, calc(100vw - 32px)); }
.share-dialog::backdrop { background: color-mix(in srgb, var(--ink) 60%, transparent); }
.share-dialog img { width: 100%; height: auto; aspect-ratio: 1200 / 630; background: var(--card); }
.share-dialog .share-url { margin-block: 12px; color: var(--mute); overflow-wrap: anywhere; user-select: all; }
.share-dialog[open] { animation: pop .25s cubic-bezier(.2, .7, .3, 1); }
@keyframes pop { from { opacity: 0; translate: 0 12px; scale: .98; } }

/* ---------- «Myk» look (theme "look": "myk") ----------
   Same colours, fonts and paper figures; rounder and with fewer lines. */
.look-myk .btn { border-radius: 999px; padding: 10px 18px; }
.look-myk .btn.big { padding: 14px 24px; }
.look-myk .sechead { border-bottom: 0; }
.look-myk .items { border-left: 0; gap: 18px; margin-top: 16px; }
.look-myk .item { border: 0; border-radius: 22px; padding: 14px 14px 18px; transition: background-color .25s ease; }
.look-myk .item:hover, .look-myk .item.on { background: var(--card); }
.look-myk .item:hover .dim span, .look-myk .item:hover .catno { background: var(--card); }
.look-myk .frame img, .look-myk .thumb, .look-myk .thumb img, .look-myk .work-gallery figure > a, .look-myk .work-gallery img,
.look-myk .portrait, .look-myk .ask-photo, .look-myk .lines img { border-radius: 14px; }
.look-myk .catno { border-radius: 0 14px 0 10px; }
.look-myk .thumb.on { outline-offset: 2px; }
.look-myk .ways-card, .look-myk .map, .look-myk .checkout, .look-myk .soon-card { border: 0; border-radius: 26px; }
.look-myk .checkout input, .look-myk .checkout textarea { border-radius: 12px; }
.look-myk .checkout fieldset, .look-myk .gift { border-radius: 16px; }
.look-myk .variant span, .look-myk .work-gallery figcaption a { border-radius: 999px; }
.look-myk .tb { border-radius: 20px; overflow: hidden; }
.look-myk .toast { border: 0; border-radius: 999px; box-shadow: 0 12px 30px -14px color-mix(in srgb, var(--ink) 55%, transparent); }
.look-myk .toast img { border-radius: 50%; }
.look-myk .lightbox img { border-radius: 14px; }
.look-myk .share-dialog { border: 0; border-radius: 24px; box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--ink) 60%, transparent); }
.look-myk .share-dialog img { border-radius: 12px; }
.look-myk .buybar { border-top: 0; border-radius: 22px 22px 0 0; }

/* ---------- Narrow screens ---------- */
@media (max-width: 920px) {
    .hero .wrap, .origin, .about .wrap, .product, .maker-page, .join-hero { grid-template-columns: 1fr; }
    .join-hero img { max-width: 360px; }
    .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .terms li:nth-child(3n) { padding-left: 0; border-left: 0; }
    .terms li:nth-child(3n+2) { padding-left: 22px; border-left: 1px solid var(--line); }
    .terms li:nth-child(2n) { padding-left: 22px; border-left: 1px solid var(--line); }
    .terms li:nth-child(2n+1) { padding-left: 0; border-left: 0; }
    .makers { grid-template-columns: 1fr; }
    .portrait.big { max-width: 360px; }
    .hero-art { max-width: 460px; }
    .map { max-width: 380px; }
    .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .corner { width: 160px; }
    .leaf { width: 36px; }
    .head-art .handmade { width: 110px; }
    .tb { grid-template-columns: 1fr 1fr; }
    .tb .big { grid-column: span 2; grid-row: auto; border-bottom: 1.5px solid var(--ink); }
    .tb > div { border-bottom: 1.5px solid var(--ink); }
    .tb > div:nth-child(odd):not(.big) { border-right: 0; }
    .tb .leafcell { display: none; }
}
@media (max-width: 600px) {
    .items, .ways { grid-template-columns: 1fr; }
    /* Header in two short rows: logo and cart, then the menu as one line you can swipe. */
    .header .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-block: 10px 6px; }
    .logo img { height: 36px; }
    .header .btn { grid-column: 2; grid-row: 1; }
    .nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; flex-wrap: nowrap; gap: 18px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-block: 4px; }
    .nav::-webkit-scrollbar { display: none; }
    .soon-card .corner { width: 110px; }
    .top .wrap > span:last-child { display: none; } /* the coordinates; the delivery line matters more */
    .ways-card .corner, .map .corner { display: none; }
    .head-art .handmade { display: none; }
    .ways-card { padding: 18px; }
    .join .way, .contact .way { grid-template-columns: 1fr; padding-right: 0; }
    .contact .way img { grid-row: auto; }
    .terms { grid-template-columns: 1fr; }
    .terms li, .terms li:nth-child(3n+2), .terms li:nth-child(3n) { padding-left: 0; border-left: 0; }
    .join .way img { grid-row: auto; }
    .head-art .pose-map { width: 80px; }
    .tb { grid-template-columns: 1fr; }
    .tb .big { grid-column: auto; }
    .tb > div { border-right: 0; }
    .thanks { grid-template-columns: 1fr; }
    .maker-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
    .thanks img { width: 160px; }
    .lines li { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .lines li form { grid-column: 2; }
}
