/**
 * Terminal Landing Page - Base Styles
 * Core CSS using custom properties for theming
 */

/* =====================================================
   CSS RESET & BASE
   ===================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-color: var(--terminal-background);
  color: var(--terminal-text);
  font-family: 'IBM Plex Mono', 'Fira Code', 'Source Code Pro', 'Consolas', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--terminal-scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--terminal-scrollbar);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--terminal-primary-bright);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--terminal-scrollbar) var(--terminal-scrollbar-track);
}

/* =====================================================
   SELECTION
   ===================================================== */

::selection {
  background: var(--terminal-selection);
  color: var(--terminal-text);
}

::-moz-selection {
  background: var(--terminal-selection);
  color: var(--terminal-text);
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--terminal-primary-bright);
  text-shadow: 0 0 10px var(--terminal-glow);
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--terminal-accent);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--terminal-hover);
  text-shadow: 0 0 8px var(--terminal-glow);
}

a:focus {
  outline: 1px dashed var(--terminal-focus);
  outline-offset: 2px;
}

strong, b {
  color: var(--terminal-primary-bright);
  font-weight: 600;
}

em, i {
  font-style: italic;
  color: var(--terminal-text-dim);
}

code {
  font-family: inherit;
  background: var(--terminal-background-lighter);
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--terminal-border-dim);
}

pre {
  background: var(--terminal-background-light);
  border: 1px solid var(--terminal-border-dim);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
}

/* =====================================================
   TERMINAL CONTAINER
   ===================================================== */

.terminal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

@media (max-width: 768px) {
  .terminal-container {
    padding: 1rem;
  }
}

/* =====================================================
   TERMINAL WINDOW
   ===================================================== */

.terminal-window {
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border);
  border-radius: 4px;
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.5),
    0 0 60px var(--terminal-glow),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Window chrome/title bar */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--terminal-background-lighter);
  border-bottom: 1px solid var(--terminal-border-dim);
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--terminal-text-muted);
  transition: background 0.2s ease;
}

