/* Maske for maske. Colours follow the active yarn (data-way on <html>). */

@property --ground { syntax: '<color>'; inherits: true; initial-value: #17264a; }
@property --deep { syntax: '<color>'; inherits: true; initial-value: #0f1a36; }
@property --yarn { syntax: '<color>'; inherits: true; initial-value: #efe9da; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #bb2530; }
@property --accent-ink { syntax: '<color>'; inherits: true; initial-value: #a81d28; }

:root {
  --ground: #17264a;
  --deep: #0f1a36;
  --yarn: #efe9da;
  --accent: #bb2530;
  --accent-ink: #a81d28;
  --text: color-mix(in srgb, var(--yarn) 90%, var(--ground));
  --soft: color-mix(in srgb, var(--yarn) 72%, var(--ground));
  --seam: color-mix(in srgb, var(--yarn) 34%, transparent);
  --display: 'Chubbo', 'Rockwell', Georgia, serif;
  --body: 'Sentient', 'Iowan Old Style', Georgia, serif;
  --topbar: 56px;
  color-scheme: dark;
  transition: --ground .8s ease, --deep .8s ease, --yarn .8s ease, --accent .8s ease, --accent-ink .8s ease;
}
:root[data-way="koks"] { --ground: #2a2a2f; --deep: #1b1b1f; --yarn: #f1eee6; --accent: #dba520; --accent-ink: #855d00; }
:root[data-way="mose"] { --ground: #33472b; --deep: #24331e; --yarn: #eee4cb; --accent: #c4622d; --accent-ink: #94400f; }
:root[data-way="tyttebaer"] { --ground: #8a1b2a; --deep: #66101d; --yarn: #f1e9da; --accent: #1d2f5c; --accent-ink: #1d2f5c; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: clip;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }

a { color: inherit; text-decoration: underline dashed; text-decoration-thickness: 2px; text-underline-offset: .24em; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); }
a:hover { text-decoration-style: solid; text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--yarn); outline-offset: 3px; border-radius: 2px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }

/* ---------- top bar ---------- */
.top {
  height: var(--topbar);
  background: var(--deep);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: clamp(16px, 4vw, 40px);
}
.mark { display: inline-flex; align-items: baseline; text-decoration: none; min-height: 44px; padding-block: 6px; color: var(--yarn); }
.mark-h { font: 700 1.9rem/1 var(--display); }
.mark-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); margin-left: .12rem; display: inline-block; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--yarn) 30%, transparent); }
.mark-name { font: 500 1rem/1 var(--display); margin-left: .7rem; letter-spacing: .01em; }
.top nav { display: flex; gap: clamp(2px, 1.5vw, 18px); }
.top nav a { font: 500 1rem/1 var(--display); color: var(--yarn); text-decoration: none; padding: 14px 10px; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a:hover { text-decoration: underline dashed 2px; text-underline-offset: .3em; }

/* ---------- hero ---------- */
.hero { background: var(--deep); }
.swatch { position: relative; background: var(--deep); line-height: 0; }
.knit { display: block; width: 100%; height: calc(100svh - var(--topbar) - 150px); min-height: 380px; touch-action: pan-y; cursor: default; }
.tail {
  position: absolute; left: 0; top: 0; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border: 0; background: none; padding: 0; border-radius: 50%; cursor: grab; touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.tail:active { cursor: grabbing; }
.tail-tip {
  position: absolute; right: 44px; top: 50%; transform: translateY(-50%);
  font: 500 .8125rem/1 var(--display); color: var(--ground); background: var(--yarn);
  padding: 7px 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.tail:hover .tail-tip, .tail:focus-visible .tail-tip { opacity: 1; }

.hero-strip {
  display: grid; gap: 18px; align-items: center;
  padding: 20px clamp(16px, 4vw, 40px) 26px;
  border-top: 3px solid var(--accent);
}
.lead { font: 500 clamp(1.3rem, 2.3vw, 1.9rem)/1.22 var(--display); color: var(--yarn); letter-spacing: -.005em; text-wrap: balance; }
.hint { font-style: italic; color: var(--soft); font-size: 1rem; line-height: 1.45; margin-top: 8px; max-width: 46ch; }

.yarns { display: flex; align-items: flex-start; gap: 6px; }
.yarns legend { float: left; font: 500 1rem/1 var(--display); color: var(--soft); padding: 17px 10px 0 0; }
.yarn { position: relative; display: grid; justify-items: center; gap: 5px; width: 64px; padding: 4px 0 2px; cursor: pointer; }
.yarn input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.yarn svg { width: 44px; height: 44px; border-radius: 50%; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.yarn span { font: 500 .8125rem/1.1 var(--display); color: var(--soft); }
.yarn:hover svg { transform: rotate(-14deg) scale(1.06); }
.yarn input:checked + svg { box-shadow: 0 0 0 2px var(--deep), 0 0 0 4.5px var(--yarn); }
.yarn input:checked ~ span { color: var(--yarn); }
.yarn input:focus-visible + svg { outline: 3px solid var(--yarn); outline-offset: 6px; }

@media (min-width: 860px) {
  .hero-strip { grid-template-columns: 1fr auto; gap: 40px; padding-block: 22px 26px; }
}

/* ---------- sections ---------- */
.sec { padding-block: clamp(64px, 9vw, 124px); }
.grid { display: grid; gap: 14px; }
.note { font: italic 400 1rem/1.2 var(--body); color: var(--soft); display: flex; align-items: center; gap: 9px; }
.m { width: 20px; height: 17px; fill: var(--yarn); flex: none; }
.main { min-width: 0; }
h2 { font: 700 clamp(2.1rem, 4.6vw, 3.6rem)/1.04 var(--display); color: var(--yarn); letter-spacing: -.012em; text-wrap: balance; }
h3 { font: 700 1.5rem/1.15 var(--display); color: var(--yarn); }
.sub { font-size: 1.125rem; color: var(--soft); margin-top: 14px; max-width: 52ch; }
p { max-width: 64ch; text-wrap: pretty; }
.nb { white-space: nowrap; }

@media (min-width: 1000px) {
  .grid { grid-template-columns: 150px minmax(0, 1fr); column-gap: 48px; }
  .note { align-self: start; padding-top: 1.35rem; }
}

/* about */
.om { display: grid; gap: 30px; }
.om-text p { margin-top: 1.1em; }
.om-text h2 + p { margin-top: 26px; font-size: 1.1875rem; }
.portrett { position: relative; width: min(74%, 320px); justify-self: start; margin-bottom: 14px; }
.portrett img { width: 100%; outline: 1px solid var(--seam); outline-offset: 6px; }
.fakta { display: grid; }
.fakta div { display: grid; grid-template-columns: 7.2em 1fr; gap: 12px; padding: 11px 0; border-top: 2px dashed var(--seam); }
.fakta div:last-child { border-bottom: 2px dashed var(--seam); }
.fakta dt { font: 500 1rem/1.5 var(--display); color: var(--soft); }
.fakta dd { color: var(--yarn); }

@media (min-width: 760px) {
  .om { grid-template-columns: minmax(0, 1fr) 300px; column-gap: clamp(32px, 5vw, 72px); align-items: start; }
  .portrett { width: 100%; grid-column: 2; grid-row: 1; margin-top: 10px; }
  .fakta { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; column-gap: clamp(32px, 5vw, 72px); margin-top: 20px; }
  .fakta div:nth-last-child(2) { border-bottom: 2px dashed var(--seam); }
}

/* woven label */
.tag {
  position: absolute; left: -10px; bottom: -14px; z-index: 2;
  font: 700 .8125rem/1.15 var(--display); letter-spacing: .02em; white-space: nowrap;
  color: var(--accent-ink);
  background-color: var(--yarn);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .055) 0 1px, transparent 1px 3px), repeating-linear-gradient(0deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 2px);
  padding: 9px 22px 8px;
  transform: rotate(-2.2deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.tag::before, .tag::after { content: ''; position: absolute; top: 4px; bottom: 4px; width: 0; border-left: 2px dashed color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.tag::before { left: 7px; }
.tag::after { right: 7px; }

/* care label */
.care { margin-top: 22px; background: var(--yarn); color: var(--deep); width: fit-content; max-width: 100%; padding: 4px 16px 6px; position: relative; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.care::before { content: ''; position: absolute; left: 8px; right: 8px; top: 5px; border-top: 2px dashed color-mix(in srgb, var(--deep) 45%, transparent); }
.care div { display: grid; grid-template-columns: 6.4em 1fr; gap: 10px; padding: 8px 0 6px; font: 500 .875rem/1.35 var(--display); }
.care div:first-child { padding-top: 16px; }
.care div + div { border-top: 1px solid color-mix(in srgb, var(--deep) 22%, transparent); }
.care dt { color: color-mix(in srgb, var(--deep) 72%, var(--yarn)); }

.shot { width: 100%; background: var(--yarn); outline: 1px solid var(--seam); outline-offset: 6px; }
.type { font: italic 400 1rem/1.4 var(--body); color: var(--soft); margin-top: 6px; }
.links { display: flex; flex-wrap: wrap; gap: 4px 26px; margin-top: 18px; }
.links a { font: 500 1.0625rem/1.2 var(--display); padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center; color: var(--yarn); }

/* Mittgarn */
.mittgarn { margin-top: clamp(40px, 6vw, 72px); }
.mg-top { display: grid; gap: 44px; }
.mg-fig { position: relative; margin-right: 34px; }
.mg-mobil { position: absolute; right: -34px; bottom: -22px; width: 25%; border: 5px solid var(--deep); border-radius: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
.mg-text h3 { font-size: clamp(2rem, 3.4vw, 2.6rem); }
.mg-text p:not(.type) { margin-top: 14px; }
.flytt { margin-top: clamp(40px, 5vw, 60px); border-top: 2px dashed var(--seam); padding-top: 26px; }
.flytt h4 { font: 500 1.0625rem/1.2 var(--display); color: var(--soft); }
.tall { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin: 18px 0 22px; }
.tall li { font-size: 1rem; line-height: 1.3; color: var(--text); }
.tall b { display: block; font: 700 clamp(2rem, 3.6vw, 2.9rem)/1 var(--display); color: var(--yarn); letter-spacing: -.01em; margin-bottom: 5px; font-variant-numeric: tabular-nums; }

@media (min-width: 620px) { .tall { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) {
  .mg-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 70px; align-items: start; }
  .tall { grid-template-columns: repeat(5, auto); justify-content: space-between; }
  .tall li + li { border-left: 2px dashed var(--seam); padding-left: 26px; }
}

/* other garments */
.plagg-grid { display: grid; gap: 72px; margin-top: clamp(72px, 9vw, 110px); }
.plagg figure { position: relative; margin-bottom: 36px; }
.plagg h3 { font-size: 1.75rem; }
.plagg > p:not(.type):not(.links) { margin-top: 12px; }
@media (min-width: 760px) { .plagg-grid { grid-template-columns: 1fr 1fr; column-gap: clamp(40px, 6vw, 84px); row-gap: 88px; } }
.alle { margin-top: 56px; }
.alle a { font: 700 1.25rem/1.2 var(--display); color: var(--yarn); display: inline-flex; min-height: 44px; align-items: center; }

/* three things */
.tre { display: grid; gap: 34px; margin-top: 40px; }
.tre li { padding-top: 26px; position: relative; }
.tre li::before { content: ''; position: absolute; left: 0; top: -8px; width: 20px; height: 17px; background: var(--yarn); -webkit-mask: var(--maske) center / contain no-repeat; mask: var(--maske) center / contain no-repeat; }
.tre li::after { content: ''; position: absolute; left: 30px; right: 0; top: 0; border-top: 2px dashed var(--seam); }
.tre h3 { font-size: 1.4rem; text-wrap: balance; }
.tre p { margin-top: 10px; }
@media (min-width: 860px) { .tre { grid-template-columns: repeat(3, 1fr); column-gap: 44px; } }

/* the pattern sheet */
.sec-ark { padding-top: 0; }
.ark {
  background: var(--yarn); color: var(--deep);
  padding: clamp(28px, 5vw, 64px);
  position: relative;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
  outline: 2px dashed color-mix(in srgb, var(--deep) 30%, transparent); outline-offset: -12px;
}
.ark h2, .ark h3 { color: var(--deep); }
.ark .sub { color: color-mix(in srgb, var(--deep) 80%, var(--yarn)); }
.ark :focus-visible { outline-color: var(--deep); }
.pris { margin-top: 30px; }
.pris li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 13px 0; border-top: 1px solid color-mix(in srgb, var(--deep) 18%, transparent); }
.pris li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--deep) 18%, transparent); }
.hva { font: 700 1.25rem/1.25 var(--display); flex: 1 0 100%; }
.hva small { display: block; font: italic 400 1rem/1.4 var(--body); color: color-mix(in srgb, var(--deep) 78%, var(--yarn)); }
.prikker { flex: 1; min-width: 20px; border-bottom: 2px dotted color-mix(in srgb, var(--deep) 45%, transparent); transform: translateY(-.28em); }
.kr { font: 500 1.125rem/1.3 var(--display); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.fot { margin-top: 16px; font-style: italic; }
.ark h3 { margin-top: 44px; font-size: 1.4rem; }
.med { margin-top: 14px; display: grid; gap: 10px; }
.med li { padding-left: 32px; position: relative; max-width: 60ch; }
.med li::before { content: ''; position: absolute; left: 0; top: .32em; width: 20px; height: 17px; background: var(--accent-ink); -webkit-mask: var(--maske) center / contain no-repeat; mask: var(--maske) center / contain no-repeat; }
.ark .links a { color: var(--deep); }
:root { --maske: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 17'%3E%3Cpath d='M2.2 1.2c3.6.4 6.6 6.3 7.5 14.6C6 13.6 1.8 8.400 1 3.400c-.2-1.300.2-2.300 1.200-2.200zM17.800 1.200c-3.600.4-6.600 6.300-7.500 14.600 3.700-2.200 7.900-7.400 8.700-12.400.2-1.300-.2-2.300-1.200-2.200z'/%3E%3C/svg%3E"); }
@media (min-width: 700px) {
  .hva { flex: 0 1 auto; }
  .med { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

/* free check */
.sjekk { display: grid; gap: 40px; align-items: center; }
.sjekk h2 + p { margin-top: 22px; font-size: 1.1875rem; }
.lapp-knapp {
  display: inline-flex; align-items: center; min-height: 56px; margin-top: 28px;
  font: 700 1.125rem/1 var(--display); text-decoration: none;
  background: var(--yarn); color: var(--deep); padding: 18px 30px;
  outline: 2px dashed color-mix(in srgb, var(--deep) 55%, transparent); outline-offset: -7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.lapp-knapp:hover { transform: translateY(-2px) rotate(-.6deg); }
.lapp-knapp:focus-visible { outline: 3px solid var(--yarn); outline-offset: 4px; }
.lapp { display: block; justify-self: center; transform: rotate(4deg); box-shadow: 0 14px 30px rgba(0, 0, 0, .4); width: 230px; height: 200px; }
@media (min-width: 760px) { .sjekk { grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(40px, 7vw, 110px); } .lapp { margin-right: clamp(0px, 4vw, 60px); } }

/* knitted bands */
.band { display: block; width: 100%; height: 76px; }

/* contact */
.kontakt { display: grid; gap: 52px; }
.kontakt h2 + p { margin-top: 20px; font-size: 1.1875rem; }
.post { margin-top: 26px; }
.post a { font: 700 clamp(1.2rem, 6vw, 2.3rem)/1.15 var(--display); color: var(--yarn); display: inline-flex; align-items: center; min-height: 48px; white-space: nowrap; text-decoration-thickness: 3px; }
.ring { margin-top: 10px; font-size: 1.1875rem; }
.ring a { font: 700 1.3rem/1 var(--display); color: var(--yarn); display: inline-flex; min-height: 44px; align-items: center; margin-left: 4px; }
.lese h3 { font: 500 1.0625rem/1.2 var(--display); color: var(--soft); }
.lese ul { margin-top: 10px; }
.lese li { border-top: 2px dashed var(--seam); }
.lese li:last-child { border-bottom: 2px dashed var(--seam); }
.lese a { display: block; padding: 13px 0; text-decoration: none; color: var(--yarn); }
.lese a:hover { text-decoration: underline dashed 2px; }
@media (min-width: 900px) { .kontakt { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); column-gap: 64px; align-items: end; } }

/* footer */
.fot-side { background: var(--deep); padding-block: 40px 48px; font-size: 1rem; color: var(--soft); border-top: 3px solid var(--accent); }
.fot-grid { display: grid; gap: 20px; }
.fot-merke { font: 500 1rem/1.3 var(--display); color: var(--yarn); }
.fot-h { display: block; margin-bottom: 8px; }
.fot-merke .mark-h { font-size: 2.2rem; }
.fot-side a { display: inline-flex; min-height: 44px; align-items: center; margin-right: 22px; color: var(--yarn); }
@media (min-width: 860px) { .fot-grid { grid-template-columns: 1.1fr 1.6fr 1fr; column-gap: 48px; align-items: start; } }

@media (max-width: 859px) {
  .hero-strip { gap: 12px; padding-block: 16px 14px; }
  .hint { margin-top: 6px; }
  .yarns legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; float: none; }
  .yarns { justify-content: space-between; max-width: 420px; }
  .yarn { flex: 1; }
}
@media (max-width: 430px) {
  .mark-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  html { scroll-behavior: auto; }
  .yarn svg, .lapp-knapp, .tail-tip { transition: none; }
}
