/* boxi scroll scene: shared page styles.
   Direction: retro editorial print. Cream paper page, taxi yellow and charcoal, fat serif headlines. */

:root {
  --page: #F4EDDE;
  --ink: #161616;
  --charcoal: #1F1E1C;
  --yellow: #FCBF02;
  --yellow-deep: #E7AB00;
  --cream: #FCEFD9;
  --line: rgba(22, 22, 22, 0.16);
  --muted: rgba(22, 22, 22, 0.62);
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --text: 'Montserrat', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  color-scheme: light;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--page);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--page); }
::-webkit-scrollbar-thumb:hover { background: #000; }
::-webkit-scrollbar-thumb:active { background: var(--yellow-deep); }
::-webkit-scrollbar-corner { background: var(--page); }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

canvas.scene { display: block; width: 100%; height: 100%; }

/* the parts of the page the browser draws: selection and taps, in the palette */
::selection { background: var(--yellow); color: var(--ink); }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: rgba(22, 22, 22, 0.14); }

.label {
  font-family: var(--text);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.btn {
  font: 700 13px/1 var(--text);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); color: var(--page); }
}
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ------------------------------------------------------------ review player */
.player { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr auto; }
.player .stage { position: relative; min-height: 0; }
.player .stage canvas { position: absolute; inset: 0; }
.player .tag {
  position: absolute; left: 20px; top: 16px;
  display: flex; gap: 14px; align-items: baseline;
}
.player .tag b { font: 900 22px/1 var(--display); letter-spacing: -0.01em; }
.player .tag span { color: var(--muted); }
.player .links { position: absolute; right: 20px; top: 12px; display: flex; gap: 8px; }
.player .links .btn { padding: 9px 12px; font-size: 12px; }

.deck {
  border-top: 2px solid var(--ink);
  background: var(--page);
  padding: 12px 20px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 16px;
  align-items: center;
}
.deck .play { min-width: 92px; justify-content: center; }
.deck .readout { font: 700 13px/1 var(--text); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.deck .beats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.deck .beats button, .deck .opts button {
  font: 600 12px/1 var(--text);
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 7px 10px; cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 140ms ease, background-color 140ms ease;
}
.deck .beats button:active, .deck .opts button:active { transform: scale(0.97); }
.deck .beats button[aria-current='true'] { border-color: var(--ink); background: var(--ink); color: var(--page); }
.deck .opts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.deck .opts button[aria-pressed='true'] { border-color: var(--ink); background: var(--yellow); }

.scrub { position: relative; height: 28px; display: flex; align-items: center; }
.scrub input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
}
.scrub input::-webkit-slider-runnable-track { height: 4px; background: var(--line); }
.scrub input::-moz-range-track { height: 4px; background: var(--line); }
.scrub input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 22px; margin-top: -9px;
  background: var(--yellow); border: 2px solid var(--ink);
}
.scrub input::-moz-range-thumb { width: 13px; height: 19px; border-radius: 0; background: var(--yellow); border: 2px solid var(--ink); }
.scrub .ticks { position: absolute; left: 8px; right: 8px; top: 2px; bottom: 2px; pointer-events: none; }
.scrub .ticks i { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--ink); opacity: 0.35; }
.scrub .fill { position: absolute; left: 0; top: 12px; height: 4px; background: var(--ink); pointer-events: none; }

@media (max-width: 720px) {
  .deck { grid-template-columns: auto 1fr auto; padding: 10px 12px 12px; }
  .deck .beats button { padding: 6px 8px; font-size: 11px; }
  .player .tag span { display: none; }
}

/* ------------------------------------------------------------ scroll page */
/* keyboard users: jump past the animation. Only visible when it has focus. */
.skip {
  position: absolute; left: var(--gutter); top: 10px; z-index: 10;
  font: 700 14px/1 var(--text); color: var(--page); background: var(--ink); text-decoration: none;
  padding: 14px 16px; transform: translateY(-200%);
}
.skip:focus { transform: none; }

.site .top {
  display: flex; align-items: center; gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 2px solid var(--ink);
}
.site .brand img { display: block; height: 34px; width: auto; }
.site .tagline { color: var(--muted); margin-right: auto; }
/* Logo C: boxi, a rule, "En del av" over the Book It wordmark (assets/book-it.svg). The footer has the
   Book It part on one line (.endorse.row). */
