@font-face {
  font-family: "body";
  src: url("/fonts/CascadiaMono.ttf");
}

:root {
  --bg-color: lightsteelblue;
  --fg-color: #110;
  --hover-color: gold;
}

html {
  /* font-size: 14px; */
}

* {
  color: var(--fg-color);
  font-family: body;
  transition: all;
  text-wrap: pretty;
}

a.external-repository:hover {
  background-color: var(--hover-color);
}

body {
  background-color: var(--bg-color);
  padding: 1rem;

  max-width: 800px;
  margin: auto;

  position: relative;
}

details {
  >summary {
    color: darkkhaki;
    background-color: var(--fg-color);
    padding: 0.5rem;
    border-radius: 0 1ch 0 0;
    padding-right: 3ch;
    text-transform: capitalize;
    cursor: pointer;
    display: inline-flex;
  }

  > :not(summary) {
    padding: 1rem;
    border: thin solid var(--fg-color);
    border-top: thick solid var(--fg-color);
    background-color: white;
    margin-top: 0.125rem;
  }
}

details details summary {
  display: flex;
}

details[open]>summary {
  color: khaki;
}

details:not(:last-child) {
  margin-bottom: 0.25rem;
}

details:not(:last-child)[open]> :not(summary) {
  margin-bottom: 0.5rem;
}

h1 {
  color: black;
}

td>div {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

dl {
  font-weight: 500;
}

dd {
  font-weight: 100;
  margin-left: 2ch;
  margin-top: 0.5ch;
}

dt::before {
  content: "—";
  margin-right: 1ch;
}

dd:not(:last-of-type),
li:not(:last-of-type) {
  margin-bottom: 0.5rem;
}

img {
  border-radius: 0.5rem;
}

p:not(:last-child) {
  margin-bottom: 2rem;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 0.5ch;
}

.column.double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  height: max-content;
}

.column.quadruple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.25rem;
  height: max-content;
}

.competence-level {
  flex: 1 0;
  position: relative;
  margin-bottom: 1rem;

  >* {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0.5rem;
  }

  >*:not(:last-child) {
    margin-bottom: 0.125rem;
  }

  >div {
    font-weight: 500;
  }

  >div::before {
    content: attr(data-time) " yr";
    background: linear-gradient(to right, #00000000 calc(100% - var(--progress)), var(--progress-color) calc(100% - var(--progress)));
    text-align: end;
    color: olive;
    padding: 0.25rem 0.5rem;
    font-weight: 100;
  }

  >div.level-titles {
    margin-bottom: 0.5rem;
  }

  >div.level-titles::before {
    content: "seniority level";
    text-align: start;
    padding: 0;
    text-transform: capitalize;
  }

  >div:nth-of-type(2n)::before {
    --progress-color: color-mix(in srgb, var(--bg-color), crimson 10%);
  }

  >div:nth-of-type(2n+1)::before {
    --progress-color: color-mix(in srgb, var(--bg-color), tomato 15%);
  }
}

.experience {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  grid-template-columns: 1fr 1fr;

  .icons {
    text-align: center;
    margin-top: 1rem;

    display: grid;
    grid-template-columns: repeat(5, 1fr);

    gap: 0.1rem;
    row-gap: 0.5rem;

    >img {
      margin: auto;
      height: 56px;
    }
  }

  >.notice:not(:last-child) {
    margin-bottom: 0;
  }
}

.notice {
  border: thin solid var(--bg-color);
  border-radius: 0.5rem;
  padding: 1rem;
  position: relative;
  background-color: var(--bg-color);
}

.notice:not(:last-child) {
  margin-bottom: 0.5rem;
}

.notice::before {
  content: attr(data-title);
  font-weight: bold;
  text-transform: capitalize;
}

.row {
  display: flex;
  gap: 1ch;
}

.row.responsive {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  .tech-stack-logos {
    img {
      width: 32px;
      object-fit: ;
      aspect-ratio: 1;
      border-radius: 0.25rem;
      padding: 0.25rem;
      /* border: thin solid black; */
      background-color: white;
      ;
      filter: drop-shadow(0 0 0.25rem #edc)
    }
  }
}

.project {
  text-decoration: none;

  .name {
    text-transform: uppercase;
  }

  .links {
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    border: thin solid var(--bg-color);
    align-self: stretch;
    justify-content: space-around;

    >* {
      background-size: contain;
      background-position: center;
      background-repeat: no-repeat;
      height: 1.5em;
      aspect-ratio: 1;
      border-radius: 0.25rem;
    }

    [data-platform="android"] {
      background-image: url(/images/about-me/android-logo.svg);
    }

    [data-platform="apple"] {
      background-image: url(/images/about-me/apple-logo.svg);
    }

    [data-platform="chrome"] {
      background-image: url(/images/about-me/chrome-bw-logo.png);
    }

    [data-platform="web"] {
      background-image: url(/images/about-me/web-logo.jpg);
    }
  }
}

*:not(a)[data-platform] {
  opacity: 0.1;
}

div[data-title="craftsmanship"] {
  a.external-repository img {
    width: 8rem;
    aspect-ratio: 1;
    position: absolute;
    right: 0;
    top: 0;
    transform: translateX(calc(100% + 1rem));
  }

  >dl {
    width: calc(100% - 8rem - 1rem);
    position: relative;
    min-height: 8rem;
  }
}

#projects img {
  width: 64px;
  height: auto;
}

#projects details article.projects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1ch;
}

#projects details article .project {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2ch;
  border: thin solid var(--bg-color);
  border-radius: 0.25rem;
  padding: 1ch;
  aspect-ratio: 1;
  width: max-content;
  min-width: 14ch;
}

#who-i-am {
  display: grid;
  grid-template-columns: auto auto;

  gap: 6ch;
  align-items: center;
  justify-items: center;

  padding: 1ch;

  .avatar {
    width: 256px;
    height: auto;
  }

  .logo {
    height: 64px;
    aspect-ratio: 1;
  }

  .logos {
    justify-content: center;
    grid-column: 1 / 3;
  }
}

@media(max-width: 700px) {
  body {
    padding: 1ch;
  }

  details> :not(summary) {
    padding: 0.15rem;
  }

  .experience {
    .icons {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.5rem;
    }
  }

  #who-i-am {
    grid-template-columns: 1fr;
    gap: 3ch;

    .logos {
      grid-column: 1;
    }
  }
}

.cv-button {
  float: right;
  margin-right: 0.5rem;

  position: sticky;
  bottom: 0.5rem;

  padding: 1rem;
  border-radius: 1rem;
  border: thick solid black;
  background-color: var(--bg-color);

  filter: drop-shadow(1px 1px 6px rgba(0, 0, 0, 0.25));

  text-decoration: none;
}