/* Odin Chips
   Colours come from the product: tallow (talg), fried-chip gold (gull), the black pouch (ravn), salt.
   Phone first; the desktop layout starts at 960px. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --talg: #f4e5a1;
  --talg-lys: #fbf5dc;
  --gull: #db9a26;
  --ravn: #16171a;
  --ravn-2: #2b2d31;
  --salt: #ffffff;
  --skall: #6b5f50;
  --linje: #e4dcc8;
  --felt: #b9ae98;
  --ok: #1d6b42;
  --feil: #9b2c1f;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --gutter: 20px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--salt);
  color: var(--ravn);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--talg);
}

:focus-visible {
  outline: 3px solid var(--ravn);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ravn);
  color: var(--salt);
}

.skip:focus {
  left: 12px;
}

/* ---- Buttons and links ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid var(--ravn);
  border-radius: 999px;
  background: var(--ravn);
  color: var(--salt);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--ravn-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-lg {
  min-height: 56px;
  padding: 0 28px;
  font-size: 1.125rem;
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9375rem;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--ravn);
}

.btn-ghost:hover {
  background: var(--talg-lys);
}

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.text-link:hover {
  text-decoration-thickness: 2.5px;
}

.logo {
  font-size: 1.375rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

/* ---- Hero ---- */

.hero-main {
  display: grid;
  gap: 28px;
  padding-top: max(40px, env(safe-area-inset-top));
  padding-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.6rem, 1.6rem + 6vw, 4.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 11ch;
}

.lead {
  margin-top: 16px;
  font-size: 1.1875rem;
  line-height: 1.45;
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 28px;
}

.hero-img img {
  width: min(78%, 340px);
  margin-inline: auto;
}

/* phones: no "Velg pakke" button in the hero (the packs are right below) */
@media (max-width: 599px) {
  .hero-actions {
    display: none;
  }
}

/* ---- Perks row under the hero: packaging-style badges ---- */

.perks-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 8px;
  padding-bottom: 8px;
  list-style: none;
}

/* the packs follow the badges closely */
.perks + .section {
  padding-top: 40px;
}

.perks-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.perks-list svg {
  width: 52px;
  height: 52px;
  color: var(--ravn);
}

.perks-list span {
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 359px) {
  .perks-list svg {
    width: 44px;
    height: 44px;
  }

  .perks-list span {
    font-size: 0.71875rem;
    letter-spacing: 0;
  }
}

/* ---- Sections ---- */

.section {
  padding-top: 56px;
  padding-bottom: 56px;
}

/* two sections in a row share one gap */
.section + .section {
  padding-top: 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-head p {
  margin-top: 10px;
  color: var(--skall);
}

/* ---- Packs ---- */

.packs {
  display: grid;
  gap: 18px;
}

.pack {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  grid-template-areas:
    'img body'
    'btn btn';
  gap: 16px 16px;
  align-items: center;
  padding: 20px;
  border: 1.5px solid var(--linje);
  border-radius: 16px;
  background: var(--salt);
}

.pack-featured {
  border-color: var(--ravn);
  box-shadow: inset 0 0 0 1px var(--ravn);
  background: var(--talg-lys);
  margin-top: 8px;
}

.pack-tag {
  position: absolute;
  top: -13px;
  left: 18px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--gull);
  font-size: 0.875rem;
  font-weight: 700;
}

.pack-img {
  grid-area: img;
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.pack-body {
  grid-area: body;
}

.pack-price {
  margin-top: 2px;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pack-desc {
  margin-top: 4px;
  color: var(--skall);
  font-size: 0.9875rem;
  line-height: 1.45;
}

.pack .btn {
  grid-area: btn;
}

/* ---- Form fields and the postal code result (checkout) ---- */

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

input[type='text'],
input[type='tel'],
input[type='email'],
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--felt);
  border-radius: 10px;
  background: var(--salt);
  color: var(--ravn);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.3;
  appearance: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9a8f7c;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--ravn);
  box-shadow: 0 0 0 3px rgba(219, 154, 38, 0.5);
}

input:disabled,
textarea:disabled {
  background: #f6f3ec;
  color: #8d8473;
}

