@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Special+Elite&display=swap');

:root {
  --paper: #d8c18e;
  --paper-light: #ead9a9;
  --paper-dark: #b89b60;
  --paper-card: #f1e4bf;
  --ink: #2b2418;
  --muted: #66553a;
  --red: #7e3f2d;
  --red-hover: #9c4f39;
  --shadow: rgba(46, 32, 12, .28);
  --shadow-deep: rgba(35, 24, 9, .4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .15), transparent 25%),
    radial-gradient(circle at 80% 70%, rgba(73, 48, 20, .12), transparent 30%),
    repeating-linear-gradient(0deg, rgba(80, 55, 20, .035) 0 1px, transparent 1px 4px),
    #756342;
  font-family: "Courier Prime", "Courier New", monospace;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(0, 0, 0, .025) 7px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, .025) 8px);
  mix-blend-mode: multiply;
  z-index: 1;
}

.site-shell {
  width: min(1180px, calc(100% - 30px));
  margin: 28px auto;
  padding: 20px 24px 18px;
  background:
    linear-gradient(rgba(255, 255, 255, .08), rgba(0, 0, 0, .03)),
    var(--paper);
  border: 1px solid #7b6338;
  box-shadow:
    0 12px 35px var(--shadow),
    inset 0 0 45px rgba(87, 56, 16, .12);
  position: relative;
  z-index: 2;
}

.site-shell::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(64, 46, 21, .22);
  pointer-events: none;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 12px 18px;
  border-bottom: 3px double rgba(48, 37, 20, .65);
  position: relative;
}

/* ==========================================================================
   NAMEPLATE FLIP CARD
   ========================================================================== */

/* Outer flip wrapper — sets the 3D perspective */
.nameplate-flip {
  flex-shrink: 0;
  perspective: 700px;
  cursor: pointer;
  user-select: none;
}

/* The card that rotates */
.nameplate-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.45, .05, .55, .95);
  /* Match nameplate sizing */
  padding: 8px 20px 5px;
  width: max-content;
}

/* Flipped state — triggered by JS class */
.nameplate-flip.is-flipped .nameplate-inner {
  transform: rotateY(180deg);
}

/* FRONT face — the MISBAH text */
.nameplate-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -3px;
  transform: rotate(-1.5deg);
  background: rgba(232, 214, 166, .58);
  border: 1px solid #8e7444;
  box-shadow: 2px 3px 0 rgba(63, 45, 21, .2);
  padding: 8px 20px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

/* BACK face — the eye photo */
.nameplate-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  background: #1c160e;
  border: 2px solid #8e7444;
  box-shadow: 2px 3px 0 rgba(63, 45, 21, .3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nameplate-eye-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(.15) contrast(1.1) brightness(1.02) saturate(.9);
}

/* Subtle hint: a tiny pulse on the front to suggest it's clickable */
@keyframes nameplateHint {

  0%,
  90%,
  100% {
    box-shadow: 2px 3px 0 rgba(63, 45, 21, .2);
  }

  95% {
    box-shadow: 2px 3px 0 rgba(126, 63, 45, .5), 0 0 14px rgba(126, 63, 45, .25);
  }
}

.nameplate-front {
  animation: nameplateHint 4s 2s infinite ease-in-out;
}

/* Stop the hint pulse after first flip */
.nameplate-flip.is-flipped .nameplate-front {
  animation: none;
}

/* ==========================================================================
   END NAMEPLATE FLIP
   ========================================================================== */

.tagline {
  margin-left: auto;
  padding: 8px 16px;
  font-weight: 200;
  font-size: clamp(14px, 2vw, 21px);
  font-family: "Special Elite", "Courier New", monospace;
  background: #c5a65e;
  transform: rotate(.8deg);
  box-shadow: 3px 3px 0 rgba(57, 40, 18, .2);
  user-select: none;
}

.pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #40382b;
  box-shadow: 1px 2px 2px rgba(0, 0, 0, .45);
  position: absolute;
  right: 8px;
  top: 6px;
}


