@font-face {
  font-family: "Anek Latin";
  src: url("../fonts/anek-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
  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 {
  --granite: #1a2c33;
  --granite-deep: #12222a;
  --gold: #c59b2d;
  --gold-bright: #dda027;
  --mica: #ece5d6;
  --stone: #a3aeb0;

  --gutter: clamp(1.5rem, 5vw, 4rem);
  --column-gap: clamp(2.5rem, 6vw, 6rem);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-sweep: cubic-bezier(0.45, 0, 0.25, 1);
}

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

html {
  color-scheme: dark;
  background-color: var(--granite);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: "Anek Latin", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--mica);
  background-color: var(--granite);
  background-image:
    url("../images/granite.svg"),
    radial-gradient(ellipse 80% 70% at 30% 35%, var(--granite) 40%, var(--granite-deep) 100%);
  background-size: 320px 320px, 100% 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  opacity: 0.5;
}

body::before {
  background-image: url("../images/mica-a.svg");
  background-size: 300px 300px;
}

body::after {
  background-image: url("../images/mica-b.svg");
  background-size: 370px 370px;
  background-position: 117px 53px;
}

::selection {
  color: var(--granite);
  background-color: var(--gold-bright);
}

h1,
h2,
p {
  margin: 0;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding: var(--gutter);
  row-gap: var(--gutter);
}

.intro {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "brand headline"
    "about contact";
  column-gap: var(--column-gap);
  row-gap: clamp(3rem, 8vh, 5.5rem);
  align-items: end;
}

.brand {
  grid-area: brand;
  display: grid;
  line-height: 0;
}

.logo {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
}

.logo--engraved {
  fill: #0e1c22;
  opacity: 0;
}

.logo--sheen {
  fill: #fff3d2;
  opacity: 0;
}

.headline {
  grid-area: headline;
  font-size: clamp(2.75rem, 1.6rem + 3.6vw, 5.25rem);
  font-stretch: 75%;
  font-weight: 420;
  line-height: 0.96;
  letter-spacing: -0.005em;
  text-wrap: balance;
  text-box: trim-both cap alphabetic;
}

.about {
  grid-area: about;
  align-self: start;
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.6;
  color: var(--stone);
  color: color-mix(in srgb, var(--mica) 80%, var(--granite));
  text-wrap: pretty;
}

.contact {
  grid-area: contact;
  align-self: start;
  display: grid;
  row-gap: 0.5rem;
}

.contact__label {
  color: var(--stone);
}

.contact__email {
  justify-self: start;
  font-size: clamp(1.375rem, 1rem + 1.2vw, 2rem);
  font-stretch: 112%;
  font-weight: 320;
  line-height: 1.3;
  color: var(--gold);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(197 155 45 / 0.45);
  text-underline-offset: 0.3em;
  overflow-wrap: anywhere;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

.contact__email:hover {
  color: var(--gold-bright);
  text-decoration-color: currentColor;
}

.contact__email:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 0.35em;
  border-radius: 2px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  font-size: 0.9375rem;
  color: var(--stone);
}

@media (max-width: 52rem) {
  .page {
    max-width: 40rem;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "headline"
      "about"
      "contact";
    row-gap: 2rem;
  }

  .brand {
    margin-bottom: 1rem;
  }

  .headline {
    font-size: clamp(2.5rem, 1.4rem + 5vw, 4rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .logo--gold,
  .logo--sheen {
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }

  .logo--engraved {
    animation: logo-engraved 2.8s ease both;
  }

  /* The reveal lasts exactly the first half of the gleam cycle, so the first gleam rides the reveal edge. */
  .logo--gold {
    -webkit-mask-image: linear-gradient(105deg, #000 45%, transparent 55%);
    mask-image: linear-gradient(105deg, #000 45%, transparent 55%);
    animation: logo-reveal 2s var(--ease-sweep) 0.3s both;
  }

  .logo--sheen {
    -webkit-mask-image: linear-gradient(105deg, transparent 46.5%, #000 50%, transparent 53.5%);
    mask-image: linear-gradient(105deg, transparent 46.5%, #000 50%, transparent 53.5%);
    opacity: 0.8;
    animation: logo-gleam 4s var(--ease-sweep) 0.3s infinite both;
  }

  body::before {
    animation: mica-shimmer 3.5s ease-in-out infinite alternate;
  }

  body::after {
    animation: mica-shimmer 4.75s ease-in-out -2.25s infinite alternate;
  }
}

@keyframes logo-engraved {
  from,
  80% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes logo-reveal {
  from {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }

  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes logo-gleam {
  0% {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }

  50%,
  100% {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

@keyframes mica-shimmer {
  from {
    opacity: 0.1;
  }

  to {
    opacity: 0.9;
  }
}
