:root {
  color-scheme: dark;
  --night: #090f17;
  --hero: #0f1723;
  --ink: #f5f4f0;
  --muted: #bdc6d2;
  --warm: #edc08c;
  --rule: #2d3948;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 81% -15%, #192b40, transparent 58%), var(--night);
  color: var(--ink);
  font: 1rem/1.55 "Inter", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

a { color: inherit; }

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

h1, h2, p, ul, address { margin: 0; }

.page {
  width: min(100% - 84px, 1200px);
  margin: auto;
  padding-bottom: 20px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 87px;
  padding-inline: 2px;
}

.location {
  color: var(--muted);
  font-size: .94rem;
  font-weight: 500;
}

.language {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #0d152099;
}

.language a {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 34px;
  padding-inline: 6px;
  border-radius: 5px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.language a[aria-current], .language a:hover {
  background: #253243;
  color: var(--ink);
}

.intro {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(530px, 46.5vw, 620px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--hero);
  box-shadow: 0 21px 55px #02060d70, inset 0 1px 0 #ffffff0d;
}

.identity {
  z-index: 1;
  width: 56%;
  padding: clamp(36px, 5.5vw, 78px) 0 clamp(36px, 5.5vw, 78px) clamp(32px, 5.5vw, 78px);
}

.role {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: calc(2 * 1.4em);
  margin-bottom: 22px;
  color: var(--warm);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .085em;
  line-height: 1.4;
  text-transform: uppercase;
}

.role::before {
  content: "";
  flex: 0 0 24px;
  height: 1px;
  background: var(--warm);
}

.identity h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(4.25rem, 8.7vw, 8.6rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: -.028em;
}

.identity h1 span { display: block; }
.identity h1 span:last-child { color: #f3d7b7; }

.description {
  max-width: 42ch;
  min-height: calc(3 * 1.55em);
  margin-top: 25px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
}

.portrait {
  position: absolute;
  inset: 0 0 0 auto;
  width: 56%;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 5%;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--hero) 0%, #0f1723eb 18%, #0f172399 30%, transparent 56%),
    linear-gradient(0deg, #090f176b, transparent 39%);
  pointer-events: none;
}

.contacts {
  display: flex;
  gap: 9px;
  margin-top: 29px;
  font-style: normal;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .94rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.contact-link {
  flex: 0 0 auto;
  border-color: #697381;
  background: #101824b3;
}

.contact-link--whatsapp { --contact-accent: #25d366; --contact-tint: #25d36614; }
.contact-link--telegram { --contact-accent: #26a5e4; --contact-tint: #26a5e414; }
.contact-link--linkedin { --contact-accent: #0a66c2; --contact-tint: #0a66c214; }

.contact-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: fill 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .contact-link:hover {
    border-color: var(--contact-accent);
    color: var(--contact-accent);
    background: var(--contact-tint);
  }
}

.contact-link:focus-visible,
.contact-link:active {
  border-color: var(--contact-accent);
  color: var(--contact-accent);
  background: var(--contact-tint);
}

.experience {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 57px 2px 31px;
}

.experience h2 {
  flex: 0 0 192px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 500;
}

.experience ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 540px;
  max-width: 730px;
  padding: 0;
  list-style: none;
}

.company {
  position: relative;
  min-width: 0;
}

.company-trigger {
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: 52px;
  padding: 8px 9px 10px;
  border: 1px solid #1f2a38;
  border-radius: 8px;
  background: #0d1520;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .company-trigger:hover {
    border-color: #3a4b61;
    background: #131e2c;
  }
}

.company-trigger:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 2px;
}

.company-trigger img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: var(--logo-height, 28px);
  object-fit: contain;
  object-position: center bottom;
  transition: opacity 160ms ease;
}

.company-trigger .severstal-color {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: var(--logo-height, 28px);
  background-color: #00407e;
  -webkit-mask-image: url("./logos/severstal-distribution-white.webp");
  mask-image: url("./logos/severstal-distribution-white.webp");
  mask-mode: alpha;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: opacity 160ms ease;
}

/* Balance optical wordmark height across different logo aspect ratios. */
.company-trigger[aria-controls="antalis-info"] { --logo-height: 29px; }
/* The raised Severstal emblem takes up part of the image height. */
.company-trigger[aria-controls="severstal-distribution-info"] { --logo-height: 33px; }
.company-trigger[aria-controls="proks-info"] { --logo-height: 24px; }
.company-trigger[aria-controls="joyou-info"] { --logo-height: 27px; }

.company-color { opacity: 0; }
.company-trigger[aria-expanded="true"] {
  border-color: #f4f2ec;
  background: #f4f2ec;
  box-shadow: 0 4px 14px #02060d66;
}
.company-trigger[aria-expanded="true"] img:first-child { opacity: 0; }
.company-trigger[aria-expanded="true"] .company-color { opacity: 1; }

.company:has(.company-trigger[aria-expanded="true"]) { z-index: 1; }

.company-card {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 100%;
  left: 50%;
  width: min(272px, calc(100vw - 36px));
  height: auto;
  margin: 0;
  padding: 0 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  max-width: none;
  max-height: none;
  transform: translateX(-50%);
}

.company:first-child .company-card { left: 0; transform: none; }
.company:last-child .company-card { right: 0; left: auto; transform: none; }

@media (min-width: 761px) {
  .company-card.card-below {
    top: 100%;
    bottom: auto;
    padding: 8px 0 0;
  }
}

.company-card::backdrop {
  background: #02060db3;
  animation: card-backdrop-enter 180ms ease-out;
}

.company-card-content {
  position: relative;
  padding: 14px 16px 15px;
  border: 1px solid #45556a;
  border-radius: 9px;
  background: #172332;
  box-shadow: 0 12px 28px #02060d80;
  animation: company-card-enter 180ms ease-out;
}

.card-close { display: none; }

.company-card strong { color: var(--warm); }
.company-card p { margin-top: 5px; color: var(--ink); font-size: .9rem; line-height: 1.5; }

@keyframes company-card-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .page { width: min(100% - 32px, 540px); margin-block: 0; padding-bottom: 16px; }
  .masthead { min-height: 71px; gap: 8px; }
  .language a { min-width: 37px; min-height: 36px; }
  .intro { display: block; min-height: 0; border-radius: 15px; }
  .identity {
    position: relative;
    width: auto;
    padding: clamp(250px, 63vw, 375px) 21px 25px;
  }
  .identity h1 { font-size: clamp(3.35rem, 12.5vw, 5.7rem); }
  .role { gap: 8px; margin-bottom: 15px; letter-spacing: .06em; }
  .role::before { flex-basis: 14px; }
  .description { min-height: calc(4 * 1.55em); margin-top: 17px; }
  .contacts { margin-top: 21px; }
  .contact-link { gap: 7px; padding-inline: 10px; font-size: .9rem; }
  .portrait { inset: 0 0 auto; width: 100%; height: clamp(293px, 73vw, 438px); }
  .portrait img { object-position: center 9%; }
  .portrait::after { background: linear-gradient(0deg, var(--hero) 0%, #0f1723ed 18%, #0f1723a6 34%, transparent 62%); }
  .experience { flex-direction: column; align-items: flex-start; gap: 9px; padding-top: 18px; }
  .experience h2 { flex: 0 0 auto; width: 192px; }
  .experience ul { flex: 0 0 auto; width: 100%; }

  .company:has(.company-trigger[aria-expanded="true"]) { z-index: 40; }
  .company-trigger[aria-expanded="true"] {
    border-color: #edc08c80;
    background: #131e2c;
    box-shadow: none;
  }
  .company-trigger[aria-expanded="true"] img:first-child { opacity: 1; }
  .company-trigger[aria-expanded="true"] .company-color { opacity: 0; }

  .company-card,
  .company:first-child .company-card,
  .company:last-child .company-card {
    position: fixed;
    inset: auto 16px calc(16px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow-y: auto;
    transform: none;
  }

  .company-card-content {
    padding-right: 42px;
    border-radius: 12px;
    box-shadow: 0 -12px 40px #02060d99;
  }

  .card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  .card-close:hover {
    background: #253243;
    color: var(--ink);
  }

  .card-close:focus-visible {
    outline: 2px solid var(--warm);
    outline-offset: 2px;
  }
}

@media (max-width: 480px) {
  .experience { gap: 8px; }
  .experience h2 { width: auto; }
  .experience ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    max-width: none;
  }
  .company-trigger { min-height: 52px; padding: 7px 5px; }
  .contacts { flex-direction: column; }
  .contact-link { width: 100%; flex: 0 0 auto; }
  .description { min-height: calc(4 * 1.55em); }
  .role { min-height: calc(2 * 1.4em); }
}

@media (max-width: 390px) {
  .experience ul {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin-inline: -2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .company { flex: 0 0 68px; scroll-snap-align: start; }
}

@media (max-width: 360px) {
  .description { min-height: calc(5 * 1.55em); }
  .role { min-height: calc(3 * 1.4em); }
}

@media (min-width: 761px) and (max-width: 860px) {
  .contact-link { gap: 6px; padding-inline: 8px; font-size: .84rem; }
  .description { min-height: calc(4 * 1.55em); }
}

@media (forced-colors: active) {
  .language a[aria-current] { outline: 1px solid; }
  .contact-link { border-color: LinkText; }
}

@media (prefers-reduced-motion: reduce) {
  .language a, .contact-link, .contact-icon,
  .company-trigger, .company-trigger img, .company-trigger .severstal-color { transition: none; }
  .company-card-content, .company-card::backdrop { animation: none; }
}
