/* ─── PEDRO ULRICHSEN — PROJECT PAGE ─── */

:root {
  --black:   #0E0B09;
  --brown:   #2A1208;
  --orange:  #E8501E;
  --cream:   #F5F1EB;
  --cream2:  #D6CFBF;
  --muted:   #8A7E6E;
  --sans:    'Work Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --page:    clamp(28px, 7vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── GRAIN ─── */
.grain { position: relative; }
.grain::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ─── NAV ─── */
.proj-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--page);
  background: rgba(14, 11, 9, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245,241,235,0.06);
}
.proj-nav-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(245,241,235,0.7);
  transition: color 0.2s, gap 0.2s;
}
.proj-nav-back:hover { color: var(--orange); gap: 14px; }
.proj-nav-back .arr {
  display: inline-block; width: 24px; height: 1px; background: currentColor;
  position: relative;
}
.proj-nav-back .arr::before {
  content: ''; position: absolute; left: 0; top: -3px;
  width: 7px; height: 7px;
  border-left: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.proj-nav-logo {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--cream);
}
.proj-nav-logo em { color: var(--orange); font-style: italic; }
.proj-nav-actions { display: flex; align-items: center; gap: 12px; }
.proj-nav-actions a {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 18px; border: 1px solid rgba(245,241,235,0.15);
  color: rgba(245,241,235,0.7);
  transition: all 0.2s;
}
.proj-nav-actions a:hover {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.proj-nav-actions a.primary {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.proj-nav-actions a.primary:hover { background: #d1481a; border-color: #d1481a; }

/* ─── HERO STRIP ─── */
.proj-hero {
  padding: 120px var(--page) 56px;
  position: relative;
  border-bottom: 1px solid rgba(245,241,235,0.07);
}
.proj-hero-eyebrow {
  display: inline-flex; align-items: baseline; gap: 14px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(245,241,235,0.45);
  margin-bottom: 28px;
}
.proj-hero-eyebrow .num {
  font-style: italic; color: var(--orange); font-size: 13px;
}
.proj-hero-eyebrow .dot {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(245,241,235,0.2);
}
.proj-hero h1 {
  font-family: var(--sans);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--cream);
}
.proj-hero h1 em {
  font-style: italic; color: var(--orange); font-weight: 300;
}
.proj-hero-desc {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--cream2); line-height: 1.7;
  max-width: 640px; margin-bottom: 28px;
}
.proj-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 24px; row-gap: 12px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(245,241,235,0.45);
}
.proj-hero-meta .tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(245,241,235,0.15);
  border-radius: 999px;
  color: rgba(245,241,235,0.6);
}
.proj-hero-meta .tag.accent {
  border-color: rgba(232,80,30,0.4);
  color: var(--orange);
  background: rgba(232,80,30,0.05);
}

/* ─── IMAGE GALLERY ─── */
.gallery {
  background: #1a1612;
  padding: 0 0 56px;
}
.gallery-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--page);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(245,241,235,0.4);
  border-bottom: 1px solid rgba(245,241,235,0.07);
  background: rgba(0,0,0,0.4);
}
.gallery-toolbar .gt-left {
  display: flex; align-items: center; gap: 14px;
}
.gallery-toolbar .gt-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
  animation: blink 2.5s ease-in-out infinite;
}
.gallery-toolbar .gt-actions { display: flex; gap: 18px; align-items: center; }
.gallery-toolbar .gt-counter {
  font-feature-settings: "tnum";
  color: rgba(245,241,235,0.7);
}
.gallery-toolbar .gt-counter .gt-cur { color: var(--orange); font-weight: 500; }
.gallery-toolbar .gt-actions button {
  background: none; border: none; cursor: pointer;
  font: inherit; color: rgba(245,241,235,0.5);
  letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px;
  padding: 6px 10px; transition: color 0.2s;
}
.gallery-toolbar .gt-actions button:hover { color: var(--orange); }

.gallery-stage {
  position: relative;
  padding: 32px var(--page) 0;
  margin: 0 auto;
}
.gallery-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 200px);
  background: #0a0807;
  border: 1px solid rgba(245,241,235,0.08);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  cursor: zoom-in;
}
.gallery-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  background: #0a0807;
}
.gallery-slide.active { opacity: 1; pointer-events: auto; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  background: rgba(14,11,9,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245,241,235,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  font-size: 22px; line-height: 1;
  transition: all 0.25s ease;
  z-index: 3;
}
.gallery-nav:hover {
  background: var(--orange); border-color: var(--orange);
  color: #fff;
}
.gallery-nav.prev { left: calc(var(--page) + 20px); }
.gallery-nav.next { right: calc(var(--page) + 20px); }
.gallery-nav:disabled { opacity: 0.25; cursor: not-allowed; }
.gallery-nav:disabled:hover {
  background: rgba(14,11,9,0.72); border-color: rgba(245,241,235,0.12); color: var(--cream);
}

.gallery-thumbs {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 24px var(--page) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(245,241,235,0.15) transparent;
}
.gallery-thumbs::-webkit-scrollbar { height: 6px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(245,241,235,0.15); border-radius: 3px; }
.gallery-thumb {
  flex: 0 0 auto;
  width: 96px; aspect-ratio: 16 / 9;
  background: #0a0807;
  border: 1px solid rgba(245,241,235,0.08);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  position: relative;
  opacity: 0.5;
  transition: all 0.2s ease;
}
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.96);
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  backdrop-filter: blur(20px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  background: rgba(245,241,235,0.08);
  border: 1px solid rgba(245,241,235,0.15);
  border-radius: 50%;
  color: var(--cream); cursor: pointer;
  font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}