/* ==========================================================================
   MAIN CONTENT GRID
   ========================================================================== */

.content {
  display: grid;
  grid-template-columns: minmax(240px, .82fr) minmax(420px, 1.8fr) minmax(180px, .65fr);
  gap: 20px;
  padding: 22px 0 16px;
}

.panel {
  background:
    linear-gradient(rgba(255, 255, 255, .10), rgba(0, 0, 0, .035)),
    var(--paper-light);
  border: 1px solid #9a7e4b;
  box-shadow: 2px 3px 0 rgba(64, 44, 17, .15);
  padding: 17px;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  border-top: 1px solid rgba(72, 51, 22, .18);
}

.section-label {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 16px;
  letter-spacing: .04em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.intro {
  align-self: start;
  transform: rotate(-.35deg);
}

.intro p {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.intro p:last-of-type {
  margin-bottom: 0;
}

.identity {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: .05em;
}

/* ==========================================================================
   PORTRAIT SPECIMEN — NOEYES / YESEYES SWAP
   ========================================================================== */

.portrait-specimen {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.portrait-frame {
  position: relative;
  display: inline-block;
  padding: 5px;
  background: rgba(30, 22, 10, .1);
  border: 1px solid #8b7244;
  box-shadow:
    3px 4px 0 rgba(59, 42, 17, .25),
    inset 0 0 16px rgba(0, 0, 0, .12);
}

/* Portrait image fills the frame */
.portrait-img {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: cover;
  filter: sepia(.18) contrast(1.08) brightness(.97);
  transition: opacity .18s ease, filter .3s ease;
}

/* Mid-swap fade class applied by JS */
.portrait-img.portrait-swapping {
  opacity: 0;
}

/* Vintage photo mounting corner brackets */
.portrait-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(64, 46, 21, .72);
  z-index: 2;
  pointer-events: none;
}

.portrait-corner.ptl {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.portrait-corner.ptr {
  top: -1px;
  right: -1px;
  border-left: 0;
  border-bottom: 0;
}

.portrait-corner.pbl {
  bottom: -1px;
  left: -1px;
  border-right: 0;
  border-top: 0;
}

.portrait-corner.pbr {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}



@keyframes hintBob {

  0%,
  100% {
    transform: translateY(0);
    opacity: .9;
  }

  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-2px, 0px) rotate(1deg); }
  30% { transform: translate(2px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-2px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shake-animation {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Specimen caption below the frame */
.portrait-caption {
  font-family: "Courier Prime", monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  user-select: none;
}

/* ==========================================================================
   SELECTED WORK SECTION & THUMBNAIL PICTURE OVERLAYS
   ========================================================================== */

.work-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding: 0 2px 7px;
  margin-bottom: 14px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 17px;
}

.section-heading small {
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  color: var(--muted);
}

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

/* Project Card */
.project-card {
  cursor: pointer;
  min-width: 0;
  background: var(--paper-card);
  padding: 8px;
  border: 1px solid #8e7444;
  box-shadow: 2px 3px 0 rgba(59, 42, 19, .2);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  outline: none;
}

.project-card:nth-child(2n + 1) {
  transform: rotate(-0.75deg);
}

.project-card:nth-child(2n) {
  transform: rotate(0.75deg);
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-5px) rotate(0deg);
  box-shadow: 4px 8px 0 rgba(45, 30, 11, .28);
  border-color: var(--ink);
}

/* Project Thumbnail Container */
.project-thumb {
  aspect-ratio: 16 / 10;
  border: 1px solid #755f36;
  position: relative;
  overflow: hidden;
  background: #2a2218;
  display: block;
}

/* Project Thumbnail Image */
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(.2) contrast(1.05) brightness(.96) saturate(.9);
  transition: transform .35s cubic-bezier(.25, .8, .25, 1), filter .35s ease;
}

.project-card:hover .thumb-img,
.project-card:focus-visible .thumb-img {
  transform: scale(1.07);
  filter: sepia(0) contrast(1.1) brightness(1.02) saturate(1.05);
}

/* Picture Overlay */
.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg,
      rgba(25, 18, 10, 0.15) 0%,
      rgba(25, 18, 10, 0.45) 50%,
      rgba(20, 14, 8, 0.82) 100%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 5;
}

.project-card:hover .thumb-overlay,
.project-card:focus-visible .thumb-overlay {
  opacity: 1;
}

/* Corner Photo Mounting Brackets */
.thumb-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(234, 217, 169, .9);
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 2px rgba(0, 0, 0, .4);
}

