/* ============================================================
   portfolio-index.css — dedicated /portfolio showcase page
   Editorial magazine aesthetic: warm off-white, oversized serif
   headlines, full-bleed project rows. Loaded only on /portfolio.
   All selectors scoped under .page-portfolio-index.
   ============================================================ */

.page-portfolio-index {
  --paper: #f7f3eb;
  --paper-2: #efe9dc;
  --ink: #14110d;
  --ink-2: #4d4639;
  --ink-3: #8a8275;
  --rule: #d6cdb9;
  --accent: #c8553d;

  --serif: "New York", "Source Serif 4", Georgia, "Times New Roman", ui-serif, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* own stacking context so the fixed photo layer below stays inside this page */
  isolation: isolate;
}

/* Full-cover aesthetic backdrop for everything below the hero.
   Fixed so the glass sections scroll over it; the opaque hero covers it. */
.page-portfolio-index::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/images/ui/portfolio-backdrop.jpg") center / cover no-repeat #1c1640;
}

.page-portfolio-index,
.page-portfolio-index * { box-sizing: border-box; }

.page-portfolio-index a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Full-bleed hero ---------- */
.pi-hero {
  --hero-img: url("/images/ui/portfolio-backdrop.jpg");
  position: relative;
  height: 100vh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
  background: #1c1640;
}

.pi-hero-bg {
  position: absolute;
  inset: -4%;
  z-index: -3;
  background-color: #1c1640;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: pi-kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes pi-kenburns {
  0%   { transform: scale(1.02) translate3d(0, 0, 0); }
  50%  { transform: scale(1.06) translate3d(-1%, -0.6%, 0); }
  100% { transform: scale(1.08) translate3d(-1.5%, 0.4%, 0); }
}

.pi-hero-grain { display: none; }

.pi-hero-scrim { display: none; }

/* Spline 3D scene — the robot brings its own colour. No blend mode, no
   tinting overlay, no scrim. Words stay black for full contrast. */
.pi-hero-spline {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.pi-hero-spline > * {
  width: 100%;
  height: 100%;
}

/* Aesthetic loading stage — sits on the paper backdrop while the Spline
   scene streams + initialises, then fades out once onLoad fires. */
.pi-spline-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #1c1640;
  transition: opacity 700ms ease;
}

.pi-spline-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.pi-spline-loader-bar {
  width: clamp(120px, 18vw, 200px);
  height: 2px;
  background: color-mix(in srgb, var(--paper) 18%, transparent);
  overflow: hidden;
  position: relative;
}

.pi-spline-loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--paper);
  animation: pi-spline-sweep 1.25s ease-in-out infinite;
}

.pi-spline-loader-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

@keyframes pi-spline-sweep {
  0%   { left: -40%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pi-spline-loader-bar::after { animation: none; left: 0; width: 100%; opacity: 0.4; }
}

/* Hero overlay chrome adopts the same frosted-glass system as the project
   cards: low-alpha fill, soft border, inset catch-light, blurred backdrop. */
.pi-hero-tl {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  left: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--paper);
  text-transform: uppercase;
  max-width: min(30vw, 430px);
  padding: clamp(18px, 2vw, 26px);
  border-radius: 24px;
  background: rgba(18, 16, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.pi-hero-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
  font-weight: 500;
  transition: color 200ms ease;
  align-self: flex-start;
}

.pi-hero-home:hover { color: var(--accent); }

.pi-hero-mark { display: flex; flex-direction: column; gap: 14px; }

.pi-hero-mark-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.2vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--paper);
  font-weight: 500;
  text-transform: none;
}

.pi-hero-mark-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--paper);
  line-height: 1.5;
}

