:root {
  color-scheme: light dark;

  --primary-bg-color: light-dark(#fff, #1d1d1d);
  --primary-color: light-dark(#333, #fff);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: monospace;
  margin: 0;
  padding: 0px 20px !important;
  color: var(--primary-color);
  background-color: var(--primary-bg-color);
}

section {
  margin-bottom: 16px;
}

h1 {
  color: var(--primary-color);
  margin: 0;
  font-size: 48px;
}

h2 {
  margin-top: 0px;
  font-size: 24px;
}

p {
  font-size: 18px;
}

#contact-info {
  list-style-type: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

#contact-info li {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  box-sizing: border-box;
  background-color: var(--primary-color);
  text-decoration: none;
  color: var(--primary-bg-color);
  border: var(--primary-color) solid 4px;
  padding: 4px 8px;
}

#contact-info button {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
}

li a {
  display: flex;
  align-items: center;
  color: var(--primary-bg-color);
  text-decoration: none;
}

li span {
  display: flex;
  align-items: center;
  color: var(--primary-bg-color);
  text-decoration: none;
}

#contact-info img {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  filter: none;
}

:root[data-theme="dark"] #contact-info img {
  filter: invert(1);
}

:root[data-theme="light"] #contact-info img {
  filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) #contact-info img {
    filter: invert(1);
  }
}

.shadow3d {
  font-weight: bold;
  font-size: 64px;
  color: var(--primary-color);
  text-shadow:
    3px 0 0 currentColor,
    -3px 0 0 currentColor,
    0 3px 0 currentColor,
    0 -3px 0 currentColor;
}

#experience {
  display: grid;
  grid-template-columns: auto auto;
  gap: 16px;
}

#personal-projects {
  display: grid;
  grid-template-columns: auto auto;
  gap: 16px;
}

@media only screen and (max-width: 768px) {
  .shadow3d {
    font-size: 48px;
    text-shadow:
      2px 0 0 currentColor,
      -2px 0 0 currentColor,
      0 2px 0 currentColor,
      0 -2px 0 currentColor;
  }
  #experience {
    grid-template-columns: auto;
  }

  #personal-projects {
    grid-template-columns: auto;
  }
}

#experience h1 {
  width: 100%;
}

.job,
.project {
  background-color: var(--primary-bg-color);
  border: var(--primary-color) solid 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.job p,
.project p {
  margin: 8px 0px;
}

p small {
  width: 100%;
}

.job h2,
.project h2 {
  margin: 0px;
}

.project a {
  color: var(--primary-color);
  word-break: break-word;
}

.tech-stack {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.job .tech-stack,
.project .tech-stack {
  margin-top: auto;
}

.tech-stack strong {
  width: 100%;
}

.tech {
  background-color: var(--primary-color);
  color: var(--primary-bg-color);
  padding: 4px 8px;
}

#education {
  display: grid;
  grid-template-columns:
    calc(2 / 5 * 100%) calc(1 / 5 * 100%) calc(1 / 5 * 100%)
    calc(1 / 5 * 100%);
  gap: 16px;
}

@media only screen and (max-width: 1280px) {
  #education {
    grid-template-columns: calc(2 / 4 * 100%) calc(1 / 4 * 100%) calc(
        1 / 4 * 100%
      );
  }
}

@media only screen and (max-width: 768px) {
  #education {
    grid-template-columns: auto;
  }
}

.education-item {
  background-color: var(--primary-color);
  color: var(--primary-bg-color);
  border: var(--primary-color) solid 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.education-item p {
  margin: 0px;
}

.print-only {
  display: none !important;
}

@media print {
  @page {
    margin: 0px !important;
    padding: 0px !important;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  :root,
  :root[data-theme="light"],
  :root[data-theme="dark"] {
    color-scheme: light;
    --primary-bg-color: #fff;
    --primary-color: #000;
  }

  body {
    margin: 0px !important;
    padding: 0px 20px 0px 20px !important;
    background-color: #fff;
    color: #000;
  }

  #download-cv, #theme-toggle {
    display: none !important;
  }

  .print-only {
    display: flex !important;
  }

  #contact-info img {
    filter: none;
  }

  a {
    color: inherit;
  }

  .shadow3d {
    text-shadow: none;
  }
}