.thumb-corner.tl {
  top: 6px;
  left: 6px;
  border-right: 0;
  border-bottom: 0;
}

.thumb-corner.tr {
  top: 6px;
  right: 6px;
  border-left: 0;
  border-bottom: 0;
}

.thumb-corner.bl {
  bottom: 6px;
  left: 6px;
  border-right: 0;
  border-top: 0;
}

.thumb-corner.br {
  bottom: 6px;
  right: 6px;
  border-left: 0;
  border-top: 0;
}

/* Subtle Film Grain Texture on Overlay */
.thumb-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Action Badge on Hover */
.thumb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-light);
  color: var(--ink);
  border: 1.5px solid #634b28;
  padding: 6px 12px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .4);
  transform: translateY(8px);
  transition: transform .25s cubic-bezier(.2, .8, .3, 1.2), background .15s ease;
  user-select: none;
}

.project-card:hover .thumb-badge,
.project-card:focus-visible .thumb-badge {
  transform: translateY(0);
}

.thumb-badge-icon {
  color: var(--red);
  font-size: 13px;
}

/* Spec Tag / Tool Label on Thumbnail */
.thumb-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(126, 63, 45, .88);
  color: #fff;
  font-family: "Courier Prime", monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
  text-transform: uppercase;
  transform: translateY(6px);
  transition: transform .25s ease;
}

.project-card:hover .thumb-tag,
.project-card:focus-visible .thumb-tag {
  transform: translateY(0);
}

/* Placeholder Thumbnail */
.project-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #574626;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .2), transparent 20%),
    repeating-linear-gradient(45deg, rgba(85, 60, 23, .07) 0 2px, transparent 2px 8px),
    #c6aa6b;
  font-family: "Special Elite", monospace;
  font-size: 15px;
  text-align: center;
}

.project-thumb.placeholder i {
  position: absolute;
  right: 9px;
  bottom: 5px;
  font-style: normal;
  font-size: 18px;
  opacity: .7;
}

