/* KAISAR Home, first screen. Measured from the approved comp (.impeccable/mocks/home-d-halftone.png, 2528 px wide):
   one comp pixel is 100vw / 2528, written below as calc(N * var(--px)). */

@font-face {
  font-family: "Lexend";
  src: url("fonts/lexend.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("fonts/zalando-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ground: #fbfafb;
  --ink: #320d47;            /* the wordmark's purple: all text */
  --ink-soft: #5b3a6b;
  --copper: #a5502f;         /* the one filled action */
  --copper-ink: #94472a;     /* copper as text on the white ground */
  --ghost: #f4eaee;          /* the pale words behind the figure */
  --display: "Lexend", "Trebuchet MS", sans-serif;
  --text: "Zalando Sans", "Segoe UI", system-ui, sans-serif;
  --px: min(calc(100vw / 2528), max(calc(100vh / 1696), 0.47px));      /* one comp pixel; capped so the first screen fits the window's height */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ground); scrollbar-color: var(--ink) var(--ground); }

body {
  margin: 0;
  color: var(--ink);
  font: 400 1rem/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--ground); }

a { color: inherit; text-underline-offset: 0.22em; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

img { display: block; max-width: 100%; height: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--ground); text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip:focus { top: 1rem; }

/* ---------- Navigation ---------- */

.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  height: calc(196 * var(--px));
  display: flex; align-items: center;
  padding: 0 calc(52 * var(--px)) 0 calc(51 * var(--px));
  gap: calc(38 * var(--px));
}
.nav__logo { width: calc(354 * var(--px)); flex: none; margin-right: auto; }
.nav__links { display: flex; gap: calc(54 * var(--px)); }
.nav__links a, .nav__lang a {
  font: 500 calc(25.5 * var(--px))/1 var(--text);
  letter-spacing: 0.035em; text-transform: uppercase;
  padding: 0.6em 0;
  text-decoration: underline 1.5px transparent; text-underline-offset: 0.55em;
  transition: text-decoration-color 0.35s var(--ease-out);
}
.nav__links a:hover, .nav__lang a:hover { text-decoration-color: currentColor; }
.nav__lang { display: flex; align-items: center; gap: 0.45em; font: 500 calc(25.5 * var(--px))/1 var(--text); }
.nav__lang a:not([aria-current]) { color: var(--ink-soft); }

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--text); text-decoration: none; white-space: nowrap;
  border-radius: calc(10 * var(--px));
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.button:active { transform: translateY(1px); }
.button--outline {
  height: calc(63 * var(--px)); padding: 0 calc(26 * var(--px));
  font-weight: 500; font-size: calc(25.5 * var(--px)); letter-spacing: 0.035em; text-transform: uppercase;
  color: var(--copper-ink); border: 1.5px solid var(--copper);
}
.button--outline:hover { background: var(--copper); color: #fff; }
.button--solid {
  height: calc(90 * var(--px)); padding: 0 calc(46 * var(--px));
  font-weight: 500; font-size: calc(37 * var(--px));
  background: var(--copper); color: #fff;
}
.button--solid:hover { background: var(--ink); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 0.45em;
  font: 400 calc(37 * var(--px))/1 var(--text); text-decoration: none;
}
.arrow-link svg { width: 0.95em; height: 0.95em; transition: transform 0.35s var(--ease-out); }
.arrow-link:hover svg { transform: translateX(0.3em); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: calc(1696 * var(--px));
  overflow: hidden;
  isolation: isolate;
}

.hero__words {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  animation: drift 16s ease-in-out infinite alternate;
}
.hero__word { font: 800 165px/1 var(--display); fill: var(--ghost); text-anchor: middle; }
.hero__word--far { font-size: 120px; opacity: 0.8; }
.hero__word--near { font-size: 205px; }
.hero__word--low { font-size: 165px; }
@keyframes drift {
  from { transform: translate3d(-0.5vw, 0.25vw, 0); }
  to { transform: translate3d(0.6vw, -0.3vw, 0); }
}

.hero__k, .hero__stream, .hero__figure { position: absolute; z-index: 1; }
.hero__k { left: calc(458 * var(--px)); top: calc(425 * var(--px)); width: calc(415 * var(--px)); height: calc(459 * var(--px)); object-fit: contain; }
.hero__stream { left: calc(880 * var(--px)); top: calc(430 * var(--px)); width: calc(436 * var(--px)); height: calc(750 * var(--px)); object-fit: fill; }
.hero__figure { left: calc(1331 * var(--px)); top: calc(236 * var(--px)); width: calc(843 * var(--px)); height: calc(1011 * var(--px)); }

.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; opacity: 0; }