.terminal-button--close { background: #ff5f56; }
.terminal-button--minimize { background: #ffbd2e; }
.terminal-button--maximize { background: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--terminal-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.terminal-menu {
  display: flex;
  gap: 1rem;
}

.terminal-menu-item {
  font-size: 0.75rem;
  color: var(--terminal-text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.terminal-menu-item:hover {
  color: var(--terminal-text);
}

/* =====================================================
   TERMINAL BODY
   ===================================================== */

.terminal-body {
  padding: 1.5rem;
  min-height: 60vh;
  position: relative;
}

/* =====================================================
   COMMAND LINE
   ===================================================== */

.terminal-line {
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.terminal-prompt {
  color: var(--terminal-accent);
  margin-right: 0.5rem;
  user-select: none;
  white-space: nowrap;
}

.terminal-prompt::before {
  content: '❯ ';
  color: var(--terminal-primary);
}

.terminal-command {
  color: var(--terminal-primary-bright);
  flex: 1;
}

.terminal-output {
  width: 100%;
  margin-top: 0.25rem;
  padding-left: 1rem;
  color: var(--terminal-text);
}

/* =====================================================
   ASCII HEADER
   ===================================================== */

.ascii-header {
  font-family: inherit;
  font-size: 0.625rem;
  line-height: 1.1;
  color: var(--terminal-primary);
  margin-bottom: 1.5rem;
  white-space: pre;
  text-shadow: 0 0 10px var(--terminal-glow);
  overflow-x: auto;
}

@media (max-width: 600px) {
  .ascii-header {
    font-size: 0.5rem;
  }
}

.ascii-subtitle {
  font-size: 0.9375rem;
  color: var(--terminal-accent);
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 500;
}

.ascii-affiliation {
  font-size: 0.8125rem;
  color: var(--terminal-text-dim);
  margin-top: 0.25rem;
  text-align: center;
}

/* =====================================================
   BOOT SEQUENCE
   ===================================================== */

.boot-sequence {
  margin-bottom: 2rem;
}

.boot-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--terminal-text-dim);
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.boot-line--success .boot-status {
  color: var(--terminal-success);
}

.boot-line--warning .boot-status {
  color: var(--terminal-warning);
}

.boot-line--error .boot-status {
  color: var(--terminal-error);
}

.boot-status {
  min-width: 4rem;
  text-align: right;
}

.boot-message {
  flex: 1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* =====================================================
   SECTIONS
   ===================================================== */

.terminal-section {
  margin-bottom: 1rem;
  border: 1px solid var(--terminal-border-dim);
  background: var(--terminal-background-light);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.terminal-section:hover {
  border-color: var(--terminal-border);
}

.terminal-section.expanded {
  border-color: var(--terminal-primary);
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
}

/* Section header (clickable) */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.section-header:hover {
  background: var(--terminal-background-lighter);
}

.section-header:focus {
  outline: none;
  background: var(--terminal-background-lighter);
}

.section-header:focus-visible {
  outline: 1px dashed var(--terminal-focus);
  outline-offset: -2px;
}

.section-icon {
  color: var(--terminal-accent);
  font-size: 1rem;
}

.section-title {
  flex: 1;
  color: var(--terminal-primary);
  font-weight: 500;
}

.section-number {
  color: var(--terminal-accent);
  margin-right: 0.75rem;
  font-weight: 600;
  min-width: 1.5rem;
}

.section-command {
  flex: 1;
  color: var(--terminal-primary);
}

.section-toggle {
  color: var(--terminal-text-muted);
  transition: transform 0.3s ease, color 0.2s ease;
  font-size: 0.875rem;
}

.terminal-section.expanded .section-toggle {
  transform: rotate(90deg);
  color: var(--terminal-primary);
}

/* Section body (collapsible content) */
.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.3s ease;
  padding: 0 1rem;
}

.terminal-section.expanded .section-body {
  max-height: 3000px;
  padding: 1rem;
  border-top: 1px solid var(--terminal-border-dim);
}

/* Legacy support for section-content */
.section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.terminal-section.expanded .section-content {
  max-height: 2000px;
}

.section-inner {
  padding: 1rem;
  border-top: 1px solid var(--terminal-border-dim);
}

/* =====================================================
   SKILL BARS
   ===================================================== */

.skill-category {
  margin-bottom: 1.5rem;
}

.skill-category-title {
  color: var(--terminal-accent);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.skill-name {
  min-width: 120px;
  color: var(--terminal-text);
  font-size: 0.875rem;
}

.skill-bar {
  flex: 1;
  font-family: inherit;
  letter-spacing: -0.05em;
  color: var(--terminal-primary);
}

.skill-bar-empty {
  color: var(--terminal-text-muted);
}

.skill-level {
  min-width: 3rem;
  text-align: right;
  color: var(--terminal-text-dim);
  font-size: 0.8125rem;
}

/* =====================================================
   PROJECT LIST (ls -la style)
   ===================================================== */

.project-list {
  font-size: 0.875rem;
}

.project-header {
  color: var(--terminal-text-dim);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--terminal-border-dim);
}

.project-item {
  display: flex;
  padding: 0.375rem 0;
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: 2px;
}

.project-item:hover {
  background: var(--terminal-background-lighter);
}

.project-item.selected {
  background: var(--terminal-selection);
}

.project-perms { 
  width: 90px; 
  color: var(--terminal-text-dim); 
}

.project-size { 
  width: 60px; 
  text-align: right;
  color: var(--terminal-text-dim);
  margin-right: 1rem;
}

.project-date { 
  width: 70px; 
  color: var(--terminal-text-dim); 
  margin-right: 1rem;
}

.project-name { 
  color: var(--terminal-accent);
  flex: 1;
}

.project-name::before {
  content: './';
  color: var(--terminal-text-muted);
}

/* Project detail panel */
.project-detail {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border-dim);
}

.project-detail-title {
  color: var(--terminal-primary-bright);
  margin-bottom: 0.5rem;
}

.project-detail-desc {
  color: var(--terminal-text);
  margin-bottom: 1rem;
}

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

.project-tech-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background: var(--terminal-background-lighter);
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-accent);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  font-size: 0.8125rem;
  color: var(--terminal-primary);
}

/* =====================================================
   EXPERIENCE TIMELINE
   ===================================================== */

.experience-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--terminal-border-dim);
}

.experience-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--terminal-border-dim);
}