.site .lockup { display: flex; align-items: center; gap: 14px; }
.endorse {
  display: inline-grid; gap: 5px; justify-items: start; align-content: center;
  padding: 2px 0 2px 14px; border-left: 2px solid var(--ink); color: var(--ink); text-decoration: none;
}
.endorse .label { font-size: 9px; letter-spacing: 0.18em; line-height: 1; white-space: nowrap; }
.endorse img { display: block; height: 14px; width: auto; }
.endorse.row { display: inline-flex; align-items: center; gap: 10px; padding: 0; border-left: 0; }
.endorse.row .label { font-size: 11px; letter-spacing: 0.16em; }
.endorse.row img { height: 15px; }
.site .top .btn { padding: 10px 14px; }
/* the header's two links look the same but take a 44 px finger: an invisible area around each */
.site .brand, .site .top .btn { position: relative; }
.site .brand::after, .site .top .btn::after { content: ''; position: absolute; inset: -6px -4px; }

.site h1, .site h2 {
  font-family: var(--display);
  font-weight: 900;
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.035em;
  line-height: 0.9;
  margin: 0;
}
.site .lede { font-size: clamp(16px, 1.5vw, 20px); font-weight: 500; max-width: 34ch; margin: 0; }

/* Opening screen: the headline lies on top of the pinned scene, beside the closed door.
   It covers exactly what is visible below the header at scroll 0, scrolls away with the page
   and is faded by js/scroll.js as the door starts to open. js/scroll.js measures .hero-copy
   and tells the scene which part of the screen is left for the door. */
.hero {
  position: absolute; left: 0; top: 0; width: 100%; z-index: 2;
  height: calc(100vh - var(--top-h, 76px)); height: calc(100svh - var(--top-h, 76px));
  padding: clamp(28px, 6vh, 72px) clamp(16px, 4vw, 48px) clamp(28px, 6vh, 64px);
  display: grid; align-content: end; justify-items: start;
  pointer-events: none; will-change: opacity;
}
.hero-copy { display: grid; gap: clamp(16px, 2.6vh, 30px); justify-items: start; }
.hero h1 { font-size: clamp(44px, min(8.8vw, 21vh), 176px); margin-left: -0.04em; padding-bottom: 0.08em; }
.hero .cue { display: inline-flex; align-items: center; gap: 14px; margin: 0; }
.hero .cue i { display: block; width: 2px; height: 46px; background: var(--ink); position: relative; }
.hero .cue i::after {
  content: ''; position: absolute; left: -5px; bottom: 0; width: 10px; height: 10px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg);
}
/* tall screens (phones, upright tablets): headline on top, door underneath */
@media (max-aspect-ratio: 6/5) {
  .hero { align-content: start; padding-top: clamp(20px, 3.5vh, 44px); }
  .hero-copy { gap: 14px; }
  .hero h1 { font-size: clamp(40px, 13.2vw, 124px); }
  .hero .cue i { height: 30px; }
}

.journey { position: relative; height: 560vh; }
.journey .stage { --cap: 0px; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.journey .stage canvas { position: absolute; inset: 0; }
.plain-door { display: none; }       /* only shown when the scene cannot run, see the end of this file */

.captions { list-style: none; margin: 0; padding: 0; position: absolute; right: clamp(16px, 4vw, 48px); bottom: clamp(28px, 6vh, 64px); pointer-events: none; }
.captions li {
  position: absolute; right: 0; bottom: 0; white-space: nowrap;
  display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 14px; row-gap: 8px;
  background: var(--page); padding: 10px 0 0 14px;   /* a paper-coloured plate, so a caption stays readable if art slides under it */
  opacity: 0; transform: translateY(8px);
  transition: opacity 260ms ease, transform 420ms var(--ease-out);
}
.captions li.on { opacity: 1; transform: none; }
.captions b { font: 900 clamp(28px, 3.7vw, 60px)/1 var(--display); letter-spacing: -0.03em; }
.captions em { grid-column: 2; font-style: normal; font-weight: 500; font-size: clamp(14px, 1.25vw, 18px); line-height: 1.3; }
.rail { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--line); }
.rail i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

/* Tall screens (phones, upright tablets): the caption has its own strip above the picture. The canvas
   starts below the strip (--cap), so a caption can never cover the driver or the door.
   js/scroll.js sizes the scene from the canvas. Wide screens are untouched: caption bottom right. */
@media (max-aspect-ratio: 6/5) {
  .journey .stage { --cap: clamp(100px, 9vw + 64px, 136px); }
  .journey .stage canvas { top: var(--cap); bottom: auto; height: calc(100% - var(--cap)); }
  .captions { top: 0; bottom: auto; left: var(--gutter); right: var(--gutter); height: var(--cap); }
  .captions li {
    inset: 0; white-space: normal;
    grid-template-columns: minmax(0, 1fr); align-content: center; row-gap: 6px;
    background: none; padding: 0;
  }
  .captions b { font-size: clamp(28px, 5vw, 44px); }
  .captions em { grid-column: 1; }
}

/* Därför boxi: a charcoal block under the checker strip from the taxi door. Headline on the left, the
   reasons as a ruled list on the right; each reason is marked with the roof light from the wordmark. */
