:root {
  --navy: #050b1a;
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, .78);
  --line: rgba(255, 255, 255, .26);
  --accent: #6f93ff;
  --gutter: max(44px, 6vw);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  background: var(--navy);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
}

/* ---------- BACKGROUND ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--navy);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.slide.is-active {
  opacity: 1; /* first photo is visible with no JavaScript */
}

.slide picture,
.slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.slide img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  transform-origin: 50% 55%;
  will-change: transform;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 11, 26, .6), rgba(5, 11, 26, 0) 68%),
    linear-gradient(180deg, rgba(5, 11, 26, .5) 0%, rgba(5, 11, 26, .22) 38%, rgba(5, 11, 26, .9) 100%);
}

/* ---------- LINE DRAWING ---------- */
.frame {
  position: fixed;
  inset: 20px;
  z-index: 2;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  overflow: visible;
  pointer-events: none;
}

.frame line,
.country-lines line {
  stroke: var(--line);
  stroke-width: 1;
  fill: none;
}

.frame-marks line {
  stroke: rgba(255, 255, 255, .5);
}

.frame [data-draw],
.country-lines [data-draw] {
  stroke-dasharray: 1;
}

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 44px;
  left: var(--gutter);
  z-index: 10;
}

.site-header img {
  display: block;
  width: 120px;
  height: auto;
}

/* ---------- LAYOUT ---------- */
.page {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
  padding: clamp(120px, 20vh, 200px) var(--gutter) 24px;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.headline {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(2.2rem, 5.2vw, 4.8rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.02em;
}

.headline .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}

.headline .wi {
  display: inline-block;
  will-change: transform;
}

.lede {
  margin: 24px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- COUNTRIES ---------- */
.countries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3vw;
}

.country {
  position: relative;
  padding-top: 28px;
}

.country-lines {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 2px;
  overflow: visible;
}

.country-lines .accent {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s var(--ease);
}

.country:hover .accent,
.country:focus-within .accent,
.country.is-active .accent {
  stroke-dashoffset: 0;
}

.country-inner {
  transition: opacity .6s var(--ease);
}

.countries.has-active .country:not(.is-active) .country-inner {
  opacity: .6;
}

.country-index {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--ink-soft);
}

.country h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -.01em;
}

.country p {
  margin: 0 0 26px;
  max-width: 28ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid rgba(255, 255, 255, .7);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}

.btn:hover,
.country.is-active .btn {
  background: var(--ink);
  color: var(--navy);
}

.btn:focus-visible,
.slideshow-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--gutter) max(28px, env(safe-area-inset-bottom));
  font-size: 12px;
  color: rgba(255, 255, 255, .62);
}

.slideshow-toggle {
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.slideshow-toggle:hover {
  color: var(--ink);
}

/* ---------- MOTION ARMED STATE (hidden until animated; removed by failsafe / reduced motion) ---------- */
.armed .stage {
  clip-path: inset(100% 0 0 0);
}

.armed [data-reveal],
.armed .country {
  opacity: 0;
}

.armed .frame [data-draw],
.armed .country-lines [data-draw] {
  stroke-dashoffset: 1;
}

.armed .frame-marks {
  opacity: 0;
}

/* ---------- TABLET / MOBILE ---------- */
@media (max-width: 900px) {
  :root {
    --gutter: 44px;
  }

  /* logo scrolls away instead of overlapping stacked content */
  .site-header {
    position: absolute;
  }

  .hero {
    gap: 48px;
    padding-top: 140px;
  }

  .countries {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .country p {
    max-width: none;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 36px;
  }

  .frame {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }

  .site-header {
    top: 32px;
  }

  .site-header img {
    width: 96px;
  }

  .hero {
    padding-top: 120px;
  }

  .btn {
    width: 100%;
    padding: 14px 0;
    text-align: center;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .country-inner,
  .country-lines .accent {
    transition: none;
  }
}
