:root {
  --link-color: #0077cc;
  --link-color-hover: #00487c;
  --header-footer-bg-color: #f0f0f0;
  --aside-accent-color: #9d836b;
  --skill-bar-fill-color: #f3e4c6;
  --blockquote-bg-color: #f7fafc;
  --blockquote-accent-color: #4a5568;
  --blockquote-text-color: #4a5568;
  --spacing-inline: 0.5rem;
}

/* Base Styles */
body {
  font-family: "Nunito", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-weight: 400;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
}

h2 {
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
}

h3 {
  font-size: 1.1rem;
  font-weight: 500;
}

h4 {
  font-size: 1rem;
  font-weight: 500;
}

h5 {
  font-size: 1rem;
  font-weight: 500;
}

h6 {
  font-size: 1rem;
  font-weight: 500;
}

p {
  margin: 0.75rem 0;
}

a {
  color: var(--link-color) !important;
  text-decoration: none;
}

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

address {
  font-style: normal;
}

figure,
ul {
  margin: 0;
  padding: 0;
}

header,
main,
aside,
footer {
  padding: 2rem;
}

header {
  padding-bottom: 0.5rem;
}

aside {
  border-top: 1px solid #ccc;
}

footer {
  text-align: center;
}

section {
  margin-bottom: 1.5rem;
}

/* Utility */
.block {
  display: block;
  margin: 0.25rem 0;
}

.flex-responsive {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Main Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.page-content .container {
  display: grid;
  grid-template-columns: 1fr;
}

.page-header,
.page-footer {
  background: var(--header-footer-bg-color);
}

.page-header {
  border-bottom: 1px solid #ccc;
}

.page-header .container {
  display: flex;
  flex-direction: column;
}

.header-top {
  gap: 1rem;
}

.top-nav-bar {
  background: #1f344a;
  border-bottom: 1px solid #314a61;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 3rem;
}

.top-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  color: #e8f1fb !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
}

.top-nav-links a:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.top-nav-links a.active {
  background: rgba(255, 255, 255, 0.22);
}

.company-favicon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 3px;
}

.header-image {
  width: 100%;
  max-width: 256px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #999;
}

.header-info ul {
  margin: 1rem 0;
}