.why {
  position: relative; background: var(--charcoal); color: var(--page);
  padding: calc(clamp(64px, 12vh, 150px) + 20px) var(--gutter) clamp(64px, 12vh, 150px);
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.why::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 20px;
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--cream) 0 50%) 0 0 / 20px 20px;
}
.why ::selection { background: var(--yellow); color: var(--ink); }
.why-copy { display: grid; gap: clamp(18px, 3vh, 30px); justify-items: start; }
.why .label { color: var(--yellow); }
.why h2 { font-size: clamp(44px, 7vw, 124px); margin-left: -0.03em; }
.why .lede { color: rgba(244, 237, 222, 0.8); }
.why-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--page); }
.why-list li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 16px; row-gap: 8px; align-items: center;
  padding: clamp(18px, 3vh, 28px) 0; border-bottom: 1px solid rgba(244, 237, 222, 0.24);
}
.why-list li::before {
  content: ''; width: 30px; height: 12px; background: var(--yellow);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}
.why-list b { font: 900 clamp(26px, 2.9vw, 44px)/1 var(--display); font-variation-settings: 'opsz' 144; letter-spacing: -0.03em; }
.why-list li > span { grid-column: 2; font-size: clamp(15px, 1.25vw, 18px); font-weight: 500; line-height: 1.45; color: rgba(244, 237, 222, 0.8); max-width: 46ch; }
.why-list .langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 600; color: var(--page); font-size: clamp(16px, 1.4vw, 20px); }
.why-list .langs i { width: 5px; height: 5px; background: var(--yellow); }
.why-list .langs [lang='ar'] { font-size: 1.25em; line-height: 1; }   /* the system's Arabic face runs small beside Montserrat */
@media (max-width: 720px) {
  .why { grid-template-columns: minmax(0, 1fr); }
  .why-list li { grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; }
  .why-list li::before { width: 24px; height: 10px; }
}