/* Project Name Label below Thumbnail */
.project-name {
  padding: 8px 4px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-name::after {
  content: "↗";
  font-size: 12px;
  color: var(--muted);
  transition: color .2s ease, transform .2s ease;
}

.project-card:hover .project-name::after,
.project-card:focus-visible .project-name::after {
  color: var(--red);
  transform: translate(2px, -2px);
}

/* ==========================================================================
   SIDE STACK (SKILLS & FIND ME)
   ========================================================================== */

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skills {
  transform: rotate(.4deg);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-list span {
  font-size: 10px;
  padding: 5px 7px;
  border: 1px dashed #7e663d;
  background: rgba(201, 172, 109, .45);
  font-weight: 700;
  letter-spacing: .03em;
}

.contact {
  transform: rotate(-.5deg);
}

.links {
  display: grid;
  gap: 8px;
}

.links a {
  color: var(--ink);
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
  padding-bottom: 4px;
  transition: color .15s ease, border-color .15s ease, padding-left .15s ease;
}

.links a:hover,
.links a:focus-visible {
  color: var(--red);
  border-bottom-color: var(--red);
  padding-left: 3px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 2px solid rgba(48, 37, 20, .6);
  margin-top: 14px;
  padding: 12px 2px 4px;
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
}

/* ==========================================================================
   PROJECT LIGHTBOX / MODAL PICTURE OVERLAY
   ========================================================================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.open {
  display: flex;
  animation: modalFadeIn .2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 20, 11, .78);
  backdrop-filter: blur(4px);
}

.modal-window {
  position: relative;
  z-index: 1;
  width: min(740px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px;
  background: var(--paper-light);
  border: 2px solid #725a31;
  box-shadow: 10px 14px 0 rgba(20, 14, 7, .35);
  transform: rotate(-.3deg);
  animation: modalPop .25s cubic-bezier(.17, .89, .32, 1.25);
}

@keyframes modalPop {
  from {
    transform: scale(.94) rotate(-.3deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(-.3deg);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  z-index: 10;
  right: 10px;
  top: 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color .15s ease, transform .15s ease;
}

.modal-close:hover {
  color: var(--red);
  transform: scale(1.15);
}

.modal-image {
  min-height: 230px;
  margin-bottom: 14px;
  border: 1.5px solid #8b7040;
  background:
    repeating-linear-gradient(45deg, rgba(85, 60, 23, .07) 0 2px, transparent 2px 8px),
    #251e15;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-preview-img {
  width: 100%;
  max-height: 440px;
  display: block;
  object-fit: contain;
  margin: auto;
}

.modal-placeholder {
  height: 230px;
  width: 100%;
}

.modal-copy p {
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
}

.modal-tools {
  margin: 12px 0 16px;
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  letter-spacing: .05em;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #7e663d;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
  box-shadow: 2px 3px 0 rgba(64, 44, 17, .25);
  transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .12s ease;
}

.modal-link:hover,
.modal-link:focus-visible {
  background: var(--red);
  color: #fff;
  border-color: #572517;
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(45, 18, 10, .35);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 980px) {
  .content {
    grid-template-columns: 1fr 1.7fr;
  }

  .side-stack {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .site-shell {
    width: calc(100% - 12px);
    margin: 8px auto;
    padding: 14px 12px;
  }

  .topbar {
    min-height: 80px;
    gap: 12px;
  }

  .nameplate-front {
    font-size: clamp(28px, 7vw, 44px);
    letter-spacing: -2px;
    padding: 6px 14px 4px;
  }

  .tagline {
    font-size: 12px;
    padding: 6px 10px;
  }

  .content {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .side-stack {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .nameplate-front {
    font-size: 28px;
    letter-spacing: -2px;
    padding: 5px 10px 4px;
  }

  .tagline {
    display: none;
  }

  .project-name {
    font-size: 10px;
  }
}

/* ==========================================================================
   PROJECT PAGE STYLES
   ========================================================================== */

.project-shell {
  max-width: 1100px;
}

.project-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-light);
  border: 1.5px solid #816839;
  padding: 8px 16px;
  box-shadow: 2px 3px 0 rgba(50, 35, 15, .25);
  transition: all .2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  background: var(--red);
  color: #fff;
  border-color: #552417;
  transform: translateX(-3px);
  box-shadow: 3px 5px 0 rgba(35, 15, 8, .35);
}

.back-arrow {
  font-size: 16px;
  transition: transform .2s ease;
}

.back-link:hover .back-arrow {
  transform: translateX(-3px);
}

.project-tagline {
  letter-spacing: .08em;
  font-size: 13px;
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 0 16px;
}

/* --- Project Header Panel --- */
.project-header-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proj-category-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(126, 63, 45, 0.1);
  border: 1px dashed var(--red);
  padding: 4px 10px;
}

.project-main-title {
  margin: 0;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1.1;
  text-transform: uppercase;
}

.project-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: #4a3d28;
  font-style: italic;
  max-width: 900px;
}

/* --- Meta Bar --- */
.proj-meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  background: rgba(43, 36, 24, 0.05);
  border: 1px solid #8e7444;
  padding: 12px 16px;
  margin-top: 6px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}

.meta-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.status-badge {
  color: var(--red);
  letter-spacing: .05em;
}

.meta-tools-item {
  grid-column: span 2;
}

