/* Forsiden på alle enheder: én skærm, hvor man sætter pinde i jorden, og bestillingen. Mobil først;
   computer-layoutet står nederst.
   Som en app: trykflader på mindst 44 px, felter på mindst 16 px (ellers zoomer Safari),
   sikre kanter om notch og hjem-streg, og feedback på hvert tryk. */

:root {
  --ink: #1d2b22;
  --ink-soft: #5b6962;
  --paper: #eef1ec;
  --card: #ffffff;
  --line: #d5dcd6;
  --leaf: #3f7a3a;
  --leaf-soft: #e5efe1;
  --marigold: #e8a019;
  --warn: #9a3412;
  --soil-top: #6b4a33;
  --soil-bottom: #432c1e;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  /* baggrundsfoto bag pindene; sæt fx url(/marketing/hero.jpg), når fotoet findes */
  --hero-photo: none;
  --stick-w: 64px;
  font-family: 'Bricolage Grotesque', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100svh; background: var(--paper); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page { max-width: 520px; margin: 0 auto; }

button { font: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: transform 90ms ease-out, background-color 150ms, border-color 150ms, opacity 150ms; }
button:active:not(:disabled) { transform: scale(0.96); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ------------------------------------------------------------ bedet med pindene */

.hero {
  --sink: 10px; /* pindens bund under bedets kant; sættes af src/forside.js */
  position: sticky; top: 0; z-index: 2;
  /* højden sættes af src/forside.js: pindens højde (mindst 250 px) + 45 px luft over den */
  height: 305px; overflow: hidden;
  background:
    var(--hero-photo) center / cover no-repeat,
    radial-gradient(60% 50% at 18% 30%, rgb(120 168 110 / 0.55), transparent 70%),
    radial-gradient(50% 45% at 85% 22%, rgb(150 190 130 / 0.5), transparent 70%),
    radial-gradient(45% 40% at 60% 55%, rgb(96 150 96 / 0.35), transparent 70%),
    linear-gradient(#dfe9e1, #c4d8c0);
  transition: height 200ms ease-out;
}
.hero__brand { position: absolute; top: calc(10px + var(--safe-top)); left: 16px; z-index: 4;
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.hero__count {
  position: absolute; top: calc(6px + var(--safe-top)); right: 12px; z-index: 4;
  min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: rgb(29 43 34 / 0.82); color: #fff;
  font-size: 0.85rem; font-weight: 800; font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero__count.is-ready { background: var(--leaf); }
.hero__soil {
  /* lidt jord, så formularen får pladsen (SOIL i src/forside.js) */
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--soil, 44px); z-index: 3; pointer-events: none;
  background: linear-gradient(var(--soil-top), var(--soil-bottom));
  box-shadow: 0 -6px 14px rgb(40 25 15 / 0.25);
}
.hero__soil::before { /* ujævn jordkant */
  content: ''; position: absolute; left: 0; right: 0; top: -7px; height: 14px;
  background: radial-gradient(circle at 10px 12px, var(--soil-top) 9px, transparent 10px) 0 0 / 22px 14px repeat-x;
}

/* rækken ruller vandret; den pind, man skriver på, står i midten */
.row {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; gap: calc(var(--stick-w) * 0.25);
  padding: 0 calc(50% - var(--stick-w) / 2) var(--sink);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.row::-webkit-scrollbar { display: none; }

.bigstick {
  position: relative; flex: 0 0 var(--stick-w); height: var(--stick-h, 70%); padding: 0;
  transition: height 220ms cubic-bezier(0.2, 0.8, 0.2, 1), flex-basis 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 0; border-radius: calc(var(--stick-w) * 0.25) calc(var(--stick-w) * 0.25) 4px 4px;
  background: var(--base, #efefe9); color: var(--ink2, #262826);
  box-shadow: 3px 4px 10px rgb(0 0 0 / 0.22), inset -3px 0 5px rgb(0 0 0 / 0.06);
  display: flex; justify-content: center;
}
/* teksten placeres i px af src/forside.js efter printets mål: vandrette linjer, drejet så de læses nedefra og op */
.bigstick__text { position: absolute; inset: 0; pointer-events: none; text-shadow: 0.5px 1px 0 rgb(0 0 0 / 0.18); /* teksten er hævet */ }
.bigstick__text > span {
  position: absolute; left: 0; top: 0; display: block;
  line-height: 1; white-space: nowrap; letter-spacing: 0.02em;
  transform-origin: 0 0;
}
.bigstick__qty {
  /* over pinden, så mærket ikke dækker teksten, heller ikke når pindene er zoomet smalle */
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); z-index: 1;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--marigold); color: #1d2b22; font: 800 0.8rem/1 'Bricolage Grotesque', sans-serif;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
/* den blanke pind, man skriver på */
.bigstick.is-active { outline: 2.5px dashed rgb(29 43 34 / 0.35); outline-offset: 4px; }
.bigstick.is-active.has-text { outline-color: transparent; }
.bigstick.is-example .bigstick__text { opacity: 0.55; }
.bigstick.is-example .bigstick__text span { transition: opacity 250ms; }
.bigstick.is-example .is-fading { opacity: 0; }
/* den nye pind falder ned i jorden */
.bigstick.drop { animation: drop 480ms cubic-bezier(0.3, 1.35, 0.5, 1) both; }
@keyframes drop { from { transform: translateY(-115%); } 70% { transform: translateY(3%); } to { transform: none; } }
/* den satte pind får et lille skub ned, når den står */
.bigstick.planted { animation: planted 320ms ease-out; }
@keyframes planted { 40% { transform: translateY(5px); } }

/* ------------------------------------------------------------ felt og valg */

.body { padding: 18px 16px calc(120px + var(--safe-bottom)); }
.body h1 { margin: 0 0 14px; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; }
.body label { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 700; }

.field { display: flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); transition: box-shadow 150ms; }
.field:focus-within { box-shadow: 0 0 0 4px rgb(232 160 25 / 0.35); }
.field input { flex: 1; min-width: 0; height: 56px; padding: 0 14px; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.field input::placeholder { color: #9aa49e; font-weight: 400; }
.field button { flex: none; margin: 6px; padding: 0 16px; border: 0; border-radius: 11px;
  background: var(--ink); color: var(--paper); font-size: 0.95rem; font-weight: 700; }
.field.shake { animation: shake 320ms; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.note { margin: 8px 2px 0; font-size: 0.88rem; font-weight: 700; line-height: 1.35; color: var(--warn); }

.sortrow { display: flex; margin-top: 8px; }
.sortrow input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 13px;
  background: var(--card); font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); }
.sortrow input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(232 160 25 / 0.35); }
.sortrow input::placeholder { color: #9aa49e; font-weight: 400; }
.sortrow__add { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px dashed var(--line); background: transparent;
  font-size: 0.88rem; font-weight: 700; color: var(--ink-soft); }
.hint { margin: 6px 2px 0; font-size: 0.85rem; color: var(--ink-soft); }
body.kb .hint { display: none; }
.swatches { display: flex; gap: 6px; margin-top: 12px; }
.swatch { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; min-width: 0; padding: 0 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch--font { flex: 0 0 auto; padding: 0 12px; border-style: dashed; color: var(--ink-soft); }
.swatch__chip { flex: none; display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 6px;
  font-style: normal; font-size: 0.72rem; font-weight: 800; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.18); }
.swatch__chip--bw { background: #efefe9; color: #262826; }
.swatch__chip--wb { background: #262826; color: #efefe9; }

.trust { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.92rem; }
.trust li { display: flex; align-items: baseline; gap: 8px; }
.trust li::before { content: '✓'; flex: none; color: var(--leaf); font-weight: 800; }
.trust li:first-child { font-weight: 800; }

/* tastaturet er oppe: bedet bliver stående øverst, og feltet ligger lige under */
body.kb .body h1, body.kb .body label, body.kb .swatches, body.kb .trust { display: none; }
body.kb .body { padding-top: 10px; }
body.kb .cta { display: none; }

/* ------------------------------------------------------------ videre */

.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-width: 520px; margin: 0 auto;
  padding: 8px 16px calc(12px + var(--safe-bottom));
  background: rgb(238 241 236 / 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line); }
.cta__upsell { margin: 0 0 6px; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--leaf); }
.cta__btn { width: 100%; min-height: 54px; border: 0; border-radius: 15px;
  background: var(--ink); color: var(--paper); font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cta__btn.is-waiting { background: #c9d0ca; color: #4d5a53; }

/* ------------------------------------------------------------ ark nedefra */

.sheet { width: 100%; max-width: 520px; max-height: 88svh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); overflow: auto; }
.sheet::backdrop { background: rgb(20 28 23 / 0.45); }
.sheet[open] { animation: sheet-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet__grab { display: block; width: 100%; height: 28px; padding: 0; border: 0; background: none; touch-action: none; }
.sheet__grab::before { content: ''; display: block; width: 40px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: #c3cac5; }
.sheet__inner { padding: 4px 16px calc(16px + var(--safe-bottom)); }
.sheet h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; }
.sheet h3 { margin: 18px 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.sheet__sub { margin: 0 0 12px; font-size: 0.9rem; color: var(--ink-soft); }
.sheet__actions { display: grid; gap: 8px; margin-top: 18px; }
.btn { min-height: 50px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line); font-size: 1rem; font-weight: 700; }
.btn--primary { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn--danger { color: var(--warn); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 4px; }
.stepper button { width: 54px; height: 54px; border: 0; border-radius: 50%; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line); font-size: 1.6rem; font-weight: 600; }
.stepper output { min-width: 60px; text-align: center; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: 46px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 0.95rem; font-weight: 700; }
.pick[aria-pressed="true"] { border-color: var(--leaf); background: var(--leaf-soft); color: #24501f; }
.font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.font-tile { min-height: 72px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; }
.font-tile[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.font-tile b { display: block; font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-tile small { font-size: 0.75rem; color: var(--ink-soft); }

/* ------------------------------------------------------------ butikkens oplysninger */

.shop { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--ink-soft); }
.shop p { margin: 0 0 6px; line-height: 1.5; }
.shop__links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; font-size: inherit; font-weight: 700;
  color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sheet__text { margin: 0; font-size: 0.92rem; line-height: 1.5; white-space: pre-line; }
body.kb .shop { display: none; }

/* ------------------------------------------------------------ bestillingen */

.full { width: 100%; max-width: 520px; height: 100%; max-height: 100%; margin: 0 auto; padding: 0;
  border: 0; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.full::backdrop { background: var(--paper); }
.full[open] { animation: full-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes full-in { from { transform: translateX(100%); } }
.full__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px;
  padding: calc(6px + var(--safe-top)) 12px 6px; background: var(--paper); border-bottom: 1px solid var(--line); }
.full__head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.icon-btn { width: 44px; height: 44px; padding: 10px; border: 0; background: none; color: inherit; }
.icon-btn svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.full__body { padding: 14px 16px 0; }

.summary { margin: 0 0 6px; display: grid; gap: 5px; font-variant-numeric: tabular-nums; }
.summary div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.98rem; }
.summary dd { margin: 0; white-space: nowrap; }
.summary .link-btn { min-height: 0; margin-left: 8px; font-size: 0.82rem; font-weight: 600; }
.summary__sum { margin-top: 3px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 1.12rem !important; font-weight: 800; }

.discount summary { display: flex; align-items: center; min-height: 44px; width: fit-content; font-size: 0.92rem;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; list-style: none; }
.discount summary::-webkit-details-marker { display: none; }
.discount__row { display: flex; gap: 8px; }
.discount__row input { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font: inherit; font-size: 17px; text-transform: uppercase; color: var(--ink); }
.discount__row button { padding: 0 18px; border: 0; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }

#order h3 { margin: 14px 0 10px; font-size: 1.05rem; font-weight: 800; }
.f { display: grid; gap: 4px; margin-bottom: 12px; font-size: 0.9rem; font-weight: 600; }
.f input { width: 100%; min-width: 0; height: 50px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font: inherit; font-size: 17px; font-weight: 500; color: var(--ink); }
.f input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(232 160 25 / 0.35); }
.f input[readonly] { background: transparent; border-style: dashed; }
.f input[readonly].is-error::placeholder { color: var(--warn); font-weight: 700; }
.f-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fine { margin: 0 0 8px; font-size: 0.8rem; line-height: 1.45; color: var(--ink-soft); }
.fine .link-btn { min-height: 0; font-weight: 700; }

/* status og betalingsknapper står fast i bunden af bestillingen */
.pay { position: sticky; bottom: 0; z-index: 1; margin: 12px -16px 0; padding: 10px 16px calc(12px + var(--safe-bottom));
  background: var(--paper); border-top: 1px solid var(--line); }
.pay__row { display: flex; gap: 8px; }
.pay__row .cta__btn { flex: 1.4; min-width: 0; font-size: 1.02rem; }
.pay__row button:disabled { opacity: 0.35; }
.apple-pay { flex: 1; min-width: 0; min-height: 54px; border: 0; border-radius: 15px; background: #000; color: #fff; font-weight: 700;
  -webkit-appearance: -apple-pay-button; -apple-pay-button-type: plain; -apple-pay-button-style: black; }
@supports (-webkit-appearance: -apple-pay-button) { .apple-pay span { display: none; } }
.status { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line);
  font-size: 0.92rem; font-weight: 700; line-height: 1.35; }
.status.is-busy { display: flex; align-items: center; gap: 10px; border-color: var(--ink); }
.status.is-busy::before { content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
.status.is-error { color: var(--warn); background: #fbeee8; border-color: var(--warn); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ computer */

@media (min-width: 821px) {
  body { padding-bottom: 140px; }
  .page { max-width: 1080px; padding: 0 24px; }
  /* bedet i fuld bredde med afrundede hjørner forneden; pindene er 1,3 gange større (src/forside.js) */
  .hero { position: relative; border-radius: 0 0 28px 28px; }
  .hero__brand { top: 18px; left: 24px; font-size: 1.3rem; }
  .hero__count { top: 14px; right: 20px; min-height: 40px; padding: 0 18px; font-size: 0.95rem; cursor: pointer; }
  .row { cursor: grab; }
  .row.is-dragging { cursor: grabbing; user-select: none; }
  .row.is-dragging .bigstick { pointer-events: none; }
  .bigstick__qty { min-width: 30px; height: 30px; border-radius: 15px; font-size: 0.9rem; }

  .body { max-width: 600px; margin: 0 auto; padding: 32px 0 40px; }
  .body h1 { font-size: 2.2rem; text-align: center; margin-bottom: 22px; }
  .body label { font-size: 1.05rem; }
  .field input { height: 64px; font-size: 1.4rem; padding: 0 18px; }
  .field button { padding: 0 24px; font-size: 1.05rem; border-radius: 12px; }
  .field button:hover, .cta__btn:not(.is-waiting):hover, .btn--primary:hover { background: #2c3d32; }
  .swatch:hover, .sortrow__add:hover, .pick:hover, .font-tile:hover { border-color: var(--ink); }
  .trust { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 12px; margin-top: 22px; font-size: 0.86rem; white-space: nowrap; }
  .shop { margin-top: 40px; text-align: center; font-size: 0.82rem; }
  .shop__links { justify-content: center; }
  .link-btn { min-height: 32px; }

  /* "videre" som et kort nederst i midten i stedet for en bundlinje */
  .cta { left: 50%; right: auto; bottom: 20px; width: 600px; max-width: calc(100% - 48px); margin: 0; transform: translateX(-50%);
    padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 12px 40px rgb(29 43 34 / 0.18); }

  /* bestillingen som et vindue midt på skærmen */
  .full { width: 540px; height: auto; max-height: min(92vh, 900px); margin: auto; border-radius: 22px;
    box-shadow: 0 24px 70px rgb(29 43 34 / 0.3); }
  .full::backdrop { background: rgb(20 28 23 / 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .full[open] { animation: pop-in 200ms ease-out; }
  .full__head { padding: 10px 14px; border-radius: 22px 22px 0 0; }
  .full__body { padding: 18px 22px 0; }
  .pay { margin: 12px -22px 0; padding: 12px 22px 18px; border-radius: 0 0 22px 22px; }

  /* arkene som små vinduer i midten */
  .sheet { max-width: 480px; margin: auto; border-radius: 22px; }
  .sheet[open] { animation: pop-in 200ms ease-out; }
  .sheet__grab { display: none; }
  .sheet__inner { padding: 22px; }
  @keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
}

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