.experience-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.experience-marker {
  position: absolute;
  left: -1.125rem;
  top: 0.25rem;
  color: var(--terminal-primary);
  font-size: 0.875rem;
}

.experience-header {
  margin-bottom: 0.5rem;
}

.experience-title {
  color: var(--terminal-primary-bright);
  font-weight: 600;
}

.experience-company {
  color: var(--terminal-accent);
}

.experience-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--terminal-text-dim);
  margin-bottom: 0.5rem;
}

.experience-desc {
  color: var(--terminal-text);
  margin-bottom: 0.5rem;
}

.experience-achievements {
  font-size: 0.875rem;
  color: var(--terminal-text-dim);
}

.experience-achievement::before {
  content: '→ ';
  color: var(--terminal-accent);
}

/* =====================================================
   CONTACT SECTION
   ===================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-icon {
  color: var(--terminal-accent);
  font-size: 1rem;
}

.contact-label {
  color: var(--terminal-text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-value {
  color: var(--terminal-text);
}

/* Social links */
.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text);
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--terminal-primary);
  color: var(--terminal-primary);
  background: var(--terminal-background-lighter);
}

.social-link-icon {
  color: var(--terminal-accent);
}

/* Contact form */
.terminal-form {
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border-dim);
  padding: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  color: var(--terminal-accent);
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
}

