@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-bg: #eaf0f3;
  --color-text: #ffffff;
  --color-shade: 12, 34, 20;
  --color-accent: #97b710;
  --color-icon-hover: rgba(255, 255, 255, 0.175);
  --color-icon-active: rgba(255, 255, 255, 0.35);

  --font-main: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-size-base: clamp(15px, 0.9rem + 0.4vw, 20px);
  --font-size-title: clamp(2.4rem, 1rem + 7vw, 5.5rem);
  --font-size-subtitle: 1.25em;
  --font-weight-light: 300;
  --font-weight-black: 900;

  --space-xs: 0.25em;
  --space-s: 0.75em;
  --space-m: 1.5em;
  --space-l: 3em;
  --icon-size: 1.75em;
  --icon-ring: 2.5em;
  --icon-slot: 5.35em;
  --footer-height: 6em;

  --tile-ratio: 16 / 9;
  --tile-w: calc(100lvh * var(--tile-ratio));

  --duration-bg: 60s;
  --duration-page: 3s;
  --duration-overlay: 1.5s;
  --delay-overlay: 1.5s;
  --duration-header: 1s;
  --delay-header: 2.25s;
  --duration-icon: 0.5s;
  --delay-icon: 2.25s;
  --delay-icon-step: 0.25s;
  --duration-ui: 0.2s;

  --shadow-text: 0 1px 2px rgba(var(--color-shade), 0.35), 0 2px 24px rgba(var(--color-shade), 0.45);
  --overlay-noise: url("assets/images/overlay-noise.png");
  --overlay-square: max(100vw, 100lvh);
  --overlay-band-1: linear-gradient(45deg, rgba(255, 255, 255, 0.225) 32.5%, transparent 32.5%);
  --overlay-band-2: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 50%, transparent 50%);
  --overlay-band-3: linear-gradient(45deg, rgba(255, 255, 255, 0.075) 67.5%, transparent 67.5%);
  --overlay-scrim: radial-gradient(
    ellipse 60% 45% at 50% 50%,
    rgba(var(--color-shade), 0.38),
    rgba(var(--color-shade), 0.1) 70%,
    transparent
  );
  --footer-gradient: linear-gradient(to bottom, transparent, rgba(var(--color-shade), 0.55) 75%);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-light);
  letter-spacing: -0.025em;
  line-height: 1.75;
}

h1,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Background */

.bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: calc(100vw + var(--tile-w));
  height: 100lvh;
  background: var(--color-bg) url("assets/images/bg-bali-rice-terraces.jpg") repeat-x 0 0 / var(--tile-w) 100%;
  backface-visibility: hidden;
  will-change: transform;
  animation:
    fade-in var(--duration-page) both,
    bg-pan var(--duration-bg) linear infinite;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  height: 100lvh;
  background-image:
    var(--overlay-noise),
    var(--overlay-band-1),
    var(--overlay-band-2),
    var(--overlay-band-3),
    var(--overlay-scrim);
  background-position: 0 0, center, center, center, center;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size:
    auto,
    var(--overlay-square) var(--overlay-square),
    var(--overlay-square) var(--overlay-square),
    var(--overlay-square) var(--overlay-square),
    100% 100%;
  animation: fade-in var(--duration-overlay) var(--delay-overlay) both;
}

/* Page */

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  animation: fade-in var(--duration-page) both;
}

/* Hero */

.hero {
  align-self: center;
  justify-self: center;
  width: 90%;
  padding: var(--space-l) 0 var(--space-m);
  text-align: center;
  text-shadow: var(--shadow-text);
  cursor: default;
  animation: rise var(--duration-header) var(--delay-header) both;
}

.hero__title {
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero__subtitle {
  margin: var(--space-s) 0 var(--space-xs);
  color: var(--color-text);
  font-size: var(--font-size-subtitle);
  line-height: 1.4;
}

/* Social */

.social {
  margin-top: var(--space-m);
}

.social__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.social__item {
  display: grid;
  place-items: center;
  width: var(--icon-slot);
  height: var(--icon-slot);
  animation: rise var(--duration-icon) ease-in-out both;
}

.social__item:nth-child(1) { animation-delay: calc(var(--delay-icon) + var(--delay-icon-step) * 1); }
.social__item:nth-child(2) { animation-delay: calc(var(--delay-icon) + var(--delay-icon-step) * 2); }
.social__item:nth-child(3) { animation-delay: calc(var(--delay-icon) + var(--delay-icon-step) * 3); }
.social__item:nth-child(4) { animation-delay: calc(var(--delay-icon) + var(--delay-icon-step) * 4); }

.social__link {
  display: grid;
  place-items: center;
  width: var(--icon-ring);
  height: var(--icon-ring);
  border: 1px solid var(--color-text);
  font-size: var(--icon-size);
  margin: 0;
  padding: 0;
  background-color: transparent;
  border-radius: 50%;
  color: var(--color-text);
  font-family: inherit;
  line-height: 1;
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--duration-ui) ease-in-out,
    transform var(--duration-ui) ease-in-out;
}

.social__icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(var(--color-shade), 0.35));
}

a.social__link[href],
button.social__link {
  cursor: pointer;
}

button.social__link:disabled {
  cursor: progress;
}

.is-sending {
  cursor: progress;
}

@media (hover: hover) {
  .social__link:hover {
    background-color: var(--color-icon-hover);
    transform: scale(1.1);
  }
}

.social__link:active {
  background-color: var(--color-icon-active);
  transform: scale(0.95);
}

a.social__link[href]:focus-visible,
button.social__link:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

/* Footer */

.footer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: var(--footer-height);
  padding: var(--space-l) 1rem 1.125em;
  background-image: var(--footer-gradient);
  color: var(--color-text);
  line-height: 1.75;
  text-align: center;
  cursor: default;
}

.footer__sep {
  margin: 0 var(--space-xs);
}

.footer__link {
  color: var(--color-text);
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-skip-ink: auto;
}

.footer__link:hover {
  text-decoration-style: solid;
}

.footer__link:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  :root {
    --icon-size: 1.5em;
    --icon-slot: 4.25em;
  }
}

@media (max-width: 736px) {
  .footer__part {
    display: block;
  }

  .footer__sep {
    display: none;
  }
}

/* Animations */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 1em, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bg-pan {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(var(--tile-w) * -1), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .bg,
  .overlay,
  .page,
  .hero,
  .social__item {
    animation: none;
  }

  .social__link {
    transition: none;
  }
}