.pi-hero-tr {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--paper);
  max-width: min(30vw, 300px);
  line-height: 1.5;
  padding: clamp(16px, 2vw, 22px);
  border-radius: 24px;
  background: rgba(18, 16, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.pi-hero-tr-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

.pi-hero-bl {
  position: absolute;
  bottom: clamp(24px, 4vw, 48px);
  left: clamp(24px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(18, 16, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.pi-hero-arrow {
  font-size: 18px;
  display: inline-block;
  animation: pi-hero-bob 2.2s ease-in-out infinite;
}

@keyframes pi-hero-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

.pi-hero-br {
  position: absolute;
  bottom: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 48px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(18, 16, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

@media (max-width: 720px) {
  .pi-hero-tr { max-width: 180px; font-size: 11px; }
  .pi-hero-mark-name { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pi-hero-arrow,
  .pi-hero-bg,
  .pi-hero-grain { animation: none !important; }
  .pi-hero-bg { inset: 0; transform: none; }
}

/* ---------- Top bar ---------- */
.pi-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pi-topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  transition: color 200ms ease;
}

.pi-topbar-home:hover { color: var(--accent); }

.pi-topbar-where {
  color: var(--ink-3);
}

/* ---------- Cover ---------- */
.pi-cover {
  padding: clamp(96px, 14vw, 200px) clamp(20px, 5vw, 64px) clamp(64px, 10vw, 120px);
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.pi-cover-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 32px;
}

.pi-cover-title {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 40px;
  font-weight: 500;
  max-width: 16ch;
}

.pi-cover-title em {
  font-style: italic;
  color: var(--accent);
}

.pi-cover-lede {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 64px;
  max-width: 52ch;
}

.pi-cover-scroll {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 14px 22px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.pi-cover-scroll:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(2px);
}

/* ---------- Capabilities ---------- */
.pi-caps {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 64px clamp(20px, 5vw, 64px);
}

.pi-caps-head {
  max-width: 1280px;
  margin: 0 auto 32px;
}

.pi-caps-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pi-caps-grid {
  max-width: 1280px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
}

.pi-cap {
  padding: 24px clamp(8px, 2vw, 32px) 24px 0;
  border-right: 1px solid var(--rule);
}

.pi-cap:nth-child(3n) { border-right: none; }
.pi-cap:last-child { border-right: none; }

.pi-cap-label {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
}

.pi-cap-detail {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- Projects list ---------- */
.pi-projects {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) clamp(20px, 5vw, 64px) clamp(48px, 8vw, 96px);
}

.pi-projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}

.pi-projects-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.pi-projects-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.pi-projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each project is now a full-width visual band — image background,
   minimal corner overlays, large title slides up on hover.
   "Show, don't tell" — image is primary, words secondary. */

.pi-project {
  --proj-accent: var(--accent);
  --proj-img: none;
  position: relative;
  margin-bottom: 16px;
}

.pi-project:last-child { margin-bottom: 0; }

.pi-project-link {
  position: relative;
  display: block;
  height: clamp(280px, 38vw, 480px);
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
  background: #111;
}

.pi-project-bg {
  position: absolute;
  inset: -4%;
  z-index: -2;
  background-color: var(--proj-accent);
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--proj-accent) 70%, #000) 0%, color-mix(in srgb, var(--proj-accent) 35%, #111) 60%, color-mix(in srgb, var(--proj-accent) 60%, #000) 100%),
    var(--proj-img);
  background-size: cover, cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 800ms cubic-bezier(0.2, 0, 0.2, 1), filter 800ms ease;
  will-change: transform;
  filter: saturate(0.85);
}

.pi-project-link:hover .pi-project-bg,
.pi-project-link:focus-visible .pi-project-bg {
  transform: scale(1.08) translate3d(-0.4%, -0.2%, 0);
  filter: saturate(1.1);
}

.pi-project-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, transparent 30%, rgba(0,0,0,0.85) 100%);
  transition: opacity 400ms ease;
}

.pi-project-link:hover .pi-project-scrim {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, color-mix(in srgb, var(--proj-accent) 18%, transparent) 50%, rgba(0,0,0,0.9) 100%);
}

/* Corner labels — small monospace, igloo style */
.pi-project-corner {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pi-project-corner-tl {
  top: clamp(16px, 2.5vw, 28px);
  left: clamp(16px, 2.5vw, 28px);
}

.pi-project-corner-tr {
  top: clamp(16px, 2.5vw, 28px);
  right: clamp(16px, 2.5vw, 28px);
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pi-project-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eff8a;
  box-shadow: 0 0 8px rgba(94, 255, 138, 0.55);
}

/* Title block — bottom-left, slides up on hover */
.pi-project-text {
  position: absolute;
  bottom: clamp(20px, 3vw, 36px);
  left: clamp(20px, 3vw, 36px);
  right: clamp(20px, 3vw, 36px);
  z-index: 2;
  color: #fff;
  transform: translateY(8px);
  transition: transform 500ms cubic-bezier(0.2, 0, 0.2, 1);
  max-width: 720px;
}

.pi-project-link:hover .pi-project-text,
.pi-project-link:focus-visible .pi-project-text {
  transform: translateY(0);
}

.pi-project-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  font-weight: 500;
  color: #fff;
  margin: 0 0 10px;
  max-width: 22ch;
}

.pi-project-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.95rem, 1.4vw, 1.125rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 18px;
  max-width: 56ch;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 350ms ease 50ms, transform 500ms cubic-bezier(0.2, 0, 0.2, 1) 50ms;
}

