:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #171717;
  --muted: #5f5f5f;
  --accent: #1c1c1c;
  --accent-soft: #f6f6f6;
  --border: #e6e6e6;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 110%; /* ~17.6px base */
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(960px, calc(100% - 5rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: none;
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  position: relative;
  margin-left: 55px;
}

.earth-widget {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #df5252;
  background: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.earth-icon {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: url("assets/earthicon.jpg") center / cover no-repeat;
  border: 1px solid #abd7e2;
}

.co2-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 0.55rem 0.65rem;
  border: 2px solid #e06a6a;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

.co2-popover p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.co2-popover p:first-child {
  white-space: nowrap;
}

.co2-popover sub {
  font-size: 0.68em;
  vertical-align: baseline;
  position: relative;
  bottom: -0.2em;
}

.co2-source {
  margin-top: 0.2rem;
  font-size: 0.73rem !important;
  line-height: 1.1;
  color: #7d7d7d;
}

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

.nav-links {
  margin: 0;
  padding: 0.34rem 0.48rem;
  list-style: none;
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  border: 2px solid #d2d2d2;
  border-radius: 999px;
  background: #ffffff;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
}

.nav-links a:hover {
  color: var(--text);
  background: #f5f5f5;
}

.nav-links a.active {
  color: #ffffff;
  background: #111111;
}

.nav-links a.active:hover {
  color: #ffffff;
  background: #111111;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 3.2rem;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
}

.profile-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.65rem;
  transform: translateX(-54px);
}

.profile-wrap {
  position: relative;
  width: 164px;
  height: 164px;
  margin: 0;
  filter: none;
  transform: translateX(0);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  margin: 0;
  border: 5px solid #d3d3d3;
  position: relative;
  z-index: 2;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.14),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0;
  position: absolute;
  left: calc(50% + 96px);
  top: 50%;
  transform: translateY(-50%);
}

.status-pill-rainbow {
  border: 2.5px solid transparent;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(
        120deg,
        #ff7a7a,
        #ffb86b,
        #ffe56b,
        #7ee787,
        #7dd3fc,
        #c4b5fd,
        #ff7a7a
      )
      border-box;
  background-size: 100% 100%, 280% 280%;
  background-position: 0 0, 0% 50%;
  animation: rainbow-shimmer 3.8s linear infinite;
}

.intro {
  font-size: 1rem;
  margin: 0 0 0.62rem;
  color: var(--muted);
}

.name {
  margin: 0 0 1.35rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2.2rem, 5.4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0.012em;
}

.hero-line {
  width: min(640px, 100%);
  margin: 0 auto 1.35rem;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text);
}

.hero-actions {
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-actions .button {
  padding: 0.82rem 1.3rem;
  font-size: 1.06rem;
}

.button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.62rem 1.02rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.92rem;
}

.button-primary {
  background: #111111;
  color: #fff;
  border-color: #111111;
}

.button-primary:hover {
  background: #000000;
}

.button-outline {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff;
}

.button-outline:hover {
  background: var(--accent-soft);
}

.rainbow-outline {
  position: relative;
  color: var(--text);
  border: 2px solid transparent;
  background: linear-gradient(
      #ffffff,
      #ffffff
    )
    padding-box,
    linear-gradient(
      120deg,
      #ff7a7a,
      #ffb86b,
      #ffe56b,
      #7ee787,
      #7dd3fc,
      #c4b5fd,
      #ff7a7a
    )
    border-box;
  background-size: 100% 100%, 280% 280%;
  background-position: 0 0, 0% 50%;
  animation: rainbow-shimmer 4s linear infinite;
}

@keyframes rainbow-shimmer {
  0% {
    background-position: 0 0, 0% 50%;
  }
  50% {
    background-position: 0 0, 100% 50%;
  }
  100% {
    background-position: 0 0, 200% 50%;
  }
}

.section {
  padding: 2.5rem 0;
}

.about p,
.page-intro p,
.cv-entry p,
.education-card p,
.project-detail-copy p,
.contact-card p {
  color: var(--muted);
}

.about p {
  font-size: 1.16rem;
  line-height: 1.78;
}

.about {
  max-width: 780px;
  margin-top: 2.1rem;
  margin-bottom: 2.5rem;
  margin-left: auto;
  margin-right: auto;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
  padding-top: 1.3rem;
  padding-bottom: 1.3rem;
}

