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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

img {
  display: block;
}

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

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

/* ---------- shared components ---------- */

/* button — Figma: components / button
   Width never changes: on hover the arrow (24px + 4px gap) grows in while the
   label's side padding (2 × 14px) shrinks by the same amount, so the label slides right. */
.button {
  --button-shift: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 16px 34px;
  border-radius: var(--radius-button);
  background: var(--color-lime);
  color: var(--color-black);
  font-size: 18px;
  font-weight: var(--weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.button__arrow {
  flex: none;
  width: 0;
  height: 24px;
  margin-right: 0;
  opacity: 0;
  transition: width var(--button-shift), margin-right var(--button-shift), opacity var(--button-shift);
}

.button__label {
  padding: 0 14px;
  transition: padding var(--button-shift);
}

.button:is(:hover, .is-hover) .button__arrow,
.button:focus-visible .button__arrow {
  width: 24px;
  margin-right: 4px;
  opacity: 1;
}

.button:is(:hover, .is-hover) .button__label,
.button:focus-visible .button__label {
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  .button__arrow,
  .button__label {
    transition: none;
  }
}

.button[disabled] {
  cursor: progress;
  opacity: 0.7;
}

/* language dropdown — Figma: components / dropdown */
.lang {
  position: relative;
}

.lang__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: var(--weight-bold);
}

.lang__chevron {
  width: 8px;
  height: 8px;
  margin: 0 3px 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.lang__toggle[aria-expanded="true"] .lang__chevron {
  transform: translateY(4px) rotate(-135deg);
}

/* Open list: plain bold words under the toggle, text lined up with "eng" above;
   the current language is lime with a diamond hanging to its left.
   Black behind it on the site (it can open over photos), none on the login sky. */
.lang__list {
  --lang-pad: 24px; /* room for the diamond */
  position: absolute;
  left: calc(-1 * var(--lang-pad));
  top: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 16px 16px 16px var(--lang-pad);
  list-style: none;
  background: var(--color-bg); /* the page's own black, so the panel doesn't read as a darker box */
}

/* drafts hidden on the live site (js/lang.js shows them locally) — wins over any display rule */
[data-draft][hidden] {
  display: none !important;
}

.lang__list[hidden] {
  display: none;
}

/* Opening: the words drop in one after another (6px down + fade).
   Closing (.is-closing, set by lang.js for 150ms): the whole list fades out. */
.lang__list {
  animation: lang-fade 0.2s ease both; /* the black panel on site pages fades in too */
}

.lang__list > li {
  animation: lang-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lang__list > li:nth-child(2) { animation-delay: 0.05s; }
.lang__list > li:nth-child(3) { animation-delay: 0.1s; }

.lang__list.is-closing {
  animation: lang-out 0.15s ease both;
}

@keyframes lang-out {
  to { opacity: 0; }
}

@keyframes lang-fade {
  from { opacity: 0; }
}

@keyframes lang-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.lang__option {
  position: relative;
  display: block;
  padding: 0 0 2px;
  text-align: left;
  font-size: 18px;
  font-weight: var(--weight-bold);
  line-height: normal;
}

.lang__option[aria-current="true"] {
  color: var(--color-lime);
}

.lang__option[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -3px;
  background: currentColor;
  transform: rotate(45deg);
}

/* not translated yet — shown, but not clickable */
.lang__option[aria-disabled="true"] {
  cursor: default;
}

/* hover as on contact's phone: turns lime while a 1px line draws in from the left */
a.lang__option,
button.lang__option {
  text-decoration: none; /* the line only draws in on hover */
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: color 0.15s ease, background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a.lang__option:not([aria-current="true"]):is(:hover, .is-hover),
button.lang__option:not([aria-current="true"]):is(:hover, .is-hover),
a.lang__option:not([aria-current="true"]):focus-visible,
button.lang__option:not([aria-current="true"]):focus-visible {
  color: var(--color-lime);
  background-size: 100% 1px;
}

/* ---------- green tag bars sliding in a loop (js/ticker.js) ----------
   32px, #A1FF00, Clash Display Bold 10 caps. Pages position them (top/bottom). */
.ticker {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  height: 32px;
  overflow: hidden;
  background: var(--color-lime-90);
}

.ticker__track {
  display: flex;
  flex: none;
  animation: ticker-left var(--ticker-duration, 30s) linear infinite;
}

.ticker[data-ticker="right"] .ticker__track {
  animation-name: ticker-right;
}

.ticker span:not(.ticker__track) {
  flex: none;
  padding-right: 64px; /* equal spacing so the loop is seamless */
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em; /* a touch of air between the capitals */
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes ticker-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes ticker-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ---------- project art on mobile (home cards, case-study heroes) ----------
   Layers instead of one flat image, so it can take any height: clouds (cropped
   to fill), the screen (scaled to fit inside 72px top/bottom and 24px
   left/right) and two tag bars 24px from the top and bottom edges. */
.art {
  position: relative;
  overflow: hidden;
}

.art__clouds {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art__screen {
  position: absolute;
  inset: 72px 24px;
  width: calc(100% - 48px);
  height: calc(100% - 144px);
  object-fit: contain;
}

.art picture {
  display: contents; /* the layers are positioned by their <img> */
}

.art .ticker--top { top: 24px; }
.art .ticker--bottom { top: auto; bottom: 24px; }

/* ---------- snackbar (js/toast.js) — black bar centered at the bottom ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: calc(100vw - 48px);
  padding: 0 16px;
  border-radius: var(--radius-button);
  background: var(--color-black);
  color: var(--color-white);
  font-size: 14px;
  font-weight: var(--weight-regular);
  line-height: 1.2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.35s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.toast__icon {
  flex: none;
  color: var(--color-lime);
}

/* On black pages (about) a black snackbar would vanish: lime with black text and star */
.about-page .toast {
  background: var(--color-lime);
  color: var(--color-black);
}

.about-page .toast__icon {
  color: var(--color-black);
}

/* over the lime mobile menu the snackbar is black again, wherever it opens */
.is-menu-open .toast {
  background: var(--color-black);
  color: var(--color-white);
}

.is-menu-open .toast__icon {
  color: var(--color-lime);
}

@media (max-width: 767px) {
  .button {
    height: 48px;
    font-size: 16px;
  }

  .lang__toggle,
  .lang__option {
    font-size: 16px;
  }

  /* one line: left: 50% would otherwise let it be only half the screen wide */
  .toast {
    bottom: 24px;
    width: max-content;
    white-space: nowrap;
  }

  /* contact on a phone: lime with black text and star, like on about */
  html:not(.is-menu-open) .contact-page .toast {
    background: var(--color-lime);
    color: var(--color-black);
  }

  html:not(.is-menu-open) .contact-page .toast__icon {
    color: var(--color-black);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none !important; }

  .lang__list,
  .lang__list.is-closing,
  .lang__list > li { animation: none; }

  .toast,
  .toast.is-visible {
    transform: translate(-50%, 0);
    transition: none;
  }
}

/* tablets (768–1199 wide, tokens.css): the button's label is body-sized, 16px */
@media (min-width: 768px) and (max-width: 1199px) {
  .button {
    font-size: 16px;
  }
}

/* "pause animations" on (js/site.js): buttons don't slide their arrow in */
.is-motion-paused :is(.button__arrow, .button__label) {
  transition: none;
}