.form-label::before {
  content: '$ ';
  color: var(--terminal-text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--terminal-background-light);
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--terminal-primary);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-submit {
  background: transparent;
  border: 1px solid var(--terminal-primary);
  color: var(--terminal-primary);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-submit:hover {
  background: var(--terminal-primary);
  color: var(--terminal-background);
}

.form-submit:focus {
  outline: 1px dashed var(--terminal-focus);
  outline-offset: 2px;
}

/* =====================================================
   CURSOR
   ===================================================== */

.terminal-cursor {
  display: inline-block;
  background: var(--terminal-cursor);
  color: var(--terminal-background);
  animation: blink 1s step-end infinite;
}

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

/* =====================================================
   EFFECTS - SCANLINES
   ===================================================== */

.scanlines {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scanlines.active {
  opacity: 0.1;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* CRT screen curvature effect */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

/* =====================================================
   FOOTER
   ===================================================== */

.terminal-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--terminal-border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--terminal-text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-switcher {
  display: flex;
  gap: 0.5rem;
}

.theme-btn {
  width: 16px;
  height: 16px;
  border: 1px solid var(--terminal-border-dim);
  background: var(--terminal-background);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-btn:hover {
  transform: scale(1.2);
}

.theme-btn.active {
  border-color: var(--terminal-primary);
  box-shadow: 0 0 5px var(--terminal-glow);
}

.theme-btn--green { background: #00ff00; }
.theme-btn--amber { background: #ffb000; }
.theme-btn--cyan { background: #00ffff; }
.theme-btn--purple { background: #cc66ff; }
.theme-btn--matrix { background: #00ff41; }

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-primary { color: var(--terminal-primary) !important; }
.text-dim { color: var(--terminal-text-dim) !important; }
.text-muted { color: var(--terminal-text-muted) !important; }
.text-accent { color: var(--terminal-accent) !important; }
.text-success { color: var(--terminal-success) !important; }
.text-warning { color: var(--terminal-warning) !important; }
.text-error { color: var(--terminal-error) !important; }

.glow {
  text-shadow: 0 0 10px var(--terminal-glow);
}

/* =====================================================
   ABOUT SECTION CONTENT
   ===================================================== */

.about-content {
  line-height: 1.7;
}

/* Profile Image with CRT Effects */
.about-profile-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.profile-frame {
  position: relative;
  padding: 8px;
  background: linear-gradient(135deg, 
    var(--terminal-background-lighter) 0%, 
    var(--terminal-background) 50%, 
    var(--terminal-background-lighter) 100%);
  border: 2px solid var(--terminal-border);
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.profile-frame::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    var(--terminal-primary) 0%, 
    transparent 40%, 
    transparent 60%, 
    var(--terminal-primary) 100%);
  z-index: -1;
  opacity: 0.5;
}

.profile-image-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  overflow: hidden;
  background: var(--terminal-background);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Apply theme color tint */
  filter: 
    grayscale(100%) 
    contrast(1.1) 
    brightness(0.9);
  /* Color overlay using mix-blend-mode */
  mix-blend-mode: normal;
}

/* Theme color overlay */
.profile-image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--terminal-primary);
  mix-blend-mode: multiply;
  opacity: 0.7;
  pointer-events: none;
}

/* Scanlines overlay */
.profile-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100%;
  }
}

/* Glow effect */
.profile-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-shadow: inset 0 0 30px var(--terminal-glow);
  pointer-events: none;
  animation: profilePulse 4s ease-in-out infinite;
}

@keyframes profilePulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* CRT overlay with vignette and flicker */
.profile-crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  animation: crtFlicker 0.15s infinite;
}

@keyframes crtFlicker {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

/* Scan line animation that moves down */
.profile-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--terminal-primary),
    transparent
  );
  opacity: 0.3;
  animation: scanLine 3s linear infinite;
  z-index: 10;
}

@keyframes scanLine {
  0% {
    top: -3px;
  }
  100% {
    top: 100%;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .profile-image-wrapper {
    width: 140px;
    height: 140px;
  }
}

/* CRT turn-on effect */
.profile-image-wrapper.crt-activate {
  animation: crtTurnOn 0.5s ease-out;
}

@keyframes crtTurnOn {
  0% {
    filter: brightness(30) saturate(0);
    transform: scale(1, 0.01);
  }
  50% {
    filter: brightness(2) saturate(0.5);
    transform: scale(1, 1);
  }
  100% {
    filter: brightness(1) saturate(1);
    transform: scale(1, 1);
  }
}

.about-content h1,
.about-content h2,
.about-content h3 {
  color: var(--terminal-accent);
  margin: 1.5rem 0 0.75rem 0;
}

.about-content h1:first-child,
.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--terminal-text);
}

.about-content strong {
  color: var(--terminal-primary-bright);
}

.about-content hr {
  border: none;
  border-top: 1px dashed var(--terminal-border-dim);
  margin: 1.5rem 0;
}

.about-content em {
  color: var(--terminal-text-dim);
  font-style: italic;
}

/* =====================================================
   EXPERIENCE SECTION CONTENT
   ===================================================== */

.experience-content {
  padding: 0.5rem 0;
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--terminal-border-dim);
}

.timeline-entry {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--terminal-border-dim);
}

.timeline-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.timeline-entry.current .timeline-marker {
  color: var(--terminal-success);
}

.timeline-marker {
  position: absolute;
  left: -1.25rem;
  top: 0.25rem;
  color: var(--terminal-text-muted);
  font-size: 1rem;
}

.timeline-content {
  padding-left: 0.5rem;
}

.entry-header {
  margin-bottom: 0.75rem;
}