/* What is included: headline on the left, a printed receipt on the right */
.ingar {
  border-top: 2px solid var(--ink);
  padding: clamp(64px, 12vh, 150px) clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.ingar-copy { display: grid; gap: clamp(18px, 3vh, 30px); justify-items: start; }
.ingar h2 { font-size: clamp(44px, 7.4vw, 128px); margin-left: -0.03em; }

.slip {
  justify-self: center; width: min(430px, 100%);
  transform: rotate(-1.6deg);
  filter: drop-shadow(10px 14px 0 rgba(22, 22, 22, 0.14));   /* on the wrapper, so the shadow follows the torn edge */
}
.slip-paper {
  --tooth: 10px;
  background: #FFFBF1; color: var(--ink);
  padding: 28px 26px calc(24px + var(--tooth));
  /* torn bottom edge: a solid sheet plus a row of teeth */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 0.5px) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom left / calc(var(--tooth) * 2) var(--tooth) repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) + 0.5px) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom left / calc(var(--tooth) * 2) var(--tooth) repeat-x;
}
.slip p { margin: 0; }
.slip-head { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 16px; border-bottom: 2px dashed var(--ink); }
.slip-head img { display: block; height: 30px; width: auto; }
.slip dl { margin: 0; }
.slip dl > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 15px 0; border-bottom: 1px dashed var(--line); }
.slip dt { font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.slip dd { margin: 0; grid-column: 1 / -1; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--muted); max-width: 38ch; }
.slip dd.incl {
  grid-column: 2; grid-row: 1; color: var(--ink); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--yellow); padding: 3px 7px; align-self: center;
}
.slip-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 0 16px; border-bottom: 2px dashed var(--ink); border-top: 1px solid var(--ink); margin-top: -1px; }
.slip-sum span { font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.slip-sum b { font: 900 clamp(30px, 3vw, 40px)/1 var(--display); letter-spacing: -0.03em; }
.slip-foot { padding-top: 16px; text-align: center; color: var(--muted); }

/* Contact */
.outro {
  border-top: 2px solid var(--ink);
  padding: clamp(64px, 14vh, 160px) clamp(16px, 4vw, 48px);
  display: grid; gap: clamp(18px, 3vh, 30px); justify-items: start;
  background: var(--yellow);
}
.outro h2 { font-size: clamp(44px, 9vw, 150px); margin-left: -0.03em; }
.outro .tel {
  font: 900 clamp(40px, 7.2vw, 118px)/1 var(--display); font-variation-settings: 'opsz' 144;
  letter-spacing: -0.03em; font-variant-numeric: lining-nums;
  color: var(--ink); text-decoration: none;
  border-bottom: 0.06em solid var(--ink); padding-bottom: 0.06em; margin-top: clamp(6px, 2vh, 22px);
  white-space: nowrap;
}
.outro .ways { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.outro .btn { min-height: 48px; padding: 14px 20px; font-size: 14px; background: var(--ink); color: var(--page); }
.outro .btn.ghost { background: transparent; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .outro .tel:hover { background: var(--ink); color: var(--yellow); }
  .outro .btn:hover { background: var(--page); color: var(--ink); }
  .outro .btn.ghost:hover { background: var(--ink); color: var(--page); }
}
.foot { border-top: 2px solid var(--ink); padding: 18px clamp(16px, 4vw, 48px) max(18px, env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { color: var(--ink); }

@media (max-width: 720px) {
  .site .tagline { display: none; }
  .site .top { justify-content: space-between; gap: 12px; }
  .site .lockup { gap: 10px; }
  .site .lockup .endorse { padding-left: 10px; gap: 4px; }
  .site .lockup .endorse .label { font-size: 8px; letter-spacing: 0.14em; }
  .site .lockup .endorse img { height: 12px; }
  .foot { align-items: center; }
  .journey { height: 520vh; }
  .ingar { grid-template-columns: minmax(0, 1fr); }
  .slip { transform: rotate(-1deg); }
}
/* very narrow phones: no room for the Book It part beside the button; it is still in the footer */
@media (max-width: 349px) {
  .site .lockup .endorse { display: none; }
}

/* small windows that are wider than tall (a phone on its side): caption on a plate, top left, as before */
@media (max-width: 720px) and (min-aspect-ratio: 601/500) {
  .captions { bottom: auto; top: 22px; right: auto; left: 16px; }
  .captions li { bottom: auto; top: 0; right: auto; left: -8px; grid-template-columns: auto; row-gap: 6px; background: var(--page); padding: 6px 10px 8px 8px; }
  .captions em { grid-column: 1; }
}

/* reduced motion: three stills instead of a pinned, scrubbed scene */
.reduced .journey { height: auto; padding: 32px 16px 48px; }
.reduced .hero { position: static; height: auto; padding: 8px 0 36px; opacity: 1 !important; }
.reduced .hero .cue { display: none; }
.reduced .journey .stage { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; visibility: hidden; }
.stills { display: grid; gap: 28px; justify-items: center; }
.stills figure { margin: 0; display: grid; gap: 12px; width: min(1100px, 100%); }
.stills img { width: 100%; height: auto; display: block; border: 2px solid var(--ink); }
.stills figcaption { display: flex; align-items: baseline; gap: 14px; }
.stills b { font: 900 clamp(24px, 3vw, 40px)/1 var(--display); letter-spacing: -0.03em; }
@media (prefers-reduced-motion: reduce) {
  .captions li, .btn { transition: none; }
}

/* The plain page: shown when scripts are off (no .js on <html>) or when the scene cannot start
   (.static, set by js/scroll.js or by the inline script in index.html). Same words, the approved
   door as a picture, the four steps as a list. No pinning and no empty stage. Try it with ?plain=1. */
html:not(.js) .journey, html.static .journey { height: auto; padding: 0 var(--gutter) clamp(48px, 9vh, 96px); }
html:not(.js) .hero, html.static .hero {
  position: static; height: auto; padding: clamp(28px, 6vh, 72px) 0 clamp(32px, 6vh, 64px);
  opacity: 1 !important; visibility: visible !important;
}
html:not(.js) .hero .cue, html.static .hero .cue { display: none; }
html:not(.js) .journey .stage, html.static .journey .stage {
  position: static; width: auto; height: auto; overflow: visible; opacity: 1; visibility: visible;
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center;
}
/* scoped to .journey: the review player has a .stage and a canvas of its own and must not be touched */
html:not(.js) .journey .stage canvas, html.static .journey .stage canvas,
html:not(.js) .journey .rail, html.static .journey .rail,
html.static .stills { display: none; }
html:not(.js) .journey .plain-door, html.static .journey .plain-door { display: block; width: 100%; max-width: 560px; height: auto; justify-self: center; }
html:not(.js) .journey .captions, html.static .journey .captions {
  position: static; height: auto; display: grid; gap: clamp(22px, 4vh, 40px); pointer-events: auto;
}
html:not(.js) .journey .captions li, html.static .journey .captions li {
  position: static; opacity: 1; transform: none; transition: none; white-space: normal;
  grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 6px; background: none; padding: 0;
}
html:not(.js) .journey .captions em, html.static .journey .captions em { grid-column: 2; font-size: clamp(16px, 1.25vw, 19px); }
@media (max-width: 720px) {
  html:not(.js) .journey .stage, html.static .journey .stage { grid-template-columns: minmax(0, 1fr); }
  html:not(.js) .journey .plain-door, html.static .journey .plain-door { max-width: 340px; justify-self: start; }
}
