/* -------------------------------------------------- */
/* Reset & base                                        */
/* -------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

:root {
  --color-bg: #f6f3ee;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #5c5c70;
  --color-accent: #b3243d;
  --color-border: #e4ded4;
  --color-code-bg: #efe9df;
  --max-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14141c;
    --color-surface: #1e1e2a;
    --color-text: #e8e8ee;
    --color-text-muted: #a3a3b5;
    --color-accent: #ff6b81;
    --color-border: #2a2a38;
    --color-code-bg: #1d1d29;
  }
}

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

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* -------------------------------------------------- */
/* Accessibility                                       */
/* -------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

/* -------------------------------------------------- */
/* Layout                                              */
/* -------------------------------------------------- */
.site-header,
.site-main,
.site-footer {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-main {
  padding-block: 2rem 4rem;
  min-height: 60vh;
}

.site-main--wide {
  max-width: 64rem;
}

/* -------------------------------------------------- */
/* Header / Nav                                        */
/* -------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav-links a:hover,
.site-nav-links a[aria-current="page"] {
  color: var(--color-text);
}

/* -------------------------------------------------- */
/* Footer                                              */
/* -------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* -------------------------------------------------- */
/* Bio / Homepage                                      */
/* -------------------------------------------------- */
.bio {
  padding-block: 1rem 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.bio h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.bio-summary {
  color: var(--color-text-muted);
  margin: 0;
}

.section-heading {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* -------------------------------------------------- */
/* Post list                                           */
/* -------------------------------------------------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-link {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
}

.post-list-link:hover {
  color: var(--color-accent);
}

.post-list-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.post-list-description {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
}

/* -------------------------------------------------- */
/* Post page                                           */
/* -------------------------------------------------- */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-tags a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-code-bg);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.post-content h2 {
  margin-top: 2.5rem;
  font-size: 1.5rem;
}

.post-content h3 {
  margin-top: 2rem;
  font-size: 1.2rem;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-block: 1.1em;
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin-inline: 0;
  padding-inline: 1rem;
  color: var(--color-text-muted);
}

.post-content code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.post-content pre {
  background: var(--color-code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

.header-anchor {
  margin-left: 0.4em;
  color: var(--color-text-muted);
  text-decoration: none;
  opacity: 0;
}

.post-content h2:hover .header-anchor,
.post-content h3:hover .header-anchor,
.post-content h4:hover .header-anchor {
  opacity: 1;
}

/* -------------------------------------------------- */
/* Responsive video embeds                             */
/* -------------------------------------------------- */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-block: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-code-bg);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -------------------------------------------------- */
/* Giscus comments                                     */
/* -------------------------------------------------- */
.giscus-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

/* -------------------------------------------------- */
/* Hero section                                        */
/* -------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: 1rem 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

.hero-avatar {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-accent);
  margin-bottom: 1rem;
}

.hero-name {
  margin: 0;
  font-size: 1.9rem;
}

.hero-title {
  margin: 0.35rem 0 1rem;
  color: var(--color-text-muted);
}

.hero-social {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-code-bg);
  color: var(--color-text);
}

.hero-social a:hover,
.hero-social a:focus {
  color: var(--color-accent);
}

.hero-social .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* -------------------------------------------------- */
/* About page                                          */
/* -------------------------------------------------- */
.about h1 {
  font-size: 1.75rem;
}

.section-title {
  position: relative;
  display: inline-block;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
}

.section-title-dots {
  position: absolute;
  top: -0.4rem;
  left: -0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-accent);
  z-index: 0;
}

.section-title-text {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-left: 0.85rem;
  font-size: 1.85rem;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* -------------------------------------------------- */
/* Experience / Education timeline card                */
/* -------------------------------------------------- */
.timeline-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 1.75rem 1.5rem;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--color-border);
}

.timeline-item {
  position: relative;
  margin-left: 1.75rem;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-icon {
  position: absolute;
  top: 0;
  left: -1.8rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
}

.timeline-icon .icon {
  width: 1rem;
  height: 1rem;
}

.timeline-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.timeline-company {
  font-weight: 400;
  color: var(--color-text-muted);
}

.timeline-dates {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* -------------------------------------------------- */
/* Experience + Badges + Education grid                */
/* -------------------------------------------------- */
.experience-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.experience-grid-badges {
  order: -1;
}

@media (min-width: 860px) {
  .experience-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 2rem;
    grid-template-areas:
      "experience badges"
      "education badges";
    align-items: start;
  }

  .experience-grid-badges {
    grid-area: badges;
    order: initial;
  }

  .experience-grid-experience {
    grid-area: experience;
  }

  .experience-grid-education {
    grid-area: education;
  }
}

.badge-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  list-style: none;
  padding: 0.25rem 0 0.5rem;
  margin: 0;
  scrollbar-width: thin;
}

.badge-grid li {
  flex: 0 0 calc(50% - 0.5rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.badge-grid img {
  width: 100%;
  height: auto;
  max-width: 140px;
}

@media (min-width: 860px) {
  .badge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
  }

  .badge-grid li {
    flex: initial;
  }
}

/* -------------------------------------------------- */
/* Carousel (Certifications, Reviews)                  */
/* -------------------------------------------------- */
.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
  padding: 0.25rem 0 1rem;
  margin: 0;
  scrollbar-width: thin;
}

.carousel-slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.carousel-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.certification-slide {
  flex: 0 0 100%;
}

.certification-slide img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

@media (min-width: 860px) {
  .certification-slide {
    flex: 0 0 calc(50% - 0.5rem);
  }
}

.carousel-reviews .carousel-slide {
  flex: 0 0 100%;
}

.review {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 2rem 2.5rem;
}

.review-avatar {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.review-author {
  margin: 0;
  font-weight: 600;
}

.review-role {
  margin: 0.15rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.review-comment {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.review-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--color-border);
  cursor: pointer;
}

.carousel-dot.is-active {
  background: var(--color-accent);
}
