/* ============================================================
   DESIGN TOKENS
   Global CSS custom properties: colors, spacing, layout sizes
   ============================================================ */

:root {
  --bg: #0f111a;
  --panel: #171a26;
  --panel-2: #1d2131;
  --text: #eff2ff;
  --muted: #b5bedf;
  --accent: #78a8ff;
  --accent-2: #a28bff;
  --line: rgba(255, 255, 255, 0.12);
  --top-bar-height: 72px;
  --sidebar-collapsed: 78px;
  --sidebar-expanded: 230px;
}


/* ============================================================
   RESET & BASE
   Box model reset, base html/body styles, and global defaults
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #232a44 0%, var(--bg) 45%);
  line-height: 1.6;
  min-height: 100vh;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 4.1vw, 3rem);
}

h2 {
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}


/* ============================================================
   TOP BAR
   Sticky header bar at the top of every page
   ============================================================ */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--top-bar-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem clamp(1rem, 3vw, 3rem);
  backdrop-filter: blur(8px);
  background: rgba(15, 17, 26, 0.88);
  border-bottom: 1px solid var(--line);
}

/* Logo / site name link inside the top bar */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.top-bar-version {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Hamburger button — hidden on desktop, shown on mobile */
.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  flex-direction: column;
  cursor: pointer;
}

.menu-toggle span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}


/* ============================================================
   SIDEBAR
   Fixed left navigation panel; collapses to icon-only width,
   expands on hover/focus to show labels
   ============================================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: var(--top-bar-height);
  height: calc(100vh - var(--top-bar-height));
  width: var(--sidebar-collapsed);
  z-index: 25;
  background: rgba(15, 17, 26, 0.92);
  border-right: 1px solid var(--line);
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: width 0.35s ease, transform 0.32s ease;
  overflow: hidden;
}

.sidebar:hover,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
}

/* Navigation links inside the sidebar */
.sidebar a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem;
  border-radius: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.sidebar a:hover {
  background: rgba(120, 168, 255, 0.12);
  color: var(--text);
}

