/* =========================================
       THEME VARIABLES
       ========================================= */
:root {
  --bg-sidebar: #000000;
  --bg-content: #0a0a0a;
  --bg-content-translucent: rgba(10, 10, 10, 0.85);
  --text-main: #ffffff;
  --text-muted: #b3b3b3;
  --border-color: #1a1a1a;
  --accent: #e95420;

  --font-main: "Inter", sans-serif;
}

body.light-theme {
  --bg-sidebar: #f4ebd9;
  --bg-content: #fcf8f2;
  --bg-content-translucent: rgba(252, 248, 242, 0.85);
  --text-main: #2c2421;
  --text-muted: #7c6d66;
  --border-color: #ebdcc9;
}

/* =========================================
       GLOBAL STYLES & SEAMLESS SCROLL
       ========================================= */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (min-width: 1200px) {
  html {
    font-size: 17px;
  }
}

@media (min-width: 1600px) {
  html {
    font-size: 18px;
  }
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-content);
  background-image:
    linear-gradient(rgba(152, 152, 152, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(152, 152, 152, 0.04) 1px, transparent 1px);
  /* background-image: 
    radial-gradient(rgba(115, 115, 115, 0.15) 1px, transparent 1px); */
  background-size: 10px 10px;
  background-position: center;
  color: var(--text-main);
  font-family: var(--font-main);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

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

/* =========================================
       SCROLL REVEAL ANIMATIONS
       ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}
.delay-4 {
  transition-delay: 0.4s;
}

/* =========================================
       THE BRUTALIST SIDEBAR (Desktop)
       ========================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  padding: 2.5rem 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-right: 1px solid var(--border-color);
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.brand {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-main);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.mobile-toggle:hover {
  border-color: var(--text-main);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.nav-group {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-group a {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  position: relative;
  padding-left: 40px;
}

.main-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 2px;
  background-color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-group a:hover,
.main-nav a.active {
  color: var(--text-main);
}

.main-nav a:hover::before,
.main-nav a.active::before {
  width: 25px;
  background-color: var(--text-main);
}

.external-links {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--border-color);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem;
  cursor: pointer;
  text-align: left;
  width: max-content;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.footer-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================
       THE CONTENT AREA
       ========================================= */
.content-area {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 2rem 0;
}

section {
  padding: 4rem 4rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1.2px solid var(--border-color);
  transition: border-color 0.4s ease;
}

section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 2.5rem;
  max-width: 800px;
}

.about-layout {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-image {
  flex-shrink: 0;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--text-main);
  border-radius: 8px;
  transition: border-color 0.4s ease;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h2 {
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
}

.item-block {
  display: flex;
  gap: 2rem;
  margin-bottom: 4rem;
  max-width: 850px;
}
.item-block:last-child {
  margin-bottom: 0;
}

/* Left side: The Date */
.item-date {
  flex-shrink: 0;
  width: 200px; /* Keeps the dates aligned in a clean column */
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  padding-top: 0.2rem; /* Aligns text with the top of the <h3> */
}

.item-image {
  flex-shrink: 0;
  width: 250px;
  height: 200px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

#certifications .item-image {
  height: auto;
  aspect-ratio: 4 / 3;
  border-color: var(--text-muted);
  transition: border-color 0.4s ease;
}

#certifications .item-image img {
  object-fit: fill;
}

.item-content {
  flex-grow: 1;
}

.item-content h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
  /* color: var(--accent); Accent color from your screenshot */
}

.item-content h3 a {
  color: var(--text-main);
  transition: color 0.2s ease;
}

.item-content h3 a:hover {
  color: var(--accent);
}

.job-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-left: 0.75rem;
  vertical-align: middle;
  border-radius: 4px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  max-width: 650px;
}

h3 {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0;
  color: var(--text-main);
}

.meta-tags {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-links a {
  font-size: 1.25rem;
  color: var(--text-main);
  padding-bottom: 0.25rem;
  max-width: max-content;
  font-weight: 400;
  /* text-transform: uppercase; */
  letter-spacing: 0.05em;
}

.contact-links a:hover {
  color: var(--accent);
}

.stack {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.stack-item {
  font-size: 0.65rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color 0.4s ease;
}

.cert-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-top: 0.5rem;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.cert-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* =========================================
       MOBILE RESPONSIVENESS (Bottom Nav)
       ========================================= */
@media (max-width: 900px) {
  html {
    font-size: 15px;
  }

  body {
    flex-direction: column;
    padding-bottom: 80px;
  }

  .content-area {
    margin-left: 0;
    width: 100%;
    padding: 0;
  }

  section {
    padding: 4rem 2rem;
  }

  .section-header {
    position: sticky;
    top: 0;
    background-color: var(--bg-content-translucent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    margin-top: -4rem;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
    margin: 0;
  }

  .about-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }

  .item-block {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
  }

  .item-date {
    width: 100%;
    padding-top: 0;
    margin-bottom: 0.5rem;
  }

  .item-image {
    width: 100%;
    height: 180px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 1.25rem 2rem;
    border-right: none;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  }

  .sidebar-header {
    margin-bottom: 0;
  }
  .mobile-toggle {
    display: block;
  }

  .sidebar-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
      opacity 0.4s ease,
      margin-top 0.4s ease;
  }

  .sidebar.open .sidebar-content {
    max-height: 70vh;
    opacity: 1;
    margin-top: 2rem;
    padding-bottom: 1rem;
    overflow-y: auto;
  }

  /* .nav-group {
    gap: 1.5rem;
  }
  .main-nav a {
    padding-left: 0;
  }
  .main-nav a::before {
    display: none;
  } */

  .external-links {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }
  .sidebar-bottom {
    margin-top: 2.5rem;
  }
  .footer-text {
    display: none;
  }
}

/* =========================================
       DESKTOP THREE-COLUMN LAYOUT
       ========================================= */
@media (min-width: 901px) {
  section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    align-items: start;
  }

  .section-header {
    margin-bottom: 0;
    position: sticky;
    top: 4rem;
    z-index: 10;
  }

  .section-body {
    display: flex;
    flex-direction: column;
    gap: 4rem;
  }

  #about .section-body,
  #contact .section-body {
    gap: 1.5rem;
  }

  .item-block {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    margin-bottom: 0;
    max-width: none;
  }

  .item-date {
    width: auto;
    padding-top: 0.2rem;
  }

  .item-image {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 4;
  }
}

/* =========================================
   EXTERNAL LINK ICON (SVG MASK)
   ========================================= */
.external-link::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  vertical-align: -0.05em;
  background-color: currentColor;
  
  /* Webkit engines (iOS Safari, Android Chrome, etc.) */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;

  /* Standard syntax */
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;

  transition: transform 0.2s ease;
}

.external-link:hover::after {
  transform: translate(2px, -2px);
}