.page-main {
  padding: 2rem 0 3.4rem;
}

.page-intro h1,
.section h2 {
  margin-bottom: 0.5rem;
}

.page-intro h1 {
  font-size: clamp(2.1rem, 4.6vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.projects-page {
  min-height: calc(100vh - 140px);
  padding-left: 4.5rem;
  padding-right: 4.5rem;
}

.projects-stage {
  min-height: calc(100vh - 220px);
  display: grid;
  grid-template-rows: 2fr 1fr;
  gap: 2.7rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  max-width: 860px;
  margin: 0 auto;
}
.project-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.75rem;
  position: relative;
}

.bee-star {
  position: absolute;
  left: -30px;
  top: -22px;
  font-size: 56px;
  color: #fff200;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  transform: rotate(-20deg);
  -webkit-text-stroke: 1px #c9a800;
}

.project-thumb-media {
  width: 100%;
  aspect-ratio: 1 / 1; /* make tiles square */
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(12,12,12,0.06);
  border: 1.5px solid #e2e8f0;
}

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

.project-thumb-placeholder {
  background: linear-gradient(135deg, #e8f0e8 0%, #d4e8d4 50%, #c8dfc8 100%);
}

/* smooth image transform and specific zoom for one tile */
.project-thumb-media img {
  transition: transform 260ms cubic-bezier(.2,.9,.3,1);
  transform-origin: center center;
}
.project-thumb-media img.zoom-in {
  transform: scale(1.08);
}

.project-thumb-title {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  background: #c4c4c4;
  border: 2px solid transparent;
  width: 100%;
  transition: background 200ms;
}

.project-thumb:hover .project-thumb-title {
  background: #b0b0b0;
}

/* Add spacing between the intro and the gallery */
.projects-stage { margin-top: 3rem; }

.project-detail {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 34%);
  gap: 1rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-height: 100%;
}

.project-detail-copy h2 {
  margin-top: 0.1rem;
  margin-bottom: 0.45rem;
}

.project-detail-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.project-detail-description {
  display: grid;
  gap: 0.55rem;
}

.project-detail-side {
  border: 0;
  border-radius: 0;
  min-height: 170px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
}

.project-detail-side img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: contain;
}

.project-detail-side p {
  margin: 0;
  font-size: 0.82rem;
  color: #9a9a9a;
}

.project-detail-side.is-empty img {
  display: none;
}

.cv-layout {
  display: grid;
  gap: 3.2rem;
  max-width: 820px;
  margin-top: 1.2rem;
  margin-bottom: 1.4rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.cv-page-heading {
  font-size: clamp(2.1rem, 4.6vw, 2.8rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 0.8rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.9rem;
  position: relative;
}

.cv-page-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.8rem;
  height: 1.5px;
  background: #cccccc;
}

.cv-page-subhead {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.6rem;
}

.cv-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaaaaa;
  margin: 0 0 1.8rem;
}

.cv-experience {
  display: grid;
  gap: 0;
  padding-left: 2rem;
}

.cv-experience h2,
.cv-education h2 {
  margin: 0 0 0.6rem;
}

.cv-entry {
  position: relative;
  padding: 0 0 0.5rem 1.8rem;
  margin-bottom: 2.2rem;
}

/* pin circle head */
.cv-entry::before {
  content: '';
  position: absolute;
  left: -0.45rem;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #9aabb8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  z-index: 1;
}

/* vertical line runs only the height of the entry content, stops before the margin gap */
.cv-entry::after {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 0;
  width: 1.5px;
  background: #dedede;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry-head,
.education-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.cv-entry-head h3,
.education-head h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
}

.cv-entry-head span,
.education-head span {
  color: #aaaaaa;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-org {
  margin: 0 0 0.4rem;
  color: #7a8fa6;
  font-weight: 800;
  font-size: 0.95rem;
}

.cv-entry p:last-child {
  margin: 0;
}

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

.education-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #ffffff;
  box-shadow: none;
}

.education-card p {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}

.cv-awards {
  padding-top: 0.2rem;
}

.cv-awards .cv-section-label {
  color: var(--text);
  letter-spacing: 0.06em;
  text-align: left;
  margin-bottom: 0.4rem;
}

