/* ==========================================================================
   ABBA Marketing — Landing styles
   Mobile-only: base rules match the 390px reference 1:1.
   On screens >= 480px the whole page is scaled up as one unit via
   transform:scale() (see the "Wide-screen scaling" block). No separate
   desktop layout.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--c-body);
  color: var(--c-ink);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--c-accent);
  text-decoration: none;
}
a:hover {
  color: var(--c-accent-hover);
}

img {
  display: block;
  max-width: 100%;
}

input,
textarea,
select,
button {
  font-family: inherit;
}
input::placeholder,
textarea::placeholder {
  color: var(--c-placeholder);
}

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

/* Outer container that reserves the (possibly scaled) page height. */
.viewport {
  width: 100%;
}

/* Fluid on native mobile (matches the full-bleed header exactly — no side
   gaps on phones wider than the 390px reference, e.g. 412/414/430px).
   On wide screens `html.is-scaled` pins this back to 390px and applies
   transform:scale() so it fills the viewport as one unit. */
.page-scale {
  width: 100%;
  margin: 0 auto;
}

.page {
  background: var(--c-page);
  overflow: hidden;
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes abba-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@keyframes abba-fill {
  0% {
    transform: scaleX(0);
  }
  24.9% {
    transform: scaleX(1);
  }
  25% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(0);
  }
}

/* ==========================================================================
   Header (full-width bar — spans edge-to-edge on every screen so page
   content never peeks through around it; see .is-scrolled for the opaque
   state once the user scrolls past the hero).
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}
.site-header.is-scrolled {
  background: var(--header-scrolled-bg);
  backdrop-filter: var(--header-scrolled-blur);
  -webkit-backdrop-filter: var(--header-scrolled-blur);
  box-shadow: var(--header-scrolled-shadow);
}

.site-header__logo {
  height: 30px;
  width: auto;
  filter: none;
  transition: filter 0.3s ease;
}
.site-header.is-scrolled .site-header__logo {
  filter: invert(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Desktop nav — hidden on mobile */
.site-nav {
  display: none;
}

.chrome-btn {
  height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--chrome-border-top);
  background: transparent;
  color: var(--chrome-color-top);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}
.site-header.is-scrolled .chrome-btn {
  border-color: var(--chrome-border-scrolled);
  color: var(--chrome-color-scrolled);
}
.chrome-btn--lang {
  padding: 0 12px;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}
.chrome-btn--menu {
  width: 36px;
  padding: 0;
}

/* CTA button in the desktop header */
.header-cta {
  display: none;
}

/* ==========================================================================
   Mobile dropdown menu
   ========================================================================== */
.menu-panel {
  position: fixed;
  z-index: 61;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 358px;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  padding: 8px;
  box-shadow: 0 22px 48px rgba(6, 14, 24, 0.24);
}
.menu-panel[hidden] {
  display: none;
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-menu-item);
  color: #16202b;
}
.menu-item:hover {
  background: rgba(47, 111, 228, 0.07);
  color: #16202b;
}
.menu-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-item__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.menu-item__sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted-3);
}
.menu-sep {
  height: 1px;
  background: rgba(15, 26, 38, 0.07);
  margin: 2px 12px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--c-hero-fallback) center / cover no-repeat;
}
.hero__bg--alt {
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__bg--alt.is-active {
  opacity: 1;
}
.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 76px 20px 28px;
}
.hero__kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  margin-bottom: 12px;
}
.hero__title {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero__subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 24px;
}
.hero__cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border-radius: var(--r-pill);
  background: var(--c-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-primary:hover {
  background: var(--c-accent-hover);
  color: #fff;
}
.hero__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
}
.hero__bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.hero__bar-fill {
  width: 100%;
  height: 100%;
  background: #fff;
  transform-origin: left center;
  transform: scaleX(0);
  animation: abba-fill 12s linear infinite both;
}
.hero__bar-fill--2 {
  animation-delay: 6s;
}
.hero__count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  flex: 0 0 auto;
}

/* ==========================================================================
   Brands marquee
   ========================================================================== */
.brands {
  position: relative;
  overflow: hidden;
  padding: 34px 0 36px;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: 84px; /* keep content clear of the fixed header on anchor-jump */
}
.brands__label {
  position: relative;
  z-index: 1;
  padding: 0 20px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.brands__viewport {
  position: relative;
  z-index: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}
.brands__track {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: abba-marquee 26s linear infinite;
}
.brand-plate {
  width: 132px;
  height: 64px;
  border-radius: var(--r-plate);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-brand-plate);
  flex: 0 0 auto;
  padding: 0 10px;
  text-align: center;
}
.brand-plate img {
  max-height: 40px;
  max-width: 108px;
  width: auto;
  object-fit: contain;
}

/* ==========================================================================
   Portfolio
   ========================================================================== */
