/* Project details modal: ember-lit black/orange treatment, responsive desktop/mobile. */
:root {
  --pdm-heat: #fff0a4;
  --pdm-gold: #ffb43b;
  --pdm-orange: #ff681b;
  --pdm-red: #9d260d;
}

.project-detail-modal {
  position: fixed;
  inset: 0;
  width: min(1160px, calc(100vw - 48px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: visible;
  color: #f7f3ee;
  border: 1px solid rgba(255, 105, 27, .92);
  border-radius: 22px;
  background: #090807;
  box-shadow: 0 0 0 1px rgba(255, 180, 59, .16), 0 22px 90px rgba(0,0,0,.78), 0 0 44px rgba(255, 79, 17, .22), inset 0 0 42px rgba(255, 91, 22, .055);
}
.project-detail-modal[open] { display: block; animation: pdm-enter .34s cubic-bezier(.2,.75,.25,1) both; }
.project-detail-modal::backdrop { background: rgba(2, 3, 5, .82); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.project-detail-modal.is-closing { animation: pdm-exit .2s ease both; }
.pdm-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  height: min(760px, calc(100dvh - 48px));
  min-height: min(590px, calc(100dvh - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  overflow: hidden;
  border-radius: inherit;
  isolation: isolate;
  background: radial-gradient(ellipse at 78% 100%, rgba(133, 37, 9, .26), transparent 44%), linear-gradient(138deg, #15100d 0%, #090909 53%, #0b0807 100%);
}
.pdm-shell::before,
.pdm-shell::after { position: absolute; z-index: -1; pointer-events: none; content: ""; }
.pdm-shell::before {
  inset: 0;
  opacity: .62;
  background: radial-gradient(ellipse at 2% 4%, rgba(255, 91, 20, .18), transparent 22%), radial-gradient(ellipse at 100% 100%, rgba(255, 82, 16, .2), transparent 24%), radial-gradient(ellipse at 55% 100%, rgba(120, 37, 15, .13), transparent 38%);
}
.pdm-shell::after {
  right: -12%; bottom: -30%; width: 62%; height: 48%;
  border-radius: 50%; filter: blur(55px); opacity: .3;
  background: radial-gradient(ellipse, rgba(255, 83, 14, .38), transparent 68%);
}
.pdm-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 60px 28px 48px;
  overflow: hidden;
  background: radial-gradient(ellipse at 47% 60%, rgba(255, 111, 28, .17), transparent 52%), linear-gradient(145deg, rgba(34, 19, 12, .82), rgba(8, 8, 8, .55));
  border-right: 1px solid rgba(255, 135, 54, .17);
}
.pdm-visual::before,
.pdm-visual::after { position: absolute; content: ""; pointer-events: none; }
.pdm-visual::before {
  width: 78%; height: 42%; left: 8%; bottom: 8%;
  background: radial-gradient(ellipse, rgba(255, 92, 19, .23), transparent 70%);
  filter: blur(25px);
}
.pdm-visual::after {
  left: -18%; top: 13%; width: 68%; height: 1px;
  transform: rotate(-25deg);
  background: linear-gradient(90deg, transparent, rgba(255, 175, 58, .9), rgba(255, 74, 19, .2), transparent);
  box-shadow: 0 0 14px rgba(255, 103, 29, .65);
}
.pdm-laptop {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  transform: perspective(1100px) rotateY(-5deg) rotateX(1deg);
  filter: drop-shadow(0 28px 30px rgba(0,0,0,.72)) drop-shadow(0 0 20px rgba(255, 101, 24, .13));
  transition: transform .45s ease, filter .45s ease;
}
.project-detail-modal[open] .pdm-laptop { animation: pdm-laptop-arrive .65s .08s cubic-bezier(.2,.75,.25,1) both; }
.pdm-screen-frame {
  position: relative;
  padding: 10px 10px 9px;
  border: 1px solid rgba(255, 212, 162, .82);
  border-bottom-color: rgba(255, 132, 50, .8);
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(135deg, #3b2a21, #090b0d 24%, #1a1715 72%, #5e3922);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.42), 0 0 0 1px rgba(255, 118, 30, .2), 0 0 24px rgba(255, 99, 22, .12);
}
.pdm-screen-frame::before {
  position: absolute; z-index: 2; top: 4px; left: 50%; width: 4px; height: 4px;
  content: ""; transform: translateX(-50%); border-radius: 50%; background: #65564c;
}
.pdm-screen-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px 8px 3px 3px;
  background: #0b0b0b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.pdm-laptop-placeholder {
  display: grid;
  place-content: center;
  gap: 9px;
  width: 100%;
  aspect-ratio: 16 / 10;
  text-align: center;
  border-radius: 8px 8px 3px 3px;
  color: #ffe0b2;
  background: radial-gradient(ellipse at 52% 38%, rgba(255, 111, 26, .32), transparent 42%), linear-gradient(145deg,#10202a,#080b10 62%,#24130b);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.pdm-laptop-placeholder strong { font: 600 clamp(20px, 2.6vw, 34px)/1.1 Georgia,serif; letter-spacing: .04em; }
.pdm-laptop-placeholder span { color: #e9a35d; font: 10px 'DM Mono',monospace; letter-spacing: .22em; text-transform: uppercase; }
.pdm-laptop-hinge { height: 6px; margin: 0 2%; background: linear-gradient(180deg,#77716b,#272625 55%,#9a8876); border-radius: 0 0 8px 8px; }
.pdm-laptop-base {
  position: relative;
  height: 18px;
  margin: 0 -5.5%;
  border: 1px solid rgba(225, 198, 168, .6);
  border-top: 1px solid rgba(255,255,255,.48);
  border-radius: 2px 2px 15px 15px;
  background: linear-gradient(180deg,#b9aaa0 0%,#4b4846 18%,#171717 58%,#817064 82%,#2c2621 100%);
  box-shadow: 0 8px 14px rgba(0,0,0,.5), 0 0 16px rgba(255, 121, 31, .13);
}
.pdm-laptop-base::before {
  position: absolute; top: 2px; left: 38%; width: 24%; height: 3px;
  content: ""; border-radius: 0 0 5px 5px; background: linear-gradient(90deg,#282522,#77716b,#282522); opacity: .85;
}
.pdm-visual-caption { position: absolute; left: 24px; bottom: 17px; color: rgba(255, 220, 189, .56); font: 9px 'DM Mono',monospace; letter-spacing: .18em; text-transform: uppercase; }
.pdm-content {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 46px 46px 38px;
  overflow: auto;
  scrollbar-color: rgba(255, 116, 34, .45) transparent;
}
.pdm-close {
  position: absolute;
  z-index: 5;
  top: 17px; right: 17px;
  display: grid; place-items: center;
  width: 43px; height: 43px;
  padding: 0;
  color: #fff5ea;
  font: 300 28px/1 Manrope, sans-serif;
  border: 1px solid rgba(255, 137, 46, .9);
  border-radius: 50%;
  background: rgba(13, 10, 8, .88);
  box-shadow: 0 0 15px rgba(255, 94, 20, .2), inset 0 0 10px rgba(255, 125, 32, .08);
  cursor: pointer;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.pdm-close:hover { transform: rotate(90deg); background: rgba(255, 91, 20, .18); box-shadow: 0 0 22px rgba(255, 94, 20, .4); }
.pdm-category {
  display: inline-flex; align-items: center; gap: 9px;
  max-width: calc(100% - 56px);
  margin: 5px 0 15px;
  padding: 8px 13px;
  color: #f3e9df;
  font-size: 12px; line-height: 1.35;
  border: 1px solid rgba(255, 135, 53, .58);
  border-radius: 999px;
  background: linear-gradient(110deg,rgba(255, 119, 29, .12),rgba(14, 12, 11, .68));
}
.pdm-category-mark { color: var(--pdm-gold); font-size: 15px; }
.pdm-title { margin: 0 48px 13px 0; color: #fffaf5; font: 600 clamp(27px, 3vw, 42px)/1.12 Manrope, sans-serif; letter-spacing: -.045em; }
.pdm-title span { color: var(--pdm-orange); }
.pdm-description { margin: 0 0 23px; color: #d4cfca; font-size: 15px; line-height: 1.72; }
.pdm-section { margin: 21px 0 0; }
.pdm-section-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; color: #fff8f0; font-size: 17px; font-weight: 700; }
.pdm-section-icon { display: inline-grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; color: var(--pdm-orange); font-size: 23px; text-shadow: 0 0 13px rgba(255, 115, 30, .38); }
.pdm-section-heading::after { height: 1px; flex: 1; content: ""; background: linear-gradient(90deg,rgba(255, 164, 79, .34),rgba(255,255,255,.08)); }
.pdm-contributions { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pdm-contributions li { display: grid; grid-template-columns: 23px minmax(0,1fr); align-items: start; gap: 9px; color: #e8e1da; font-size: 13px; line-height: 1.55; }
.pdm-check { display: grid; place-items: center; width: 21px; height: 21px; color: #ffe6a4; font-size: 12px; font-weight: 800; border-radius: 50%; background: radial-gradient(circle at 35% 25%,#ffbb47,#b6420e 78%); box-shadow: 0 0 12px rgba(255, 110, 25, .27); }
.pdm-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.pdm-tag { padding: 7px 12px; color: #f4e9df; font-size: 11px; line-height: 1.2; border: 1px solid rgba(194, 132, 88, .43); border-radius: 999px; background: linear-gradient(120deg,rgba(255, 121, 28, .075),rgba(255,255,255,.025)); }
.pdm-note { margin: 12px 0 0; color: #b8aaa0; font-size: 11px; line-height: 1.55; }
.pdm-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.pdm-visit,
.pdm-close-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 176px; min-height: 48px; padding: 12px 22px;
  color: #fffaf5; text-decoration: none; font: 700 14px/1.2 Manrope, sans-serif;
  border-radius: 12px; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.pdm-visit { border: 1px solid #ff9c30; background: linear-gradient(110deg,#ff9b24,#f04b0b 58%,#a92a0a); box-shadow: 0 0 17px rgba(255, 101, 19, .36), inset 0 1px 0 rgba(255,255,255,.26); }
.pdm-visit:hover { transform: translateY(-2px); box-shadow: 0 0 25px rgba(255, 101, 19, .55), inset 0 1px 0 rgba(255,255,255,.3); }
.pdm-close-secondary { border: 1px solid rgba(255, 135, 42, .9); background: rgba(10, 9, 8, .55); }
.pdm-close-secondary:hover { transform: translateY(-2px); background: rgba(255, 105, 24, .1); }
.pdm-no-link { align-self: center; color: #c5b6aa; font-size: 12px; }

@keyframes pdm-enter { from { opacity: 0; transform: translateY(12px) scale(.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pdm-exit { to { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes pdm-laptop-arrive { from { opacity: 0; transform: perspective(1100px) translateY(16px) rotateY(-5deg) rotateX(1deg); } to { opacity: 1; transform: perspective(1100px) translateY(0) rotateY(-5deg) rotateX(1deg); } }

@media (max-width: 820px) {
  .project-detail-modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); border-radius: 18px; }
  .pdm-shell { display: block; height: auto; min-height: 0; max-height: calc(100dvh - 28px); overflow-y: auto; }
  .pdm-visual { min-height: 245px; padding: 42px 28px 30px; border-right: 0; border-bottom: 1px solid rgba(255, 135, 54, .18); }
  .pdm-laptop { width: min(82%, 410px); }
  .pdm-laptop-base { height: 13px; }
  .pdm-content { padding: 26px 28px 28px; overflow: visible; }
  .pdm-close { top: 11px; right: 11px; width: 39px; height: 39px; }
  .pdm-category { margin-top: 1px; font-size: 11px; }
  .pdm-title { font-size: clamp(25px, 6vw, 34px); }
  .pdm-description { font-size: 13px; margin-bottom: 18px; }
  .pdm-section { margin-top: 18px; }
  .pdm-actions { margin-top: 25px; }
}
@media (max-width: 480px) {
  .project-detail-modal { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); border-radius: 15px; }
  .pdm-shell { max-height: calc(100dvh - 18px); }
  .pdm-visual { min-height: 205px; padding: 38px 17px 24px; }
  .pdm-laptop { width: 86%; }
  .pdm-screen-frame { padding: 7px 7px 6px; border-radius: 12px 12px 7px 7px; }
  .pdm-content { padding: 21px 19px 23px; }
  .pdm-title { margin-right: 35px; font-size: 25px; }
  .pdm-category { max-width: calc(100% - 42px); padding: 7px 10px; font-size: 10px; }
  .pdm-section-heading { font-size: 15px; }
  .pdm-contributions li { font-size: 12px; }
  .pdm-tags { gap: 6px; }
  .pdm-tag { padding: 6px 9px; font-size: 10px; }
  .pdm-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .pdm-visit, .pdm-close-secondary { width: 100%; min-height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-detail-modal[open], .project-detail-modal.is-closing, .project-detail-modal[open] .pdm-laptop { animation: none !important; }
  .pdm-laptop, .pdm-close, .pdm-visit, .pdm-close-secondary { transition: none !important; }
}

/* Buttons retain the existing link treatments while opening the modal. */
.project-modal-trigger { appearance: none; -webkit-appearance: none; font-family: inherit; cursor: pointer; }
button.project-text-link.project-modal-trigger, button.text-link.project-modal-trigger { border: 0; background: transparent; padding: 0; text-align: left; line-height: inherit; }
