/* ============================================================
   app.css — SPA transitions, cursor, modals, hover effects
   ============================================================ */

/* ── CUSTOM CURSOR ──────────────────────────────────────── */
* { cursor: none !important; }
#cursor {
  position: fixed;
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%,-50%);
  transition: width 0.25s ease, height 0.25s ease,
              border-color 0.25s ease, background 0.25s ease,
              opacity 0.25s ease;
  mix-blend-mode: difference;
}
#cursor-dot {
  position: fixed;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%,-50%);
  transition: transform 0.08s ease;
}
body.cursor-hover #cursor {
  width: 56px; height: 56px;
  background: rgba(200,240,62,0.08);
}
body.cursor-click #cursor {
  width: 24px; height: 24px;
  background: rgba(200,240,62,0.2);
}
@media (hover: none) {
  #cursor, #cursor-dot { display: none; }
  * { cursor: auto !important; }
}

/* ── PAGE TRANSITION OVERLAY ────────────────────────────── */
#page-overlay {
  position: fixed;
  inset: 0;
  background: var(--accent);
  z-index: 9000;
  transform: translateY(100%);
  pointer-events: none;
}
#page-overlay.sweep-in  { animation: sweepIn  0.42s cubic-bezier(0.76,0,0.24,1) forwards; }
#page-overlay.sweep-out { animation: sweepOut 0.38s cubic-bezier(0.76,0,0.24,1) forwards; }
@keyframes sweepIn  { from{transform:translateY(100%)} to{transform:translateY(0)} }
@keyframes sweepOut { from{transform:translateY(0)}    to{transform:translateY(-100%)} }

/* ── SECTIONS (SPA) ─────────────────────────────────────── */
.app-section {
  display: none;
  opacity: 0;
  transform: translateY(24px);
  min-height: calc(100vh - 72px);
  padding-top: 72px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.app-section.active {
  display: block;
}
.app-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── NAV ACTIVE STATE ───────────────────────────────────── */
.nav-btn { position: relative; }
.nav-btn.active { color: var(--text) !important; }
.nav-btn.active::after { width: 100% !important; }

/* ── TILT CARDS ─────────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease, box-shadow 0.3s ease !important;
}
.tilt-card:hover {
  box-shadow: 0 20px 60px rgba(200,240,62,0.1) !important;
}

/* ── PORTFOLIO ITEM HOVER ───────────────────────────────── */
.proj-card {
  cursor: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              border-color 0.3s ease !important;
}
.proj-card:hover {
  transform: translateY(-8px) scale(1.015) !important;
  border-color: var(--accent) !important;
}
.proj-card:hover .portfolio-thumb::after {
  opacity: 1 !important;
}
.proj-card .portfolio-thumb {
  position: relative;
  overflow: hidden;
}
.proj-card .portfolio-thumb::before {
  content: 'View project';
  position: absolute;
  inset: 0;
  background: rgba(200,240,62,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.proj-card:hover .portfolio-thumb::before { opacity: 1; }

/* thumbnail image zoom on hover */
.proj-card .portfolio-thumb-img {
  transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}
.proj-card:hover .portfolio-thumb-img { transform: scale(1.06); }

/* ── MAGNETIC BUTTONS ───────────────────────────────────── */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.3s ease !important;
}

/* ── SKILL CHIPS HOVER ──────────────────────────────────── */
.skill-chip {
  transition: all 0.2s ease;
}
.skill-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(200,240,62,0.06) !important;
}

/* ── HERO TITLE ANIMATION ───────────────────────────────── */
.hero-title {
  overflow: hidden;
}
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  animation: wordIn 0.7s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes wordIn {
  to { opacity:1; transform:translateY(0); }
}

/* ── HERO EYEBROW PULSE ─────────────────────────────────── */
.hero-eyebrow {
  animation: fadeSlideIn 0.6s ease 0.1s both;
}
.hero-sub { animation: fadeSlideIn 0.6s ease 0.5s both; }
.hero-cta { animation: fadeSlideIn 0.6s ease 0.7s both; }
.hero-visual { animation: fadeSlideIn 0.7s ease 0.3s both; }
@keyframes fadeSlideIn {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── SECTION STAGGER ON ENTER ───────────────────────────── */
.app-section.visible .section-label { animation: fadeSlideIn 0.5s ease 0.1s both; }
.app-section.visible .section-title { animation: fadeSlideIn 0.5s ease 0.2s both; }
.app-section.visible .page-header-title { animation: fadeSlideIn 0.6s ease 0.15s both; }
.app-section.visible .page-header-sub   { animation: fadeSlideIn 0.6s ease 0.3s both; }

/* ── PROJECT MODAL ──────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 8000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}
#modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
#project-modal {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  z-index: 8100;
  padding: 40px clamp(24px,5vw,64px) 48px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
  max-height: 85vh;
  overflow-y: auto;
}
#project-modal.open {
  transform: translateY(0);
}
#modal-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  cursor: none;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
#modal-close:hover { background: var(--accent); color: #0d0d0d; border-color: var(--accent); }
#modal-thumb {
  width: 320px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  min-height: 0;
  background: var(--surface);
}
#modal-body { flex: 1; min-width: 240px; }
#modal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
#modal-title {
  font-family: var(--font-display);
  font-size: clamp(20px,3vw,30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: var(--text);
}
#modal-desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 24px;
}
#modal-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* drag handle */
#project-modal::before {
  content: '';
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--border);
}

@media (max-width: 640px) {
  #project-modal { flex-direction: column; }
  #modal-thumb { width: 100%; min-height: 180px; }
}

#nav-logo-link:hover #nav-logo-img,
#nav-logo-link:active #nav-logo-img {
  content: url('phila_green.png');
}