.cv-awards-list {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.9;
  text-align: center;
}

.contact-page {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.contact-page .contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.contact-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.contact-centered .page-intro {
  align-self: flex-start;
  width: 100%;
  padding-bottom: 1.2rem;
  border-bottom: 1.5px solid #e6e6e6;
  margin-bottom: 0.5rem;
}


.contact-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  display: grid;
  align-content: center;
  gap: 0.8rem;
}

.contact-card h2,
.contact-info h2 {
  margin-top: 0;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 0;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  text-decoration: none;
  color: var(--text);
  min-width: 240px;
  min-height: 64px;
  padding: 1rem 1.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  transition: box-shadow 200ms, border-color 200ms;
}

.social-btn-email {
  border-color: transparent;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(
      120deg,
      #ff7a7a,
      #ffb86b,
      #ffe56b,
      #7ee787,
      #7dd3fc,
      #c4b5fd,
      #ff7a7a
    ) border-box;
  background-size: 100% 100%, 280% 280%;
  background-position: 0 0, 0% 50%;
  animation: rainbow-shimmer 3.8s linear infinite;
}

.contact-location {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.3rem 0 0;
}

.contact-location svg {
  width: 15px;
  height: 15px;
  fill: #9aabb8;
  flex-shrink: 0;
}

.social-btn svg {
  width: 20px;
  height: 20px;
  fill: #5f5f5f;
  flex: 0 0 auto;
}

.social-btn:hover {
  border-color: transparent;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(
        120deg,
        #ff7a7a,
        #ffb86b,
        #ffe56b,
        #7ee787,
        #7dd3fc,
        #c4b5fd,
        #ff7a7a
      )
      border-box;
  background-size: 100% 100%, 280% 280%;
  background-position: 0 0, 0% 50%;
  animation: rainbow-shimmer 3.8s linear infinite;
}

.social-btn:hover svg {
  fill: #1f1f1f;
}

.contact-info-email {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(
      120deg,
      #ff7a7a,
      #ffb86b,
      #ffe56b,
      #7ee787,
      #7dd3fc,
      #c4b5fd,
      #ff7a7a
    ) border-box;
  background-size: 100% 100%, 280% 280%;
  background-position: 0 0, 0% 50%;
  animation: rainbow-shimmer 3.8s linear infinite;
}

.contact-info-location {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.contact-info-location svg {
  width: 16px;
  height: 16px;
  fill: #777777;
  flex: 0 0 auto;
}

.tech-stack {
  margin-bottom: 0.5rem;
  padding-top: 1.2rem;
}

.tech-stack-head {
  text-align: left;
}

.tech-marquee {
  width: 100%;
  overflow: hidden;
  margin-top: 0.8rem;
  padding: 0.35rem 0;
}

.tech-track {
  width: max-content;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  animation: tech-scroll 30s linear infinite;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes tech-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.footer-wrap {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .header-left {
    margin-left: 0;
  }

  .container {
    width: min(960px, calc(100% - 2rem));
  }

  .profile-wrap {
    width: 132px;
    height: 132px;
    transform: translateX(0);
  }

  .profile-row {
    margin-bottom: 1.35rem;
    transform: translateX(-32px);
  }

  .status-pill {
    left: calc(50% + 78px);
    font-size: 0.74rem;
    padding: 0.33rem 0.66rem;
  }

  .hero {
    padding-top: 3.4rem;
  }

  .projects-stage {
    min-height: auto;
    grid-template-rows: auto auto;
  }

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

  .project-detail {
    grid-template-columns: 1fr;
  }

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

  .tech-track {
    animation-duration: 24s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-track {
    animation: none;
  }

  .rainbow-outline {
    animation: none;
  }
}

/* Project subpage styles */
.project-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.4rem;
}

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

.project-page-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.4rem;
  margin-bottom: 2rem;
}

.project-page-header h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  line-height: 1.15;
}

.project-page-intro {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 680px;
}

.project-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-figures.single {
  grid-template-columns: 1fr;
  max-width: 820px;
}

.project-figures.poster {
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
}

