.container {
  border: 1px solid #ccc;
  background: #f9f9f9;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #1a1a1a;
  max-width: 800px;
  margin: 16px 0;
}

.home-layout {
  --layout-gap: 20px;
  display: flex;
  gap: var(--layout-gap);
  align-items: start;
  margin: 16px 0;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
  flex: 0 1 800px;
  min-width: 0;
}

.home-main .container {
  margin: 0;
}

.container h1 {
  background: #dedede;
  border-bottom: 2px solid #b8b8b8;
  margin: -12px -16px 14px -16px;
  padding: 8px 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.container h2 {
  background: transparent;
  border-left: 4px solid #b8b8b8;
  margin: 16px 0 8px 0;
  padding: 2px 0 2px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #444;
}

.gallery-container {
  max-width: 800px;
}

.gallery-intro {
  margin: 0 0 14px 0;
}

.gallery-page .collapsible {
  background-color: #dedede;
  color: #1a1a1a;
  cursor: pointer;
  padding: 14px 16px;
  width: 100%;
  border: 1px solid #c9c9c9;
  border-bottom: none;
  text-align: left;
  outline: none;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 0;
  margin: 12px 0 0 0;
  transition: background-color 0.2s ease;
}

.gallery-page .collapsible:hover {
  background-color: #d4d4d4;
}

.gallery-page .collapsible:after {
  content: "+";
  font-size: 1.2rem;
  float: right;
  line-height: 1;
}

.gallery-page .collapsible.active:after {
  content: "−";
}

.gallery-page .content-section {
  padding: 14px 16px 16px 16px;
  display: none;
  overflow: hidden;
  background-color: #f9f9f9;
  border: 1px solid #c9c9c9;
  border-top: none;
  border-radius: 0;
  margin-top: 0;
}

.gallery-page .image-box {
  width: 100%;
  height: auto;
  background-color: #ffffff;
  border: 1px solid #d7d7d7;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gallery-page .image-box img,
.gallery-page .image-box iframe {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 0;
}

.gallery-page .image-box img {
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

.gallery-page .image-box-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(34, 34, 34, 0.78);
  padding: 8px 12px;
  border-radius: 0;
  font-size: 0.95rem;
  color: #ffffff;
}

.gallery-page .image-box iframe {
  min-height: 315px;
}

.topnav {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 16px;
  background: #e8e8e8;
  border-bottom: 1px solid #ccc;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  margin-right: 16px;
  padding: 12px 8px;
  color: #1a1a1a;
}

.topnav a {
  text-decoration: none;
  color: #1a1a1a;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-bottom: 3px solid transparent;
}

.topnav a:hover {
  background: #d8d8d8;
}

.topnav a.active {
  background: #c8c8c8;
  border-bottom: 3px solid #888;
  text-decoration: underline;
}

.breadcrumb {
  background: #f5f5f5;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #666;
  border-bottom: 1px solid #ccc;
}

.breadcrumb a {
  color: #0066cc;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 6px;
}

.profile-pic {
  width: 200px;
  height: 200px;
  object-fit: cover;
  margin: 20px 0;
}

.tools-container {
  margin: 0;
  flex: 0 0 640px;
}

/* Projects page */
.projects-page .container {
  max-width: 860px;
}

.projects-page .container>h1 {
  text-align: center;
}

.projects-page .project-content {
  text-align: center;
}

.projects-page .project-content ul {
  display: inline-block;
  text-align: left;
  list-style-position: inside;
  padding-left: 0;
  margin: 0 auto;
}

.projects-page .project-content .gallery-button {
  margin: 0;
}

.projects-page .project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.projects-page .project-progress {
  max-width: 560px;
  margin: 20px auto 0;
}

.projects-page .project-progress h2 {
  background: none;
  border: 0;
  margin: 0 0 8px 0;
  padding: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #444;
}

.projects-page .project-progress p {
  margin-top: 8px;
}

.projects-page .project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.projects-page .project-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d2d2d2;
  background: #fff;
  padding: 10px;
}

.projects-page .project-list-item:hover {
  background: #ececec;
}

.projects-page .project-list-thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  flex: 0 0 150px;
  border: 1px solid #cfcfcf;
}