/* Square icon badge shown at the collapsed width */
.nav-icon {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Text label revealed when the sidebar expands */
.nav-label {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label {
  opacity: 1;
  transform: translateX(0);
}

/* Share block pinned to the bottom of the sidebar */
.sidebar-share {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  overflow: hidden;
}

/* Single share icon shown at collapsed width */
.share-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.share-links {
  display: flex;
  gap: 0.45rem;
  opacity: 0;
  max-width: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, max-width 0.28s ease;
}

.share-links a {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text);
}

.share-links a:hover {
  background: rgba(120, 168, 255, 0.2);
}

.share-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Swap share icon -> share links row when sidebar is open */
.sidebar:hover .share-icon,
.sidebar:focus-within .share-icon {
  display: none;
}

.sidebar:hover .share-links,
.sidebar:focus-within .share-links {
  opacity: 1;
  max-width: 180px;
  transform: translateX(0);
}

/* Dark overlay that appears behind the sidebar on mobile */
.sidebar-overlay {
  display: none;
}


/* ============================================================
   PAGE LAYOUT
   Content width and left-offset to sit beside the sidebar
   ============================================================ */

main,
.site-footer {
  width: min(1100px, 92vw);
  margin-left: calc(var(--sidebar-collapsed) + 2.4rem);
  margin-right: auto;
}

/* ============================================================
   FEATURED RECOMMENDATIONS
   Carousel-style highlight panel with prev/next navigation
   ============================================================ */

.featured-recommendations {
  margin-top: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(140deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: clamp(1rem, 2.5vw, 1.4rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  gap: 0.8rem;
}

/* Main card: large image on the left, thumbnails + description on the right */
.fr-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  text-decoration: none;
  min-width: 0;
  align-self: stretch;
}

.fr-media-main img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.fr-media-side {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

/* 2x2 thumbnail grid in the side column */
.fr-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.fr-thumb {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.fr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fr-thumb:hover,
.fr-thumb:focus-visible,
.fr-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(120, 168, 255, 0.2);
}

/* Short text description below the thumbnails */
.fr-description {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.15);
}

.fr-description p {
  margin: 0;
  color: var(--muted);
}

/* Prev / Next arrow buttons flanking the card */
.fr-nav {
  width: 44px;
  height: 100%;
  min-height: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.fr-nav:hover,
.fr-nav:focus-visible {
  border-color: var(--accent);
}

/* Dot row at the bottom indicating which slide is active */
.fr-page-indicator {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.fr-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.fr-indicator-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120, 168, 255, 0.2);
}

/* Warning banner shown when recommendation data has issues */
.featured-recommendations.has-warning {
  border-color: #f4b860;
  box-shadow: 0 0 0 2px rgba(244, 184, 96, 0.25);
}

.fr-warning {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  border: 1px solid #f4b860;
  border-radius: 10px;
  background: rgba(244, 184, 96, 0.14);
  padding: 0.6rem 0.8rem;
  color: #ffd9a1;
}

.fr-warning ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}


/* ============================================================
   SECTION PANELS
   Shared card-like panel style used by multiple sections
   ============================================================ */

.tags-system,
.about,
.featured-recommendations,
.resume-section,
.works,
.site-footer {
  margin-top: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(140deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: clamp(1.1rem, 3vw, 2.2rem);
}


/* ============================================================
   ABOUT SECTION
   Bio / introduction panel on the home page
   ============================================================ */

.about img {
  border-radius: 14px;
  align-items: center;
}

.about-headline {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.about-details p {
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.skill-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}


/* ============================================================
   RESUME SECTIONS (Experience & Education)
   Card-based timeline layout for work history and education
   ============================================================ */

.resume-item {
  margin-bottom: 1.2rem;
}

.resume-item:last-child {
  margin-bottom: 0;
}

.resume-item h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}

.resume-org {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.15rem 0 0;
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.resume-date {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-sub-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: rgba(0, 0, 0, 0.16);
  margin: 0.6rem 0;
}

.resume-sub-item h4 {
  font-size: 0.92rem;
  margin: 0 0 0.15rem;
  color: var(--text);
}

.resume-engine {
  color: var(--accent-2);
  font-weight: 500;
  font-size: 0.82rem;
}

.resume-sub-item time {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.resume-sub-item ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.resume-sub-item li,
.resume-item > ul > li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}


/* ============================================================
   TAG FILTER BAR
   Sticky pill-button row for filtering the works gallery
   ============================================================ */

.tags-system {
  position: sticky;
  top: var(--top-bar-height);
  z-index: 20;
  backdrop-filter: blur(8px);
}

.tag-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Individual filter pill */
.tag-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.tag-chip.is-active,
.tag-chip:hover,
.tag-chip:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(120, 168, 255, 0.2);
}


/* ============================================================
   WORKS GALLERY
   2-column grid of project cards on the home page
   ============================================================ */

.gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Individual project card */
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.16);
}

.card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.card h3 {
  padding: 0.8rem 0.8rem 0.2rem;
  font-size: 1rem;
}

.work-link {
  text-decoration: none;
  display: block;
}

.work-tags {
  margin: 0 0.8rem 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Message shown when no cards match the active tag filter */
.works-empty {
  margin-top: 1rem;
  color: var(--muted);
}


/* ============================================================
   SITE FOOTER
   Centered footer with social icon links and copyright
   ============================================================ */

.site-footer {
  margin-bottom: 2rem;
  text-align: center;
}

.site-footer p {
  color: var(--muted);
  margin: 0.5rem auto;
  max-width: 62ch;
}

/* Row of circular social-platform icon links */
.social-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.social-links a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
}