.project-figure {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.project-figure img {
  width: 100%;
  display: block;
  object-fit: contain;
}

.project-figure figcaption {
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

.project-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Project subpage template ──────────────────────────────── */

/* Outer wrapper — sets the generous side margins */
.pj-page {
  padding: 2rem 0 4rem;
}

/* Inner content — narrower than the default container for bigger side margins */
.pj-inner {
  width: min(860px, calc(100% - 10rem));
  margin: 0 auto;
  padding-left: 1.5rem;
}

/* Page header: title + lede above the two-column body */
.pj-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.6rem;
  margin-bottom: 2.2rem;
}

.pj-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.7rem, 3.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pj-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.68;
  max-width: 640px;
}

/* Layout: scope box floats top-right, body text wraps beneath it */
.pj-layout {
  display: block;
}

.pj-layout::after {
  content: '';
  display: table;
  clear: both;
}

.pj-sidebar {
  float: right;
  width: 210px;
  margin-left: 2.6rem;
  margin-bottom: 1.4rem;
}

/* Main body */
.pj-body {
  min-width: 0;
}

/* Individual subsections */
.pj-section {
  margin-bottom: 2.6rem;
}

.pj-section:last-child {
  margin-bottom: 0;
}

.pj-section h2,
.pj-body h2 {
  margin: 0 0 0.7rem;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: inherit;
  color: inherit;
}

/* Space between toggle and the section that follows it */
.pj-toggle + .pj-section {
  margin-top: 2.6rem;
}

.pj-section p {
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.72;
}

.pj-section p:last-child {
  margin-bottom: 0;
}

/* Toggle / disclosure for processing section */
.pj-toggle {
  border: none;
  margin-bottom: 1rem;
}

.pj-toggle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
  line-height: 1.72;
  margin-top: 0.5rem;
}

.pj-toggle[open] summary {
  margin-bottom: 0.8rem;
}

.pj-toggle summary::-webkit-details-marker { display: none; }

.pj-toggle summary::before {
  content: '▶';
  font-size: 0.65em;
  color: var(--text);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.pj-toggle[open] summary::before {
  transform: rotate(90deg);
}

.pj-toggle p {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.72;
}

.pj-toggle p:last-child {
  margin-bottom: 0;
}

/* Figure wrapper — used for both real images and placeholders */
.pj-fig-placeholder {
  margin: 1.4rem 0;
}

.pj-fig-placeholder figcaption {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Dashed placeholder box — only shown when there is no <img> */
.pj-fig-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0f0f0;
  border: 1.5px dashed #d0d0d0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #aaaaaa;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Wide single figure */
.pj-fig-wide .pj-fig-box {
  aspect-ratio: 21 / 9;
}

/* Two-up figure grid — bleeds slightly past the text column */
.pj-fig-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.4rem -6rem 1.4rem -4.5rem;
}

.scope-box {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.2rem;
  background: #fafafa;
}

.scope-label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #aaaaaa;
  text-align: center;
}

.scope-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.scope-list dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888888;
  margin-bottom: 0.1rem;
}

.scope-list dd {
  margin: 0 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .pj-inner {
    width: min(860px, calc(100% - 3rem));
  }

  .pj-sidebar {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 1.6rem;
  }

  .pj-fig-grid {
    grid-template-columns: 1fr;
    margin: 1.4rem 0;
  }
}

/* ── Project modal styles ──────────────────────────────────── */
.project-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 120;
}
.project-modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  z-index: 120;
  pointer-events: auto;
}
.modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 3rem));
  max-height: calc(100vh - 4rem);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  overflow: auto;
  padding: 1.25rem;
  z-index: 121;
  pointer-events: auto;
}
.modal-close {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  border: 0;
  background: transparent;
  font-size: 1.05rem;
  cursor: pointer;
  z-index: 122;
}
.project-modal { pointer-events: auto; }
.modal-header h3 { margin: 0 0 0.6rem 0; }
.modal-body { display: grid; gap: 1rem; }
.modal-gallery { display: grid; gap: 0.6rem; align-items: center; }
.modal-gallery img { width: 100%; max-height: 480px; object-fit: contain; border-radius: 8px; }
.modal-copy p { margin: 0 0 0.6rem 0; color: var(--muted); }
.modal-links a { display: inline-block; margin-right: 0.6rem; margin-top: 0.6rem; }
.modal-nav { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.6rem; }

@media (max-width: 640px) {
  .modal-dialog { width: calc(100% - 2rem); padding: 0.9rem; }
  .modal-gallery img { max-height: 260px; }
}
