/* ==========================================================================
   Mosa Ultra
   ========================================================================== */


/* Tokens
   All colours, fonts and the main sizes. Most sizes use clamp(): the first
   value is the phone size, the last value the desktop size, and the middle
   value makes it grow smoothly in between.
   ========================================================================== */

:root {
  --orange: #FF3C00;
  --orange-dark: #D93300;
  --dark-brown: #39302B;
  --light-brown: #6C5C53;
  --dark-beige: #C7B8AE;
  --light-beige: #E2D5CD;
  --black: #000000;
  --white: #FFFFFF;

  --font-mono: "Basier Square Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: "Ease Semi Display", "Helvetica Neue", Arial, sans-serif;

  --text-size: 1.125rem;
  --line-height: 1.45;
  --tracking: -0.03em;            /* body text */
  --tracking-display: -0.055em;  /* headings and big numbers */

  --title-size: clamp(3.5rem, 2.9rem + 2.1vw, 4.5rem);      /* h2 on the homepage */
  --title-size-small: clamp(2.5rem, 2.25rem + 0.8vw, 3rem); /* h2 on sub pages */

  --gutter: 1.5rem;              /* space left and right of the text on phones */
  --measure: 43rem;              /* width of the text column */
  --paragraph-gap: calc(var(--text-size) * var(--line-height)); /* one empty line */

  /* Space between big blocks (text, photos, the info card) */
  --gap: clamp(3.5rem, 2.2rem + 4vw, 6.5rem);
  /* Padding of the coloured sections on the register page */
  --section-padding: clamp(4.5rem, 3rem + 5.5vw, 9rem);
  /* Padding at the top and bottom of the hero */
  --hero-padding: clamp(4.5rem, 2.5rem + 6vw, 9.5rem);
  /* Space between the items in the hero */
  --hero-gap: clamp(3.25rem, 16.5vw, 4.5rem);

  /* Photos with an irregular mask.
     The masks are shown at their real size (in px) on screens of 1100px and
     wider. Between 1920px and 1100px the left and right edges of the masks
     simply move out of view. Below 1100px the masks scale down gradually, to
     64% at 440px (the mobile design), and keep shrinking on smaller phones. */
  --mask-unit: min(1px, 0.407px + 0.0539vw);
}

@media (min-width: 36em) {
  :root {
    --text-size: 1.375rem;
    --gutter: 2.625rem;
  }
}


/* Fonts
   ========================================================================== */