input[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--feil);
}

.result {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 10px;
  align-items: start;
}

.result::before {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1;
}

.result-ok::before {
  content: '✓';
  background: var(--ok);
  color: var(--salt);
}

.result-out::before,
.result-unknown::before {
  content: '!';
  background: var(--gull);
  color: var(--ravn);
}

.result strong {
  font-weight: 700;
}

.result p {
  grid-column: 2;
}

.result p + p {
  margin-top: 4px;
}

.result-out {
  padding: 14px 16px;
  border: 2px solid var(--ravn);
  border-radius: 12px;
  background: var(--talg-lys);
}

/* ---- FAQ ---- */

.faq {
  max-width: 760px;
  border-top: 1px solid var(--linje);
}

.faq details {
  border-bottom: 1px solid var(--linje);
}

.faq summary {
  position: relative;
  padding: 18px 44px 18px 0;
  font-size: 1.125rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '–';
}

.faq details p {
  padding-bottom: 20px;
  max-width: 60ch;
  color: var(--skall);
}

/* ---- Footer ---- */

.footer {
  margin-top: 24px;
  padding-top: 48px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  background: var(--ravn);
  color: #e9e3d3;
}

.footer :focus-visible {
  outline-color: var(--talg);
}

.footer-inner {
  display: grid;
  gap: 28px;
}

.logo-light {
  color: var(--talg);
}

.footer-inner p + p {
  margin-top: 6px;
}

.footer-links a {
  color: var(--salt);
  text-underline-offset: 4px;
}

.footer-base {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #b9b2a2;
  font-size: 0.9375rem;
}

.home .footer {
  margin-top: 0;
}

/* ---- Simple pages (checkout, receipt, terms) ---- */

.bar {
  border-bottom: 1px solid var(--linje);
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: 14px;
}

.page main {
  padding-bottom: 56px;
}

.page h1 {
  margin-top: 28px;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.narrow {
  max-width: 720px;
}

.notice {
  margin-top: 18px;
  padding: 12px 16px;
  border-left: 4px solid var(--gull);
  border-radius: 8px;
  background: var(--talg-lys);
}

.notice-ok {
  border-left-color: var(--ok);
}

.notice-warn {
  border-left-color: var(--feil);
}

/* checkout */

.order {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.step {
  min-width: 0;
  margin: 0 0 32px;
  padding: 0;
  border: 0;
}

.step legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
  font-size: 1.375rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.step-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ravn);
  color: var(--talg);
  font-size: 1rem;
  font-weight: 800;
}

.step:disabled legend,
.step:disabled .field {
  opacity: 0.45;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1.5px solid var(--linje);
  border-radius: 12px;
  background: var(--salt);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.option input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ravn);
}

.option:has(input:checked) {
  border-color: var(--ravn);
  box-shadow: inset 0 0 0 1px var(--ravn);
  background: var(--talg-lys);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--ravn);
  outline-offset: 2px;
}

.option-name {
  display: block;
  font-weight: 700;
}

.option-desc {
  display: block;
  color: var(--skall);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.option-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.field {
  margin-bottom: 18px;
}

.optional {
  color: var(--skall);
  font-weight: 400;
}

.hint {
  margin-top: 6px;
  color: var(--skall);
  font-size: 0.9375rem;
}

.field-error {
  margin-top: 6px;
  color: var(--feil);
  font-size: 0.9375rem;
  font-weight: 600;
}

.postnr-status:not(:empty) {
  margin-top: 12px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.summary {
  padding: 20px;
  border: 1.5px solid var(--linje);
  border-radius: 16px;
  background: var(--talg-lys);
}

.summary h2 {
  font-size: 1.375rem;
  letter-spacing: -0.015em;
}

.summary-list {
  margin: 14px 0 0;
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--linje);
}

.summary-list dt {
  color: var(--skall);
}

.summary-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 14px 0 18px;
  font-size: 1.125rem;
}

.summary-total strong {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.form-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fcedea;
  color: var(--feil);
  font-weight: 600;
}

.fine {
  margin-top: 12px;
  color: var(--skall);
  font-size: 0.9375rem;
}

