:root {
  font-family: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;
  background-color: rgb(245, 244, 238);
  color: #000;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background-color: rgb(245, 244, 238);
}

#chip-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  contain: strict;
  pointer-events: none;
}

/* On phones the chip runs off the bottom edge; fade it so browser toolbars
   that float over the page never show a hard cut. */
@media (max-width: 40rem) {
  #chip-background {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
  }
}

main {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 46rem);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6rem) clamp(1.25rem, 5vw, 3rem);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: inherit;
  cursor: pointer;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.intro {
  position: relative;
  max-width: 54ch;
  text-align: center;
}

/* A soft reading veil keeps the bio legible over the chip drawing. */
.intro::before {
  position: absolute;
  z-index: -1;
  inset: -2.5rem clamp(-4rem, -5vw, -1rem);
  background: radial-gradient(closest-side, rgba(245, 244, 238, 0.78) 45%, rgba(245, 244, 238, 0));
  content: "";
  pointer-events: none;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.intro p {
  max-width: 50ch;
  margin-top: 1.25rem;
  font-size: clamp(0.95rem, 1.1vw, 1.0625rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.contributions {
  --cell-size: clamp(0.625rem, 2.8vw, 0.8125rem);
  --cell-gap: clamp(0.1875rem, 1vw, 0.3125rem);
  width: min(100%, 23rem);
  margin-top: clamp(2.75rem, 7vh, 4rem);
  padding: clamp(1rem, 4vw, 1.35rem);
  border: 1px solid #d8d7d1;
  border-radius: 0.5rem;
  background: rgba(245, 244, 238, 0.84);
  backdrop-filter: blur(0.1875rem);
  -webkit-backdrop-filter: blur(0.1875rem);
}

.contributions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.contributions-header p,
.contributions-header a {
  color: #5e5d58;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.contributions-header p {
  margin-top: 0.2rem;
}

.graph-wrap {
  width: max-content;
  max-width: 100%;
  margin: 1.5rem auto 0;
}

.months,
.graph {
  display: grid;
  grid-template-columns: repeat(14, var(--cell-size));
  column-gap: var(--cell-gap);
}

.months {
  margin-bottom: 0.4rem;
  color: #77766f;
  font-size: 0.625rem;
  line-height: 1;
}

.months span:nth-child(1) {
  grid-column: 1 / span 5;
}

.months span:nth-child(2) {
  grid-column: 6 / span 4;
}

.months span:nth-child(3) {
  grid-column: 10 / span 5;
}

.graph {
  grid-template-rows: repeat(7, var(--cell-size));
  grid-auto-flow: column;
  row-gap: var(--cell-gap);
}

.day,
.legend i {
  display: block;
  border-radius: 0.15rem;
  background: #dddcd6;
}

.day {
  width: var(--cell-size);
  height: var(--cell-size);
}

.day[data-level="1"],
.legend i[data-level="1"] {
  background: #a7d8b1;
}

.day[data-level="2"],
.legend i[data-level="2"] {
  background: #62b77d;
}

.day[data-level="3"],
.legend i[data-level="3"] {
  background: #268f5a;
}

.day[data-level="4"],
.legend i[data-level="4"] {
  background: #0b633e;
}

.legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.85rem;
  color: #77766f;
  font-size: 0.625rem;
}

.legend i {
  width: 0.6875rem;
  height: 0.6875rem;
}

.socials {
  display: flex;
  gap: 1.25rem;
  margin-top: 2rem;
  font-size: 0.8125rem;
}

.socials a:hover,
.socials a:focus-visible,
.contributions-header a:hover,
.contributions-header a:focus-visible {
  text-decoration-thickness: 2px;
}

@media (max-width: 24rem) {
  .contributions-header {
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (max-height: 46rem) {
  main {
    justify-content: flex-start;
    padding-block: 2.5rem;
  }

  .contributions {
    margin-top: 2.5rem;
  }
}
