/* ==========================================================================
   PETER HEPHZIBAH — MINIMALISTIC PORTFOLIO
   Titles Font: Plus Jakarta Sans (character spacing: -2px)
   Body Font: Space Grotesk
   Palette: Very Dark Red to Black Gradient, Pale Red (#FFBFBF) Titles & Light Buttons,
            Dark Red Buttons, Red Rim Lighting on Hover
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400..800;1,400..800&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #020001;
  --bg-dark-red: #1a0407;
  --bg-card: rgba(15, 3, 6, 0.75);
  --color-pale-red: #FFBFBF;
  --color-dark-red: #2d060c;
  --color-dark-red-hover: #4b0a14;
  --text-primary: #FFFFFF;
  --text-secondary: #c49a9a;
  --text-muted: #734848;
  --border-subtle: rgba(255, 90, 115, 0.14);
  --border-hover: rgba(255, 191, 191, 0.45);

  --glass-panel: rgba(18, 3, 6, 0.82);
  --glass-pill: rgba(45, 6, 12, 0.75);
  --glass-pill-hover: rgba(75, 10, 20, 0.9);
  --glass-border: rgba(255, 90, 115, 0.25);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-primary);
  background-image: radial-gradient(ellipse 90% 70% at 50% -10%, #1c0408 0%, #0c0103 45%, #020001 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  color: var(--text-primary);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  background-color: transparent !important;
  background-image: radial-gradient(ellipse 90% 70% at 50% -10%, #1c0408 0%, #0c0103 45%, #020001 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  color: var(--text-primary);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.5px;
  line-height: 1.5;
}

::selection {
  background: #FFBFBF;
  color: #160205;
}

/* ==========================================================================
   TYPOGRAPHY - PLUS JAKARTA SANS ON ALL TITLES, CHARACTER SPACING -2PX
   Default accent titles: Pale Red (#FFBFBF)
   Primary featured titles (Header, Selected Works, 7 Years): Pure White (#FFFFFF)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -2px !important;
  font-weight: 700;
  line-height: 1.18;
  color: #FFBFBF;
}

.text-white,
.heading-white {
  color: #FFFFFF !important;
}

.title-pale-red,
.text-pale-red {
  color: #FFBFBF !important;
}

.tracking-neg-1,
.tracking-neg-2 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -2px !important;
}

.tracking-neg-1px {
  letter-spacing: -1px !important;
}

/* ==========================================================================
   TEXT PULL-UP ANIMATION SYSTEM
   ========================================================================== */
.pull-up-mask {
  display: block;
  overflow: hidden;
  line-height: 1.2;
  padding-bottom: 0.75rem;
}

.pull-up-inline {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: 1.15;
  padding-bottom: 0.06em;
}

.pull-up-text {
  display: inline-block;
  transform: translateY(115%);
  opacity: 0;
  transform-origin: bottom center;
  transition: transform 1s var(--ease-out), opacity 0.8s var(--ease-out);
  will-change: transform, opacity;
}

.is-revealed .pull-up-text,
.pull-up-active .pull-up-text {
  transform: translateY(0%);
  opacity: 1;
}

/* Stagger utilities */
.delay-100 { transition-delay: 100ms !important; }
.delay-150 { transition-delay: 150ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-250 { transition-delay: 250ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }

/* ==========================================================================
   SCROLL PULL-UP REVEAL ANIMATION SYSTEM
   Smooth upward reveal for elements entering viewport during scroll
   ========================================================================== */
.scroll-pull-up,
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-pull-up.is-revealed,
.scroll-reveal.is-revealed,
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger / Cascade delays for grid elements */
.reveal-delay-1 { transition-delay: 80ms !important; }
.reveal-delay-2 { transition-delay: 160ms !important; }
.reveal-delay-3 { transition-delay: 240ms !important; }
.reveal-delay-4 { transition-delay: 320ms !important; }
.reveal-delay-5 { transition-delay: 400ms !important; }

@media (prefers-reduced-motion: reduce) {
  .pull-up-text,
  .scroll-pull-up,
  .scroll-reveal {
    transition: opacity 0.2s ease !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ==========================================================================
   GLASS ELEMENTS (RESTRICTED TO TOP PANEL & SELECT BUTTONS)
   Light buttons: Pale Red (#FFBFBF)
   Dark buttons: Dark Red (rgba(45, 6, 12, 0.75))
   ========================================================================== */
.glass-top-panel {
  background: var(--glass-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
}

/* Dark Red Buttons */
.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: rgba(45, 6, 12, 0.75) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 90, 115, 0.28) !important;
  border-radius: 9999px;
  color: #FFBFBF !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: -0.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.glass-btn:hover {
  background: rgba(80, 12, 22, 0.92) !important;
  border-color: rgba(255, 191, 191, 0.55) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 0 22px -2px rgba(220, 25, 50, 0.45);
}

.glass-btn:active {
  transform: translateY(0);
}

/* Light Buttons: Pale Red (#FFBFBF) */
.glass-btn-solid,
#form-submit-btn {
  background: #FFBFBF !important;
  color: #140205 !important;
  border: 1px solid #FFBFBF !important;
  font-weight: 600;
  box-shadow: 0 0 22px -3px rgba(255, 191, 191, 0.4);
}

.glass-btn-solid:hover,
#form-submit-btn:hover {
  background: #FFFFFF !important;
  color: #140205 !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 28px 0px rgba(255, 191, 191, 0.65);
  transform: translateY(-1px);
}

/* ==========================================================================
   FRACTAL GLASS HEADER BACKDROP WITH RED GLOW
   Fluted vertical prism glass ribs refracting a deep crimson red aura
   ========================================================================== */
.hero-fractal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 92vh;
  min-height: 660px;
  max-height: 940px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, #000000 0%, rgba(0, 0, 0, 0.96) 62%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000000 0%, rgba(0, 0, 0, 0.96) 62%, rgba(0, 0, 0, 0) 100%);
}

