/* ==========================================================================
   1. Font Face & Reset
   ========================================================================== */
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono:vf@latest/latin-wght-normal.woff2)
    format("woff2-variations");
  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;
}

* {
  min-width: 0;
  font: inherit;
}

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

img,
svg {
  display: block;
  height: auto;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ==========================================================================
     2. Layout & Components
     ========================================================================== */
#canvas {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
}

.container {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 20px;
  z-index: 10;
  margin-right: 20px;
  max-width: 768px;
}

/* Header */
.srheader {
  display: flex;
  align-items: baseline;
  column-gap: 12px;
  justify-content: space-between;
  font-family: "JetBrains Mono Variable", monospace;
}

.srhead {
  display: flex;
  align-items: baseline;
  column-gap: 9px;
}

.sralias {
  font-size: smaller;
}

.srname {
  font-size: x-large;
  font-weight: bold;
  text-transform: uppercase;
}

.srsubtitle {
  font-size: large;
  margin: 0;
  text-transform: uppercase;
}

/* Content */
section {
  margin-bottom: 39px;
}

h2 {
  font-size: 24px;
}

h2 {
  font-size: larger;
  font-weight: bold;
}

h3 {
  font-weight: bold;
  font-family: "JetBrains Mono Variable", monospace;
  font-size: larger;
  text-transform: uppercase;
}

a {
  color: #000;
  text-underline-offset: 3px;
  text-decoration: underline;

  &:hover {
    text-decoration-thickness: 2px;
  }
}

/* Social */
.srsocial {
  ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
    list-style: none;
    padding-inline-start: 0;
  }
}

/* Journal */
.srjournal {
  .blogposts {
    list-style: none;
    padding-inline-start: 0;
  }
}

.journalhead {
  display: flex;
  align-items: center;
  justify-content: space-between;

  p {
    text-transform: uppercase;
    font-family: "JetBrains Mono Variable", monospace;
    font-size: larger;
    font-weight: bold;
  }
}

.post {
  display: flex;
  align-items: baseline;
  column-gap: 9px;
  justify-content: space-between;
  margin: 5px 0;
}

.srpostdate {
  flex-shrink: 0;
  font-size: small;
}

.dashed-line {
  flex: 1 1 0;
  min-height: 6px;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    transparent 4px,
    #262626 5px,
    #262626 6px
  );
  background-repeat: repeat-x;
  background-size: 6px 1px;
  background-position: 0 48%;
}

/* Footer */
.srfooter {
  border-top-color: darkgrey;
  border-top-style: solid;
  border-top-width: 1px;
  display: flex;
  font-family: "JetBrains Mono Variable", monospace;
  flex-direction: column;

  p {
    font-size: 14px;
  }
}

.palette {
  display: none;
  height: 6px;
  --stops: 6;
  --a: hsla(0, 0%, 0%, 0.1);
  --b: hsla(0, 0%, 0%, 0.2);
  --c: hsla(0, 0%, 0%, 0.3);
  --d: hsla(0, 0%, 0%, 0.4);
  --e: hsla(0, 0%, 0%, 0.5);
  --f: hsla(0, 0%, 0%, 0.7);
  width: calc(var(--stops) * 24px);
  background-image: linear-gradient(
    to right,
    var(--a) calc(100% / var(--stops)),
    var(--b) calc(100% / var(--stops)),
    var(--b) calc(100% / var(--stops) * 2),
    var(--c) calc(100% / var(--stops) * 2),
    var(--c) calc(100% / var(--stops) * 3),
    var(--d) calc(100% / var(--stops) * 3),
    var(--d) calc(100% / var(--stops) * 4),
    var(--e) calc(100% / var(--stops) * 4),
    var(--e) calc(100% / var(--stops) * 5),
    var(--f) calc(100% / var(--stops) * 5),
    var(--f) 100%
  );
  margin-top: 24px;
}

/* ==========================================================================
     3. Media Queries
     ========================================================================== */
@media (min-width: 768px) {
  #canvas {
    display: block;
  }

  .srsocial {
    ul {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      column-gap: 14px;
    }
  }

  .srfooter {
    flex-direction: row;
    justify-content: space-between;
  }

  .palette {
    display: block;
  }
}

@media (min-width: 1024px) {
  .container {
    margin-right: 0;
  }
}
