@font-face {
  font-family: "Blimp";
  src: url("../fonts/OCBlimpVARv2VF.woff2") format("woff2"),
       url("../fonts/OCBlimpVARv2VF.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Colourways: one per bake week, set in week.json ---------- */
:root {
  --brand-green: #2a6e53;
  --green: #255f48;   /* text green: passes contrast on cream and blush */
  --pink: #f06798;
  --blush: #f5cdd9;
  --cream: #e8d7b9;
  --flour: #efe3cc;
  --cinnamon: #6b3f22;
  --crust: #311e11;

  --bg: var(--cream);
  --ink: var(--green);
  --logo: var(--brand-green);
  --accent: var(--pink);        /* wave lines + small flourishes, never small text */
  --duo-dark: var(--green);
  --duo-light: var(--cream);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --blimp: "Blimp", "Arial Rounded MT Bold", system-ui, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
[data-theme="surdeig"] { --bg: var(--cream); --ink: var(--green); --logo: var(--brand-green); --accent: var(--pink); --duo-dark: var(--green); --duo-light: var(--cream); }
[data-theme="rosa"]  { --ink: var(--green); --logo: var(--brand-green); --duo-dark: var(--green); --bg: var(--blush); --accent: var(--green); --wave-opacity: .4; --duo-light: var(--blush); }
[data-theme="skog"]  { --bg: var(--green); --ink: var(--blush); --logo: var(--blush); --accent: var(--pink); --duo-dark: var(--green); --duo-light: var(--blush); }
[data-theme="kanel"] { --bg: var(--flour); --ink: var(--cinnamon); --logo: var(--cinnamon); --accent: var(--pink); --duo-dark: var(--cinnamon); --duo-light: var(--flour); }
[data-theme="mel"]       { --bg: #f4efe6; --ink: var(--green); --logo: var(--brand-green); --accent: var(--pink); --duo-dark: var(--green); --duo-light: #f4efe6; }
[data-theme="bringebær"] { --bg: var(--pink); --ink: #2a1410; --logo: var(--brand-green); --accent: #fbe3ea; --duo-dark: #2a1410; --duo-light: #f59bbb; }
[data-theme="salvie"]    { --bg: #c7d1b5; --ink: #22513d; --logo: #22513d; --accent: var(--pink); --duo-dark: #22513d; --duo-light: #dfe5d3; }
[data-theme="plomme"]    { --bg: #4e2340; --ink: var(--blush); --logo: var(--blush); --accent: var(--pink); --duo-dark: #4e2340; --duo-light: var(--blush); }
[data-theme="blåbær"]    { --bg: #27304f; --ink: var(--blush); --logo: var(--blush); --accent: var(--pink); --duo-dark: #27304f; --duo-light: var(--blush); }
[data-theme="natt"]  { --bg: var(--crust); --ink: var(--cream); --logo: var(--cream); --accent: var(--pink); --duo-dark: var(--crust); --duo-light: #d9b98a; }

/* First visit, before the sheet answers (~1.5 s): the page is "unbaked" flour,
   then the week's colour washes in and the logo rises. See index.html. */
html.is-waiting[data-theme] {
  --bg: #f4efe6; --ink: #9a9184; --logo: #c9c0b2; --accent: #ddd5c8;
  --duo-dark: #9a9184; --duo-light: #f4efe6;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.2s var(--ease), color 1.2s var(--ease);
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: .15em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
em { font-style: italic; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

/* Small labels borrow the MIKRO / BAKERI lockup type: Blimp, flat, wide caps */
.eyebrow, .corner, .fact__label {
  font-family: var(--blimp);
  font-variation-settings: "pump" 0;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.eyebrow {
  margin: 0 0 1.6em;
  text-align: center;
}

/* ---------- Corners ---------- */
/* soft paper fade so the corner labels stay readable over photos */
body::before, body::after {
  content: "";
  position: fixed;
  left: 0; right: 0;
  z-index: 19;
  height: 64px;
  pointer-events: none;
  transition: background .8s var(--ease);
}
body::before { top: 0; background: linear-gradient(var(--bg) 20%, transparent); }
body::after  { bottom: 0; background: linear-gradient(transparent, var(--bg) 80%); }
.corner {
  position: fixed;
  z-index: 20;
  padding: 12px var(--gutter);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  text-decoration: none;
}
.corner--top { top: 0; left: 50%; transform: translateX(-50%); text-align: center; padding-top: max(12px, env(safe-area-inset-top)); }
.corner__link { text-decoration: none; }
.top-label {
  display: grid;
  gap: 3px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.top-label.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.top-label__week { opacity: .75; letter-spacing: .16em; white-space: nowrap; }
/* the paper fade at the top only matters once the label is there */
body::before { opacity: 0; transition: opacity .5s var(--ease), background .8s var(--ease); }
body:has(.top-label.is-shown)::before { opacity: 1; }
.corner--bl { bottom: 0; left: 0; }
.corner--br { bottom: 0; right: 0; }
.corner--bc {
  bottom: 0; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  transition: background-color .4s var(--ease), color .4s var(--ease), padding .4s var(--ease);
}
.corner--bc.has-items {
  bottom: max(10px, env(safe-area-inset-bottom));
  padding: 9px 16px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
}
.corner--bc .bump { display: inline-block; animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 72px var(--gutter) 64px;
}
.waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--accent);
  opacity: var(--wave-opacity, .9);
  transition: color 1.2s var(--ease);
  pointer-events: none;
}
.waves path { fill: none; stroke: currentColor; stroke-width: 1.1; vector-effect: non-scaling-stroke; }

/* The lockup is one fixed-ratio comp (460 × 550, like the brand file).
   Every size inside is in cqw, so the balance holds at any screen size,
   and the wordmark is sized for its most "pumped" state so it never
   grows into MIKRO / BAKERI. */
.lockup {
  position: relative;
  margin: 0;
  width: min(100%, 520px, calc((100svh - 190px) * 460 / 550));
  aspect-ratio: 460 / 550;
  container-type: inline-size;
  color: var(--logo);
  transition: color 1.2s var(--ease);
  font-weight: normal;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.lockup__small {
  position: absolute;
  left: 0; right: 0;
  font-family: var(--blimp);
  font-variation-settings: "pump" 0;
  font-size: 3.5cqw;
  line-height: 1;
  letter-spacing: .3em;
  text-indent: .3em;
  text-align: center;
  text-transform: uppercase;
  color: var(--logo);
}
.lockup__small--top    { top: 15.5%; }
.lockup__small--bottom { bottom: 13%; }
.lockup__word {
  --pump: 0;
  --bble: 0;
  position: absolute;
  left: 0; right: 0;
  top: 54.3%;
  transform: translateY(-50%);
  display: grid;
  font-family: var(--blimp);
  font-variation-settings: "pump" var(--pump), "bble" var(--bble), "flot" 0;
  font-size: 40cqw;
  line-height: .8;
  letter-spacing: -.03em;
  text-indent: -.03em;
  text-align: center;
}

.hero__week {
  margin: 20px 0 0;
  text-align: center;
  font-size: 17px;
}

/* ---------- Statement (big serif, like a pull quote) ---------- */
.statement {
  padding: 14vh var(--gutter);
  text-align: center;
}
.statement p {
  max-width: 17ch;
  margin: 0 auto;
  font-size: clamp(36px, 10.5vw, 104px);
  line-height: .98;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.statement--small p { font-size: clamp(28px, 7.5vw, 64px); max-width: 20ch; }

/* ---------- Duotone ---------- */
.duo {
  position: relative;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--duo-light);
  transition: background-color .8s var(--ease);
}
.duo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.duo > img:first-child {
  filter: grayscale(1) contrast(1.15) brightness(1.08);
  mix-blend-mode: multiply;
}
.duo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--duo-dark);
  mix-blend-mode: lighten;
  pointer-events: none;
  transition: background-color .8s var(--ease);
}
.duo .duo__color {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1.1s var(--ease), transform 1.6s var(--ease);
}
.duo.is-live .duo__color { opacity: 1; transform: scale(1); }
@media (hover: hover) {
  .duo:hover .duo__color { opacity: 1; transform: scale(1); }
}

.duo--wide {
  width: calc(100% - 2 * var(--gutter));
  max-width: 720px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
}

/* ---------- Week ---------- */
.week {
  padding: 16vh var(--gutter) 8vh;
  text-align: center;
}
.week__facts { display: grid; gap: 1.6em; }
.week__facts p { margin: 0; }
.fact__label { display: block; margin-bottom: .8em; }
.fact__big { display: block; font-size: clamp(34px, 9.5vw, 72px); line-height: 1; }
/* "Ukemeny" as a title in the same Blimp as the product names */
.week__title {
  margin: 0 0 1em;
  font-family: var(--blimp);
  font-weight: normal;
  font-variation-settings: "pump" 100;
  font-size: clamp(30px, 8.6vw, 48px);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.fact__small { display: block; font-size: 17px; margin-top: .35em; }
.week__note { font-style: italic; }
.countdown { font-variant-numeric: tabular-nums; }
/* Everything that comes from the sheet rises in softly once it has arrived */
[data-loads] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 140ms);
}
html.is-loaded [data-loads] { opacity: 1; transform: none; }

/* ---------- Products ---------- */
.menu { padding: 4vh 0 10vh; }
.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18vh;
}
.product { display: grid; gap: 18px; }
.product .duo {
  width: 78%;
  aspect-ratio: 4 / 5;
}
.product:nth-child(even) .duo { justify-self: end; }
.product__body { padding: 0 var(--gutter); max-width: 560px; }
.product:nth-child(even) .product__body { justify-self: end; }

.product__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.product__name {
  margin: 0;
  font-family: var(--blimp);
  font-weight: normal;
  font-variation-settings: "pump" var(--name-pump, 100);
  font-size: clamp(26px, 7.6vw, 40px);
  line-height: 1.05;
  letter-spacing: .02em;
  text-transform: uppercase;
  transition: font-variation-settings .7s var(--ease);
}
/* rises a touch when it's in the basket */
.product.is-picked .product__name { font-variation-settings: "pump" 200; }
.leader {
  flex: 1;
  min-width: 18px;
  border-bottom: 1.5px dashed currentColor;
  transform: translateY(-.3em);
  opacity: .7;
}
.product__price { font-size: clamp(26px, 7vw, 36px); white-space: nowrap; }
/* one line under the name: "● Bare 3 igjen" on the left, "pr. stk" on the right */
.product__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: .35em 0 0;
}
.product__unit { margin: 0 0 0 auto; font-size: 16px; }
.product__left {
  margin: 0;
  font-family: var(--blimp);
  font-variation-settings: "pump" 0;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.product__left::before { content: "● "; color: var(--accent); }
.product__desc { margin: .9em 0 0; font-size: 20px; }

/* Dividers are the wave lines from behind the logo, drawn in the text colour */
.variants { margin-top: 18px; position: relative; padding-top: 10px; }
.variants::before, .variant::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Cpath d='M0 5 C15 1.5 25 1.5 40 5 S65 8.5 80 5 S105 1.5 120 5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 10px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Cpath d='M0 5 C15 1.5 25 1.5 40 5 S65 8.5 80 5 S105 1.5 120 5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 10px;
  pointer-events: none;
}
.variants::before { top: 0; }
.variant::after { bottom: -5px; }
.variant {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}
/* in the basket: a dot before the name */
.variant__name { transition: opacity .3s; }
.variant.has-qty .variant__name::before { content: "● "; color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid;
  font-size: 22px;
  line-height: 1;
  display: grid; place-items: center;
  transition: background-color .25s, color .25s, transform .15s;
}
.stepper button:active { transform: scale(.9); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button.is-maxed { opacity: .3; cursor: default; }
.stepper .plus { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* The count: faint at 0, full and puffy once something is picked */
.stepper output {
  width: 40px;             /* fixed, so − and + never move when the number grows */
  flex: none;
  text-align: center;
  font-family: var(--blimp);
  font-variation-settings: "pump" 200;
  font-size: 22px;
  line-height: 1;
  opacity: .35;
  transition: opacity .3s var(--ease), font-size .3s var(--ease), font-variation-settings .4s var(--ease);
}
.stepper.has-qty output { opacity: 1; font-size: 30px; font-variation-settings: "pump" 400; }
.stepper output.pop { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.soldout { font-style: italic; }

/* ---------- Order form ---------- */
.order, .done, .closed {
  max-width: 560px;
  margin: 20vh auto 0;
  padding: 0 var(--gutter);
}
.order__title {
  margin: -.4em 0 .8em;
  font-weight: normal;
  font-size: clamp(34px, 9.5vw, 56px);
  line-height: 1;
  text-align: center;
}
.order__summary { margin-bottom: 28px; }
.sum-line { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; }
.sum-line .leader { min-width: 12px; }
.sum-total { font-size: 32px; margin-top: 8px; padding-top: 10px; border-top: 1px solid; }
.sum-empty { text-align: center; font-style: italic; opacity: .75; }

.fields { display: grid; gap: 4px; }
.field { display: block; border-bottom: 1px solid; padding: 10px 0 2px; }
.field span { display: block; font-size: 15px; }
.field i { opacity: .7; }
.field input, .field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 24px;
  padding: 4px 0 8px;
  border-radius: 0;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; }
.field:focus-within { border-bottom-width: 2px; padding-bottom: 1px; }
.field.is-bad span { font-style: italic; }
.field.is-bad span::after { content: " — mangler"; }
.hp { position: absolute; left: -9999px; }

.order__pay { font-size: 18px; text-align: center; margin: 22px 0 4px; }
.order__privacy { font-size: 15px; text-align: center; margin: 0 0 22px; opacity: .75; }
.order__error { text-align: center; font-style: italic; }

.btn {
  display: block;
  width: 100%;
  min-height: 60px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 24px;
  text-align: center;
  text-decoration: none;
  padding: 14px 24px;
  transition: opacity .3s, transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn--ghost { background: transparent; color: inherit; border: 1px solid; }
.btn + .btn { margin-top: 10px; }

.done, .closed { text-align: center; }
.done__big {
  margin: 0 0 .2em;
  font-family: var(--blimp);
  font-variation-settings: "pump" 350;
  font-size: clamp(52px, 15vw, 120px);
  line-height: .9;
}
.done__actions { margin-top: 8px; }

/* "Du har en bestilling" */
.my-order {
  max-width: 560px;
  margin: 0 auto 14vh;
  padding: 26px var(--gutter) 22px;
  text-align: center;
  border-top: 1px solid;
  border-bottom: 1px solid;
}
.my-order[hidden] { display: none; }
.my-order .eyebrow { margin-bottom: 1em; }
.my-order__lines { display: grid; gap: 2px; font-size: 22px; }
.my-order__meta { margin: .8em 0 0; font-size: 17px; }
.my-order__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.my-order__actions .btn { min-height: 52px; font-size: 20px; padding: 10px 16px; }
.order__cancel-edit { text-align: center; margin: 0 0 14px; }
.order__cancel-edit button, .linkish { text-decoration: underline; text-underline-offset: .2em; font-style: normal; }
.field input[readonly] { opacity: .6; }

/* The confirmation reads like the label on the bag: order no., items, total */
.receipt { margin: 28px 0 24px; text-align: left; }
.receipt .eyebrow { margin-bottom: 1em; }
.done__fine { margin: 10px 0 0; font-size: 16px; opacity: .8; }
.done__links { display: grid; gap: 6px; justify-items: center; margin-top: 28px; }
/* each link is a full-width, 52px-tall tap target so thumbs don't hit the wrong one */
.done__links a, .done__links button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  font-family: var(--blimp);
  font-variation-settings: "pump" 0;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: .5em;
}

/* ---------- Gallery ---------- */
.gallery {
  margin-top: 16vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.gallery .duo { aspect-ratio: 1; }

/* ---------- Footer ---------- */
.foot {
  position: relative;
  padding: 10vh var(--gutter) 96px;
  text-align: center;
  overflow: hidden;
}
.foot { padding-top: 0; }
.foot__small { font-size: 16px; line-height: 1.5; margin: 0; }

/* ---------- Info overlay ---------- */
.info {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: rise .6s var(--ease);
}
.info[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.info__inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 96px var(--gutter) 120px;
}
.info__lead { font-size: clamp(40px, 11vw, 80px); line-height: 1; text-align: center; margin: 0 0 .6em; }
.info__inner > p:not(.eyebrow):not(.info__lead) { font-size: 22px; }
.info__list { margin: 36px 0; border-top: 1px solid; }
.info__list dt { font-size: 15px; padding-top: 12px; }
.info__list dd { margin: 0; padding: 2px 0 12px; border-bottom: 1px solid; font-size: 22px; }
body.info-open { overflow: hidden; }
.homescreen {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 8px 0 36px;
  padding: 24px 16px;
  border: 1px solid;
  border-radius: 28px;
  text-align: center;
}
.homescreen[hidden] { display: none; }
.homescreen img { width: 72px; height: 72px; border-radius: 16px; }
.homescreen__title { margin: 6px 0 0; font-size: 26px; line-height: 1.1; }
.homescreen__how { margin: 0; font-size: 18px; }
.homescreen__how[hidden] { display: none; }
.homescreen .btn { margin-top: 8px; }

/* ---------- Larger screens ---------- */
@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .corner { font-size: 12px; }
  .product {
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 40px;
  }
  .product .duo { width: 100%; max-height: 82vh; }
  .product__body { padding: 0 var(--gutter) 0 0; }
  .product:nth-child(even) .duo { order: 2; }
  .product:nth-child(even) .product__body { padding: 0 0 0 var(--gutter); justify-self: stretch; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
