/* ============================================================
   CORNET STUDIO — portfolio.html styles
   ============================================================ */

/* ── Body reset for standalone page ──────────────────────── */

.pf-body {
  background: #0f0e10;
  min-height: 100vh;
}

/* ── Page layout ──────────────────────────────────────────── */

.pf-page {
  min-height: 100vh;
  background: #0f0e10;
  padding-bottom: 6rem;
}

.pf-page-hero {
  position: relative;
  padding: 9rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}

/* subtle radial glow behind header */
.pf-page-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 400px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  filter: blur(80px);
  pointer-events: none;
}

.pf-page-hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pf-back {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pf-back:hover {
  color: rgba(255, 255, 255, 0.75);
}

html[dir="rtl"] .pf-back {
  direction: rtl;
}

.pf-page-title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.pf-page-intro {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
  max-width: 540px;
}

/* ── Grid ─────────────────────────────────────────────────── */

.pf-page-grid-wrap {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.pf-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 340px;
  gap: 1rem;
}

/* featured card spans 2 cols and 2 rows */
.pf-page-grid .pf-card--featured {
  grid-column: span 2;
  grid-row: span 2;
}

/* Override pf-card cursor for portfolio page (click → modal) */
.pf-page-grid .pf-card {
  cursor: pointer;
}

.pf-page-grid .pf-card--featured .pf-card-img--corfitx {
  background-position: center top;
  background-size: cover;
}

/* tag chips */
.pf-tags-row {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pf-card:hover .pf-tags-row {
  opacity: 1;
  transform: translateY(0);
}

html[dir="rtl"] .pf-tags-row {
  left: auto;
  right: 1.25rem;
}

.pf-tag {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

/* active nav link */
.nav-link--active {
  color: #fff !important;
  opacity: 1 !important;
}

/* Portfolio page nav also needs white-space: nowrap */
.portfolio.html .nav-link,
.pf-body .nav-link {
  white-space: nowrap;
}

/* ── CTA strip ────────────────────────────────────────────── */

.pf-page-cta {
  margin-top: 4.5rem;
  padding: 0 1.5rem 1rem;
}

.pf-cta-block {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  text-align: center;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.pf-cta-block::before {
  content: "";
  position: absolute;
  bottom: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 36rem;
  height: 20rem;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(78, 184, 204, 0.09) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.pf-cta-eyebrow {
  position: relative;
  display: block;
  margin-bottom: 1rem;
  color: #4eb8cc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pf-cta-headline {
  position: relative;
  margin: 0 0 2rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.18;
  color: #eef2f6;
  letter-spacing: -0.02em;
}

.pf-cta-headline em {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  color: #4eb8cc;
}

.pf-cta-btn {
  position: relative;
}

html[dir="rtl"] .pf-cta-block,
html[dir="rtl"] .pf-cta-headline {
  direction: rtl;
}

.pf-page-cta-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  font-weight: 600;
}

/* ── Modal ────────────────────────────────────────────────── */

#pf-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#pf-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.pfm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 7, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pfm-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 1.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #090d11;
  box-shadow:
    0 48px 96px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.93) translateY(20px);
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
}

#pf-modal.is-open .pfm-shell {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Close button ── */
.pfm-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pfm-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

html[dir="rtl"] .pfm-close {
  right: auto;
  left: 1.25rem;
}

/* ── Left panel (screenshot) ── */
.pfm-left {
  flex: 1 1 0;
  min-width: 0;
  padding: 3rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.pfm-screen {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d1117;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.pfm-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.pfm-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
}

.pfm-dot {
  opacity: 0.4;
}

.pfm-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.pfm-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.pfm-cta {
  width: fit-content;
  padding: 0.85rem 2rem;
}

/* ── Right sidebar (actions) ── */
.pfm-right {
  width: 4.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 0 2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.01);
}

.pfm-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pfm-action {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pfm-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.pfm-action svg {
  width: 1rem;
  height: 1rem;
}

html[dir="rtl"] .pfm-right {
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Hover shimmer on cards ───────────────────────────── */

.pf-page-grid .pf-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.pf-page-grid .pf-card:hover::before {
  opacity: 1;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 1200px) {
  .pf-page-grid {
    grid-auto-rows: 290px;
  }
}

@media (max-width: 960px) {
  .pf-page-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
  }

  .pf-page-grid .pf-card--featured {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 680px) {
  .pf-page-hero {
    padding: 7rem 1.25rem 2.5rem;
  }

  .pf-page-grid-wrap {
    padding: 0 1rem;
  }

  .pf-page-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }

  .pf-page-grid .pf-card--featured {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Modal: stack vertically */
  .pfm-shell {
    flex-direction: column;
    max-height: 94vh;
    width: 96vw;
    border-radius: 1.25rem;
  }

  .pfm-right {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .pfm-actions {
    flex-direction: row;
  }

  .pfm-left {
    padding: 3rem 1.25rem 1.25rem;
    overflow-y: auto;
  }

  .pfm-screen {
    aspect-ratio: 16 / 9;
  }

  .pfm-title {
    font-size: 1.35rem;
  }
}

@media (max-width: 479px) {
  .pf-page-grid {
    grid-auto-rows: 210px;
  }

  .pf-page-cta {
    padding: 0 1rem;
  }

  .pf-cta-block {
    padding: 2.25rem 1.5rem;
    border-radius: 1.25rem;
  }

  .pf-page-cta-text {
    font-size: 1.05rem;
  }
}

/* ── Modal animation already defined above ── */

/* ── Keyboard focus rings ────────────────────────────── */

.pf-page-grid .pf-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

.pfm-close:focus-visible,
.pfm-action:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}
