:root {
  --base00: #181818;
  --base01: #282828;
  --base02: #383838;
  --base03: #585858;
  --base04: #b8b8b8;
  --base05: #d8d8d8;
  --base06: #e8e8e8;
  --base07: #f8f8f8;
  --base08: #ab4642;
  --base09: #dc9656;
  --base0A: #f7ca88;
  --base0B: #a1b56c;
  --base0C: #86c1b9;
  --base0D: #7cafc2;
  --base0E: #ba8baf;
  --base0F: #a16946;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Literata", serif;
  font-weight: 300;
  line-height: 1.6;
  color: var(--base05);
  background-color: var(--base00);
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
}

/* Page header container */
.page-header {
  position: relative;
  margin-bottom: 2rem;
}

/* Home navigation button */
.home-nav {
  position: absolute;
  top: 0.5rem;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.2s ease;
  z-index: 100;
}

.home-nav:hover {
  transform: scale(1.1);
}

.home-nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 50%;
}

h1 {
  font-family: "JetBrains Mono", monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--base08);
  margin: 0 0 1.5rem 0;
  text-align: center;
  padding: 0 4rem;
}

h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--base08);
  margin: 2rem 0 1rem 0;
}

p {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  text-align: justify;
}

a {
  color: var(--base0D);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--base0C);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--base0D);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}

em {
  color: var(--base0B);
}

b,
strong {
  color: var(--base0A);
  font-weight: 400;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  margin: 0 0 0.5rem 0;
}

figcaption {
  font-size: 0.9rem;
  color: var(--base04);
  font-style: italic;
}

.selfie {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  float: left;
  margin: 0 1.5rem 1rem 0;
}

/* Blog post preview styles */
.blog-post-preview {
  background-color: var(--base01);
  border: 1px solid var(--base02);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  transition: background-color 0.2s ease;
}

a .blog-post-preview {
  cursor: pointer;
}

a .blog-post-preview:hover {
  background-color: var(--base02);
}

a .blog-post-preview h2 {
  color: var(--base08);
  margin-top: 0;
}

a .blog-post-preview:hover h2 {
  color: var(--base09);
  text-decoration: underline;
}

a:has(.blog-post-preview) {
  text-decoration: none;
  color: inherit;
}

a:has(.blog-post-preview):hover {
  text-decoration: none;
  color: inherit;
}

@media (max-width: 768px) {
  body {
    padding: 1rem 0.75rem;
  }

  .home-nav {
    width: 40px;
    height: 40px;
    top: 0.25rem;
  }

  h1 {
    font-size: 2rem;
    padding: 0 3rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  p {
    font-size: 1rem;
    text-align: justify;
  }

  .selfie {
    float: none;
    display: block;
    margin: 1.5rem auto;
  }
}

/* Resume specific styles */
h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--base09);
  margin: 1.5rem 0 0.5rem 0;
}

a h3 {
  color: var(--base09);
  text-decoration: none;
}

a:hover h3 {
  color: var(--base09);
  text-decoration: underline;
  text-decoration-color: var(--base09);
}

h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--base0E);
  margin: 1rem 0 0.5rem 0;
}

.job-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.job-header-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.job-header-link:hover {
  color: inherit;
  text-decoration: underline;
}

.job-header-link:focus {
  outline: 2px solid var(--base0D);
  outline-offset: 2px;
  border-radius: 4px;
}

.job-header img {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 4px;
  object-fit: contain;
}

.job-company {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--base06);
}

.job-duration,
.job-location {
  color: var(--base04);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.job-period-location {
  display: flex;
  gap: 1rem;
  color: var(--base04);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.tools-used {
  color: var(--base04);
  margin-top: -0.5rem;
  font-size: 0.9rem;
  font-style: italic;
}

/* Image gallery styles */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.image-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  margin: 0;
  border-radius: 4px;
}

.image-gallery img:hover {
  transform: scale(1.05);
  opacity: 0.8;
}

/* Modal styles for full-size images */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: 5% auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
}

.modal-content figure {
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

.modal-content figure img {
  margin: 0 0 0.5rem 0;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  max-height: calc(90vh - 3rem);
}

.modal-content figcaption {
  color: var(--base04);
  font-size: 0.9rem;
  font-style: italic;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.modal img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: var(--base0D);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
}

.close:hover {
  color: var(--base0C);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .job-header {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .image-gallery img {
    height: 100px;
  }

  h3 {
    font-size: 1.1rem;
  }

  h4 {
    font-size: 0.95rem;
  }

  .modal-content {
    margin: 10% auto;
    max-width: 95%;
  }

  .close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