.lightbox-nav:hover {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.lightbox-nav.prev { left: 32px; }
.lightbox-nav.next { right: 32px; }
@media (max-width: 720px) {
  .lightbox-nav { width: 44px; height: 44px; font-size: 20px; }
  .lightbox-nav.prev { left: 12px; }
  .lightbox-nav.next { right: 12px; }
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(245,241,235,0.08);
  border: 1px solid rgba(245,241,235,0.15);
  border-radius: 50%;
  color: var(--cream); cursor: pointer;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: var(--orange); border-color: var(--orange); }
.lightbox-counter {
  position: absolute; top: 32px; left: 32px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(245,241,235,0.5);
  font-feature-settings: "tnum";
}
.lightbox-counter b { color: var(--orange); font-weight: 500; }

@media (max-width: 720px) {
  .gallery-stage { padding: 20px 12px 0; }
  .gallery-nav { width: 44px; height: 44px; font-size: 18px; }
  .gallery-nav.prev { left: 18px; }
  .gallery-nav.next { right: 18px; }
  .gallery-thumbs { padding: 16px 12px 0; }
  .gallery-thumb { width: 72px; }
  .gallery-toolbar { padding: 14px 20px; font-size: 10px; flex-direction: column; gap: 10px; align-items: flex-start; }
  .lightbox { padding: 20px; }
}

/* ─── PDF VIEWER (legacy — kept for dot/sandbox) ─── */
.pdf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--page);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(245,241,235,0.4);
  border-bottom: 1px solid rgba(245,241,235,0.07);
  background: rgba(0,0,0,0.4);
}
.pdf-toolbar .toolbar-left {
  display: flex; align-items: center; gap: 14px;
}
.pdf-toolbar .toolbar-left .dot-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
  animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.pdf-toolbar .toolbar-actions { display: flex; gap: 10px; }
.pdf-toolbar .toolbar-actions a {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(245,241,235,0.5);
  padding: 6px 10px;
  transition: color 0.2s;
}
.pdf-toolbar .toolbar-actions a:hover { color: var(--orange); }

.pdf-viewer-wrap {
  background: #1a1612;
  padding: 32px var(--page) 56px;
  min-height: 70vh;
}
.pdf-viewer-frame {
  width: 100%;
  height: calc(100vh - 80px);
  min-height: 600px;
  max-height: 1200px;
  border: 1px solid rgba(245,241,235,0.08);
  background: #2a2520;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  display: block;
}
.pdf-fallback {
  display: none;
  padding: 64px 40px;
  text-align: center;
  background: rgba(245,241,235,0.03);
  border: 1px dashed rgba(245,241,235,0.15);
}
.pdf-fallback p {
  color: var(--cream2); font-size: 16px; margin-bottom: 24px;
}
.pdf-fallback a {
  display: inline-block;
  padding: 14px 28px; background: var(--orange); color: #fff;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500;
}

/* ─── FOOTER NAV (other projects) ─── */
.proj-footer {
  padding: 80px var(--page) 60px;
  border-top: 1px solid rgba(245,241,235,0.07);
  background: var(--black);
}
.proj-footer-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(245,241,235,0.4);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 14px;
}
.proj-footer-label::before,
.proj-footer-label::after {
  content: ''; flex: 1; height: 1px; background: rgba(245,241,235,0.08);
}
.proj-footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: rgba(245,241,235,0.08);
}
.proj-footer-card {
  padding: 28px 32px;
  background: rgba(245,241,235,0.02);
  display: flex; flex-direction: column; gap: 6px;
  transition: background 0.25s;
}
.proj-footer-card:hover { background: rgba(245,241,235,0.06); }
.proj-footer-card:hover .pfc-arr { color: var(--orange); transform: translate(3px,-3px); }
.proj-footer-card .pfc-eyebrow {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(245,241,235,0.35);
}
.proj-footer-card .pfc-name {
  font-size: 22px; color: var(--cream); font-weight: 400; line-height: 1.2;
}
.proj-footer-card .pfc-desc {
  font-size: 13px; color: rgba(245,241,235,0.45); margin-top: 4px;
}
.proj-footer-card .pfc-arr {
  align-self: flex-end; margin-top: 12px;
  font-size: 18px; color: rgba(245,241,235,0.25);
  transition: all 0.25s;
}
.proj-footer-back {
  margin-top: 56px; padding-top: 32px;
  border-top: 1px solid rgba(245,241,235,0.06);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: 0.08em;
  color: rgba(245,241,235,0.4);
}
.proj-footer-back a {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--orange);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.proj-footer-back a:hover { gap: 14px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
  .proj-nav { padding: 14px 20px; }
  .proj-nav-logo { font-size: 12px; }
  .proj-nav-actions a { padding: 8px 12px; font-size: 10px; }
  .proj-nav-actions a:not(.primary) { display: none; }
  .proj-hero { padding: 100px 24px 40px; }
  .pdf-toolbar { padding: 14px 24px; font-size: 10px; flex-direction: column; gap: 12px; align-items: flex-start; }
  .pdf-viewer-wrap { padding: 20px 12px 40px; }
  .pdf-viewer-frame { height: calc(100vh - 60px); min-height: 480px; }
  .proj-footer { padding: 60px 24px 40px; }
  .proj-footer-grid { grid-template-columns: 1fr; }
}
