/* ===== TOKENS ===== */
:root {
  --bg: #fafaf8;
  --surface: #f0efeb;
  --text: #1a1a1a;
  --text-muted: #888888;
  --border: #e8e8e3;
  --link: #4a7fa5;
  --link-hover: #1a1a1a;
  --max-width: 680px;
}

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

body {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

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

a:hover {
  color: var(--link-hover);
}

::selection {
  background: #c8daea;
  color: var(--text);
}

/* ===== LOADER ===== */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader {
  position: relative;
  width: 120px;
  height: 120px;
}

.loader-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: "STIX Two Text", Georgia, serif;
  color: var(--text);
  z-index: 2;
}

.loader-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--text);
  animation: spin 1.5s linear infinite;
}

.loader-circle:nth-child(2) {
  border-top-color: var(--text-muted);
  animation-duration: 2s;
}

.loader-circle:nth-child(3) {
  border-top-color: var(--border);
  animation-duration: 2.5s;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== LAYOUT ===== */
.page-layout {
  display: grid;
  grid-template-columns: 110px 1fr;
  max-width: 1200px;
  margin: 0;
  padding: 3rem 4rem 3rem 4rem;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 3rem;
  height: fit-content;
  padding-right: 1.5rem;
}

.main-content {
  border-left: 1px solid #c8c8c3;
  padding-left: 2.5rem;
}

section {
  display: none;
  padding-top: 0;
}
section.section-active {
  display: block;
  animation: fadeIn 0.2s ease forwards;
}

.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s ease;
}

.hamburger:hover {
  background: var(--surface);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SIDEBAR NAV ===== */
.sidebar-inner {
  display: flex;
  flex-direction: column;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: right;
}

.nav-link {
  font-family: "STIX Two Text", Georgia, serif;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  transition: color 0.15s ease;
  display: block;
  padding: 0.1rem 0;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  font-weight: 700;
  font-style: italic;
}

/* ===== ABOUT ===== */
#about.section-active {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-image-col {
  width: 220px;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 2rem;
}

.profile-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--surface);
  filter: grayscale(10%);
  border: 1px solid var(--border);
  display: block;
}

.intro-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.about-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== EXPERIENCE ===== */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.exp-item {
  display: flex;
  flex-direction: column;
}

.exp-logo {
  margin-bottom: 1rem;
  color: var(--text);
}

.exp-logo a {
  display: block;
  line-height: 0;
}

.exp-logo svg,
.exp-logo img {
  display: block;
  height: 22px;
  width: auto;
}

.exp-role-line {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.exp-company {
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.exp-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

.exp-bullets {
  list-style: disc;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ===== PROJECTS ===== */
.projects-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.inline-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--text-muted);
}

.project-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.project-link {
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.15s ease;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-link:hover {
  color: var(--text-muted);
}

.project-tech {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== BLOGS ===== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-entry {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.blog-title {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.blog-title:hover {
  color: var(--link);
}

.blog-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border);
  margin-bottom: 3px;
  min-width: 1rem;
}

.blog-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ===== CONNECT ===== */
.connect-intro {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.contact-list {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem 1rem;
  align-items: baseline;
}

.contact-list dt {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.contact-list dd {
  font-size: 0.9rem;
  margin: 0;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.social-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.social-link:hover {
  color: var(--text);
}


/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .page-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem;
    padding-top: 4rem;
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px var(--border);
    z-index: 999;
    padding: 2rem 1.5rem;
    transition: left 0.25s ease;
    overflow-y: auto;
  }

  body.sidebar-open .sidebar {
    left: 0;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 998;
  }

  .main-content {
    border-left: none;
    padding-left: 0;
    max-width: 100%;
  }

  #about.section-active {
    flex-direction: column;
  }

  .about-image-col {
    align-self: center;
  }

  .about-image-col {
    align-self: center; 
    margin: 1.5rem 0 0 0; 
    padding-right: 0; 
    width: 100%; 
    max-width: 280px; 
  }

  .profile-image {
    margin: 0 auto; 
  }
}