@font-face {
  font-family: "Basier Square Mono";
  src: url("fonts/basiersquaremono-regular-webfont.woff2") format("woff2"),
       url("fonts/basiersquaremono-regular-webfont.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Basier Square Mono";
  src: url("fonts/basiersquaremono-semibold-webfont.woff2") format("woff2"),
       url("fonts/basiersquaremono-semibold-webfont.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ease Semi Display";
  src: url("fonts/EaseSemiDisplay-Medium.woff2") format("woff2"),
       url("fonts/EaseSemiDisplay-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}


/* Base
   ========================================================================== */

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

html {
  background-color: var(--dark-brown);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;            /* fallback for browsers without clip */
  overflow-x: clip;
  background-color: var(--dark-beige);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: var(--text-size);
  font-weight: 400;
  line-height: var(--line-height);
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

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

b, strong {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

/* Links in running text (and the footer): bold without underline, underlined
   with a slightly different colour on hover. Light text on the dark end of the
   page turns lighter, dark text on beige turns browner. */
.content a:not(.button),
.card a:not(.button),
.site-footer a:not(.footer-logo) {
  font-weight: 600;
  text-decoration: none;
}

.content a:not(.button):hover,
.card a:not(.button):hover {
  color: var(--light-brown);
  text-decoration: underline;
}

.page-end .content a:not(.button):hover,
.site-footer a:not(.footer-logo):hover {
  color: var(--light-beige);
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.no-wrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}


/* Typography
   ========================================================================== */

h1,
h2,
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

h2,
h1.page-title {
  font-size: var(--title-size);
}


/* Layout
   ========================================================================== */

.content {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Vertical rhythm inside a text column: one empty line between paragraphs
   and lists, a big gap above headings, a small one below them. */
.content > * + * {
  margin-top: var(--paragraph-gap);
}

.content > * + h2 {
  margin-top: var(--gap);
}

.content > h2 + *,
.content > h1 + * {
  margin-top: 1.125rem;
}

/* A text block between two photos (homepage) */
.text-block {
  padding-block: var(--gap);
}

/* Coloured sections with padding (register and newsletter pages) */
.section {
  padding-block: var(--section-padding);
}

.section h2,
.card h2 {
  font-size: var(--title-size-small);
}

.section .content > * + h2 {
  margin-top: clamp(3rem, 2rem + 3vw, 4.75rem);
}

.section-light {
  background-color: var(--light-beige);
}


/* Lists
   ========================================================================== */

.content ul {
  padding-left: 1.65em;
  list-style: disc;
}

.content li + li,
.content li > ul {
  margin-top: 0.5em;
}

.content li::marker {
  font-size: 0.9em;
}


/* Buttons
   ========================================================================== */

.button {
  display: inline-block;
  padding: 0.7em 1.5em;
  border-radius: 0.375rem;
  background-color: var(--orange);
  color: var(--white);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s;
}

.button:hover {
  background-color: var(--orange-dark);
}

.button:focus-visible {
  outline-color: var(--black);
}


/* Hero (top of the homepage and the register page)
   ========================================================================== */

.hero {
  padding: var(--hero-padding) var(--gutter);
  background-color: var(--dark-beige);
  background-image: url("../img/bg-hero-light.png");
  background-position: center top;
  background-size: cover;
  image-rendering: pixelated;    /* keeps the texture crisp when  scaled up */
  text-align: center;
}

.hero img {
  image-rendering: auto;
}

.hero > * + * {
  margin-top: var(--hero-gap);
}

.hero .date {
  text-transform: uppercase;
}

.hero h1 {
  line-height: 0;
}

.hero-logo {
  width: min(45rem, 80vw);
  margin-inline: auto;
}

.hero-logo-link {
  display: inline-block;
}

.hero .lead {
  max-width: 20.5em;
  margin-inline: auto;
  line-height: 1.35;
}

/* Dark variant with a smaller logo (register page) */
.hero-dark {
  background-color: var(--dark-brown);
  background-image: url("../img/bg-hero-dark.png");
  color: var(--light-beige);
}

.hero-dark .hero-logo {
  width: min(26.5rem, 64vw);
}


/* Key figures (dark band below the homepage hero)
   ========================================================================== */

/* Wraps the key figures and the first photo, so no seam can show between them */
.dark-start {
  background-color: var(--dark-brown);
}

.stats {
  padding: clamp(5rem, 3.5rem + 4vw, 7.5rem) var(--gutter) clamp(5.5rem, 4.5rem + 2.5vw, 7.5rem);
  background-color: var(--dark-brown);
  color: var(--light-beige);
  text-align: center;
}

.stats dl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.stats dt {
  margin-bottom: 0.25rem;
}

.stats dd {
  font-size: min(22vw, 6.25rem);
  white-space: nowrap;
}

@media (min-width: 48em) {
  .stats dl {
    flex-direction: row;
    justify-content: center;
    gap: clamp(2.5rem, 4.5vw, 5.5rem);
  }

  .stats dd {
    font-size: clamp(3.5rem, 6.5vw, 5.25rem);
  }
}


/* Photos with an irregular mask
   .shape-band is a full width strip that hides whatever falls outside the
   screen. .shape is the masked photo itself, always centred. Its size comes
   from the real size of the mask (--w × --h, in px) times --mask-unit.
   ========================================================================== */

.shape-band {
  overflow: hidden;              /* fallback for browsers without clip */
  overflow: clip;
}

/* Upper half dark, lower half beige, so the photo sits on the edge between
   the key figures and the text. */
.shape-band-split {
  background-image: linear-gradient(to bottom, var(--dark-brown) 53%, var(--dark-beige) 53%);
}

.shape {
  --width: calc(var(--w) * var(--mask-unit));
  position: relative;
  width: var(--width);
  height: calc(var(--h) * var(--mask-unit));
  margin-inline: calc((100% - var(--width)) / 2);
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.shape img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* By default the photo covers the whole mask, also the parts that fall off
   screen. With .shape-fit-screen the photo only covers the visible part of the
   mask (at most the screen width) and the mask's height, so on smaller screens
   it zooms in less and more of the photo's width stays in view. */
.shape-fit-screen img {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 100vw);
  transform: translateX(-50%);
}

.shape-1 {
  --w: 1811;
  --h: 675;
  --mask: url("../img/mask-1.svg");
}

.shape-2 {
  --w: 1757;
  --h: 885;
  --mask: url("../img/mask-2.svg");
}

.shape-3 {
  --w: 1816;
  --h: 744;
  --mask: url("../img/mask-3.svg");
}

/* Route map: the route drawing on top of a toned landscape photo */
.shape-map {
  background-color: var(--light-brown);
  background-image: url("../img/map-bg.jpg");
  background-position: center;
  background-size: cover;
}

.shape-map .route {
  position: absolute;
  top: 17%;
  left: 50%;
  width: auto;
  height: 69%;
  transform: translateX(-50%);
  object-fit: contain;
}


/* Info card (homepage) and the dark end of the page
   ========================================================================== */

/* The beige background stops partway down the card */
.card-band {
  --split: clamp(3.5rem, 1.5rem + 6vw, 8.75rem);
  padding-inline: var(--gutter);
  background-image: linear-gradient(to bottom, var(--dark-beige) var(--split), var(--dark-brown) var(--split));
}

.card {
  max-width: 54rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 6vw, 5.5rem);
  border-radius: 0.75rem;
  background-color: var(--light-beige);
}

.card > * + * {
  margin-top: var(--paragraph-gap);
}

.card ul {
  padding-left: 1.65em;
  list-style: disc;
}

.card li + li,
.card li > ul {
  margin-top: 0.45em;
}

/* Key facts: one per line without bullets. Lines that wrap are indented to
   the same depth as the bulleted list, so each fact reads as one block. */
.card ul.facts {
  padding-left: 0;
  list-style: none;
}

.card .facts li {
  margin-top: 0;
  padding-left: 1.65em;
  text-indent: -1.65em;
}

.content > .cta {
  margin-top: 2.5rem;
}

.card > .cta {
  margin-top: clamp(2rem, 1rem + 3vw, 3.5rem);
}

@media (max-width: 35.99em) {
  .card .button {
    display: block;
  }
}

/* FAQ and footer share the dark background. The texture (dark in the middle,
   shapes along the sides, fully dark at the top and bottom edges) sits behind
   the footer. It spans the full width, but is at least 30rem wide on phones
   so the shapes still peek in at the sides. */
.page-end {
  position: relative;
  isolation: isolate;            /* keeps the texture below the content */
  overflow: hidden;              /* fallback for browsers without clip */
  overflow: clip;                /* cuts the texture off at the page end */
  background-color: var(--dark-brown);
  color: var(--light-beige);
}

/* On pages without FAQ the top 240px of the image (at 1000px wide) is out
   of view: 6.667% of its 3600px height */
.site-footer::before,
.page-end.texture-pinned::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: max(100%, 30rem);
  aspect-ratio: 1000 / 3600;
  transform: translate(-50%, -6.667%);
  background-image: url("../img/bg-footer-dark.png");
  background-size: 100% 100%;
  image-rendering: pixelated;
}

/* Homepage: the whole texture, starting right below the FAQ */
.faq-section + .site-footer::before {
  transform: translateX(-50%);
}

/* Homepage with JavaScript: js/faq.js sets --texture-top to where the footer
   starts when all answers are closed, and adds .texture-pinned. The texture
   then hangs from .page-end instead of the footer, so it stays put while
   answers open. */
.page-end.texture-pinned::before {
  top: var(--texture-top);
  transform: translateX(-50%);
}

.texture-pinned .site-footer::before {
  content: none;
}

.page-end img {
  image-rendering: auto;
}

.faq-section {
  padding-top: calc(var(--gap) + 2em); /* a bit more room below the info card */
}


/* FAQ (native <details>, animated by js/faq.js)
   ========================================================================== */

/* Normal paragraph gap above the first question, not the smaller gap that
   usually follows a heading */
.faq-section .content > h2 + .faq {
  margin-top: var(--paragraph-gap);
}

.content > .faq + .faq {
  margin-top: clamp(1rem, 0.5rem + 1.5vw, 2.125rem);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1em;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-weight: 600;
  transition: transform 0.2s;
}

.faq summary:hover {
  color: var(--white);
}

.faq[open] summary::after {
  transform: rotate(45deg);
}

/* Set by js/faq.js while an item animates closed, so the icon turns back right away */
.faq.is-closing summary::after {
  transform: none;
}

/* The right padding is the width of the "+" plus the gap next to it, so the
   answers line up with the questions instead of running under the icon */
.faq > :not(summary) {
  padding-top: 1em;
  padding-right: calc(1ch + 1em);
  color: var(--dark-beige);
}

.faq > :last-child {
  padding-bottom: 0.5em;
}


/* Footer
   ========================================================================== */

.site-footer {
  position: relative;            /* for the texture, see .page-end */
  padding: clamp(8rem, 5.5rem + 7vw, 13.5rem) var(--gutter);
  color: var(--dark-beige);
  font-size: 0.9375rem;
  text-align: center;
}

.site-footer p {
  text-wrap: balance;
}

.site-footer p + p {
  margin-top: 2em;
}


.footer-logo {
  display: block;
  width: min(15rem, 45vw);
  margin: 6rem auto 0;
}

.footer-logo img {
  width: 100%;
}


/* Simple light pages (newsletter, 404)
   ========================================================================== */

.page-light {
  background-color: var(--light-beige);
}

.site-header {
  padding: 2.5rem var(--gutter) 0;
  text-align: center;
}

.site-header a {
  display: inline-block;
}

.site-header img {
  width: 9rem;
}

.page-light .section {
  padding-top: clamp(4rem, 2.5rem + 5vw, 7.5rem);
}


/* Newsletter form (MailerLite embed)
   MailerLite's own rules are very specific and use !important, so the
   overrides below use !important too. The rules at the end are prefixed
   with .ml-embedded + the form ID to out-rank theirs. You'll find a form's
   ID in the page source once the form has loaded.
   ========================================================================== */

.ml-embedded {
  margin-top: 3rem !important;
}

.ml-form-embedBody {
  padding: 0 !important;
}

body .ml-form-embedWrapper {
  background: none !important;
}

.ml-form-fieldRow,
.ml-form-checkboxRow,
.ml-form-recaptcha {
  margin: 0 0 2.25em !important;
}

.ml-field-group label,
.ml-form-successBody p,
.ml-form-successBody h4 {
  margin-bottom: 0.5em !important;
  color: var(--black) !important;
  font-family: var(--font-mono) !important;
  font-size: var(--text-size) !important;
  font-weight: 400 !important;
  letter-spacing: var(--tracking) !important;
  line-height: var(--line-height) !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

.ml-form-successContent h4 {
  font-weight: 600 !important;
}

body .ml-form-successContent {
  margin: 0 !important;
}

body .ml-form-successContent > * {
  margin-top: 0 !important;
}

/* Rules scoped to this form's ID (#mlb2-46744594). For another form, copy
   them and change the ID. Written out in full (no CSS nesting) so they also
   work in older browsers. */

/* Success message after signing up */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody {
  padding: 2em !important;
  border-radius: 0.375rem !important;
  background-color: var(--dark-beige) !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody h4,
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody p {
  color: var(--black) !important;
}

/* Links in the success message: same as links in running text */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody a {
  color: var(--black) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody a:hover {
  color: var(--light-brown) !important;
  text-decoration: underline !important;
}

/* Text fields */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
  height: auto !important;
  padding: 0.5em 0.6em !important;
  border: 1px solid var(--light-brown) !important;
  border-radius: 0.375rem !important;
  background-color: var(--white) !important;
  color: var(--black) !important;
  font-family: var(--font-mono) !important;
  font-size: var(--text-size) !important;
  letter-spacing: var(--tracking) !important;
  line-height: var(--line-height) !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:focus {
  outline: none !important;
  border-color: var(--dark-brown) !important;
  box-shadow: 0 0 0 2px var(--dark-brown) !important;
}

/* Consent checkbox */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow label p,
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description {
  color: var(--black) !important;
  font-family: var(--font-mono) !important;
  font-size: calc(var(--text-size) * 0.875) !important;
  letter-spacing: var(--tracking) !important;
  line-height: var(--line-height) !important;
  cursor: pointer;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow a {
  color: var(--black) !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before {
  border-color: var(--light-brown) !important;
  background-color: var(--white) !important;
}

/* Checked: dark box with a light tick */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow input[type="checkbox"]:checked ~ .label-description::before {
  background-color: var(--dark-brown) !important;
  border-color: var(--dark-brown) !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow input[type="checkbox"]:checked ~ .label-description::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 2.5 19 19'%3E%3Cpath fill='none' stroke='%23E2D5CD' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/%3E%3C/svg%3E") !important;
}

/* Subscribe button */
.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
  padding: 0.825em !important;
  border: 0 !important;
  border-radius: 0.375rem !important;
  background-color: var(--orange) !important;
  color: var(--white) !important;
  font-family: var(--font-mono) !important;
  font-size: var(--text-size) !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking) !important;
}

.ml-embedded #mlb2-46744594.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
  background-color: var(--orange-dark) !important;
}


/* 404 page: the hero fills the whole screen
   ========================================================================== */

.hero-full {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