.copyright {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE -- <= 980px (tablet / small laptop)
   Sidebar switches to a slide-in drawer; content takes full width
   ============================================================ */

@media (max-width: 980px) {
  /* Show the hamburger button */
  .menu-toggle {
    display: inline-flex;
  }

  /* Sidebar slides off-screen by default */
  .sidebar {
    width: min(78vw, 290px);
    transform: translateX(-100%);
    box-shadow: none;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: min(78vw, 290px);
  }

  /* Labels always visible when drawer is open */
  .sidebar .nav-label {
    opacity: 1;
    transform: none;
  }


  .sidebar .share-icon {
    display: none;
  }

  .sidebar .share-links {
    opacity: 1;
    max-width: 180px;
    transform: none;
  }

  .sidebar-share {
    /* Mobile browsers show a bottom URL bar. */
    /* It can cover the share links. */
    /* Move this block up by 3rem to keep links visible. */
    margin-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
  }

  /* Slide in when .is-open is toggled by JS */
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 14px 0 28px rgba(0, 0, 0, 0.45);
  }

  /* Semi-transparent backdrop behind the open sidebar */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: var(--top-bar-height) 0 0 0;
    background: rgba(3, 6, 18, 0.6);
    z-index: 24;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Main content stretches edge-to-edge */
  main,
  .site-footer {
    width: min(1100px, 92vw);
    margin: 0 auto;
  }
}


/* ============================================================
   RESPONSIVE -- <= 860px
   Featured recommendations card switches to single column
   ============================================================ */

