/* ===================================================================
   Portfolio page — layered on top of style.css
   Echoes the printed portfolio palette (teal + amber + cream)
   =================================================================== */

:root,
[data-theme="dark"] {
  --pf-teal: #7fb8b0;
  --pf-amber: #f2a81d;
  --pf-frame: #141414;
  --pf-frame-border: #262626;
  --pf-canvas: #ffffff; /* artwork canvas colour */
}

[data-theme="light"] {
  --pf-teal: #4f938a;
  --pf-amber: #e09400;
  --pf-frame: #ffffff;
  --pf-frame-border: #e2e2e7;
  --pf-canvas: #ffffff;
}

/* === Scroll reveal === */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.22, 1),
              transform 0.9s cubic-bezier(0.22, 0.61, 0.22, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === Hero === */
.pf-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 52px 24px 0;
  overflow: hidden;
}

.pf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 30% 30%, rgba(127, 184, 176, 0.22), transparent 70%),
    radial-gradient(55% 50% at 78% 70%, rgba(242, 168, 29, 0.18), transparent 70%);
  pointer-events: none;
}
[data-theme="light"] .pf-hero::before {
  background:
    radial-gradient(60% 55% at 30% 30%, rgba(79, 147, 138, 0.20), transparent 70%),
    radial-gradient(55% 50% at 78% 70%, rgba(224, 148, 0, 0.16), transparent 70%);
}

.pf-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pf-hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pf-teal);
  font-weight: 600;
  margin-bottom: 24px;
}

.pf-hero-title {
  font-family: "PF Baseline Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(44px, 11.5vw, 112px);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pf-hero-sub {
  font-size: clamp(16px, 2.6vw, 22px);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.pf-hero-sub strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pf-scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  animation: pf-bounce 2.2s ease-in-out infinite;
}
@keyframes pf-bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* === Generic section === */
.pf-section {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.pf-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pf-amber);
  font-weight: 600;
  margin-bottom: 14px;
}

.pf-title {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
}

.pf-lead {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 620px;
}

/* wider container just for portfolio pieces */
.pf-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === About / CV === */
.pf-about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}

.pf-about-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.pf-about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-about-role {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pf-teal);
  letter-spacing: 0.02em;
}

.pf-about-bio {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 640px;
}
.pf-about-bio + .pf-about-bio { margin-top: 14px; }

.pf-about-block { margin-top: 32px; }
.pf-about-block h4 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.pf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pf-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
}

.pf-edu { display: flex; flex-direction: column; gap: 10px; }
.pf-edu-item { display: flex; flex-direction: column; gap: 2px; }
.pf-edu-school { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.pf-edu-detail { font-size: 13px; color: var(--text-secondary); }

.pf-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pf-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 8px 16px;
  transition: border-color 0.2s, color 0.2s;
}
.pf-contact-link:hover { color: var(--pf-teal); border-color: var(--pf-teal); }
.pf-contact-link svg { width: 16px; height: 16px; }

/* === Project piece === */
.pf-piece { padding: 120px 0; border-top: 1px solid var(--border); }
.pf-piece-head { max-width: 720px; margin-bottom: 56px; }

/* Framed artwork — keeps the white/cream artboards from floating on dark bg */
.pf-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--pf-canvas);
  border: 1px solid var(--pf-frame-border);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.55);
}
.pf-figure img,
.pf-figure video { width: 100%; height: auto; display: block; }
.pf-frame + .pf-frame { margin-top: 28px; }

.pf-frame-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.pf-frame-grid .pf-frame + .pf-frame { margin-top: 0; }

/* Figure + caption */
.pf-figure { margin: 0; }
.pf-figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 720px;
}
.pf-figcaption strong { color: var(--text-secondary); font-weight: 600; }

/* Narrative body */
.pf-body {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 620px;
}
.pf-body + .pf-body { margin-top: 16px; }
.pf-subtitle {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pf-teal);
  font-weight: 600;
  margin-bottom: 16px;
}

/* Two-column text / media block */
.pf-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-top: 72px;
}
.pf-cols.narrow { grid-template-columns: 1fr 0.9fr; }

/* Numbered scenario steps */
.pf-steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
  counter-reset: step;
  margin-top: 8px;
}
.pf-step { display: flex; gap: 18px; align-items: flex-start; }
.pf-step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--pf-teal);
  color: var(--pf-teal);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-step-text { font-size: 16px; color: var(--text-secondary); line-height: 1.6; padding-top: 4px; }
.pf-step-text strong { color: var(--text-primary); font-weight: 600; }

@media (max-width: 820px) {
  .pf-cols, .pf-cols.narrow { grid-template-columns: 1fr; gap: 32px; margin-top: 48px; }
}

/* Exploded parts legend */
.pf-parts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 32px;
  margin-top: 18px;
  max-width: 820px;
}
.pf-part {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.pf-part b {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pf-amber);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 600px) { .pf-parts { grid-template-columns: 1fr; } }

/* 3D model gallery */
.pf-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 8px;
}
.pf-model-img {
  background: #f4f1e9;
  border: 1px solid var(--pf-frame-border);
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Cap the art at 86% of the card (≈7% breathing room each side) and let it
   keep its own ratio. Avoids height:100% + padding, which clips the bottom
   on iOS Safari. */
.pf-model-img img {
  max-width: 86%;
  max-height: 86%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.22, 1);
}
.pf-model:hover .pf-model-img img { transform: scale(1.05); }
.pf-model-label {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.pf-model-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Placeholder note for pieces still to come */
.pf-todo {
  border: 1px dashed var(--border);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 15px;
}

/* === Responsive === */
@media (max-width: 820px) {
  .pf-about-grid { grid-template-columns: 1fr; gap: 32px; }
  .pf-about-portrait { max-width: 240px; }
  .pf-frame-grid { grid-template-columns: 1fr; }
  .pf-frame-grid .pf-frame + .pf-frame { margin-top: 28px; }
}

@media (max-width: 600px) {
  .pf-section, .pf-piece { padding: 80px 0; }
  .pf-piece-head { margin-bottom: 32px; }
}
