.projects-era {
  margin-bottom: 48px;
}

.era-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.era-label {
  white-space: nowrap;
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.era-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.era-count {
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.project-type-group {
  margin-bottom: 36px;
}

.type-label {
  margin-bottom: 12px;
  padding-left: 2px;
  color: var(--forest-mid);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.projects-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--warm-white);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  transition: box-shadow 0.25s, transform 0.2s;
}

.project-card:hover {
  box-shadow: 0 6px 32px rgba(26, 23, 20, 0.09);
  transform: translateY(-2px);
}

/* Thumb — square on the left for icon cards */
.project-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  overflow: hidden;
  border-bottom: none;
  border-right: 1px solid var(--border);
  background: var(--cream);
  flex-shrink: 0;
  align-self: center;
  margin: 12px 0 12px 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.project-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
}

.thumb-icon.backend {
  background: var(--pastelred);
}

.thumb-icon.systems {
  background: var(--pastelblue);
}

.thumb-icon.design {
  background: var(--pastelpurple);
}

.thumb-icon.ai {
  background: var(--pastelpink);
}

.thumb-icon.data {
  background: var(--pastelyellow);
}

.thumb-icon.iot {
  background: var(--pastelgreen);
}

.thumb-icon.cloud {
  background: var(--pastelorange);
}

.thumb-upload-hint {
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-body {
  padding: 16px 18px;
}

.project-number {
  margin-bottom: 4px;
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.project-title {
  margin-bottom: 6px;
  color: var(--forest-deep);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.project-desc {
  margin-bottom: 12px;
  color: var(--forest-mid);
  font-size: 12.5px;
  line-height: 1.65;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--cream);
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.tag.ongoing {
  background: #fff8e8;
  color: #b07a10;
}

.tag.placeholder {
  background: var(--cream);
  color: var(--forest-light);
}

/* ── Project school & year tabs ───────────────────────────────── */
.proj-school-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--stone);
}

.proj-school-btn {
  padding: 10px 24px 12px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--forest-mid);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -2px;
}

.proj-school-btn:hover { color: var(--forest-light); }

.proj-school-btn.active {
  color: var(--forest-mid);
  border-bottom-color: var(--forest-mid);
  font-weight: 500;
}

.proj-school-panel { display: none; }
.proj-school-panel.active { display: block; }

.proj-year-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.proj-year-btn {
  padding: 6px 18px;
  border: 1px solid var(--stone);
  border-radius: 2px;
  background: transparent;
  color: var(--forest-mid);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.proj-year-btn:hover {
  border-color: var(--forest-light);
  color: var(--forest-light);
}

.proj-year-btn.active {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  color: #fff;
}

.proj-year-panel { display: none; }
.proj-year-panel.active { display: block; }
/* ── Fix: project cards are now <a> tags ──────────────────────── */
a.project-card {
  display: flex;
  flex-direction: row;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 700px) {
  .projects-row {
    grid-template-columns: 1fr;
  }
}

/* ── Filter bar ───────────────────────────────────────────────── */
.proj-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.proj-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid var(--stone);
  border-radius: 20px;
  background: transparent;
  color: var(--forest-mid);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.proj-filter-btn:hover {
  border-color: var(--forest-light);
  color: var(--forest-light);
}

.proj-filter-btn.active {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  color: #fff;
}

.filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Type label row (with dot + count) ────────────────────────── */
.type-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 12.2px;
}

.type-count {
  margin-left: auto;
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* Dot colours matching icon types (using the green palette) */
.filter-dot.backend,   .type-dot.backend      { background: var(--pastelred); }
.filter-dot.design,.type-dot.design   { background: var(--pastelpurple); }
.filter-dot.ai,  .type-dot.ai     { background: var(--pastelpink); }
.filter-dot.data,  .type-dot.data     { background: var(--pastelyellow); }
.filter-dot.systems,.type-dot.systems { background: var(--pastelblue); }
.filter-dot.iot,.type-dot.iot{ background: var(--pastelgreen); }
.filter-dot.cloud, .type-dot.cloud    { background: var(--pastelorange); }

/* ── School badge on card ─────────────────────────────────────── */
.project-number-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-school-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
}

