/**
 * Typewriter Effect Styles
 * Responsive and customizable
 */

/* Custom Font Loading */

 @font-face {
  font-family: 'Veteran';
  src: url('/fonts/veteran-typewriter.regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Improves loading performance */
}
/* Apply custom font to specific elements */
.veteran-typewriter {
  font-family: 'Veteran', "Source Code Pro", "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Courier New", monospace;
}

/* Ensure veteran font is applied to typewriter elements */
[data-typewriter].veteran-typewriter {
  font-family: 'Veteran', "Source Code Pro", "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Courier New", monospace !important;
}
 /* Blinking cursor animation */
.typewriter-cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  font-weight: normal;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Optional: Prevent layout shift during typing */
[data-typewriter] {
  min-height: 1em;
  display: block;
  margin: 60px auto 0 auto; /* Increased top margin for more gap */
  max-width: 800px; /* Adjust this width as needed */
  padding: 0 20px;
}

/* Keep text content left-aligned */
[data-typewriter] p,
[data-typewriter] ul,
[data-typewriter] li,
[data-typewriter] h1,
[data-typewriter] h2,
[data-typewriter] h3,
[data-typewriter] h4,
[data-typewriter] h5,
[data-typewriter] h6 {
  text-align: left;
}

/* Ensure strong tags are visible during typing */
[data-typewriter] strong,
[data-typewriter] b {
  font-weight: bold !important;
  color: inherit;
}

/* Responsive font sizing examples */
[data-typewriter].hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: bold;
  line-height: 1.2;
}

[data-typewriter].subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  line-height: 1.5;
}

[data-typewriter].small-text {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Optional: Smooth appearance for containers */
.typewriter-container {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* Optional: Prevent layout shift during typing */
[data-typewriter] {
  min-height: 1em;
  display: block;
  margin: 60px auto 0 auto; /* Increased top margin for more gap */
  max-width: 800px; /* Adjust this width as needed */
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile optimization */
@media (max-width: 768px) {
  [data-typewriter] {
    margin: 40px auto 0 auto; /* Reduced top margin on mobile */
    padding: 0 15px; /* Reduced padding on mobile */
    max-width: 100%; /* Full width on mobile */
  }
  
  .typewriter-links-container {
    margin: 15px auto 0 auto; /* Reduced top margin on mobile */
    padding: 0 15px; /* Reduced padding on mobile */
    max-width: 100%; /* Full width on mobile */
    gap: 20px; /* Reduced gap on mobile */
    flex-direction: column; /* Stack vertically on mobile */
    align-items: center;
  }
  
  .typewriter-link-container {
    margin: 15px auto 0 auto; /* Reduced top margin on mobile */
    padding: 0 15px; /* Reduced padding on mobile */
    max-width: 100%; /* Full width on mobile */
  }
  
  .typewriter-cursor {
    margin-left: 1px;
  }
  
  /* Ensure veteran font is applied on mobile */
  [data-typewriter] {
    font-family: 'Veteran', "Source Code Pro", "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Courier New", monospace !important;
  }
  
  /* Better mobile text sizing */
  [data-typewriter] p {
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    hyphens: auto;
  }
  
  [data-typewriter] ul {
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
  }
  
  [data-typewriter] li {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 8px;
  }
  
  /* Ensure proper centering on mobile */
  [data-typewriter] {
    text-align: center;
  }
  
  [data-typewriter] p,
  [data-typewriter] ul {
    text-align: left;
    display: inline-block;
    width: 100%;
  }
}

/* Prevent text selection during animation */
[data-typewriter]:not(.typing-complete) {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Typewriter links container - matches veteran-typewriter layout */
.typewriter-links-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px auto 0 auto; /* Same auto left/right margins as veteran-typewriter */
  max-width: 800px; /* Same width as veteran-typewriter */
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

/* Typewriter link container - matches veteran-typewriter layout */
.typewriter-link-container {
  display: block;
  margin: 20px auto 0 auto; /* Same auto left/right margins as veteran-typewriter */
  max-width: 800px; /* Same width as veteran-typewriter */
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Typewriter link styles */
.typewriter-link {
  display: block;
  margin-top: 20px;
  text-align: center;
  color: #6c757d; /* More subtle gray color */
  text-decoration: none;
  font-weight: normal; /* Less bold */
  font-size: 1em; /* Smaller font size */
  font-family: 'veteran', 'Courier New', 'Monaco', 'Consolas', monospace;
  transition: all 0.3s ease;
  opacity: 0.8; /* Slightly transparent */
}

.typewriter-link:hover {
  color: #495057; /* Darker gray on hover */
  text-decoration: underline;
  opacity: 1; /* Full opacity on hover */
  transform: translateY(-1px); /* Less movement */
}

/* Animated arrow */
.typewriter-link .arrow {
  display: inline-block;
  margin-left: 8px;
  animation: arrowMove 1.5s ease-in-out infinite;
}

@keyframes arrowMove {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}
