.project-main {
  padding: 3rem 0 6rem;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.project-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1.1;
  margin-bottom: 1rem;
  transition: color 0.4s ease;
}

.project-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--c-text-muted);
  border-left: 3px solid var(--c-mid);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.project-hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-surface);
  margin-bottom: 1.5rem;
}

.project-hero-media--square {
  aspect-ratio: 1 / 1;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.project-hero-media__caption {
  position: absolute;
  bottom: 0.6rem;
  left: 0.75rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.45);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.project-hero-media img,
.project-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-gallery--square .project-hero-media {
  aspect-ratio: 1 / 1;
}

.project-jump-btn {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-accent);
  border: 1.5px solid var(--c-accent);
  padding: 8px 20px;
  border-radius: var(--radius);
  margin-bottom: 3rem;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}

.project-jump-btn:hover {
  background: var(--c-accent);
  color: var(--c-white);
}

.project-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 90px;
}

.project-section__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-light);
  transition: color 0.4s ease, border-color 0.4s ease;
}

.project-section p {
  font-size: 0.95rem;
  color: var(--c-text);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 1rem;
  transition: color 0.4s ease;
}

.credits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.credits-table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--c-light);
  color: var(--c-text);
  vertical-align: top;
  transition: color 0.4s ease, border-color 0.4s ease;
}

.credits-table tr:last-child td { border-bottom: none; }

.credits-table a {
  color: var(--c-accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.credits-table a:hover { border-bottom-color: var(--c-accent); }

.credits-table__highlight td {
  font-weight: 600;
  color: var(--c-accent);
}

.credits-table__highlight td:first-child a {
  color: var(--c-accent);
}

.sidebar-block {
  background: var(--c-surface);
  border: 1px solid var(--c-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.sidebar-block__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 0.875rem;
  transition: color 0.4s ease;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--c-text);
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: var(--c-light);
  color: var(--c-dark);
}

.sidebar-link__icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.sidebar-link__icon i {
  font-size: 1rem;
  color: var(--c-text-muted);
  transition: color 0.2s;
}

.sidebar-link:hover .sidebar-link__icon i { color: var(--c-dark); }

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  padding: 4px;
  margin: -4px;
  transition: background 0.15s;
}

.award-item:hover { background: var(--c-light); }

.award-item__icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }

.award-item__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.award-item__place {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-dark);
  transition: color 0.4s ease;
}

.award-item__name {
  font-size: 0.8rem;
  color: var(--c-text);
  transition: color 0.4s ease;
}

.award-item__location {
  font-size: 0.7rem;
  color: var(--c-text-muted);
  transition: color 0.4s ease;
}

.info-list {
  display: flex;
  flex-direction: column;
}

.info-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--c-light);
  font-size: 0.825rem;
  transition: border-color 0.4s ease;
}

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

.info-item dt {
  color: var(--c-text-muted);
  font-weight: 400;
  transition: color 0.4s ease;
}

.info-item dd {
  color: var(--c-text);
  font-weight: 500;
  transition: color 0.4s ease;
}

.contributions-also {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-light);
  font-size: 0.8rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  transition: border-color 0.4s ease;
}

.contributions-also__switch {
  color: var(--c-accent);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.contributions-also__switch:hover { border-bottom-color: var(--c-accent); }

.contrib--design,
.contrib--programming,
.contributions-also--design,
.contributions-also--programming {
  display: block;
  overflow: hidden;
  transition: opacity 0.35s ease, max-height 0.35s ease, margin 0.35s ease, padding 0.35s ease;
  opacity: 1;
}

.contrib {
  border-left: 2px solid var(--c-light);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.4s ease, padding 0.35s ease, margin 0.35s ease, border-left-width 0.35s ease;
}

.contrib__title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 0.4rem;
  transition: color 0.4s ease;
}

.contrib--programming,
.contributions-also--programming {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding-left: 0;
  border-left-width: 0;
}

body.mode--programming .contrib--design,
body.mode--programming .contributions-also--design {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding-left: 0;
  border-left-width: 0;
}