/* Once the canvas is drawing, it replaces the still dots, and the K arrives with them. */
.hero.is-live .hero__canvas { opacity: 1; }
.hero.is-live .hero__figure, .hero.is-live .hero__stream { visibility: hidden; }
.hero.is-live .hero__k { animation: k-arrive 1.5s var(--ease-out) 0.55s both; }
@keyframes k-arrive {
  from { clip-path: inset(0 0 0 100%); filter: blur(calc(14 * var(--px))); transform: translateX(calc(40 * var(--px))); }
  to { clip-path: inset(0 0 0 0); filter: blur(0); transform: none; }
}

.hero__copy { position: absolute; z-index: 2; left: calc(57 * var(--px)); top: calc(986 * var(--px)); }
/* Words for search engines and screen readers that the design does not show: the society's name in the main heading. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hero__title {
  margin: 0;
  font: 800 calc(226 * var(--px))/0.815 var(--display);
  letter-spacing: -0.012em;
  margin-left: calc(-9 * var(--px));     /* optical: the s overhangs its side bearing */
}
.hero__sub { margin: calc(46 * var(--px)) 0 0; font: 400 calc(53 * var(--px))/1.15 var(--text); }
.hero__actions { margin: calc(34 * var(--px)) 0 0; display: flex; align-items: center; gap: calc(44 * var(--px)); }

.hero__label {
  position: absolute; z-index: 2; margin: 0; top: calc(1621 * var(--px));
  font: 500 calc(25.5 * var(--px))/1.2 var(--text); letter-spacing: 0.08em; text-transform: uppercase;
}
.hero__label--end { right: calc(55 * var(--px)); }

/* The map version: Sarawak in dots takes the figure's place and runs wide across the right. */
.hero--map .hero__figure { left: calc(1050 * var(--px)); top: calc(262 * var(--px)); width: calc(1420 * var(--px)); height: auto; }
.hero--map .hero__stream { display: none; }

/* ---------- Narrow screens: the same parts, stacked, figure first ---------- */

@media (max-width: 820px) {
  :root { --px: calc(100vw / 780); }

  .nav { height: 76px; padding: 0 16px; gap: 12px; }
  .nav__logo { width: 132px; }
  .nav__links { display: none; }
  .nav__lang, .nav__lang a { font-size: 13px; }
  .button--outline { height: 40px; padding: 0 14px; font-size: 13px; border-radius: 6px; }

  .hero { height: auto; padding: 84px 16px 28px; display: grid; }
  .hero__words { inset: 60px 0 auto 0; height: 118vw; }
  .hero__word { font-size: 240px; }
  .hero__word--far, .hero__word--low { display: none; }

  .hero__figure { position: relative; left: auto; top: auto; width: 80vw; height: auto; justify-self: end; margin: 34px -16px 0 0; }
  .hero__k { left: 16px; top: 92px; width: 19vw; height: auto; }
  .hero__stream { display: none; }

  .hero__copy { position: relative; left: auto; top: auto; margin-top: 3vw; }
  .hero__title { font-size: 17.4vw; line-height: 0.84; margin-left: -0.7vw; }
  .hero__sub { margin-top: 18px; font-size: 1.125rem; line-height: 1.35; max-width: 24ch; }
  .hero__actions { margin-top: 22px; gap: 22px; flex-wrap: wrap; }
  .button--solid { height: 52px; padding: 0 26px; font-size: 1.0625rem; border-radius: 6px; }
  .arrow-link { font-size: 1.0625rem; padding: 14px 0; }

  .hero__label { position: static; margin-top: 30px; font-size: 11px; }
}

@media (max-width: 820px) {
  .hero--map .hero__figure { width: 100%; margin: 96px 0 0; justify-self: stretch; }
}

/* Moving between the site's pages is one movement where the browser can do it (Chrome, Edge, Safari 18.2+).
   Every page of the site loads this file, so every page opts in: a page that did not would make the browser
   abandon the transition, and report it, when you arrive. motion.css names what travels. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__words { animation: none; }
  .hero.is-live .hero__k { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