.entry-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.position-title {
  color: var(--terminal-primary-bright);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.current-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  background: var(--terminal-success);
  color: var(--terminal-background);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.company-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.company-name {
  color: var(--terminal-accent);
}

.separator {
  color: var(--terminal-text-muted);
}

.location {
  color: var(--terminal-text-dim);
}

.entry-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--terminal-text-muted);
}

.entry-description {
  color: var(--terminal-text);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.entry-achievements {
  margin-bottom: 0.75rem;
}

.achievement {
  color: var(--terminal-text-dim);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  padding-left: 1rem;
  position: relative;
}

.achievement::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--terminal-accent);
}

.entry-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background: var(--terminal-background-lighter);
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text-dim);
}

/* =====================================================
   CONTACT SECTION CONTENT
   ===================================================== */

.contact-content {
  padding: 0.5rem 0;
}

.mail-art {
  font-family: inherit;
  font-size: 0.625rem;
  line-height: 1.2;
  color: var(--terminal-text-muted);
  margin-bottom: 1.5rem;
  white-space: pre;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--terminal-border-dim);
}

.info-item:last-child {
  border-bottom: none;
}

.info-icon {
  color: var(--terminal-accent);
}

.info-label {
  color: var(--terminal-text-muted);
  font-size: 0.8125rem;
}

.info-value {
  color: var(--terminal-text);
}

.info-link {
  color: var(--terminal-accent);
}

.info-link:hover {
  color: var(--terminal-primary-bright);
}

.social-links {
  margin-bottom: 1.5rem;
}

.social-label {
  display: block;
  color: var(--terminal-text-muted);
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.social-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--terminal-primary);
  color: var(--terminal-primary);
  background: var(--terminal-background-lighter);
}

.social-icon {
  color: var(--terminal-accent);
}

.contact-form-container {
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border-dim);
  padding: 1rem;
}

.form-title {
  color: var(--terminal-accent);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.no-content {
  color: var(--terminal-text-muted);
  font-style: italic;
}

/* =====================================================
   PUBLICATIONS SECTION CONTENT
   ===================================================== */

.publications-content {
  padding: 0.5rem 0;
}

/* Source Indicator */
.source-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--terminal-background);
  border-left: 3px solid var(--terminal-accent);
  font-size: 0.75rem;
  color: var(--terminal-text-dim);
}

.source-icon {
  font-size: 1rem;
}

.source-name {
  font-family: inherit;
}

/* Loading and Error states */
.publications-loading,
.publications-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--terminal-text-dim);
}