.pi-project-link:hover .pi-project-tagline,
.pi-project-link:focus-visible .pi-project-tagline {
  opacity: 1;
  transform: translateY(0);
}

.pi-project-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 350ms ease 100ms, transform 500ms cubic-bezier(0.2, 0, 0.2, 1) 100ms;
}

.pi-project-link:hover .pi-project-chips,
.pi-project-link:focus-visible .pi-project-chips {
  opacity: 1;
  transform: translateY(0);
}

.pi-project-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.95);
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pi-project-chip-more {
  color: var(--proj-accent);
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

/* CTA — top-right by default, becomes a bigger arrow on hover */
.pi-project-cta {
  position: absolute;
  top: clamp(16px, 2.5vw, 28px);
  right: clamp(70px, 8vw, 120px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  transform: translateX(-8px);
}

/* When project has no live badge, CTA can sit at the corner */
.pi-project:not(:has(.pi-project-corner-tr)) .pi-project-cta {
  right: clamp(16px, 2.5vw, 28px);
}

.pi-project-link:hover .pi-project-cta,
.pi-project-link:focus-visible .pi-project-cta {
  opacity: 1;
  transform: translateX(0);
}

.pi-project-cta-arrow {
  display: inline-block;
  font-size: 18px;
  transition: transform 300ms cubic-bezier(0.2, 0, 0.2, 1);
}

.pi-project-link:hover .pi-project-cta-arrow {
  transform: translateX(6px);
}

@keyframes pi-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 255, 138, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(94, 255, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 255, 138, 0); }
}

.pi-project-live-dot { animation: pi-pulse 1.8s ease-out infinite; }

/* ---------- Spline CTA (click-to-load button) ---------- */
.spline-cta {
  appearance: none;
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed var(--ink-3);
  border-radius: 999px;
  padding: 14px 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--mono);
  color: var(--ink);
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
  width: 100%;
  height: 100%;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.spline-cta:hover,
.spline-cta:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--ink);
  outline: none;
}

.spline-cta-icon {
  font-size: 22px;
  color: var(--accent);
  animation: pi-num-float 4s ease-in-out infinite;
}

.spline-cta-text {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.spline-cta-meta {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

/* ---------- Project Showcase (glass cards over page backdrop) ---------- */
.pi-proj-showcase {
  background: rgba(10, 10, 10, 0.18);
  color: var(--paper);
  padding: clamp(56px, 9vw, 96px) clamp(20px, 5vw, 56px);
  border-top: 1px solid rgba(247, 243, 235, 0.12);
}

.pi-proj-grid {
  max-width: 1280px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(32px, 4vw, 48px);
}

.pi-proj-cell {
  --proj-accent: var(--accent);
}

/* Frosted glass card: low-alpha fill, accent-tinted edge, inset top
   highlight (the catch-light that sells the glass), blurred backdrop */
.pi-proj-link {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  padding: clamp(16px, 2vw, 22px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid color-mix(in srgb, var(--proj-accent) 28%, rgba(255, 255, 255, 0.28));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  transition: transform 320ms cubic-bezier(0.2, 0, 0.2, 1), background 200ms ease;
}

.pi-proj-link:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

.pi-proj-prototype {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.35);
  transition: box-shadow 320ms ease;
}

.pi-proj-link:hover .pi-proj-prototype {
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--proj-accent) 60%, rgba(0,0,0,0.3));
}

.pi-proj-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  align-items: start;
}

