/* ============================================
   CARLOS YAJIE PORTFOLIO - McLaren Dark Theme
   ============================================ */

:root {
  --bg-main: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --text-main: #f0f0f0;
  --text-muted: #8a8a8a;
  --accent: #ff6a00;
  --accent-light: #ff8c2a;
  --accent-dark: #cc5500;
  --accent-glow: rgba(255, 106, 0, 0.3);
  --glass-bg: rgba(20, 20, 20, 0.6);
  --glass-border: 1px solid rgba(255, 106, 0, 0.12);
  --glass-border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --color-1: hsl(0 100% 63%);
  --color-2: hsl(270 100% 63%);
  --color-3: hsl(210 100% 63%);
  --color-4: hsl(195 100% 63%);
  --color-5: hsl(90 100% 63%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent); }

ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--accent-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   NAVIGATION
   ============================================ */

#desktop-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 6%;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 106, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease;
  transform: translateY(0);
  opacity: 1;
}

#desktop-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

#desktop-nav.nav-scrolled {
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid rgba(255, 106, 0, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

#tab-nav {
  display: none;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0 5%;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 106, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#tab-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

#phone-nav {
  display: none;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0 5%;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 106, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#phone-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.logo {
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 2px;
  cursor: default;
  text-transform: uppercase;
}

.t-logo {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
  cursor: default;
}

.p-logo {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  cursor: default;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nave-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navi-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links li a,
.nave-links li a,
.navi-links li a {
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  padding: 0.3rem 0;
  transition: color var(--transition-fast);
}

.nav-links li a { font-size: 0.95rem; }
.nave-links li a { font-size: 0.95rem; }
.navi-links li a { font-size: 0.85rem; }

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
  border-radius: 1px;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--accent);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

.nave-links li a:hover,
.navi-links li a:hover {
  color: var(--accent);
}

.nav-cta {
  padding: 0.55rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: "Poppins", sans-serif;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-cta:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

/* ============================================
   SECTIONS
   ============================================ */

section {
  padding: 5rem 0;
  margin: 0 auto;
  max-width: 1200px;
  width: 90%;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ============================================
   HERO / PROFILE
   ============================================ */

#profile {
  position: relative;
  min-height: 100vh;
  padding-top: 72px;
  padding-bottom: 2rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  align-items: center;
  z-index: 10;
  height: calc(100vh - 120px);
}

.hero-left-col {
  padding-right: 2rem;
  animation: fadeInLeft 0.6s ease-out forwards;
}

.hero-right-col {
  animation: fadeInRight 0.6s ease-out forwards;
}

.hero-center-circle {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  animation: scaleInCircle 0.8s ease-out forwards;
}

.hero-center-image {
  animation: fadeInUpImage 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleInCircle {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 0.9; transform: scale(1); }
}

@keyframes fadeInUpImage {
  from { opacity: 0; transform: translateY(40px) scale(1.3); }
  to { opacity: 1; transform: translateY(0) scale(1.3); }
}

/* Buttons */
.btn {
  font-weight: 600;
  transition: all var(--transition-base);
  padding: 0.75rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 106, 0, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 106, 0, 0.05);
  transform: translateY(-3px);
}

/* Responsive adjustments for Hero */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    height: auto;
    padding-top: 2rem;
  }
  .hero-left-col {
    order: 2 !important;
    padding-right: 0;
    text-align: center !important;
  }
  .hero-left-col p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-left-col > div {
    justify-content: center;
  }
  .hero-right-col {
    order: 3 !important;
    justify-content: center !important;
  }
  .hero-right-col h1 {
    font-size: 4rem !important;
  }
  .hero-center-circle {
    height: 250px !important;
    width: 250px !important;
  }
  .hero-center-image {
    width: 200px !important;
  }
  .hero-bottom-bar {
    position: relative !important;
    bottom: auto !important;
    margin-top: 3rem;
  }
}