.proj-tools-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.proj-tool-pill {
  font-size: 10px;
  font-weight: 700;
  background: rgba(201, 172, 109, 0.55);
  border: 1px dashed #7e663d;
  padding: 3px 8px;
  color: var(--ink);
}

/* Action Bar */
.proj-action-bar {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.proj-external-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper-card);
  text-decoration: none;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 8px 18px;
  border: 1px solid #1a140a;
  box-shadow: 2px 3px 0 rgba(40, 28, 12, .3);
  transition: all .2s ease;
}

.proj-external-btn:hover,
.proj-external-btn:focus-visible {
  background: var(--red);
  color: #fff;
  border-color: #552417;
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(35, 15, 8, .4);
}

/* --- Hero Media Display --- */
.project-media-section {
  width: 100%;
}

.proj-hero-frame {
  position: relative;
  background: #1e170e;
  border: 2px solid #755f36;
  padding: 10px;
  box-shadow: 4px 6px 0 rgba(40, 26, 11, .35);
  overflow: hidden;
}

.proj-hero-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  filter: sepia(.12) contrast(1.06) brightness(.98);
  transition: filter .3s ease;
}

.proj-hero-img:hover {
  filter: sepia(0) contrast(1.08) brightness(1.02);
}

/* Corner brackets & Tape for Hero */
.corner-bracket {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(234, 217, 169, .9);
  pointer-events: none;
  z-index: 4;
}

.corner-bracket.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.corner-bracket.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.corner-bracket.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.corner-bracket.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.tape {
  position: absolute;
  width: 70px;
  height: 20px;
  background: rgba(220, 205, 165, .7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  z-index: 5;
  pointer-events: none;
}

.tape-tl {
  top: -6px;
  left: 30px;
  transform: rotate(-5deg);
}

.tape-tr {
  top: -6px;
  right: 30px;
  transform: rotate(5deg);
}

.proj-img-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--paper-light);
  font-family: "Courier Prime", monospace;
  text-transform: uppercase;
}

.caption-icon {
  color: var(--red);
  font-size: 12px;
}

/* --- Two Column Layout --- */
.project-two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}

/* --- Overview Content --- */
.project-text-body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
}

.project-text-body p {
  margin: 0 0 12px;
}

.project-text-body p:last-child {
  margin-bottom: 0;
}

.project-text-body em {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}

/* --- Power Flow Blockquote / Diagram --- */
.power-flow-box {
  background: rgba(43, 36, 24, 0.07);
  border-left: 3px solid var(--red);
  padding: 12px 16px;
  margin: 14px 0;
  font-family: "Courier Prime", monospace;
  font-size: 12px;
}

.power-flow-title {
  font-weight: 700;
  color: var(--red);
  margin-bottom: 6px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 11px;
}

.power-flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.power-flow-node {
  background: var(--paper-card);
  border: 1px solid #9a7e4b;
  padding: 3px 8px;
  font-size: 11px;
}

.power-flow-arrow {
  color: var(--red);
  font-weight: 700;
}

/* --- Highlights Grid --- */
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.proj-highlight-card {
  background: var(--paper-card);
  border: 1px solid #8e7444;
  border-left: 3px solid var(--red);
  padding: 10px 14px;
  box-shadow: 1px 2px 0 rgba(40, 26, 11, .12);
  transition: transform .18s ease;
}

.proj-highlight-card:hover {
  transform: translateX(4px);
}

.highlight-label {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--red);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.highlight-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
}

/* --- Process Steps --- */
.process-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proj-process-step {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--paper-card);
  border: 1px solid #9a7e4b;
  padding: 12px 14px;
  box-shadow: 1px 2px 0 rgba(40, 26, 11, .12);
  transition: transform .18s ease;
}

.proj-process-step:hover {
  transform: translateX(4px);
}