/* receipt / subscription / message pages */

.page .lead {
  margin-top: 12px;
}

.receipt {
  margin: 28px 0;
  padding: 8px 20px 12px;
  border: 1.5px solid var(--linje);
  border-radius: 16px;
}

.receipt .summary-list {
  margin: 0;
}

.receipt .summary-list > div:last-child {
  border-bottom: 0;
}

/* phones: label above value, so long addresses read naturally */
@media (max-width: 599px) {
  .receipt .summary-list > div {
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
  }

  .receipt .summary-list dt {
    font-size: 0.9375rem;
  }

  .receipt .summary-list dd {
    text-align: left;
  }
}

.box {
  margin: 28px 0;
  padding: 20px;
  border-radius: 16px;
  background: var(--talg-lys);
}

.box h2 {
  font-size: 1.375rem;
}

.box p {
  margin-top: 8px;
}

.stack > * + * {
  margin-top: 14px;
}

.page main > p {
  margin-top: 16px;
}

.prose h2 {
  margin-top: 36px;
  font-size: 1.375rem;
}

.prose p {
  margin-top: 10px;
  max-width: 64ch;
}

/* ---- Admin (used on a phone while delivering) ---- */

.admin h2 {
  margin-top: 36px;
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.admin h3 {
  margin: 20px 0 8px;
  font-size: 1.0625rem;
}

.count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--talg);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
}

.a-summary {
  margin-top: 10px;
  color: var(--skall);
}

.a-card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1.5px solid var(--linje);
  border-radius: 14px;
  background: var(--salt);
}

.a-card p + p {
  margin-top: 4px;
}

.a-done {
  opacity: 0.55;
}

.a-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.a-name {
  font-weight: 700;
}

.a-sms {
  margin: 0 8px;
}

.a-note {
  font-style: italic;
}

.a-meta {
  color: var(--skall);
  font-size: 0.9375rem;
}

.a-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.a-actions form {
  margin: 0;
}

.a-empty {
  color: var(--skall);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eee8d8;
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge-ok {
  background: #dcefe3;
  color: var(--ok);
}

.badge-warn {
  background: #fbe2dc;
  color: var(--feil);
}

.table-wrap {
  overflow-x: auto;
}

.admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.admin th,
.admin td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--linje);
  text-align: left;
  white-space: nowrap;
}

/* ---- Larger phones / tablets ---- */

@media (min-width: 600px) {
  :root {
    --gutter: 32px;
  }

  .pack {
    grid-template-columns: 110px 1fr;
  }

  .pack-img {
    width: 110px;
    height: 110px;
  }
}

/* ---- Desktop ---- */

@media (min-width: 960px) {
  :root {
    --gutter: 40px;
  }

  body {
    font-size: 1.125rem;
  }

  .hero-main {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 48px;
    padding-top: 64px;
    padding-bottom: 40px;
  }

  .lead {
    margin-top: 22px;
    font-size: 1.375rem;
  }

  .hero-actions {
    margin-top: 36px;
  }

  .hero-img img {
    width: min(100%, 460px);
    margin-right: 0;
  }

  .section {
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .perks-list {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .perks + .section {
    padding-top: 64px;
  }

  .perks-list svg {
    width: 64px;
    height: 64px;
  }

  .perks-list span {
    font-size: 0.9375rem;
  }

  .section-head {
    margin-bottom: 40px;
  }

  .packs {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
  }

  .pack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 28px 24px 24px;
  }

  .pack-featured {
    margin-top: 0;
  }

  .pack-img {
    width: 100%;
    height: 180px;
    margin-bottom: 20px;
  }

  .pack-name {
    font-size: 1.375rem;
  }

  .pack-price {
    font-size: 2rem;
  }

  .pack-desc {
    margin-top: 8px;
    font-size: 1rem;
  }

  .pack .btn {
    margin-top: auto;
  }

  .pack-body {
    margin-bottom: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .footer-links {
    text-align: right;
  }

  .order {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 56px;
    align-items: start;
    margin-top: 32px;
  }

  .summary {
    position: sticky;
    top: 24px;
    padding: 24px;
  }

  .admin main {
    max-width: 860px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