@media (max-width: 860px) {
  .fr-card {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   RESPONSIVE -- <= 760px (large phone / small tablet)
   Tag bar scrolls horizontally; featured carousel reflows
   ============================================================ */

@media (max-width: 760px) {
  /* Tag bar: horizontally scrollable single row of pills */
  .tag-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.2rem;
  }

  .tag-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Hide thumbnail strip in the featured carousel */
  .fr-thumbs {
    display: none;
  }

  /* Featured carousel: card spans full width, nav buttons side by side below */
  .featured-recommendations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fr-card,
  .fr-page-indicator,
  .fr-warning {
    grid-column: 1 / -1;
  }

  .fr-card {
    grid-row: 1;
  }

  .fr-nav-prev {
    grid-column: 1;
    grid-row: 2;
  }

  .fr-nav-next {
    grid-column: 2;
    grid-row: 2;
  }

  .fr-page-indicator {
    grid-row: 3;
  }

  .fr-warning {
    grid-row: 4;
  }

  .fr-nav {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
  }
}


/* ============================================================
   RESPONSIVE -- <= 640px (phone)
   Brand text shrinks; works gallery becomes single column
   ============================================================ */

@media (max-width: 640px) {
  .brand span {
    font-size: 0.96rem;
  }

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

  .card img {
    height: 210px;
  }

  .resume-item-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .about-skills {
    gap: 0.3rem;
  }
}


/* ============================================================
   PROJECT PAGE -- LAYOUT & PANEL
   Outer wrapper and main content panel for individual project pages
   ============================================================ */

.project-template-main {
  width: min(1100px, 92vw);
  margin-left: calc(var(--sidebar-collapsed) + 2.4rem);
  margin-right: auto;
}

.project-panel {
  margin-top: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(140deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: clamp(1.1rem, 3vw, 2.2rem);
}

/* Small all-caps accent label above the project title */
.project-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Introductory paragraph below the project title */
.project-lead {
  max-width: 72ch;
  color: var(--muted);
}


/* ============================================================
   PROJECT PAGE -- META GRIDS (old template variant)
   Three-column metadata grid, showcase grid, and process columns
   ============================================================ */

.project-meta-grid,
.process-columns,
.project-showcase-grid,
.other-projects-grid {
  display: grid;
  gap: 1rem;
}

.project-meta-grid {
  margin-top: 1.1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-meta-grid article,
.process-columns article,
.showcase-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.16);
}

.project-tag-list {
  margin: 0;
  padding-left: 1rem;
}

/* Two-column showcase grid with image + link cards */
.project-showcase-grid {
  margin-top: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.showcase-card h4 {
  margin: 0 0 0.5rem;
}

.showcase-card a {
  color: var(--accent);
  font-weight: 600;
}

.showcase-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Three-column process / steps layout */
.process-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Two-column grid linking to other projects at the bottom of a project page */
.other-projects-grid {
  margin-top: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.other-projects-grid .card {
  text-decoration: none;
}


/* ============================================================
   RESPONSIVE -- <= 980px  (project page specific)
   Remove sidebar offset; stack overview columns vertically
   ============================================================ */

@media (max-width: 980px) {
  .project-template-main {
    width: 100%;
    margin: 0 auto;
  }

  .project-panel {
    padding: 1rem;
  }

  /* Stack overview columns vertically */
  .project-overview-layout {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .project-overview-info {
    order: 1;
  }

  .project-overview-gallery {
    order: 2;
    margin-top: 0.35rem;
  }

  .project-cover,
  .project-gallery-main-frame,
  .project-gallery-main {
    width: 100%;
    max-width: 100%;
  }

  /* Stack meta label/value pairs vertically */
  .project-meta-grid-2col {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    flex-basis: min(42vw, 180px);
  }
}


/* ============================================================
   RESPONSIVE -- <= 760px  (project page specific)
   Project grids collapse to a single column
   ============================================================ */

@media (max-width: 760px) {
  .project-meta-grid,
  .project-showcase-grid,
  .process-columns,
  .other-projects-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   PROJECT PAGE -- OVERVIEW LAYOUT
   Two-column layout: info/metadata on the left, gallery on the right
   ============================================================ */

.project-overview-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}

.project-overview-info,
.project-overview-gallery {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.16);
}

/* Hero cover image at the top of the gallery column */
.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* Stacked sections (description, roles, tools, etc.) in the info column */
.project-detail-list {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.project-detail-list section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.project-detail-list h2 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.project-detail-list p,
.project-detail-list li {
  color: var(--muted);
  font-size: 0.95rem;
}

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

/* Two-column label -> value grid for project metadata (date, role, etc.) */
.project-meta-grid-2col {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 0.85rem;
  margin-top: 0.35rem;
}

.meta-label,
.meta-value {
  margin: 0;
  color: var(--muted);
}

.meta-label {
  font-weight: 600;
}

/* Pill tag list used in the info column */
.project-tag-boxes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-tag-boxes li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.85rem;
}


/* ============================================================
   PROJECT PAGE -- IMAGE GALLERY
   Main image viewer with a scrollable thumbnail strip below
   ============================================================ */

.project-gallery-main-frame {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.project-gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Horizontal scrollable row of thumbnail buttons */
.project-gallery-track {
  --thumb-gap: 0.6rem;
  margin-top: 0.75rem;
  display: flex;
  gap: var(--thumb-gap);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
}

.project-thumb {
  flex: 0 0 calc((100% - (var(--thumb-gap) * 3)) / 3.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
}

.project-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.project-thumb:hover,
.project-thumb:focus-visible,
.project-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(120, 168, 255, 0.2);
}


/* ============================================================
   PROJECT PAGE -- DETAILS CONTENT
   Rich-text blocks, images, and embedded video in the details section
   ============================================================ */

.project-details-content {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

/* Generic content block (text, image, or video) */
.project-details-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.16);
  margin: 0;
}

.project-details-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Responsive iframe wrapper for embedded video */
.project-details-video-frame {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.project-details-video-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}


/* ============================================================
   PROJECT PAGE -- IMAGE COMPARE
   Before/after slider with draggable divider
   ============================================================ */

.project-details-image-compare {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.project-details-image-compare.project-details-block {
  padding: 0;
  background: none;
}

.image-compare-after {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.image-compare-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  clip-path: inset(0 50% 0 0);
}

.image-compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--text);
  transform: translateX(-50%);
  z-index: 2;
}

.image-compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.image-compare-handle svg {
  width: 20px;
  height: 20px;
}

.image-compare-labels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.6rem;
  z-index: 3;
  pointer-events: none;
}

.image-compare-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

@media (max-width: 640px) {
  .image-compare-handle {
    width: 32px;
    height: 32px;
  }

  .image-compare-handle svg {
    width: 16px;
    height: 16px;
  }
}
