/* danbing.app — production stylesheet */

/* 1. Custom properties */
:root {
  --bg-page: #1a1a1f;
  --text-primary: #f0f0f0;
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent-gold: #c9a84c;
  --felt-green: #1a4a2e;
  --card-cream: #f5f0e8;
  --card-border-width: 4px;
  --card-radius: 16px 12px 14px 10px;
  --card-rotation: -2.5deg;
  --transition-bounce: 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-ease: 280ms ease;
  --font-display: 'DM Sans', sans-serif;
  --font-serif: 'Libre Baskerville', serif;
}

/* 2. Reset / base
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

/* 3. Body + dot-grid background
   ============================================================ */
body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-display);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* 4. Page wrapper + layout
   ============================================================ */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 48px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 5. Header
   ============================================================ */
.site-header {
  margin-bottom: 64px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}

.site-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

/* 6. Card grid
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  flex: 1;
}

/* 7. Card container + hover
   ============================================================ */
.card-container {
  width: 100%;
  max-width: 320px;
  height: 400px;
  cursor: default;
  transform: rotate(var(--card-rotation));
  transition:
    transform var(--transition-bounce),
    box-shadow var(--transition-ease);
}

.card-container:hover {
  transform: rotate(0deg) scale(1.03);
}

/* 8. Card internals
   ============================================================ */

/* Project card base */
.project-card {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  border: var(--card-border-width) solid var(--accent-gold);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  transition: box-shadow var(--transition-ease);
  display: flex;
  flex-direction: column;
}

.card-container:hover .project-card {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(201, 168, 76, 0.1);
}

/* Felt texture overlay */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='felt'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23felt)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  z-index: 1;
}

/* Card-specific: felt green background */
.project-card--cards {
  background-color: var(--felt-green);
}

/* Card visual area — fixed height so an <img> can replace CSS decoration later */
.card-visual {
  width: 100%;
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Fanned playing cards */
.playing-card {
  position: absolute;
  width: 64px;
  height: 92px;
  background: var(--card-cream);
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform-origin: bottom center;
  transition: transform 250ms ease;
}

.playing-card-1 { transform: rotate(-20deg) translateY(-10px); }
.playing-card-2 { transform: rotate(-8deg)  translateY(-14px); }
.playing-card-3 { transform: rotate(6deg)   translateY(-12px); z-index: 2; }
.playing-card-4 { transform: rotate(18deg)  translateY(-8px); }

.playing-card-3 .card-face {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}

/* Hover: fan cards out further */
.card-container:hover .playing-card-1 { transform: rotate(-24deg) translateY(-12px); }
.card-container:hover .playing-card-2 { transform: rotate(-10deg) translateY(-16px); }
.card-container:hover .playing-card-3 { transform: rotate(4deg)   translateY(-14px); }
.card-container:hover .playing-card-4 { transform: rotate(22deg)  translateY(-10px); }

/* Card text */
.card-text {
  padding: 24px 20px;
  position: relative;
  z-index: 2;
}

.card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 6px;
  position: relative;
  display: inline-block;
}

/* Sparkle decoration */
.card-title::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -18px;
  width: 12px;
  height: 12px;
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%,
    79% 91%, 50% 70%, 21% 91%, 32% 57%,
    2% 35%, 39% 35%
  );
  background-color: var(--accent-gold);
  opacity: 0.7;
}

.card-subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  color: rgba(232, 220, 200, 0.7);
}

/* 9. Ghost slots
   ============================================================ */
.ghost-slot {
  width: 100%;
  max-width: 320px;
  height: 400px;
  border: 2px dashed rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ghost-slot::after {
  content: '+';
  font-size: 32px;
  color: rgba(255, 255, 255, 0.06);
  font-weight: 300;
}

/* 10. Footer
   ============================================================ */
.site-footer {
  text-align: center;
  padding-top: 60px;
  font-family: var(--font-display);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}

/* 11. Responsive breakpoints
   ============================================================ */

/* Tablet: 768px – 1279px */
@media (max-width: 1279px) and (min-width: 768px) {
  .page-wrapper {
    padding: 60px 36px 48px;
  }

  .site-title {
    font-size: 56px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .card-container {
    max-width: 300px;
    height: 380px;
  }

  .ghost-slot {
    max-width: 300px;
    height: 380px;
  }

  /* Keep only one ghost slot visible in the 2-column layout */
  .ghost-slot:nth-child(4) {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card-container,
  .playing-card,
  .project-card {
    transition: none;
  }
}

/* Mobile: ≤767px */
@media (max-width: 767px) {
  .page-wrapper {
    padding: 48px 24px 40px;
  }

  .site-title {
    font-size: 42px;
  }

  .site-header {
    margin-bottom: 40px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
  }

  .card-container {
    transform: rotate(0deg);
    max-width: 100%;
    height: 380px;
  }

  .card-container:hover {
    transform: rotate(0deg) scale(1.01);
  }

  .ghost-slot {
    max-width: 100%;
    height: 200px;
  }

  .ghost-slot:nth-child(4) {
    display: none;
  }
}