body.mode--programming .contrib--programming,
body.mode--programming .contributions-also--programming {
  max-height: 9000px;
  opacity: 1;
  padding-left: 1rem;
  border-left-width: 2px;
}

body.mode--programming .contrib { border-left-color: #2a2a4a; }
body.mode--programming .contrib__title { color: var(--c-mid); }

body.mode--programming .credits-table__highlight td { color: var(--c-light); }
body.mode--programming .credits-table__highlight td:first-child a { color: var(--c-light); }

body.mode--programming .project-title          { color: var(--c-light); }
body.mode--programming .project-quote          { color: #8888aa; border-left-color: var(--c-mid); }
body.mode--programming .project-section__title { color: var(--c-light); border-bottom-color: #2a2a4a; }
body.mode--programming .project-section p      { color: #c0c0d8; }
body.mode--programming .project-hero-media     { background: #16162a; }
body.mode--programming .project-gallery__item  { background: #16162a; }

body.mode--programming .sidebar-block          { background: #16162a; border-color: #2a2a4a; }
body.mode--programming .sidebar-block__title   { color: #8888aa; }
body.mode--programming .sidebar-link           { color: var(--c-light); }
body.mode--programming .sidebar-link:hover     { background: #2a2a4a; color: var(--c-light); }
body.mode--programming .sidebar-link__icon i   { color: #8888aa; }
body.mode--programming .sidebar-link:hover .sidebar-link__icon i { color: var(--c-light); }
body.mode--programming .award-item:hover       { background: #2a2a4a; }
body.mode--programming .award-item__place      { color: var(--c-light); }
body.mode--programming .award-item__name       { color: #c0c0d8; }
body.mode--programming .award-item__location   { color: #8888aa; }
body.mode--programming .info-item              { border-bottom-color: #2a2a4a; }
body.mode--programming .info-item dt           { color: #8888aa; }
body.mode--programming .info-item dd           { color: var(--c-light); }
body.mode--programming .credits-table td       { color: #c0c0d8; border-bottom-color: #2a2a4a; }

body.mode--programming .feature-list li        { color: #c0c0d8; }
body.mode--programming .feature-list li::before { color: #66668f; }

.strong {
  font-weight: 900;
  color: var(--c-dark);
}

body.mode--programming .strong {
  color: var(--c-light);
}

.project-gallery { display: grid; gap: 0.75rem; }

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

.project-gallery--3 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
}
.project-gallery--3 .project-gallery__item:first-child {
  grid-column: 1 / -1;
}

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

.project-gallery--5 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
}
.project-gallery--5 .project-gallery__item:nth-child(-n+2) {
  grid-column: span 1;
}
.project-gallery--5 .project-gallery__item:first-child {
  grid-column: 1 / 3;
}

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

.project-gallery__item {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-surface);
  cursor: pointer;
  transition: transform 0.35s ease;
}

.project-gallery__item:hover {
  transform: scale(1.2);
  z-index: 1;
}

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

.project-gallery--centered {
  display: flex;
  justify-content: center;
}

.project-gallery--centered .project-gallery__item {
  width: 40%;
  max-width: 400px;
  cursor: default;
  transition: none;
}

.project-gallery--centered .project-gallery__item:hover {
  transform: none;
  z-index: auto;
}

.project-gallery--portrait { grid-template-columns: repeat(3, 1fr); }
.project-gallery--card     { grid-template-columns: repeat(4, 1fr); }
.project-gallery--map     { grid-template-columns: repeat(1, 1fr); }

.project-gallery--portrait .project-gallery__item img { aspect-ratio: 582 / 1215; }
.project-gallery--card     .project-gallery__item img { aspect-ratio: 732 / 1098; }
.project-gallery--map     .project-gallery__item img { aspect-ratio: 2549 / 850; }

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

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--c-text-muted);
  font-size: 0.9rem;
}

.feature-list li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.55rem;
  color: var(--c-text);
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 300;
  overflow-wrap: anywhere;
  word-break: break-word;
}

ul.feature-list {
    list-style: none;
    padding: 0;
}

ul.feature-list li::before {
    content: "•";
}

ol.feature-list {
    list-style: decimal;
    padding-left: 1.5rem;
}

ol.feature-list li::before {
    content: none;
}

.project-section a {
  color: var(--c-accent);
  border-bottom: 1px solid var(--c-accent);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.project-section a:hover {
  color: var(--c-dark);
  border-bottom-color: var(--c-dark);
}

.project-section p > i {
  display: block;
  text-align: center;
  font-style: italic;
  color: var(--c-text-muted);
  margin: 0.5rem 2rem;
}

.contrib p > a {
  font-weight: 600;
  color: var(--c-mid);
  border-bottom: none;
}

.contrib p > a:hover {
  color: var(--c-dark);
}

.credits-table a {
  border-bottom: none;
}

.project-gallery--map .project-gallery__item {
  cursor: default;
  transition: none;
}

.project-gallery--map .project-gallery__item:hover {
  transform: none;
}

.project-gallery__item {
  position: relative;
}

.contributions-also--programming {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

body.mode--programming .contributions-also--design {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.media-with-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.media-with-text__content {
  flex: 1;
}

.media-with-text__content p {
  margin-bottom: 0;
}

.audio-player {
  flex-shrink: 0;
  width: 220px;
}

.doc-section {
    display: block;
    margin: 2rem 0;
    padding: 1.5rem;
    padding-bottom: 0.5rem;
    background: var(--c-surface);
    border: 1px solid var(--c-light);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    width: 100%;
    max-height: 800px;
    overflow-y: auto;
    box-sizing: border-box;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

.doc-section h1,
.doc-section h2,
.doc-section h3,
.doc-section p,
.doc-section li {
    font-family: var(--font-body), system-ui, sans-serif;
}

.doc-section > h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-dark);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--c-light);
}

.doc-section > h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--c-dark);
    margin: 2rem 0 1rem 0; 
}

.doc-section > h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--c-accent);
    margin: 1.25rem 0 0.5rem 0;
}

.doc-section > p {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--c-text);
    margin: 0 0 1rem 0;
}

.doc-section > ul, 
.doc-section > ol {
    margin: 0 0 1.5rem 1.25rem;
    padding: 0;
}

.doc-section li {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--c-text);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0;
}

.doc-section li::before {
    content: none !important;
}

.doc-section ul {
    list-style-type: disc;
}

.doc-section ol {
    list-style-type: decimal;
}

.doc-section > *:last-child {
    margin-bottom: 0 !important;
}

.doc-section > ul:last-child,
.doc-section > ol:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.doc-section li > ul,
.doc-section li > ol {
    list-style-type: circle;
    margin: 1.5rem 0 1.5rem 2.25rem;
    padding: 0;
}

body.mode--programming .doc-section {
    background: #16162a;
    border-color: #2a2a4a;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
body.mode--programming .doc-section > h1,
body.mode--programming .doc-section > h2 {
    color: var(--c-light);
}
body.mode--programming .doc-section > h1 {
    border-bottom-color: #2a2a4a;
}
body.mode--programming .doc-section > p,
body.mode--programming .doc-section li {
    color: #c0c0d8;
}

.doc-section::-webkit-scrollbar {
    width: 8px;
}
.doc-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.doc-section::-webkit-scrollbar-thumb {
    background: var(--c-light);
    border-radius: 4px;
}
.doc-section::-webkit-scrollbar-thumb:hover {
    background: var(--c-text-muted);
}

body.mode--programming .doc-section::-webkit-scrollbar-track {
    background: #16162a;
}
body.mode--programming .doc-section::-webkit-scrollbar-thumb {
    background: #2a2a4a;
}
body.mode--programming .doc-section::-webkit-scrollbar-thumb:hover {
    background: #66668f;
}

body.mode--programming .contrib--programming + .contrib--programming {
  margin-top: 1.5rem;
}

body.mode--programming .contrib--programming {
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .project-layout  { grid-template-columns: 1fr; }
  .project-sidebar { position: static; }
}

@media (max-width: 768px) {
  .feature-columns { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (max-width: 600px) {
  .project-gallery { grid-template-columns: 1fr; }
  .info-item       { grid-template-columns: 90px 1fr; }
}

.project-gallery--map {
  margin-bottom: 1rem;
}