@keyframes rotate-glow {
  100% { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   RAINBOW BUTTON
   ============================================ */
@keyframes rainbow {
  0% { background-position: 0%; }
  100% { background-position: 200%; }
}

.rainbow-button {
  position: relative;
  display: inline-flex;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 0;
  background-size: 200%;
  padding: 0.5rem 2rem;
  font-weight: 500;
  color: var(--text-main);
  transition: colors var(--transition-base);
  background-clip: padding-box, border-box, border-box;
  background-origin: border-box;
  border: calc(0.08 * 1rem) solid transparent;
  cursor: pointer;
  animation: rainbow 2s infinite linear;
  text-decoration: none;
  font-family: "Poppins", sans-serif;

  /* Dark mode background */
  background-image:
    linear-gradient(#121213, #121213),
    linear-gradient(#121213 50%, rgba(18, 18, 19, 0.6) 80%, rgba(18, 18, 19, 0)),
    linear-gradient(90deg, var(--color-1), var(--color-5), var(--color-3), var(--color-4), var(--color-2));
}

.rainbow-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent);
}

.rainbow-button:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.rainbow-button::before {
  content: "";
  position: absolute;
  bottom: -20%;
  left: 50%;
  z-index: -1;
  height: 20%;
  width: 60%;
  transform: translateX(-50%);
  animation: rainbow 2s infinite linear;
  background-image: linear-gradient(90deg, var(--color-1), var(--color-5), var(--color-3), var(--color-4), var(--color-2));
  background-size: 200%;
  filter: blur(calc(0.8 * 1rem));
}

/* ============================================
   CONTAINER SCROLL ANIMATION
   ============================================ */
.scroll-container {
  height: 60rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .scroll-container {
    height: 80rem;
    padding: 5rem;
  }
}

.scroll-wrapper {
  padding: 2.5rem 0;
  width: 100%;
  position: relative;
  perspective: 1000px;
}

@media (min-width: 768px) {
  .scroll-wrapper {
    padding: 10rem 0;
  }
}

.scroll-header {
  max-width: 64rem;
  margin: 0 auto;
  text-align: center;
  transition: transform 0.1s ease-out;
}

.scroll-title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.scroll-title-span {
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 0.25rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .scroll-title-span {
    font-size: 6rem;
  }
}

.scroll-card {
  max-width: 64rem;
  margin: -3rem auto 0;
  height: 30rem;
  width: 100%;
  border: 4px solid #6C6C6C;
  padding: 0.5rem;
  background-color: #222222;
  border-radius: 30px;
  box-shadow:
    0 0 #0000004d, 0 9px 20px #0000004a, 0 37px 37px #00000042,
    0 84px 50px #00000026, 0 149px 60px #0000000a, 0 233px 65px #00000003;
  transition: transform 0.1s ease-out;
  transform-origin: center top;
}

@media (min-width: 768px) {
  .scroll-card {
    height: 40rem;
    padding: 1.5rem;
  }
}

.scroll-card-inner {
  height: 100%;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background-color: var(--bg-card);
}

@media (min-width: 768px) {
  .scroll-card-inner {
    padding: 1rem;
  }
}

.scroll-card-img {
  margin: 0 auto;
  border-radius: 1rem;
  object-fit: cover;
  height: 100%;
  object-position: left top;
}

/* ============================================
   SERVICES
   ============================================ */

#services { padding-top: 6rem; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
}

.services-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--glass-bg);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
  border: var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.service-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 106, 0, 0.04);
  border-color: rgba(255, 106, 0, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(255, 106, 0, 0.05);
}

.service-card:hover::before { opacity: 1; }

.service-card .service-icon { margin-bottom: 1.2rem; }

.service-card h3 {
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================
   ABOUT
   ============================================ */

#about { padding-top: 6rem; }

.about-wrapper {
  display: flex;
  gap: 5rem;
  align-items: center;
}

.about-image-col {
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-image-frame {
  width: 360px;
  height: 450px;
  border-top-left-radius: 180px;
  border-top-right-radius: 180px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 106, 0, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.about-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: filter var(--transition-slow);
}

.about-image-frame:hover img {
  filter: contrast(1.05);
}

.about-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.9;
  text-align: justify;
}

.about-credentials {
  list-style: none;
  padding: 0;
}

.about-credentials li {
  color: var(--text-main);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  opacity: 0.85;
}

.about-credentials li strong { color: var(--accent); }

.btn-container {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ============================================
   SKILLS
   ============================================ */

#experience { padding-top: 4rem; }

.skills-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.skill-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--percent) * 1%), rgba(255, 255, 255, 0.06) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.skill-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px var(--accent-glow);
}

.skill-circle .inner-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-percent {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.skill-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ============================================
   PORTFOLIO
   ============================================ */

#projects { padding-top: 6rem; }

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: "Poppins", sans-serif;
  transition: all var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* ============================================
   INTERACTIVE REPOSITORY CARDS (Swappable/Spreadable)
   ============================================ */

.interactive-cards-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 450px;
  margin: 0 auto 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1500px;
}

.interactive-cards-container.is-spread {
  height: auto;
  min-height: 450px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  perspective: none;
}

.portfolio-card {
  position: absolute;
  width: 320px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  transform-origin: center center;
  display: flex;
  flex-direction: column;
}

/* Base states for stacked cards */
.interactive-cards-container:not(.is-spread) .portfolio-card[data-index="0"] {
  z-index: 5;
  transform: translateY(0) scale(1);
}

.interactive-cards-container:not(.is-spread) .portfolio-card[data-index="1"] {
  z-index: 4;
  transform: translateY(-20px) scale(0.95);
  opacity: 0.9;
}

.interactive-cards-container:not(.is-spread) .portfolio-card[data-index="2"] {
  z-index: 3;
  transform: translateY(-40px) scale(0.9);
  opacity: 0.8;
}

.interactive-cards-container:not(.is-spread) .portfolio-card[data-index="3"] {
  z-index: 2;
  transform: translateY(-60px) scale(0.85);
  opacity: 0.7;
}

/* Default state for stacked cards beyond index 3 */
.interactive-cards-container:not(.is-spread) .portfolio-card[data-index]:not([data-index="0"]):not([data-index="1"]):not([data-index="2"]):not([data-index="3"]) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-80px) scale(0.8);
  z-index: 0;
}

