/* ==========================================================================
   MOTIONSITES "3D JACK PORTFOLIO" DESIGN SYSTEM
   Dark Theme (#0C0C0C), Kanit Typography, Sticky-Stacking Cards, Dual Marquee
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Fira+Code:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0C0C0C;
  --bg-surface: #141416;
  --bg-card: rgba(18, 18, 22, 0.75);
  --border-light: rgba(215, 226, 234, 0.18);
  --border-active: rgba(182, 0, 168, 0.6);

  --text-main: #FFFFFF;
  --text-silver: #D7E2EA;
  --text-muted: #8E9BAE;
  --text-dim: #546075;

  --accent-cyan: #00cec9;
  --accent-magenta: #B600A8;
  --accent-violet: #7621B0;

  --font-kanit: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-kanit);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Three.js Background Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* MotionSites Signature Hero Heading Gradient */
.hero-heading {
  background: linear-gradient(180deg, #646973 0%, #BBCCD7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-family: var(--font-kanit);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

/* Ambient Diffused Glows */
.ambient-glow-1 {
  position: fixed;
  top: 10%;
  right: 5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(118, 33, 176, 0.2) 0%, rgba(0, 206, 201, 0.05) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-2 {
  position: fixed;
  bottom: 10%;
  left: 5%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(182, 0, 168, 0.15) 0%, rgba(56, 189, 248, 0.05) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

/* Top Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #B600A8, #7621B0, #00cec9);
  z-index: 2000;
  width: 0%;
  transition: width 0.05s linear;
}

/* ==========================================================================
   1. NAVBAR (Clean MotionSites Minimal)
   ========================================================================== */
.jack-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(12, 12, 12, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .jack-navbar {
    padding: 1.25rem 1.5rem;
  }
}

.nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--text-silver);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

.nav-link-item {
  color: var(--text-silver);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 0.2s ease;
}

.nav-link-item:hover {
  opacity: 0.7;
}

/* ==========================================================================
   MOTIONSITES SIGNATURE CONTACT BUTTON (Pill with Neon Outline)
   ========================================================================== */
.btn-contact-motionsites {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 9999px;
  background: linear-gradient(123deg, #18011F 7%, #B600A8 37%, #7621B0 72%, #BE4C00 100%);
  box-shadow: 0px 4px 4px rgba(181, 1, 167, 0.25), inset 4px 4px 12px #7721B1;
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -3px;
  color: #FFFFFF !important;
  font-family: var(--font-kanit);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-contact-motionsites:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(182, 0, 168, 0.6), inset 4px 4px 14px #B600A8;
}

.btn-secondary-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 9999px;
  border: 2px solid var(--text-silver);
  color: var(--text-silver);
  font-family: var(--font-kanit);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary-ghost:hover {
  background: rgba(215, 226, 234, 0.12);
  transform: translateY(-2px);
}

/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */
.jack-hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7rem 3rem 3rem;
  position: relative;
  z-index: 10;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .jack-hero-section {
    padding: 6.5rem 1.5rem 2rem;
  }
}

.hero-title-wrapper {
  margin-top: 1rem;
}

.hero-giant-heading {
  font-size: clamp(3.5rem, 13vw, 12rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  width: 100%;
}

.hero-center-3d-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  min-height: 320px;
  position: relative;
}

.hero-bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-bottom-tagline {
  max-width: 480px;
  color: var(--text-silver);
  font-size: clamp(0.85rem, 1.3vw, 1.25rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.hero-bottom-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   3. MARQUEE SECTION (Dual Infinite Rows)
   ========================================================================== */
.jack-marquee-section {
  width: 100%;
  overflow: hidden;
  padding: 3.5rem 0;
  background: #0C0C0C;
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.marquee-row {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  will-change: transform;
}

.marquee-row.row-right {
  animation: marquee-scroll-right 32s linear infinite;
}

.marquee-row.row-left {
  animation: marquee-scroll-left 32s linear infinite;
  margin-top: 1.25rem;
}

@keyframes marquee-scroll-right {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-scroll-left {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.marquee-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(215, 226, 234, 0.15);
  color: var(--text-silver);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.marquee-tile:hover {
  background: rgba(182, 0, 168, 0.18);
  border-color: rgba(182, 0, 168, 0.5);
  color: #FFF;
  transform: translateY(-2px);
}

/* ==========================================================================
   4. ABOUT SECTION (Character-by-Character Scroll Reveal)
   ========================================================================== */
.jack-about-section {
  min-height: 100vh;
  padding: 8rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .jack-about-section {
    padding: 5rem 1.5rem;
  }
}

.section-label-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-scroll-paragraph {
  font-size: clamp(1.4rem, 3.2vw, 2.8rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-silver);
  margin-bottom: 4rem;
  max-width: 1100px;
}

.char-span {
  opacity: 0.25;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.char-span.revealed {
  opacity: 1;
  color: #FFFFFF;
}

/* ==========================================================================
   INTERACTIVE VRAM FIT CALCULATOR CARD
   ========================================================================== */
.calc-jack-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  padding: 2.25rem;
  backdrop-filter: blur(28px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  max-width: 900px;
  width: 100%;
}

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.calc-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-control-group {
  margin-bottom: 1.25rem;
}

.calc-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calc-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #08090C;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.calc-range {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.calc-metric-box {
  background: #08090C;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.calc-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 0;
}

.calc-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.calc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #a855f7);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   5. CAPABILITIES SECTION (Numbered 01 - 05 Horizontal Layout)
   ========================================================================== */
.jack-capabilities-section {
  background: #0C0C0C;
  padding: 8rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .jack-capabilities-section {
    padding: 5rem 1.5rem;
  }
}

.capability-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

@media (max-width: 768px) {
  .capability-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2.25rem 0;
  }
}

.capability-number {
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 900;
  color: rgba(215, 226, 234, 0.2);
  line-height: 1;
}

.capability-content h3 {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: #FFF;
}

.capability-content p {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
  max-width: 800px;
}

/* ==========================================================================
   6. PROJECTS SECTION (Sticky-Stacking Cards)
   ========================================================================== */
.jack-projects-section {
  padding: 8rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .jack-projects-section {
    padding: 5rem 1.5rem;
  }
}

.sticky-stack-container {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  margin-top: 3rem;
}

.sticky-project-card {
  position: sticky;
  top: 100px;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(30, 41, 59, 0.45) 0%, #111216 70%);
  border: 2px solid var(--border-light);
  border-radius: 40px;
  padding: 3rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.15s ease-out, border-color 0.25s ease, box-shadow 0.25s ease;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform-style: preserve-3d;
}

@media (max-width: 768px) {
  .sticky-project-card {
    padding: 2rem 1.5rem;
    border-radius: 28px;
    transform: none !important;
  }
}

.sticky-project-card:hover {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

/* Hero Telemetry HUD Chip */
.hero-telemetry-hud {
  position: absolute;
  top: 7rem;
  right: 3rem;
  background: rgba(14, 18, 26, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 1rem 1.35rem;
  backdrop-filter: blur(24px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), inset 0 0 18px rgba(56, 189, 248, 0.1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-silver);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 20;
  max-width: 320px;
  animation: hud-float 4s ease-in-out infinite alternate;
}

@media (max-width: 900px) {
  .hero-telemetry-hud {
    position: relative;
    top: 0;
    right: 0;
    margin-top: 1.5rem;
    max-width: 100%;
  }
}

@keyframes hud-float {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}

.hud-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hud-pill-green {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #34d399;
  font-weight: 600;
}

.hud-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.btn-sfx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-silver);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sfx-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  color: #FFF;
}

.btn-sfx-toggle.active {
  background: rgba(0, 206, 201, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.project-card-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-dim);
}

.project-category-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--accent-cyan);
}

.project-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFF;
  margin-bottom: 1rem;
}

.project-desc {
  font-size: 1.05rem;
  color: var(--text-silver);
  font-weight: 300;
  line-height: 1.65;
  max-width: 850px;
  margin-bottom: 1.5rem;
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ==========================================================================
   7. TERMINAL & CONTACT SECTION
   ========================================================================== */
.jack-contact-section {
  padding: 8rem 3rem 10rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .jack-contact-section {
    padding: 5rem 1.5rem 8rem;
  }
}

.terminal-jack-wrapper {
  background: #08090C;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 4rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 200px;
}

.contact-final-box {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 32px;
  backdrop-filter: blur(28px);
}
