@font-face {
  font-family: 'Departure Mono';
  src: url('fonts/DepartureMono-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #fafaf8;
  --ink-color: #111111;
  
  /* Y2K Cyber Neon Colors */
  --cyber-cyan: #00f3ff;
  --cyber-pink: #ff007f;
  --cyber-green: #39ff14;
  --cyber-yellow: #fffb00;
  --cyber-purple: #9d00ff;
  --cyber-orange: #ff7700;
  
  /* Fonts */
  --font-pixel: 'VT323', monospace;
  --font-departure: 'Departure Mono', monospace;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset and basic layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  /* Vertical fade from off-white to subtle tech silver/blue */
  background-image: linear-gradient(to bottom, #fafaf8 0%, #d8e2eb 100%);
  background-attachment: fixed;
  color: var(--ink-color);
  font-family: var(--font-system);
  line-height: 1.4;
  padding: 2rem 1.5rem;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Title Banner / Header */
.portfolio-header {
  max-width: 800px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
}

.header-board {
  padding: 1.5rem 1rem;
}

@keyframes subtleRgbShift {
  0% {
    text-shadow: 2px 1px 0px rgba(255, 0, 80, 0.8), -2px -1px 0px rgba(0, 240, 255, 0.8), 0px 2px 0px rgba(57, 255, 20, 0.6);
  }
  25% {
    text-shadow: -1.5px 2px 0px rgba(255, 0, 80, 0.85), 2px -1.5px 0px rgba(0, 240, 255, 0.75), -2px 0px 0px rgba(57, 255, 20, 0.65);
  }
  50% {
    text-shadow: 2px -2px 0px rgba(255, 0, 80, 0.75), -1.5px 2px 0px rgba(0, 240, 255, 0.85), 1.5px 2px 0px rgba(57, 255, 20, 0.7);
  }
  75% {
    text-shadow: -2px -1px 0px rgba(255, 0, 80, 0.8), 1.5px 2px 0px rgba(0, 240, 255, 0.75), -1px 2px 0px rgba(57, 255, 20, 0.65);
  }
  100% {
    text-shadow: 2px 1px 0px rgba(255, 0, 80, 0.8), -2px -1px 0px rgba(0, 240, 255, 0.8), 0px 2px 0px rgba(57, 255, 20, 0.6);
  }
}

.header-title {
  font-family: var(--font-pixel);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 1px;
  color: #000;
  margin-bottom: 0.5rem;
  animation: subtleRgbShift 12s ease-in-out infinite;
}

.header-subtitle {
  font-family: var(--font-system);
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: bold;
  background: rgba(0, 0, 0, 0.05);
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.header-badges-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.dossier-nav-link {
  font-family: 'Special Elite', 'Courier Prime', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #111111;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed #111111;
  padding: 4px 14px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.8rem;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dossier-nav-link:hover {
  background: #111111;
  color: #ffffff;
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 3px 4px 0px rgba(168, 28, 28, 0.85);
}

/* Navigation note */
.portfolio-nav {
  max-width: 1200px;
  margin: 0 auto 1.5rem auto;
  text-align: center;
}

.nav-note {
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  color: #fff;
  background: var(--ink-color);
  padding: 2px 10px;
  border-radius: 3px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
  display: inline-block;
}

/* Main Grid Container */
.grid-container {
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  padding: 0 10px;
}

/* CSS Grid dense packing for retro buttons */
/* CSS Grid for uniform cards */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

@supports (grid-template-rows: masonry) {
  .masonry-grid {
    grid-template-rows: masonry;
  }
  
  .card {
    min-width: 100%; /* Force width to prevent aspect-ratio shrink under max-height */
  }
}

.masonry-grid.js-masonry {
  display: block;
  position: relative;
}

/* Card - Y2K Glossy Gel Button */
.card {
  display: block;
  text-decoration: none;
  position: relative;
  width: 100%;
  border: 2px solid #000000;
  border-radius: 6px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  
  /* Inner Bevel Highlight */
  outline: 1.5px solid rgba(255, 255, 255, 0.4);
  outline-offset: -3px;
  
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  contain: layout;
}

.card-landscape {
  aspect-ratio: 1.618 / 1; /* Golden ratio landscape */
}

.card-portrait {
  aspect-ratio: 1 / 1.4; /* Adjusted portrait (height ~448px on 320px width) */
}

.card-square {
  aspect-ratio: 1 / 1; /* Uniform square */
}

.card-wide {
  aspect-ratio: 2 / 1; /* Double width strip */
}

.card-tall {
  aspect-ratio: 1 / 1.6; /* Adjusted tall capsule (height ~512px on 320px width) */
}

.card-thin {
  aspect-ratio: 4 / 1; /* Quad width thin banner */
}

.card-app {
  aspect-ratio: 1 / 1;
  border-radius: 24px; /* iOS style rounded corners */
}

.card-dumbphone {
  aspect-ratio: 240 / 320; /* Vintage feature phone ratio */
}

.card-iframe {
  aspect-ratio: 4 / 3; /* Fixed 4:3 ratio */
  overflow: hidden;
  border-radius: 18px; /* More noticeable rounded corners */
}

.card-iframe-elem {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  display: block;
}

.card-iframe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  background: transparent;
  cursor: pointer;
}



/* App Cluster Row Wrapper */
.app-cluster {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1.5rem; /* Matches masonry gap */
  width: 100%;
}

.app-cluster .card-app {
  flex: 1 1 0;
  max-width: 120px; /* Don't let it scale beyond standard app icon size */
  min-width: 0 !important; /* Allow shrinking below masonry column width constraints */
  position: relative !important; /* Override absolute positioning in JS masonry fallback */
  left: auto !important;
  top: auto !important;
}



/* Card Hover States */
.card:hover {
  transform: scale(1.035);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.35);
  z-index: 50;
  outline: 1.5px solid rgba(255, 255, 255, 0.65);
  outline-offset: -3px;
}

/* Card Image Styles - fills the card completely */
.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(10%) contrast(102%);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.card:hover .card-img {
  transform: scale(1.02);
  filter: grayscale(0%) contrast(100%);
}

/* Y2K Aqua-gloss color variations (gradient bases) */
.btn-cyan { background: linear-gradient(to bottom, #00f3ff 0%, #007780 100%); }
.btn-pink { background: linear-gradient(to bottom, #ff007f 0%, #800040 100%); }
.btn-green { background: linear-gradient(to bottom, #39ff14 0%, #158000 100%); }
.btn-yellow { background: linear-gradient(to bottom, #fffb00 0%, #807d00 100%); }
.btn-purple { background: linear-gradient(to bottom, #9d00ff 0%, #4d0080 100%); }
.btn-orange { background: linear-gradient(to bottom, #ff7700 0%, #803b00 100%); }
.btn-silver { background: linear-gradient(to bottom, #f0f0f0 0%, #7a7a7a 100%); }


/* CSS Tooltip / Popover on Hover */
.card::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(16, 20, 30, 0.95);
  color: #fff;
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--font-system);
  font-size: 9px;
  line-height: 1.3;
  width: 160px;
  white-space: pre-wrap;
  text-align: left;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.15s ease, transform 0.15s ease;
  
  /* Inner Bevel for Tooltip */
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -2px;
}

.card:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Footer elements */
.portfolio-footer {
  text-align: center;
  margin: 3rem auto 1.5rem auto;
  padding: 1rem 0;
}

.copyright-info {
  font-family: var(--font-departure);
  font-size: 0.85rem;
  color: #555;
  letter-spacing: 0.5px;
}

/* Bluesky Feed Card Styles */
.card-bsky-container {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #111;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  text-align: left;
  border-radius: 12px;
}

.bsky-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bsky-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bsky-avatar, .bsky-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0085ff;
  object-fit: cover;
  flex-shrink: 0;
}

.bsky-display-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  color: #0b0f14;
}

.bsky-handle {
  font-size: 0.72rem;
  color: #68798d;
}

.bsky-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.bsky-text {
  font-size: 0.85rem;
  line-height: 1.35;
  color: #161e2e;
  word-break: break-word;
  white-space: pre-wrap;
}

.bsky-media {
  border-radius: 6px;
  overflow: hidden;
  max-height: 160px;
  margin-top: 4px;
  background: #f0f2f5;
}

.bsky-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bsky-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  color: #0085ff;
  font-weight: 600;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  body {
    padding: 1.5rem 0.5rem;
  }
  .portfolio-header {
    margin-bottom: 1.5rem;
  }
}
