:root {
  --bg: #080d1b;
  --panel: #0d1426;
  --panel-2: #10182c;
  --line: #26324b;
  --ink: #f4f7ff;
  --muted: #9aa6bf;
  --blue: #6f83ff;
  --orange: #ff8b4a;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: "DM Sans", sans-serif; }
button, a { font: inherit; }

.site-header { width: min(1240px, calc(100% - 48px)); margin: 0 auto; height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #17213d; font: 800 14px "Manrope", sans-serif; letter-spacing: -.08em; }
.brand-mark span { color: #6fe0dc; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font: 800 15px "Manrope", sans-serif; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.collection-count { color: var(--muted); font-size: 13px; }

.portfolio { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 62px 0 80px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 12px; color: var(--blue); text-transform: uppercase; letter-spacing: .2em; font: 800 10px "Manrope", sans-serif; }
.section-heading h1 { margin: 0; font: 800 clamp(32px, 4vw, 48px)/1.05 "Manrope", sans-serif; letter-spacing: -.045em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 8px; padding: 22px 0 28px; }
.filter { color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px; font-size: 12px; font-weight: 700; cursor: pointer; }
.filter:hover, .filter.is-active { color: var(--ink); border-color: #485b8c; background: #16213c; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.project-card { width: 100%; padding: 0; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.project-card:hover { transform: translateY(-4px); border-color: #455884; }
.project-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.project-card[hidden] { display: none; }
.card-image { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: #dfe6f0; }
.card-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,13,27,.04), rgba(8,13,27,.3)); }
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s ease; }
.project-card:hover img { transform: scale(1.025); }
.view-chip, .platform-chip { position: absolute; z-index: 2; top: 12px; display: inline-flex; align-items: center; border-radius: 99px; font: 800 9px "Manrope", sans-serif; text-transform: uppercase; letter-spacing: .12em; }
.view-chip { left: 12px; gap: 8px; padding: 8px 12px; color: #fff; background: var(--orange); }
.platform-chip { right: 12px; padding: 8px 12px; color: #fff; background: rgba(8,13,27,.9); }
.card-body { display: block; padding: 18px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.title-row > strong { font: 800 17px "Manrope", sans-serif; letter-spacing: -.02em; }
.title-row > small { color: #aeb8ff; background: #17213d; border: 1px solid #263661; border-radius: 99px; padding: 6px 9px; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 44px; margin: 14px 0 17px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.card-footer { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding-top: 15px; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #9bafff; background: #17213d; font: 800 9px "Manrope", sans-serif; }
.card-footer > span:nth-child(2), .mini-profile > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.card-footer strong, .mini-profile strong { font-size: 11px; }
.card-footer small, .mini-profile small { color: var(--muted); font-size: 9px; }
.live-status { color: var(--muted); font-size: 9px; }

dialog { width: min(1150px, calc(100% - 36px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgba(0,0,0,.86); backdrop-filter: blur(8px); }
.dialog-shell { min-height: 0; }
.dialog-header { height: 74px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.dialog-title { display: flex; flex-direction: column; gap: 4px; }
.dialog-title strong { font: 800 17px "Manrope", sans-serif; }
.dialog-title small { color: var(--muted); font-size: 10px; }
.visit-site { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; color: #fff; background: var(--orange); border-radius: 99px; padding: 11px 16px; text-decoration: none; font: 800 10px "Manrope", sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.dialog-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 23px; cursor: pointer; }
.dialog-content { display: grid; grid-template-columns: 2.1fr 1fr; min-height: 430px; }
.dialog-preview { padding: 28px; border-right: 1px solid var(--line); overflow: hidden; }
.dialog-preview img { display: block; width: 100%; height: 374px; object-fit: cover; object-position: top; border: 1px solid #35405a; border-radius: 12px; }
.dialog-details { padding: 29px 27px; overflow: auto; max-height: calc(100vh - 122px); }
.dialog-lead { margin: 0 0 25px; color: #c0c8da; font-size: 14px; line-height: 1.85; }
.dialog-details dl { margin: 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; }
.dialog-details dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; }
.dialog-details dt { color: var(--muted); font-size: 11px; }
.dialog-details dd { margin: 0; font-weight: 700; font-size: 11px; }
.summary { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.quote-mark { display: block; height: 32px; color: var(--blue); font: 700 42px/1 "Manrope", sans-serif; }
.summary > p:not(.eyebrow) { margin: 8px 0 22px; color: #c0c8da; line-height: 1.8; font-size: 13px; }
.mini-profile { display: flex; align-items: center; gap: 10px; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-content { grid-template-columns: 1.6fr 1fr; }
}

@media (max-width: 700px) {
  .site-header, .portfolio { width: calc(100% - 28px); }
  .portfolio { padding-top: 42px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .project-grid { grid-template-columns: 1fr; }
  .dialog-header { padding: 0 14px; }
  .dialog-header > .avatar, .dialog-title { display: none; }
  .visit-site { margin-left: 0; }
  .dialog-close { margin-left: auto; }
  .dialog-content { grid-template-columns: 1fr; }
  .dialog-preview { display: none; }
  .dialog-details { max-height: calc(100vh - 122px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
