:root {
  color-scheme: dark;
  --page: #0b0c0e;
  --text: #f7f6f5;
  --muted: #c0bec3;
  --accent: #ff5d6c;
  --action: #c6132e;
  --line: rgba(255, 255, 255, .14);
  --plan-pattern: url('assets/pohjapiirros-tausta.svg?v=3');
  --plan-size: clamp(920px, 105vw, 1480px) auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page) var(--plan-pattern) center top / var(--plan-size) repeat-y;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 5px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2;
  padding: .75rem 1rem;
  background: var(--text);
  color: var(--page);
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4.75vw, 68px);
}

.topbar {
  background: rgba(8, 9, 10, .62);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 32px);
}

.brand {
  display: block;
  width: clamp(150px, 24vw, 305px);
  min-width: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 1;
  object-fit: cover;
  mix-blend-mode: lighten;
}

.brand-slogan {
  display: flex;
  align-items: center;
  gap: .46em;
  margin: -1px 0 2px 3%;
  color: var(--text);
  font-size: clamp(.625rem, 1.1vw, .82rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-slogan::before {
  content: '';
  flex: 0 0 auto;
  width: clamp(7px, .85vw, 11px);
  height: 1px;
  border-radius: 1px;
  background: var(--accent);
}

.brand-slogan strong {
  color: var(--accent);
  font-weight: inherit;
}

.brand:has(.brand-slogan) {
  padding-block: 4px;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 23px);
  min-height: 54px;
  padding: 9px 12px 9px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease;
}

.button-arrow {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
  font: 1rem / 1 system-ui, sans-serif;
}

.button-primary {
  background: var(--action);
  border-color: #e2364d;
}

.button-primary:hover {
  background: #a90f27;
  border-color: var(--accent);
}

.button-outline {
  min-height: 44px;
  padding-block: 7px;
  border-color: var(--line);
  background: #111215;
}

.button-outline .button-arrow {
  width: 26px;
  height: 26px;
  color: var(--accent);
  border-color: var(--line);
}

.button-outline:hover {
  background: #202125;
  border-color: #5d5e64;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(530px, 47vw, 675px);
  overflow: hidden;
}

.hero-media,
.hero::before,
.hero::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media {
  z-index: -2;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 95% center;
  opacity: 0;
}

.hero-image.is-outgoing {
  z-index: 1;
  opacity: 1;
}

.hero-image.is-current {
  z-index: 2;
  opacity: 1;
}

.hero::before {
  content: '';
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 8, 10, .96), rgba(7, 8, 10, .78) 29%, rgba(7, 8, 10, .52) 50%, rgba(7, 8, 10, .07) 78%),
    linear-gradient(0deg, rgba(7, 8, 10, .26), transparent 34%);
}

.hero::after {
  content: '';
  z-index: -1;
  background: var(--plan-pattern) center top / var(--plan-size) repeat-y;
  mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, .65) 35%, transparent 66%);
  opacity: .65;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-image {
    transform-origin: 90% 50%;
  }

  .hero-image:is(.is-current, .is-outgoing) {
    animation: hero-approach 7s ease-out both paused;
  }

  .hero-media.is-playing .hero-image.is-current {
    animation-play-state: running;
  }

  .hero-media.is-changing .hero-image.is-current {
    animation:
      hero-dissolve 1.35s cubic-bezier(.22, .64, .35, 1) both,
      hero-approach 7s ease-out both paused;
  }

  .hero-media.is-changing.is-playing .hero-image.is-current {
    animation-play-state: running, running;
  }

  @keyframes hero-dissolve {
    from { opacity: 0; translate: .65% 0; }
    to { opacity: 1; translate: 0 0; }
  }

  @keyframes hero-approach {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
  }
}

.hero-controls {
  position: absolute;
  right: max(clamp(18px, 4.75vw, 68px), calc((100% - 1440px) / 2 + 68px));
  bottom: clamp(18px, 2.5vw, 36px);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 9px;
  background: rgba(10, 11, 13, .87);
  backdrop-filter: blur(8px);
}

.hero-controls[hidden],
.hero-controls button[hidden] {
  display: none;
}

.hero-controls button {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #d9d6d9;
  font: 600 .75rem / 1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.hero-controls button:hover {
  background: rgba(255, 255, 255, .12);
}

.hero-controls button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -3px;
}