.link-with-icon {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-label {
  font-size: 1.3rem;
  color: #444;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
}

.header-summary {
  margin: 1.25rem 0;
}

.page-footer {
  border-top: 1px solid #ccc;
}

.section-heading {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.section-heading::before,
.section-heading::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #ccc;
  margin: 0 1rem;
}

aside .section-heading {
  align-items: flex-start;
  text-align: left;
  border-left: 4px solid var(--aside-accent-color);
  padding-left: 0.5rem;
  margin-bottom: 0.75rem;
}

aside .section-heading::before,
aside .section-heading::after {
  content: none;
}

.section-label {
  font-size: 0.9rem;
  color: #444;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

.gallery {
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin: 0.5rem 0;
}

.main-gallery {
  grid-template-columns: 1fr;
}

.side-gallery {
  grid-template-columns: 1fr;
}

figcaption {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Lists */
main ul,
aside ul {
  list-style-type: disc;
  list-style-position: inside;
  padding-left: 0;
  margin: 0.75rem 0;
}

main li,
aside li {
  margin-bottom: 0.5rem;
}

.unstyled-list {
  list-style: none;
}

.inline-list {
  list-style: none;
  gap: 0.25rem;
}

.inline-list li {
  display: flex; /* This is for HTML Whitespace Issues */
}

/* Skillbars */
.skill-bar {
  width: 100%;
  height: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  background: #eee;
  border: 1px solid #848484;
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--skill-bar-fill-color) !important;
  border-right: 1px solid #848484;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
}

.skill-bar-label {
  color: #333;
  font-size: 0.9rem;
  white-space: nowrap;
}

.w-0 {
  width: 0%;
}

.w-10 {
  width: 10%;
}

.w-20 {
  width: 20%;
}

.w-25 {
  width: 25%;
}

.w-30 {
  width: 30%;
}

.w-40 {
  width: 40%;
}

.w-50 {
  width: 50%;
}

.w-60 {
  width: 60%;
}

.w-70 {
  width: 70%;
}

.w-75 {
  width: 75%;
}

.w-80 {
  width: 80%;
}

.w-90 {
  width: 90%;
}

.w-100 {
  width: 100%;
  border-right: none;
}

/* Blockquotes */
blockquote {
  margin: 1rem 2rem;
  padding: 1.5rem 2rem;
  background-color: var(--blockquote-bg-color);
  border-left: 4px solid var(--blockquote-accent-color);
  font-style: italic;
  color: var(--blockquote-text-color);
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Projects Page Styles
   ======================================== */

/* Projects Navigation */
.project-nav {
  margin-bottom: 1rem;
}

.project-nav a {
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.project-nav a:hover {
  text-decoration: underline;
}

/* Projects Navigation TOC */
.projects-nav-toc {
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.65rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toc-sections {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.toc-section {
  position: relative;
}

.toc-section-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: white;
  border: 2px solid #d0d0d0;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  color: #333 !important;
}

.toc-section-link:hover {
  background: var(--link-color);
  border-color: var(--link-color);
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.toc-section-link.active {
  background: var(--link-color);
  border-color: var(--link-color);
  color: white !important;
}

.toc-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.toc-items {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  list-style: none;
  padding: 0.4rem 0;
  z-index: 101;
}

.toc-section:hover .toc-items,
.toc-section:focus-within .toc-items {
  display: block;
}

.toc-items li {
  margin: 0;
}

.toc-items a {
  display: block;
  padding: 0.45rem 1rem;
  color: #333 !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.toc-items a:hover {
  background: #f0f0f0;
  color: var(--link-color) !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Projects Main Layout */
.projects-main {
  max-width: 1100px;
  margin: 0 auto;
}

.projects-page .page-content .container {
  display: block;
  max-width: 1320px;
}

.projects-page .projects-main {
  max-width: none;
}

.projects-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 80px;
}

/* Compact Project Layout */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.project-detail-timeline {
  margin-bottom: 0;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2e7ee;
  border-radius: 8px;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.project-detail-timeline:last-child {
  margin-bottom: 0;
}

/* Content column */
.project-content-column {
  min-width: 0;
}

/* Section Intro Text */
.section-intro {
  text-align: left;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  color: #666;
  line-height: 1.45;
}

.section-intro a {
  font-weight: 600;
}

/* Read More Link */
.read-more {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.read-more a {
  font-weight: 500;
}

/* Individual Project Article */
.project-detail {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.project-detail:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Project Header */
.project-header h3 {
  margin-bottom: 0.4rem;
  color: #222;
  font-size: 1.15rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
  color: #666;
  font-size: 0.86rem;
}

.project-meta time {
  font-weight: 500;
  color: #555;
}

.project-date-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eaf3fb;
  border: 1px solid #cfe2f5;
  color: #1e5c8f;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Tech Stack Badges */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.76rem;
  color: #444;
  font-weight: 500;
  white-space: nowrap;
}

/* Project Content */
.project-content {
  line-height: 1.55;
}

.project-summary {
  font-size: 0.97rem;
  color: #333;
  margin-bottom: 0.7rem;
  font-weight: 400;
  line-height: 1.5;
}

.highlights-list {
  margin: 0.55rem 0;
}

/* Markdown Content Styling */
.markdown-content {
  margin: 1.5rem 0;
}

.markdown-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #222;
  font-weight: 600;
}

.markdown-content h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: #333;
  font-weight: 600;
}

.markdown-content h4 {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #444;
  font-weight: 600;
}

.markdown-content p {
  margin: 0.75rem 0;
  line-height: 1.7;
}

.markdown-content ul,
.markdown-content ol {
  margin: 1rem 0;
  padding-left: 1.75rem;
  list-style-position: outside;
}

.markdown-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.markdown-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', 'Courier', monospace;
  font-size: 0.9em;
  color: #d63384;
  border: 1px solid #e0e0e0;
}

.markdown-content pre {
  background: #f8f8f8;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid #e0e0e0;
}

.markdown-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
}

.markdown-content blockquote {
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  background: var(--blockquote-bg-color);
  border-left: 4px solid var(--blockquote-accent-color);
  font-style: italic;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.markdown-content th {
  background: #f5f5f5;
  font-weight: 600;
}

/* Project Gallery */
.project-gallery {
  grid-template-columns: 1fr;
  margin: 1rem 0 0.75rem;
}

/* Project Links/Buttons */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.86rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--link-color);
  color: white !important;
  border-color: var(--link-color);
}

.btn-primary:hover {
  background: var(--link-color-hover);
  border-color: var(--link-color-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: white;
  color: var(--link-color) !important;
  border-color: var(--link-color);
}

.btn-secondary:hover {
  background: #f8f8f8;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ========================================
   Certifications & Achievements
   ======================================== */

.certifications-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid #ddd;
}

.certifications-block,
.achievements-block {
  margin-bottom: 1.5rem;
}

.certifications-block h3,
.achievements-block h3 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  color: #222;
}

/* Certifications List */
.certifications-list {
  list-style: none;
  padding: 0;
}

.certification-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.certification-item:last-child {
  border-bottom: none;
}

.cert-title {
  display: block;
  font-size: 1.05rem;
  color: #222;
  margin-bottom: 0.25rem;
}

.cert-meta {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.cert-description {
  margin: 0.5rem 0;
  color: #444;
  line-height: 1.6;
}

.cert-link {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Achievements */
.achievement-category {
  margin-bottom: 1.2rem;
}

.achievement-category h4 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.achievements-list {
  list-style: none;
  padding: 0;
}

.achievement-item {
  margin-bottom: 0.85rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--link-color);
  padding-bottom: 0.25rem;
}

.achievement-title {
  display: block;
  font-size: 1rem;
  color: #222;
}

.achievement-date {
  color: #666;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.achievement-description {
  margin: 0.5rem 0 0 0;
  color: #444;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Mobile: Stack timeline vertically */
@media (max-width: 768px) {
  .project-detail-timeline {
    padding: 0.85rem;
  }

  .toc-sections {
    flex-direction: column;
    gap: 0.5rem;
  }

  .toc-section-link {
    width: 100%;
    justify-content: center;
  }

  .toc-items {
    position: static;
    margin-top: 0.25rem;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    min-width: auto;
  }

  .toc-section:hover .toc-items,
  .toc-section:focus-within .toc-items {
    display: none;
  }

  .toc-section.expanded .toc-items {
    display: block;
  }
}

@media (min-width: 37.5rem) {
  .main-gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .side-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-timeline {
    height: 100%;
  }
}

@media (min-width: 48rem) {
  aside {
    border-top: none;
    border-left: 1px solid #ccc;
  }

  aside h1 {
    font-size: 1.4rem;
  }

  aside h2 {
    font-size: 1.1rem;
  }

  aside h3 {
    font-size: 1rem;
  }

  aside h4 {
    font-size: 1rem;
  }

  aside h5 {
    font-size: 1rem;
  }

  aside h6 {
    font-size: 1rem;
  }

  header {
    padding-bottom: 1.5rem;
  }

  .flex-responsive {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .page-content .container {
    grid-template-columns: 2fr 1fr;
  }

  .projects-page .page-content .container {
    grid-template-columns: 1fr;
  }

  .header-top {
    gap: 2rem;
  }

  .header-image {
    max-width: 192px;
  }

  .header-info {
    margin-top: 0.5rem;
  }

  .page-header ul {
    margin: 0.5rem 0;
  }

  .inline-list {
    gap: var(--spacing-inline);
  }

  .inline-list li:not(:last-child)::after {
    content: "|";
    margin-left: var(--spacing-inline);
    color: #ccc;
  }

  .side-gallery {
    grid-template-columns: 1fr;
  }

  .projects-page .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .skill-bar-label {
    background: transparent !important;
    background-color: transparent !important;
    mix-blend-mode: darken;
  }

  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