.card-school-badge.sit  { background: var(--leaf); color: var(--forest-mid); }
.card-school-badge.tp   { background: var(--border); color: var(--forest-deep); }
/* ── Project detail page ──────────────────────────────────────── */
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.breadcrumb-back {
  color: var(--forest-mid);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-back:hover { color: var(--forest-light); }

.breadcrumb-sep { color: var(--forest-light); }
.breadcrumb-current { color: var(--forest-mid); }

/* ── Detail header: two-col when image present ────────────────── */
.detail-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.detail-header-text {
  flex: 1;
  min-width: 0;
}

.detail-header-image {
  flex: 0 0 auto;
  width: clamp(180px, 24%, 300px);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
  display: none; /* shown by JS when image exists */
  align-self: flex-start;
}

.detail-header-image img {
  width: 100%;
  height: auto;       /* natural ratio — no cropping */
  max-height: 320px;  /* cap very tall portrait images */
  object-fit: contain;
  display: block;
}

@media (max-width: 600px) {
  .detail-header {
    flex-direction: column;
  }
  .detail-header-image {
    flex: 0 0 auto;
    width: 100%;
    max-height: 220px;
    aspect-ratio: unset;
  }
  .detail-header-image img {
    max-height: 220px;
    object-fit: contain;
    object-position: center;
  }
}

.detail-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.detail-header-text {
  flex: 1;
  min-width: 0;
}


.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-id {
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.detail-school-badge {
  padding: 3px 10px;
  border-radius: 2px;
  background: var(--cream);
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-ongoing {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 2px;
  background: var(--leaf);
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-title {
  margin-bottom: 8px;
  color: var(--forest-deep);
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 300;
  line-height: 1.15;
}

.detail-module {
  margin-bottom: 16px;
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Body: two-col */
.detail-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* Image */
.detail-image-wrap {
  margin-bottom: 32px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
}

.detail-image {
  width: 100%;
  display: block;
}

.detail-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
}

.detail-icon {
  width: 56px !important;
  height: 56px !important;
  font-size: 13px !important;
}

/* Full description */
.detail-section {
  margin-bottom: 32px;
}

.detail-section-label {
  margin-bottom: 10px;
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 1000;
}

.detail-full-desc {
  color: var(--forest-deep);
  font-size: 14.5px;
  line-height: 1.85;
}

.detail-full-desc ul {
  padding-left: 2rem;
  margin: 1rem 0;  
  list-style-position: outside; 
}

.detail-full-desc ol {
  padding-left: 2rem;
  margin: 1rem 0;  
  list-style-position: outside; 
}

.detail-full-desc li {
  margin-bottom: 0.5rem; 
  line-height: 1.6;    
}

/* Sidebar */
.detail-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}


.detail-sidebar-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.detail-sidebar-block:first-child {
  padding-top: 0;
}

.detail-sidebar-label {
  margin-bottom: 5px;
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-sidebar-value {
  color: var(--forest-deep);
  font-size: 14px;
  font-weight: 500;
}

.detail-sidebar-link {
  display: block;
  color: var(--forest-mid);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.detail-sidebar-link:hover { color: var(--forest-light); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
  .detail-sidebar {
    position: static;
    border-top: 1px solid var(--border);
    padding-top: 24px;
  }
  .proj-filter-bar {
    gap: 6px;
  }
  .proj-filter-btn {
    padding: 5px 12px;
    font-size: 9.5px;
  }
}

/* ── Module name on project card ──────────────────────────────── */
.project-module {
  margin-bottom: 4px;
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Feature wall (top of detail page) ───────────────────────── */
.detail-feature-wall {
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.detail-feature-wall.has-image {
  background-color: var(--cream);
}

/* Placeholder wall — coloured by icon type */
.detail-feature-wall.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-feature-wall.placeholder.backend      { background: var(--cream); }
.detail-feature-wall.placeholder.design   { background: #e8ede8; }
.detail-feature-wall.placeholder.ai     { background: var(--leaf); }
.detail-feature-wall.placeholder.data     { background: var(--leaf); }
.detail-feature-wall.placeholder.systems  { background: #e4ecf0; }
.detail-feature-wall.placeholder.embedded { background: #dde8e0; }
.detail-feature-wall.placeholder.cloud    { background: #e0eae8; }

.wall-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wall-icon {
  width: 64px !important;
  height: 64px !important;
  font-size: 13px !important;
  font-family: var(--mono);
  font-weight: 500;
}

.wall-placeholder-hint {
  color: var(--forest-light);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Google Drive / doc embed ─────────────────────────────────── */
.detail-embed-block {
  margin-bottom: 32px;
}

.detail-embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--cream);
}

/* Slides and video use 16:9 — less wasted space */
.detail-embed-wrap--slides,
.detail-embed-wrap--video {
  padding-top: 56.25%;
}

.detail-embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── GitHub button (inline with tags) ─────────────────────────── */
.detail-github-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 18px;
  border: 1.2px dashed var(--stone);
  border-radius: 2px;
  background: var(--warm-white);
  color: var(--forest-mid);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, border-style 0.2s;
  text-transform: uppercase;
}
.detail-github-btn:hover {
  border-color: var(--forest-mid);
  border-style: solid;
  color: #fff;
  background-color: var(--forest-deep);
}



/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-feature-wall {
    height: 180px;
  }
}
/* ── Embed caption ────────────────────────────────────────────── */
.detail-embed-caption {
  margin-top: 10px;
  color: var(--forest-mid);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Image embed: natural height, no fixed ratio ─────────────── */
.detail-embed-wrap--image {
  padding-top: 0 !important; /* override the 75% ratio used for iframes */
  position: static !important;
}

.app-container {
  margin-top: 0 !important;
}