:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
  background: #091016;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }

.site-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  background-image: url("./background/maelifell-optimized.jpg");
  background-size: cover;
  background-position: center;
}

.site-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 13, 19, .84) 0%, rgba(6, 13, 19, .69) 42%, rgba(6, 13, 19, .87) 100%);
}

.rain-glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
}

.rain-glass.is-visible {
  opacity: 1;
}

.site-frame {
  position: relative;
  z-index: 2;
  width: min(100% - 112px, 1380px);
  min-height: 100svh;
  margin-inline: auto;
  padding: 42px 0 clamp(58px, 9vh, 110px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.social-links {
  position: absolute;
  top: 34px;
  right: -6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  opacity: .78;
  transition: opacity .2s ease, transform .2s ease;
}

.social-links img {
  display: block;
  width: 18px;
  height: 18px;
}

.social-links a:hover,
.social-links a:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
}

.social-links a:focus-visible,
.credits a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.credits {
  position: absolute;
  right: 0;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.62);
  font-size: .65rem;
  font-weight: 300;
  letter-spacing: .1em;
  text-transform: none;
}

.credits a {
  color: inherit;
  text-decoration: none;
  border-radius: 2px;
}

.credits a:hover { color: #fff; }

.masthead {
  width: 100%;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.signature-logo {
  width: 216px;
  height: auto;
  margin-bottom: 23px;
}

h1 {
  margin: 0;
  width: min(100%, 620px);
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: .025em;
  text-transform: lowercase;
  white-space: nowrap;
}

.name-parts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.name-dot,
.last-original,
.last-hover { transition: opacity .25s ease; }

.last-name {
  position: relative;
  justify-self: start;
}

.last-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

@media (hover: hover) {
  h1:hover .name-dot,
  h1:hover .last-original { opacity: 0; }
  h1:hover .last-hover { opacity: 1; }
}

.first-name { justify-self: end; }

.timeline { width: 100%; }

.chapters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chapter {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-link {
  width: min(100%, 210px);
  height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}

.logo-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}

.logo-stage {
  position: relative;
  width: 100%;
  height: 104px;
  flex: 0 0 auto;
}

.company-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  height: auto;
  object-fit: contain;
  max-width: 85%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .32s ease, filter .32s ease, transform .32s ease;
}

.idega-logo { width: 160px; }
.greenqloud-logo { width: 148px; }
.redstapler-logo { width: 138px; }
.netapp-logo { width: 190px; }
.vast-logo { width: 152px; }

.successor-logo {
  opacity: 0;
  filter: blur(7px);
  transform: translate(-50%, -50%) scale(.9);
}

.swap-link:hover .original-logo,
.swap-link:focus-visible .original-logo {
  opacity: 0;
  filter: blur(7px);
  transform: translate(-50%, -50%) scale(1.07);
}

.swap-link:hover .successor-logo,
.swap-link:focus-visible .successor-logo {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, -50%) scale(1);
}

.idega-link:hover .idega-logo,
.idega-link:focus-visible .idega-logo {
  transform: translate(-50%, -50%) scale(1.05);
}

.acquired-note {
  opacity: 0;
  transform: translateY(5px);
  color: rgba(255,255,255,.85);
  font-size: .66rem;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity .32s ease, transform .32s ease;
}

.swap-link:hover .acquired-note,
.swap-link:focus-visible .acquired-note {
  opacity: 1;
  transform: translateY(0);
}

.chapter-year {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.4rem, 1.9vw, 1.9rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: .04em;
  text-align: center;
}

@media (max-width: 760px) {
  .site-shell::before {
    background: linear-gradient(180deg, rgba(6,13,19,.88), rgba(6,13,19,.78) 48%, rgba(6,13,19,.92));
  }

  .site-frame {
    width: min(100% - 40px, 520px);
    padding: 24px 0 54px;
  }

  .social-links { top: 17px; right: -6px; }
  .credits {
    right: 0;
    bottom: 16px;
    left: 0;
    justify-content: center;
    gap: 8px;
    font-size: .58rem;
  }

  .signature-logo { width: 164px; margin-bottom: 20px; }
  h1 { font-size: clamp(1.8rem, 6.5vw, 3rem); letter-spacing: .015em; }
  .logo-link { height: 102px; }
  .logo-stage { height: 82px; }
  .idega-logo { width: 98px; }
  .greenqloud-logo { width: 91px; }
  .redstapler-logo { width: 93px; }
  .netapp-logo { width: 112px; max-width: 96%; }
  .vast-logo { width: 101px; max-width: 96%; }
  .acquired-note { font-size: .55rem; letter-spacing: .04em; }
  .chapter-year { margin-top: 12px; font-size: clamp(1.15rem, 3.6vw, 1.5rem); }
}

@media (max-width: 440px) {
  .signature-logo { width: 140px; }
  h1 { font-size: clamp(1.5rem, 6.5vw, 1.95rem); }
  .logo-stage { height: 74px; }
  .idega-logo { width: 82px; }
  .greenqloud-logo { width: 76px; }
  .redstapler-logo { width: 78px; }
  .netapp-logo { width: 90px; }
  .vast-logo { width: 86px; }
  .acquired-note { font-size: .48rem; letter-spacing: 0; }
}

@media (hover: none) {
  .swap-link .acquired-note { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .company-logo, .acquired-note, .rain-glass, .social-links a, .name-dot, .last-original, .last-hover { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .masthead { animation: rise-in .7s both; }
  .timeline { animation: rise-in .8s .12s both; }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