.portfolio {
  padding: 40px 20px 44px;
  scroll-margin-top: 84px; /* keep content clear of the fixed header on anchor-jump */
}
.section-head {
  text-align: center;
  margin-bottom: 22px;
}
.section-head__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 10px;
}
.section-head__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}
.portfolio__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pf-card {
  position: relative;
  height: var(--card-h, 150px);
  border-radius: var(--r-card);
  overflow: hidden;
  background: #eef0f3 center / cover no-repeat;
  display: block;
}
.pf-card[data-span="2"] {
  grid-column: span 2;
}
.pf-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-card__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px;
  background: var(--grad-card);
}
.pf-card[data-span="2"] .pf-card__cap {
  padding: 14px 16px;
}
.pf-card__brand {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.pf-card[data-span="2"] .pf-card__brand {
  font-size: 15px;
}
.pf-card__tags {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

/* ==========================================================================
   Form
   ========================================================================== */
.form-section {
  background: var(--c-form-bg);
  padding: 36px 20px 42px;
  border-top: 1px solid var(--c-border);
  scroll-margin-top: 84px; /* keep content clear of the fixed header on anchor-jump */
}
.form-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.form-card__banner {
  height: 180px;
  background: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-card__banner img {
  height: 44px;
  width: auto;
}
.form-card__body {
  padding: 26px 20px 28px;
}
.form-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.028em;
  margin: 0 0 8px;
}
.form-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-muted-2);
  margin: 0 0 22px;
}
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-label);
}
.field__input {
  height: 46px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-input-border);
  background: #fff;
  font-size: 14px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.15s ease;
}
.field__input:focus {
  border-color: var(--c-accent);
}
.form-submit {
  width: 100%;
  height: 50px;
  margin-top: 20px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--c-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.form-submit:hover {
  background: var(--c-accent-hover);
}
.form-submit:disabled {
  opacity: 0.7;
  cursor: default;
}
.form-hint {
  font-size: 12px;
  color: var(--c-muted-2);
  margin-top: 12px;
}
.form-hint.is-error {
  color: var(--c-error);
}

/* Success state */
.form-success[hidden] {
  display: none;
}
.form-success {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.form-success__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-success__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
.form-success__text {
  margin: 0;
  font-size: 14px;
  color: var(--c-muted-2);
}
.form-body[hidden] {
  display: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--c-footer);
  padding: 30px 20px 34px;
}
.site-footer__logo {
  height: 28px;
  width: auto;
}
.site-footer__tag {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
}

/* ==========================================================================
   Wide-screen scaling — the 390px mobile design, blown up as one unit.
   JS adds `.is-scaled` to <html> and sets `--page-scale` = 100vw / 390
   whenever the viewport is >= 480px. Below that, phones render the design
   natively (scale 1, no transform, crisp text).

   The header and dropdown menu are position:fixed and live OUTSIDE the
   scaled wrapper (a transformed ancestor would break their viewport
   anchoring on scroll), so they carry their own matching transform here.
   ========================================================================== */
html.is-scaled .page-scale {
  /* Restore the fixed 390px reference width the JS scale math assumes
     (vw / 390) — the native rule above makes this fluid for phones. */
  width: 390px;
  max-width: none;
  transform-origin: top center;
  transform: scale(var(--page-scale, 1));
}
html.is-scaled .site-header {
  top: 0;
  /* Width is pre-shrunk by 1/scale so that, once scaled back up, the bar
     still spans exactly 100% of the real viewport (not scale% of it). */
  width: calc(100% / var(--page-scale, 1));
  transform-origin: top left;
  transform: scale(var(--page-scale, 1));
}
html.is-scaled .menu-panel {
  top: calc(72px * var(--page-scale, 1));
  max-width: none;
  transform-origin: top center;
  transform: translateX(-50%) scale(var(--page-scale, 1));
}

/* ==========================================================================
   Scroll reveal — sections/cards fade + rise into place the first time
   they cross into view. JS (IntersectionObserver) toggles `.is-visible`
   once, then stops watching — this never re-hides on scroll-up.
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero content: already on screen at load, so it gets a quick staggered
   entrance instead of a scroll trigger. */
@keyframes abba-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero__kicker,
.hero__title,
.hero__subtitle,
.hero__cta-row,
.hero__progress {
  opacity: 0;
  animation: abba-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero__kicker {
  animation-delay: 0.05s;
}
.hero__title {
  animation-delay: 0.15s;
}
.hero__subtitle {
  animation-delay: 0.28s;
}
.hero__cta-row {
  animation-delay: 0.4s;
}
.hero__progress {
  animation-delay: 0.5s;
}

/* Reduced motion: disable the looping animations. */
@media (prefers-reduced-motion: reduce) {
  .brands__track,
  .hero__bar-fill,
  .hero__bg--alt,
  .reveal,
  .hero__kicker,
  .hero__title,
  .hero__subtitle,
  .hero__cta-row,
  .hero__progress {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
