/* -------------------------------------------------------------
 * Site Mateus - Developer Personal Links Page Stylesheet
 * Architecture: Vanilla CSS3, highly responsive, performance-optimized
 * ------------------------------------------------------------- */

/* Custom Design Variables */
:root {
  --bg-color: #0d1117;       /* Deep github dark background */
  --card-bg: #161b22;        /* Dark gray-blue card theme */
  --border-color: #30363d;   /* Slate blue-gray border styling */
  --electric-blue: #4f8ef7;  /* High energy electric blue accent */
  --neon-green: #39d353;     /* GitHub contribution graph neon green */
  --text-primary: #f0f6fc;   /* Clean light gray for readable text */
  --text-muted: #8b949e;      /* Muted code-comment color */
}

/* Base Reset & Optimization */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 2.5rem 1.25rem;
}

/* Subtle Animated Dot Matrix / Grid Background */
.dot-matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: repeating-radial-gradient(
    circle, 
    rgba(79, 142, 247, 0.07) 0px, 
    rgba(79, 142, 247, 0.07) 1.5px, 
    transparent 1.5px, 
    transparent 28px
  );
  background-size: 28px 28px;
  animation: matrix-drift 80s linear infinite;
  pointer-events: none;
}

@keyframes matrix-drift {
  0% {
    background-position: 0px 0px;
  }
  100% {
    background-position: 28px 56px;
  }
}

/* Center Layout Container */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 10;
}

#main-view, 
#services-view {
  width: 100%;
  max-width: 480px;
}

#cv-view {
  width: 100%;
  max-width: 600px;
}

/* Profile Header Section */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

/* Gradient Frame Avatar Container */
.avatar-container {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--neon-green) 100%);
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.25);
  margin-bottom: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-container:hover {
  transform: rotate(3deg) scale(1.05);
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top; /* Shifts image down slightly to show head fully without clipping */
  background-color: var(--card-bg);
  border: 2px solid var(--bg-color);
}

/* Monospace Profile Name */
.profile-name {
  font-family: 'Fira Code', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

/* Typewriter Container */
.typewriter-container {
  font-family: 'Fira Code', monospace;
  font-size: 0.92rem;
  color: var(--text-muted);
  min-height: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

.typewriter-bio {
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.typewriter-container .prefix {
  color: var(--neon-green);
  font-weight: 700;
  margin-right: 0.35rem;
  user-select: none;
}

.typewriter-text {
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Blinking Command Line Cursor */
.cursor {
  color: var(--electric-blue);
  font-weight: 700;
  margin-left: 0.15rem;
  animation: cursor-blink 1.1s step-end infinite;
  user-select: none;
}

@keyframes cursor-blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

/* Main Content Area containing Link Navigation */
.main-content {
  width: 100%;
  margin-bottom: 1rem;
}

.links-nav {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  margin-top: 1.75rem;
}

/* Terminal block command card style */
.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.92rem;
  transition: transform 200ms ease, 
              border-color 200ms ease, 
              box-shadow 200ms ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: none;
}

/* Custom interactive Hover & Keyboard states */
.link-card:hover, 
.link-card:focus-visible {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--electric-blue);
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.18);
}

.link-card:active {
  transform: translateY(0px) scale(1.0);
}

/* Focus Indicator Ring for Accessibility */
.link-card:focus-visible {
  outline: 2px solid var(--electric-blue);
  outline-offset: 4px;
}

/* Left terminal prefix style ($) */
.card-prefix {
  color: var(--neon-green);
  margin-right: 0.75rem;
  font-weight: 700;
  user-select: none;
  font-size: 1rem;
}

.card-label {
  flex-grow: 1;
  text-align: left;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 200ms ease;
}

/* Link Card Text glow effect on hover */
.link-card:hover .card-label, 
.link-card:focus-visible .card-label {
  color: var(--electric-blue);
}

/* Right-hand arrow symbol */
.card-arrow {
  color: var(--text-muted);
  transition: transform 200ms ease, color 200ms ease;
  font-weight: 700;
  font-size: 1rem;
}

.link-card:hover .card-arrow, 
.link-card:focus-visible .card-arrow {
  transform: translateX(4px);
  color: var(--electric-blue);
}

/* Footer Section */
.profile-footer {
  margin-top: 3rem;
  width: 100%;
}

.footer-text {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  user-select: none;
  letter-spacing: -0.01em;
}

/* Blinking dot next to footer comment */
.blinking-dot {
  color: var(--neon-green);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  animation: dot-blink 1.2s step-end infinite;
}

@keyframes dot-blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

/* -------------------------------------------------------------
 * Dynamic View Transition Framework (Single Page View Switching)
 * ------------------------------------------------------------- */
.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1), 
              transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.view.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
}