/* Hover effect on stack */
.interactive-cards-container:not(.is-spread):hover .portfolio-card[data-index="0"] {
  transform: translateY(10px) scale(1.02);
}
.interactive-cards-container:not(.is-spread):hover .portfolio-card[data-index="1"] {
  transform: translateY(-30px) scale(0.95) rotate(-3deg) translateX(-20px);
}
.interactive-cards-container:not(.is-spread):hover .portfolio-card[data-index="2"] {
  transform: translateY(-30px) scale(0.9) rotate(3deg) translateX(20px);
}

/* Spread state styling */
.interactive-cards-container.is-spread .portfolio-card {
  position: relative;
  width: 100%;
  transform: none !important;
  opacity: 1 !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

.interactive-cards-container.is-spread .portfolio-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 106, 0, 0.1) !important;
  border-color: rgba(255, 106, 0, 0.3);
}

/* Hide cards filtered out */
.portfolio-card.hidden {
  display: none !important;
}

.portfolio-card a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.card-image-wrap {
  height: 200px;
  background: #1a1a1a;
  position: relative;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.placeholder-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.placeholder-wrap p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-info {
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
}

.card-title {
  color: var(--text-main);
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

.card-category {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* Responsive Grid adjustments */
@media (max-width: 900px) {
  .interactive-cards-container.is-spread {
      grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .interactive-cards-container.is-spread {
      grid-template-columns: 1fr;
  }
}

/* Folder Card (Legacy) */
.folder-card {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  border: var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  width: 80px;
  height: 5px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
  opacity: 0.7;
  transition: width var(--transition-base), opacity var(--transition-base);
}

.folder-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 106, 0, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(255, 106, 0, 0.08);
}

.folder-card:hover::before {
  width: 120px;
  opacity: 1;
}

.folder-preview {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
}

.folder-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.folder-card:hover .folder-preview img {
  transform: scale(1.05);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 106, 0, 0.12);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.folder-card:hover .preview-overlay { opacity: 1; }

.view-btn {
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transform: translateY(10px);
  transition: transform var(--transition-base);
  border: none;
  pointer-events: none;
}

.folder-card:hover .view-btn { transform: translateY(0); }

.folder-preview-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 106, 0, 0.03);
}

.folder-preview-placeholder svg {
  opacity: 0.15;
  transition: opacity var(--transition-base);
}

.folder-card:hover .folder-preview-placeholder svg { opacity: 0.35; }

.folder-info {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.folder-name {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.folder-type {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0;
  padding: 0.2rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50px;
}

.folder-card.view-all-card .folder-preview-placeholder {
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.05), rgba(255, 106, 0, 0.02));
}

.view-all-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   STACKED CARDS INTERACTION
   ============================================ */
.stacked-cards-container {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4rem;
}

.stacked-cards-wrapper {
  position: relative;
  width: 350px;
  height: 400px;
}

.stacked-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 350px;
  height: 400px;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 1rem; /* 2xl = 1rem */
  box-shadow: 0 0 10px rgba(0,0,0,0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0.3s;
  transform-origin: center center;
}

.stacked-card-first {
  z-index: 10;
  cursor: pointer;
}

.stacked-card-second {
  z-index: 0;
}

.stacked-card-third {
  z-index: 0;
}

/* Hover effects added via JS, but we define classes for them */
.stacked-wrapper-hover .stacked-card-second {
  transform: translateX(-40px) rotate(-5deg);
}

.stacked-wrapper-hover .stacked-card-third {
  transform: translateX(40px) rotate(5deg);
}

.stacked-card-image-wrapper {
  position: relative;
  height: 18rem; /* h-72 */
  border-radius: 0.75rem; /* rounded-xl */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
  overflow: hidden;
  width: calc(100% - 1rem);
  margin: 0.5rem auto 0;
}

.stacked-card-image {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.stacked-card-content {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-main);
  text-align: left;
}

.stacked-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.stacked-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   CONTACT
   ============================================ */

#contact {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact-input,
.contact-select,
.contact-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contact-input:focus,
.contact-select:focus,
.contact-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 106, 0, 0.1);
}

.contact-input::placeholder,
.contact-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.contact-select {
  appearance: none;
  cursor: pointer;
  color: var(--text-muted);
}

.contact-textarea {
  min-height: 140px;
  resize: none;
  grid-row: span 2;
}

.contact-submit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.contact-submit {
  padding: 0.7rem 2.5rem;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.contact-submit:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  padding: 4rem 6% 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 106, 0, 0.08);
  text-align: center;
}

.footer-logo {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-nav a:hover { color: var(--accent); }

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--transition-base);
}

.footer-socials a:hover {
  border-color: var(--accent);
  background: rgba(255, 106, 0, 0.1);
  transform: translateY(-2px);
}

.footer-contact-info {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.footer-contact-item {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-credit {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ============================================
   GLASSMORPHISM UTILITIES
   ============================================ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
}

/* Background grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   AMBIENT GLOW for hero section
   ============================================ */

.hero-ambient {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 106, 0, 0.06), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  top: 20%;
  right: 5%;
  z-index: 0;
}

/* Title helper */
.title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