.projects-page .project-list-text {
  min-width: 0;
}

.projects-page .project-list-text h2 {
  margin: 0 0 8px 0;
  padding: 0;
  border: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  background: transparent;
}

.projects-page .project-list-text p {
  margin: 0;
}

.projects-page .tools-container {
  flex: none;
  width: 100%;
}

.projects-page .tools-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

/* Tools */
.tools-page-section {
  margin-top: 16px;
}

.tools-page-section .tools-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.tools-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.tool-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d2d2d2;
  background: #fff;
  padding: 10px;
  flex: 0 0 auto;
  width: 100%;
}

.tool-list-item:hover {
  background: #ececec;
}

.tool-list-thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  flex: 0 0 150px;
  border: 1px solid #cfcfcf;
}

.tool-list-text {
  min-width: 0;
}

.tool-list-text h2 {
  margin: 0 0 8px 0;
  padding: 0;
  border: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  background: transparent;
}

.tool-list-text p {
  margin: 0;
}

/* Contact */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1a1a1a;
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid #d2d2d2;
  background: #fff;
}

.contact-item:hover {
  background: #ececec;
}

.contact-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: currentColor;
}

/* Project media */
.project-media {
  margin: 14px 0 10px 0;
}

.project-image {
  width: 250px;
  height: 250px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  margin: 0 auto 15px auto;
  box-shadow: 0 2px 8px rgba(46, 134, 171, 0.08);
}

.project-caption {
  font-size: 0.9em;
  color: #444;
  text-align: center;
  margin-top: 6px;
}

.project-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(46, 134, 171, 0.08);
}

.project-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-button {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #d2d2d2;
  border-radius: 0;
  background: #fff;
  color: #1a1a1a;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}

.gallery-button:hover {
  background: #ececec;
}

.project-progress {
  margin-top: 20px;
}

.project-progress h2 {
  margin-top: 0;
}

.progress-track {
  background-color: #ececec;
  border: 1px solid #d2d2d2;
  border-radius: 0;
  padding: 4px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.progress-fill {
  background-color: #2e86ab;
  height: 16px;
  border-radius: 0;
  transition: width 0.3s ease;
}

.projects-page .project-links .gallery-button {
  display: inline-block;
}

.project-progress p {
  color: #000;
  text-align: center;
  margin-top: 10px;
}

footer {
  border-top: 1px solid #ccc;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #666;
  margin-top: 32px;
}

/* ── Media Queries ── */

@media (max-width: 980px) {
  .home-layout {
    flex-direction: column;
  }

  .tools-row {
    flex-direction: column;
  }

  .projects-page .tools-row {
    gap: 12px;
  }

  .tools-container {
    flex-basis: auto;
    width: 100%;
  }

  .tool-list-item {
    width: 100%;
  }

  .tool-list-thumb {
    width: 120px;
    height: 120px;
    flex-basis: 120px;
  }

  .projects-page .tool-list-item {
    align-items: flex-start;
  }

  .projects-page .tool-list-thumb {
    width: 120px;
    height: 120px;
    flex-basis: 120px;
  }

  .projects-page .project-image {
    width: 100%;
    height: auto;
    max-width: 360px;
  }

  .project-image {
    width: 100%;
    height: auto;
    max-width: 360px;
  }

  .contact-item {
    word-break: break-word;
  }

  .gallery-button {
    display: block;
    margin-right: 0;
  }

  .projects-page .project-links {
    flex-direction: column;
  }

  .projects-page .project-list-item {
    align-items: flex-start;
  }

  .projects-page .project-list-thumb {
    width: 120px;
    height: 120px;
    flex-basis: 120px;
  }
}

@media (max-width: 640px) {

  .gallery-page .collapsible,
  .gallery-page .content-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gallery-page .image-box-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 980px) {
  .projects-page {
    width: 100%;
    overflow-x: hidden;
  }

  .projects-page .container {
    max-width: 100%;
    box-sizing: border-box;
  }
}