.hero-red-glow {
  position: absolute;
  inset: -12% -10% 0 -10%;
  background:
    radial-gradient(ellipse 46% 50% at 50% 42%, rgba(225, 22, 54, 0.48) 0%, rgba(165, 12, 34, 0.26) 42%, transparent 76%),
    radial-gradient(ellipse 72% 58% at 50% 34%, rgba(255, 95, 120, 0.16) 0%, rgba(115, 6, 22, 0.18) 52%, transparent 82%);
  filter: blur(30px);
  transform: translateZ(0);
}

.hero-fractal-flutes {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 191, 191, 0.095) 1px,
      rgba(255, 85, 110, 0.035) 5px,
      rgba(4, 0, 2, 0.56) 15px,
      rgba(0, 0, 0, 0.74) 23px,
      rgba(255, 191, 191, 0.05) 27px,
      rgba(255, 255, 255, 0.015) 29px
    );
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  opacity: 0.115;
  mask-image: radial-gradient(ellipse 88% 82% at 50% 42%, #000000 28%, rgba(0, 0, 0, 0.65) 64%, transparent 98%);
  -webkit-mask-image: radial-gradient(ellipse 88% 82% at 50% 42%, #000000 28%, rgba(0, 0, 0, 0.65) 64%, transparent 98%);
}

.hero-fractal-prism {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      118deg,
      transparent 0px,
      transparent 44px,
      rgba(255, 191, 191, 0.04) 45px,
      rgba(255, 75, 100, 0.03) 53px,
      rgba(0, 0, 0, 0.28) 72px,
      transparent 92px
    ),
    repeating-linear-gradient(
      62deg,
      transparent 0px,
      transparent 62px,
      rgba(255, 255, 255, 0.025) 63px,
      rgba(220, 30, 60, 0.035) 75px,
      transparent 108px
    ),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='fractalNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23fractalNoise)' opacity='0.045'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.1;
  mask-image: radial-gradient(ellipse 78% 76% at 50% 42%, #000000 22%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 78% 76% at 50% 42%, #000000 22%, transparent 95%);
}

/* ==========================================================================
   SECTION HOVER RIM LIGHTING (RED — +50% GLOW INTENSITY)
   Atmospheric red perimeter rim glow on section and card hover
   ========================================================================== */
section {
  position: relative;
  z-index: 2;
  border-radius: 1.5rem;
  transition: border-color 0.45s ease, box-shadow 0.45s ease;
}

section:hover {
  border-color: rgba(255, 100, 125, 0.68) !important;
  box-shadow: 
    0 -10px 68px -6px rgba(220, 25, 50, 0.38),
    0 0 75px -10px rgba(200, 20, 45, 0.30),
    inset 0 0 0 1px rgba(255, 90, 115, 0.25),
    inset 0 1px 2px 0 rgba(255, 191, 191, 0.53),
    inset 0 0 36px -10px rgba(220, 25, 50, 0.22);
}

/* Dud Tag */
.dud-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 191, 191, 0.12);
  border: 1px solid rgba(255, 191, 191, 0.25);
  color: #FFBFBF;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Minimal Project Cards with Red Rim Lighting */
.minimal-card {
  background: rgba(14, 3, 6, 0.7);
  border: 1px solid rgba(255, 80, 100, 0.12);
  border-radius: 1rem;
  transition: all 0.35s ease;
  overflow: hidden;
}

.minimal-card:hover {
  border-color: rgba(255, 191, 191, 0.45);
  transform: translateY(-2px);
  background: rgba(25, 5, 10, 0.85);
  box-shadow: 
    0 0 35px -8px rgba(220, 25, 50, 0.35),
    inset 0 1px 1px 0 rgba(255, 191, 191, 0.3);
}

/* Custom Minimalist Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: #FFBFBF;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out;
  box-shadow: 0 0 10px rgba(255, 191, 191, 0.85);
}

/* Toast for Dud Clicks */
#dud-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: all 0.35s var(--ease-out);
}

#dud-toast.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Modal */
#project-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#project-modal.modal-active {
  opacity: 1;
  pointer-events: auto;
}

#project-modal .modal-box {
  transform: translateY(20px);
  transition: transform 0.3s var(--ease-out);
}

#project-modal.modal-active .modal-box {
  transform: translateY(0);
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: #000000;
}

::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

/* ==========================================================================
   4-PART LAYERED SCROLL SHOWCASE (12 ASSETS, 3 SLIDE-UP LAYERS PER SLOT)
   ========================================================================== */
.scroll-layer-slot {
  position: relative;
  border: 1px solid rgba(255, 80, 100, 0.16);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.scroll-layer-slot:hover {
  border-color: rgba(255, 191, 191, 0.5);
  box-shadow:
    0 0 32px -6px rgba(220, 25, 50, 0.38),
    inset 0 1px 1px 0 rgba(255, 191, 191, 0.35);
}

.scroll-layer-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.scroll-layer-img.is-base {
  z-index: 1;
  transform: translate3d(0, 0, 0);
}

.scroll-layer-slide[data-layer="2"] {
  z-index: 2;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65);
}

.scroll-layer-slide[data-layer="3"] {
  z-index: 3;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65);
}

.scroll-layer-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  font-family: 'Space Grotesk', monospace;
  font-size: 10px;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(14, 2, 5, 0.8);
  border: 1px solid rgba(255, 191, 191, 0.28);
  color: #FFBFBF;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-layer-slide[data-layer="2"],
  .scroll-layer-slide[data-layer="3"] {
    transform: translate3d(0, 0, 0) !important;
    transition: none !important;
  }
}