.hero-controls button[aria-current="true"] {
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 -2px var(--accent);
  color: #fff;
}

.hero-controls .hero-playback {
  margin-left: 3px;
  border-left: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
}

.hero-pause-icon,
.hero-playback[data-playing="true"] .hero-play-icon {
  display: none;
}

.hero-playback[data-playing="true"] .hero-pause-icon {
  display: initial;
}

.hero-content {
  padding-block: clamp(60px, 8vw, 105px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #e4dfe2;
  font-size: .6875rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  flex: 0 0 24px;
  height: 2px;
  background: var(--accent);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.75rem, 4.9vw, 4.65rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.062em;
  text-shadow: 0 3px 24px rgba(0, 0, 0, .4);
}

.hero h1 > span {
  display: block;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-description {
  max-width: 41ch;
  margin-block: 22px 30px;
  color: #e2dfe0;
  font-size: clamp(1rem, 1.4vw, 1.1875rem);
  line-height: 1.65;
}

.spaces {
  padding-block: clamp(54px, 7.1vw, 100px);
}

.spaces-header {
  margin-bottom: clamp(22px, 3vw, 36px);
}

.spaces h2, .contact h2 {
  margin-top: 11px;
  font-size: clamp(1.95rem, 4vw, 3.65rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.052em;
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.65vw, 24px);
}

.space-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.9;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #17181a;
}

.space-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .88) 100%);
}

.space-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.space-card h3 {
  position: absolute;
  z-index: 1;
  inset-inline: clamp(16px, 2.1vw, 30px);
  bottom: clamp(17px, 2.1vw, 28px);
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  font-size: clamp(1.0625rem, 1.65vw, 1.375rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.015em;
}

.service-tiles {
  margin-top: clamp(34px, 5vw, 64px);
}

.service-tiles h2 {
  margin: 0 0 clamp(16px, 2.2vw, 27px);
  font-size: clamp(1.65rem, 3vw, 2.65rem);
}

.space-card-link {
  display: block;
  text-decoration: none;
}

.space-card-link:hover {
  border-color: var(--accent);
}

.space-card-link img {
  object-position: 76% center;
}

.space-card-link h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.space-card-link .sales-arrow {
  flex: none;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(24px, 5.15vw, 74px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(21, 22, 25, .32), transparent 72%),
    var(--plan-pattern) center 52% / var(--plan-size) repeat-y,
    radial-gradient(ellipse at top right, #2b161c, transparent 64%) #151619;
}

.contact h2 {
  max-width: 16ch;
}

.contact-description {
  max-width: 44ch;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.65;
}

.contact-action {
  display: grid;
  justify-items: center;
  gap: 13px;
}

.contact-address {
  color: var(--muted);
  font-size: .875rem;
  text-decoration-color: #65636b;
  text-underline-offset: 4px;
}

.contact-address:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.footer {
  padding-block: 28px 34px;
  color: #a7a5ab;
  font-size: .8125rem;
}

@media (max-width: 960px) {
  .hero {
    --hero-media-height: clamp(255px, 83vw, 400px);
    min-height: 0;
    padding-top: calc(var(--hero-media-height) - 24px);
  }

  .hero-media {
    height: var(--hero-media-height);
  }

  .hero-image {
    object-position: right center;
  }

  .hero-image.hero-image-service {
    object-position: 76% center;
  }

  .hero::before {
    height: calc(var(--hero-media-height) + 10px);
    background: linear-gradient(180deg, transparent 56%, rgba(11, 12, 14, .12) 74%, var(--page) 96%);
  }

  .hero::after {
    content: none;
  }

  .hero-content {
    padding-block: 22px 46px;
  }

  .hero-controls {
    top: 12px;
    right: clamp(12px, 4.75vw, 32px);
    bottom: auto;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    min-height: 70px;
  }

  .button-outline {
    gap: 8px;
    padding-inline: 11px 8px;
    font-size: .8125rem;
  }

  .button-outline .button-arrow {
    width: 23px;
    height: 23px;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 9vw, 3.35rem);
  }

  .space-grid, .contact-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .space-card {
    aspect-ratio: 4 / 3;
  }

  .contact-action {
    justify-items: start;
  }
}

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