:root {
  --dark: #121217;
  --text: #babdc6;
  --heading: #eff1f6;
  --scarlet: #cc0033;
  --display: 'Space Grotesk', Arial, sans-serif;
  --body: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--dark);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 8px 12px;
  color: var(--dark);
  background: var(--heading);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.header-inner,
.hero-inner,
.content {
  width: min(1080px, calc(100% - 64px));
  margin: 0 auto;
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--heading);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
}

nav a:hover,
nav a:focus-visible {
  color: var(--heading);
}

.hero-inner {
  min-height: 300px;
  padding: 36px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 40px;
}

h1,
h2 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-weight: 500;
}

h1 {
  max-width: 720px;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.button {
  width: fit-content;
  margin-top: 18px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--scarlet);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
}

.button:hover,
.button:focus-visible {
  background: #eb174c;
}

.hero-logo {
  width: 250px;
  height: 250px;
  display: block;
  object-fit: contain;
}

.about {
  padding: 48px 0 56px;
}

.contests {
  padding: 0 0 56px;
}

h2 {
  margin-bottom: 20px;
  font-size: 26px;
}

.content p {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.contests h2 {
  margin-bottom: 6px;
}

.content .contest-intro {
  margin-bottom: 16px;
}

.contest-list {
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contest-tile {
  min-width: 0;
  padding: 16px;
  background: #18181e;
  border: 1px solid #292930;
  border-radius: 7px;
}

.contest-logo {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contest-logo img {
  display: block;
  object-fit: contain;
}

.icpc-logo {
  width: 150px;
  max-width: 100%;
}

.rupc-logo {
  width: 72px;
  height: 72px;
}

.codeforces-logo {
  width: 80px;
  max-width: 100%;
  height: 63px;
}

.contest-list h3 {
  margin: 12px 0 5px;
  color: var(--heading);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
}

.contest-tile:hover h3,
.contest-tile:focus-visible h3 {
  color: var(--scarlet);
}

.contest-list p {
  margin: 7px 0 0;
  color: var(--heading);
  font-size: 14px;
  line-height: 1.45;
}

.contest-list p.contest-description {
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.contest-list time {
  color: inherit;
  font-size: inherit;
}

.content .contact-email {
  max-width: none;
  margin: 28px 0 0;
  text-align: center;
  font-size: 14px;
}

.text-link {
  color: var(--heading);
  border-bottom: 1px solid #555760;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--scarlet);
  border-color: var(--scarlet);
}

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .hero-logo {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 900px) {
  .contest-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .header-inner,
  .hero-inner,
  .content {
    width: calc(100% - 40px);
  }

  .hero-inner {
    min-height: 280px;
    padding: 32px 0 40px;
  }

  h1 {
    font-size: 40px;
  }

  .about {
    padding: 44px 0 50px;
  }

  .contests {
    padding-bottom: 50px;
  }

  .contest-list {
    grid-template-columns: 1fr;
  }
}