.view.fade-out {
  opacity: 0;
  transform: translateY(20px);
}

.view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Services View: Header Navigation */
.back-nav {
  width: 100%;
  text-align: left;
  margin-bottom: 1.5rem;
}

.back-btn {
  background: none;
  border: none;
  color: var(--neon-green);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  transition: color 200ms ease, transform 200ms ease;
  outline: none;
}

.back-btn:hover, 
.back-btn:focus-visible {
  color: var(--electric-blue);
  transform: translateX(-4px);
}

.back-btn:focus-visible {
  outline: 2px solid var(--electric-blue);
  outline-offset: 4px;
  border-radius: 4px;
}

.back-arrow {
  margin-right: 0.5rem;
}

/* Services View: Header & Intro */
.services-title {
  font-family: 'Fira Code', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.services-intro {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
  width: 100%;
  margin-bottom: 2.25rem;
}

/* Services View: Cards Grid */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-bottom: 2.5rem;
}

.service-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: left;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 200ms ease, 
              box-shadow 200ms ease;
}

.service-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--electric-blue);
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.12);
}

.service-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.service-icon {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-green);
  user-select: none;
}

.service-name {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.service-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Services View: CTA Section */
.services-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.cta-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cta-btn {
  width: 100%;
}

/* Curriculum Vitae View: JSON Code Block */
.json-block {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: left;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  width: 100%;
  margin-bottom: 2.5rem;
  overflow-x: auto;
  white-space: pre; /* Keep code lines formatted exactly without breaks */
}

.json-bracket {
  color: var(--text-primary);
}

.json-key {
  color: var(--electric-blue);
}

.json-string {
  color: var(--neon-green);
}

/* Curriculum Vitae View: Vertical Timeline */
.timeline-container {
  position: relative;
  border-left: 1px solid var(--border-color);
  margin-left: 0.75rem;
  padding-left: 1.5rem;
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -1.95rem; /* Aligns exactly centered on the border line */
  top: 0.15rem;
  font-size: 1rem;
  color: var(--neon-green);
  background-color: var(--bg-color);
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.timeline-company {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-role {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--electric-blue);
}

.timeline-period {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.cv-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------
 * Responsive Mobile Styling Refinements (max-width: 480px)
 * ------------------------------------------------------------- */
@media (max-width: 480px) {
  .json-block {
    font-size: 0.72rem; /* Perfectly sized to fit Fira Code lines fully on mobile screens */
    padding: 1rem 0.85rem;
  }
}

/* -------------------------------------------------------------
 * Accessibility Guidelines: prefers-reduced-motion Preference
 * ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  
  .dot-matrix-bg {
    animation: none !important;
  }
  
  .avatar-container {
    animation: none !important;
    transform: none !important;
  }
  
  .avatar-container:hover {
    transform: none !important;
  }
  
  .link-card:hover, 
  .link-card:focus-visible {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .view {
    transition: none !important;
    transform: none !important;
  }
  
  .service-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .back-btn:hover {
    transform: none !important;
  }
  
  .cursor {
    animation: none !important;
    opacity: 1 !important;
  }
  
  .blinking-dot {
    animation: none !important;
    opacity: 1 !important;
  }
}