.pi-proj-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(247, 243, 235, 0.55);
  padding-top: 4px;
}

.pi-proj-meta-body {
  min-width: 0;
}

.pi-proj-title {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--paper);
  margin: 0 0 8px;
  transition: color 200ms ease;
}

.pi-proj-link:hover .pi-proj-title {
  color: color-mix(in srgb, var(--proj-accent) 55%, #fff);
}

.pi-proj-insight {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(247, 243, 235, 0.72);
  margin: 0 0 12px;
  max-width: 56ch;
}

.pi-proj-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 243, 235, 0.9);
  transition: gap 200ms ease, color 200ms ease;
}

.pi-proj-link:hover .pi-proj-cta {
  gap: 14px;
  color: color-mix(in srgb, var(--proj-accent) 55%, #fff);
}

@media (max-width: 920px) {
  .pi-proj-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pi-proj-link, .pi-proj-prototype, .pi-proj-title, .pi-proj-cta { transition: none !important; }
  .pi-proj-link:hover { transform: none; }
  .spline-cta-icon { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .pi-proj-link,
  .pi-cap-cell {
    background: #221c15;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ---------- Capability Showcase (glass over page backdrop) ---------- */
.pi-cap-showcase {
  background: rgba(10, 10, 10, 0.25);
  color: #f4ede0;
  padding: clamp(72px, 12vw, 144px) clamp(20px, 5vw, 64px);
  position: relative;
}

.pi-cap-showcase::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 237, 224, 0.18), transparent);
}

.pi-cap-showcase-grid {
  max-width: 1280px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(32px, 4vw, 56px);
}

/* frosted glass cell: same recipe as the project cards */
.pi-cap-cell {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(16px, 2vw, 22px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.pi-cap-cell-prototype {
  width: 100%;
}

.pi-cap-cell-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 20px;
  align-items: start;
}

.pi-cap-cell-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(244, 237, 224, 0.42);
  padding-top: 6px;
}

.pi-cap-cell-title {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: #fff;
  margin: 0 0 12px;
}

.pi-cap-cell-insight {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: rgba(244, 237, 224, 0.82);
  margin: 0 0 12px;
  max-width: 52ch;
}

.pi-cap-cell-where {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: rgba(244, 237, 224, 0.5);
  margin: 0;
  max-width: 56ch;
}

.pi-cap-cell-where em {
  font-style: normal;
  color: rgba(244, 237, 224, 0.85);
  font-weight: 500;
}

@media (max-width: 920px) {
  .pi-cap-showcase-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Coda ---------- */
.pi-coda {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(96px, 14vw, 160px) clamp(20px, 5vw, 64px);
  text-align: center;
}

.pi-coda-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.75rem);
  line-height: 1.25;
  margin: 0 0 48px;
  max-width: 24ch;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.015em;
}

.pi-coda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.pi-coda-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 16px 28px;
  border-radius: 999px;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.pi-coda-btn-primary {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
}

.pi-coda-btn-primary:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.pi-coda-btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(247, 243, 235, 0.3);
}

.pi-coda-btn-ghost:hover {
  border-color: var(--paper);
}

/* ---------- Footer ---------- */
.pi-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px 48px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 243, 235, 0.65);
  background: rgba(10, 10, 10, 0.3);
  border-top: 1px solid rgba(247, 243, 235, 0.1);
}

.pi-footer a:hover { color: color-mix(in srgb, var(--accent) 55%, #fff); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .pi-caps-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .pi-cap:nth-child(3n) { border-right: 1px solid var(--rule); }
  .pi-cap:nth-child(2n) { border-right: none; }
}

@media (max-width: 720px) {
  .pi-project-link {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .pi-project-num { font-size: 2rem; }
  .pi-project-cta {
    align-self: start;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .pi-project-cta-arrow { font-size: 1.25rem; }
  .pi-caps-grid { grid-template-columns: 1fr; }
  .pi-cap { border-right: none !important; border-bottom: 1px solid var(--rule); }
  .pi-cap:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pi-project-link,
  .pi-project-link::before,
  .pi-project-title,
  .pi-project-cta-arrow,
  .pi-project-num,
  .pi-project-cta { transition: none !important; }
  .pi-project-live-dot { animation: none; }
}