.step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-family: "Special Elite", monospace;
  font-size: 14px;
  font-weight: 700;
  width: 44px;
  height: 44px;
  border: 1.5px solid #502216;
  box-shadow: 1.5px 2px 0 rgba(0, 0, 0, .25);
  user-select: none;
}

.step-body {
  min-width: 0;
}

.step-title {
  margin: 0 0 6px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  text-transform: uppercase;
}

.step-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #3b3223;
}

/* --- Hardware & Component Specimen Gallery --- */
.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.gallery-card {
  background: var(--paper-card);
  border: 1.5px solid #8e7444;
  padding: 8px;
  box-shadow: 2px 3px 0 rgba(40, 26, 11, .16);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 4px 7px 0 rgba(35, 22, 9, .25);
}

.gallery-card:nth-child(even) {
  transform: rotate(0.4deg);
}

.gallery-card:nth-child(odd) {
  transform: rotate(-0.4deg);
}

.gallery-card:hover {
  transform: translateY(-4px) rotate(0deg);
}

.gallery-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #1e170e;
  overflow: hidden;
  border: 1px solid #755f36;
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(.12) contrast(1.05) brightness(.97);
  transition: transform .3s ease, filter .3s ease;
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.05);
  filter: sepia(0) contrast(1.08) brightness(1.02);
}

.gallery-card-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(126, 63, 45, .92);
  color: #fff;
  font-family: "Courier Prime", monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, .3);
  text-transform: uppercase;
}

.gallery-card-meta {
  padding: 8px 4px 4px;
}

.gallery-card-title {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.gallery-card-desc {
  font-size: 10.5px;
  line-height: 1.45;
  color: #4f422e;
}

/* --- Specifications Table --- */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.specs-table th,
.specs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(72, 51, 22, .18);
  vertical-align: top;
  line-height: 1.5;
}

.specs-table tr:nth-child(even) {
  background: rgba(43, 36, 24, 0.04);
}

.specs-table th {
  text-align: left;
  font-family: "Special Elite", monospace;
  font-weight: 700;
  color: var(--ink);
  width: 42%;
  letter-spacing: .02em;
}

.specs-table td {
  color: #3f3524;
}

/* --- Key Learnings Panel --- */
.learnings-body {
  font-size: 12.5px;
  line-height: 1.7;
}

.learnings-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.learnings-body li {
  margin-bottom: 8px;
}

.learnings-body li:last-child {
  margin-bottom: 0;
}

/* --- Project Bottom Navigation Bar --- */
.project-nav-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 2px dashed rgba(48, 37, 20, .4);
  padding-top: 18px;
  margin-top: 8px;
}

.project-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper-light);
  border: 1.5px solid #8e7444;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 2px 3px 0 rgba(40, 26, 11, .15);
  transition: all .2s ease;
  min-width: 200px;
}

.project-nav-btn.next {
  text-align: right;
  align-items: flex-end;
  margin-left: auto;
}

.project-nav-btn:hover,
.project-nav-btn:focus-visible {
  background: var(--red);
  color: #fff;
  border-color: #552417;
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(35, 15, 8, .3);
}

.project-nav-btn:hover .nav-dir,
.project-nav-btn:hover .nav-proj-title {
  color: #fff;
}

.nav-dir {
  font-family: "Courier Prime", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav-proj-title {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}

/* --- Project Page Responsive Adjustments --- */
@media (max-width: 860px) {
  .project-two-col {
    grid-template-columns: 1fr;
  }

  .meta-tools-item {
    grid-column: span 1;
  }

  .proj-process-step {
    grid-template-columns: 38px 1fr;
    gap: 12px;
  }

  .step-badge {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
}

@media (max-width: 580px) {
  .project-nav-bar {
    flex-direction: column;
  }

  .project-nav-btn.next {
    text-align: left;
    align-items: flex-start;
  }

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

  .specs-table th,
  .specs-table td {
    display: block;
    width: 100%;
    padding: 4px 6px;
  }

  .specs-table th {
    border-bottom: none;
    color: var(--red);
    padding-top: 8px;
  }
}


