*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  color: #b0b0b0;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a, button {
  color: inherit;
  text-decoration: none;
}

/* ─── PROJECT COLOR THEMES ─────────────────────────── */
body.bg-covert { background-color: #1a1a2e; color: #bac4b8; }
body.bg-hermes { background-color: #382402; color: #f59e0b; }
body.bg-convictfi { background-color: #2b0313; color: #ff2d87; }
body.bg-vela { background-color: #031c36; color: #4da2ff; }
body.bg-pythia { background-color: #0d0724; color: #a855f7; }
body.bg-medscribe { background-color: #052211; color: #22c55e; }

/* ─── LOADING SCREEN ────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 800ms ease;
}

#loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#loader-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
}

#loader-bar {
  width: 200px;
  height: 1px;
  background: #222;
  overflow: hidden;
}

#loader-fill {
  width: 0%;
  height: 100%;
  background: #888;
  transition: width 300ms ease;
}

/* ─── ABOUT PANEL ───────────────────────────────────── */
#about-panel {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 1000;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 400ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

#about-panel.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

#about-close {
  position: absolute;
  top: 35px;
  right: 45px;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #666;
  z-index: 10;
  cursor: pointer;
  transition: color 300ms ease;
}

#about-close:hover {
  color: #fff;
}

#ap-inner {
  display: grid;
  grid-template-columns: 38% 1fr;
  width: 100%;
  padding: 60px 50px;
}

#ap-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 60px;
}

#ap-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: #fff;
}

#ap-bio {
  font-size: 13px;
  line-height: 1.7;
  color: #777;
  max-width: 300px;
  margin-bottom: 30px;
}

#ap-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ap-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  transition: color 300ms ease;
}

#ap-links a:hover {
  color: #fff;
}

#ap-avail {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.6;
  color: #555;
}

#ap-right {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 10px;
}

.ap-col-head {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 20px;
  display: block;
}

.ap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-list li {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #777;
}

/* ─── PAGE LAYOUT ──────────────────────────────────── */
#page {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 35px 45px;
  z-index: 2;
}

/* ─── HEADER ────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #888;
  transition: color 500ms ease;
}

nav {
  display: flex;
  justify-content: flex-end;
}

#about-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #666;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: color 300ms ease;
}

#about-link:hover {
  color: #fff;
}

/* ─── MAIN ──────────────────────────────────────────── */
main {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#strip-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

#strip-wrap::-webkit-scrollbar {
  display: none;
}

#strip-wrap:active {
  cursor: grabbing;
}

#strip {
  display: flex;
  gap: 24px;
  padding: 0 45px;
  transition: opacity 500ms ease, filter 500ms ease;
}

#strip.dimmed {
  opacity: 0.15;
  filter: blur(4px);
  pointer-events: none;
}

/* ─── PROJECT CARDS ─────────────────────────────────── */
.card {
  flex-shrink: 0;
  width: 280px;
  height: 200px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  transform: scale(1.03);
}

.card-inner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.4) 100%);
  z-index: 1;
}

.card-label {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  z-index: 2;
}

.card-title {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  z-index: 2;
}

/* ─── DETAIL VIEW ──────────────────────────────────── */
#detail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

#detail.show {
  opacity: 1;
  pointer-events: auto;
}

#detail-content {
  text-align: center;
  max-width: 560px;
  padding: 0 20px;
}

#detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: #fff;
}

.char-split {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.char-split.show {
  opacity: 1;
  transform: translateY(0);
}

#detail-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  margin-bottom: 28px;
}

#detail-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
}

.meta-item {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.meta-item span {
  display: block;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

#detail-link {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  opacity: 0.7;
  transition: opacity 300ms ease;
}

#detail-link:hover {
  opacity: 1;
}

/* ─── FOOTER ────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

#avail {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.6;
  color: #555;
}

#social {
  display: flex;
  gap: 20px;
}

#social a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  transition: color 300ms ease;
}

#social a:hover {
  color: #fff;
}

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  #ap-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 30px;
    overflow-y: auto;
  }
  #ap-left {
    padding-right: 0;
  }
  #ap-right {
    grid-template-columns: repeat(2, 1fr);
  }
  #about-close {
    top: 20px;
    right: 25px;
  }
  .card {
    width: 220px;
    height: 160px;
  }
}

@media (max-width: 700px) {
  #page {
    position: static;
    grid-template-rows: auto;
    gap: 30px;
    padding: 20px;
    min-height: 100vh;
  }
  html, body {
    overflow-y: auto;
  }
  header {
    display: flex;
    justify-content: space-between;
  }
  main {
    height: auto;
    min-height: 60vh;
    overflow: visible;
  }
  #strip-wrap {
    overflow: visible;
  }
  #strip {
    flex-direction: column;
    gap: 16px;
    padding: 0;
    opacity: 1 !important;
    filter: none !important;
  }
  .card {
    width: 100%;
    height: 180px;
  }
  #detail {
    position: static;
    margin-top: 30px;
  }
  #detail-title {
    font-size: 36px;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  #social {
    gap: 16px;
  }
}