.publications-loading .loading-spinner {
  font-size: 2rem;
  animation: spin 1s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.publications-error .error-icon {
  font-size: 2rem;
  color: var(--terminal-warning);
  margin-bottom: 0.5rem;
}

.publications-error .error-hint {
  font-size: 0.75rem;
  color: var(--terminal-text-muted);
  margin-top: 0.5rem;
}

/* Metrics Panel */
.metrics-panel {
  background: var(--terminal-background);
  border: 1px solid var(--terminal-border-dim);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.metrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--terminal-border-dim);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.metrics-title {
  color: var(--terminal-accent);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metrics-source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.source-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
}

.source-badge.openalex {
  background: #e64a19;
  color: white;
}

.source-badge.scopus {
  background: #ff6f00;
  color: white;
}

.source-badge.local {
  background: var(--terminal-background-lighter);
  color: var(--terminal-text-muted);
  border: 1px solid var(--terminal-border-dim);
}

.metrics-updated {
  color: var(--terminal-text-muted);
  font-size: 0.75rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: var(--terminal-background-light);
  border: 1px solid var(--terminal-border-dim);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.metric-card:hover {
  border-color: var(--terminal-primary);
  transform: translateY(-2px);
}

.metric-icon {
  font-size: 1.25rem;
  color: var(--terminal-accent);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--terminal-primary-bright);
  line-height: 1;
  text-shadow: 0 0 10px var(--terminal-glow);
}

.metric-label {
  font-size: 0.6875rem;
  color: var(--terminal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.375rem;
}

.metrics-note {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--terminal-background-light);
  border-left: 2px solid var(--terminal-warning);
  font-size: 0.75rem;
  color: var(--terminal-text-dim);
  font-style: italic;
}

/* Publications List */
.publications-list-container {
  margin-bottom: 1rem;
}

.publications-header {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--terminal-border-dim);
  font-size: 0.75rem;
  color: var(--terminal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pub-col-year,
.pub-col-citations {
  text-align: center;
}

.publications-list {
  margin-top: 0.5rem;
}

.publication-item {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--terminal-border-dim);
  transition: background 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.publication-item:hover {
  background: var(--terminal-background-lighter);
}

.publication-item.hidden {
  display: none;
}

.publication-item.fade-in {
  animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pub-main {
  min-width: 0;
}

.pub-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.citation-rank {
  font-size: 0.875rem;
  flex-shrink: 0;
}

.pub-title {
  color: var(--terminal-primary);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pub-title:hover {
  color: var(--terminal-primary-bright);
  text-decoration: underline;
}

.oa-badge {
  font-size: 0.5625rem;
  padding: 0.0625rem 0.25rem;
  background: #f57c00;
  color: white;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 2px;
  margin-left: 0.375rem;
  flex-shrink: 0;
}

.pub-authors {
  font-size: 0.8125rem;
  color: var(--terminal-text-dim);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.et-al {
  font-style: italic;
  color: var(--terminal-text-muted);
}

.pub-venue {
  font-size: 0.75rem;
  color: var(--terminal-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.venue-name {
  font-style: italic;
}

.venue-detail {
  color: var(--terminal-text-muted);
}

.venue-detail::before {
  content: '•';
  margin-right: 0.5rem;
  color: var(--terminal-border);
}

.pub-year {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terminal-text-dim);
  font-size: 0.875rem;
  font-weight: 500;
}

.pub-citations {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.citation-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--terminal-accent);
  line-height: 1;
}

.citation-label {
  font-size: 0.625rem;
  color: var(--terminal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Expand Button */
.publications-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: var(--terminal-background);
  border: 1px dashed var(--terminal-border-dim);
  color: var(--terminal-text-dim);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.publications-expand-btn:hover {
  border-color: var(--terminal-primary);
  color: var(--terminal-primary);
  background: var(--terminal-background-light);
}

.expand-icon {
  transition: transform 0.3s ease;
}

.expand-icon.rotated {
  transform: rotate(180deg);
}

/* Profile Links */
.profile-links-container {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--terminal-border-dim);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.profile-link:hover {
  border-color: var(--terminal-primary);
  color: var(--terminal-primary);
  background: var(--terminal-background-lighter);
}

.link-icon {
  font-size: 1.125rem;
}

.link-arrow {
  color: var(--terminal-accent);
  transition: transform 0.2s ease;
}

.profile-link:hover .link-arrow {
  transform: translateX(3px);
}

/* Legacy scholar link support */
.scholar-link-container {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--terminal-border-dim);
}

.scholar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--terminal-border-dim);
  color: var(--terminal-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.scholar-link:hover {
  border-color: var(--terminal-primary);
  color: var(--terminal-primary);
  background: var(--terminal-background-lighter);
}

.scholar-icon {
  font-size: 1.125rem;
}

.scholar-arrow {
  color: var(--terminal-accent);
  transition: transform 0.2s ease;
}

.scholar-link:hover .scholar-arrow {
  transform: translateX(3px);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .publication-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .pub-year,
  .pub-citations {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.5rem;
  }
  
  .pub-citations {
    flex-direction: row;
  }
  
  .citation-label {
    margin-left: 0.25rem;
  }
  
  .publications-header {
    display: none;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .terminal-cursor {
    animation: none;
    opacity: 1;
  }
  
  .scanlines.active {
    opacity: 0.05;
  }
}
