/* ALPATLAS design system: tokens and components shared by every page and app. */

@font-face {
  font-family: "Newsreader";
  src: url("/shared/fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/shared/fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/shared/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Night: the dark ground of the brand */
  --ink-950: #090e11;
  --ink-900: #0d1418;
  --ink-800: #131c21;
  --ink-700: #1b262c;

  /* Bone: text on night */
  --bone: #f0ebe1;
  --bone-2: rgb(240 235 225 / 0.72);
  --bone-3: rgb(240 235 225 / 0.58);
  --line: rgb(240 235 225 / 0.14);
  --line-strong: rgb(240 235 225 / 0.28);

  /* Paper: the light ground of the brand */
  --paper: #efe9dd;
  --paper-ink: #141b1f;
  --paper-2: #4b5457;
  --paper-line: rgb(20 27 31 / 0.16);

  /* Alpenglow, the signature: the light on the summits at dawn. Use sparingly. */
  --alpenglow: #ea845e;
  --alpenglow-deep: #a8421f;

  /* Map legend: one colour per platform */
  --legend-glacier: #8fc7c3;
  --legend-alpenglow: #ea845e;
  --legend-ochre: #d6b673;
  --legend-moss: #afbf8e;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Content never grows past this width. Wider screens get equal margins, so the
     proportions stay the same from a laptop to an ultrawide monitor. */
  --shell: 100rem;
  --gutter-base: clamp(1.25rem, 4vw, 3.5rem);
  --gutter: max(var(--gutter-base), calc((100vw - var(--shell)) / 2));
  --header-h: 4.75rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html {
  background: var(--ink-950);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--ink-950);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

[hidden] {
  display: none !important;
}

/* Animations only start once JavaScript has confirmed it is running (early.js).
   Without it, everything below is simply visible from the first moment. */
html.js body {
  opacity: 0;
  transition: opacity 0.5s ease;
}

html.js.is-ready body {
  opacity: 1;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

svg {
  display: block;
}

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

::selection {
  background: var(--alpenglow);
  color: var(--ink-950);
}

/* Type */

.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.022em;
  font-optical-sizing: auto;
}

.display em {
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.012em;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
}

/* Brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--bone);
}

.brand__mark {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  flex: none;
}

.brand__mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: miter;
}

.brand__mark .brand__summit {
  stroke: var(--alpenglow);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1;
  /* The brand name stays Latin and left-to-right in every language. */
  direction: ltr;
  unicode-bidi: isolate;
}

.brand__lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
}

.brand__section {
  padding-inline-start: 0.75rem;
  border-inline-start: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--bone-2);
}

/* On a phone, the label sits under the name so the languages keep their room. */
@media (max-width: 560px) {
  .brand__lockup {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .brand__section {
    padding-inline-start: 0;
    border-inline-start: 0;
    font-size: 0.875rem;
  }
}

@media (max-width: 359px) {
  .brand {
    gap: 0.5rem;
  }
  .brand__mark {
    inline-size: 1.5rem;
    block-size: 1.5rem;
  }
  .wordmark {
    font-size: 1rem;
    letter-spacing: 0.16em;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-block-size: 3.25rem;
  padding-block: 0.8rem;
  padding-inline: 1.6rem;
  border: 1px solid var(--bone);
  background: var(--bone);
  color: var(--ink-950);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

.btn:hover {
  background: var(--alpenglow);
  border-color: var(--alpenglow);
}

.btn--ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--ink-950);
}

.btn--small {
  min-block-size: 2.5rem;
  padding-block: 0.4rem;
  padding-inline: 1rem;
  font-size: 0.85rem;
}

.arrow {
  inline-size: 1.1em;
  block-size: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  transition: transform 0.4s var(--ease);
}

a:hover > .arrow {
  transform: translateX(0.3em);
}

[dir="rtl"] .arrow {
  scale: -1 1;
}

[dir="rtl"] a:hover > .arrow {
  transform: translateX(-0.3em);
}

/* Header */

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--bone);
  color: var(--ink-950);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  block-size: var(--header-h);
  padding-inline: var(--gutter);
  /* Fully opaque: the map and the plates pass behind it, never through the menu. */
  background: var(--ink-950);
  border-block-end: 1px solid var(--line);
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  margin-inline-start: auto;
  font-size: 0.9rem;
  color: var(--bone-2);
}

.site-nav a {
  position: relative;
  padding-block: 0.4rem;
  transition: color 0.3s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

[dir="rtl"] .site-nav a::after {
  transform-origin: right;
}

.site-nav a:hover {
  color: var(--bone);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.lang {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 2.25rem;
  min-block-size: 2.5rem;
  color: var(--bone-3);
  transition: color 0.25s ease;
}

.lang a:hover {
  color: var(--bone);
}

.lang a[aria-current="true"] {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--alpenglow);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

@media (max-width: 1080px) {
  .site-header .btn {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 4rem;
  }
  .site-nav {
    display: none;
  }
  .lang {
    margin-inline-start: auto;
    margin-inline-end: -0.5rem;
  }
  .lang a {
    min-inline-size: 1.875rem;
  }
}

/* Footer */

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: start;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 6vh, 4rem);
  padding-inline: var(--gutter);
  border-block-start: 1px solid var(--line);
  background: var(--ink-950);
  font-size: 0.9rem;
  color: var(--bone-3);
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin-block-start: 0.6rem;
}

.site-footer__list a {
  display: inline-block;
  padding-block: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--bone);
}

.site-footer__proof {
  margin-block-start: 1.5rem;
}

.site-footer__proof li {
  color: var(--bone-2);
}

.site-footer__legal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: end;
}

.site-footer__legal a {
  padding-block: 0.25rem;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
}

.site-footer a:not(.brand):hover {
  color: var(--alpenglow);
}

@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr;
  }
  .site-footer__legal {
    align-items: flex-start;
    text-align: start;
  }
}

/* Motion */

html.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 1s var(--ease),
    transform 1.1s var(--ease);
  transition-delay: var(--delay, 0s);
}

html.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
