/* ==========================================================================
   FUTURISTIC DESIGN SYSTEM - HARI VIGNESH (SENIOR SEO EXECUTIVE PORTFOLIO)
   ========================================================================== */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');

/* Cascade Layers Definition */
@layer reset, base, theme, components, utilities;

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

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }

  body {
    text-rendering: optimizeSpeed;
    line-height: 1.5;
  }

  img, picture, svg, video {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  input, button, textarea, select {
    font: inherit;
  }

  button {
    cursor: pointer;
    background: none;
    border: none;
  }

  ul, ol {
    list-style: none;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
}

@layer base {
  :root {
    color-scheme: dark;
    
    /* Design Tokens - Colors */
    --clr-bg-raw: 3, 3, 5;
    --clr-surface-raw: 10, 10, 18;
    --clr-accent-raw: 271, 91%, 65%; /* Quantum Cyber Purple */
    --clr-accent-glow: hsla(var(--clr-accent-raw), 0.15);
    
    --color-bg: rgb(var(--clr-bg-raw));
    --color-surface: rgb(var(--clr-surface-raw));
    --color-accent: hsl(var(--clr-accent-raw));
    --color-accent-dim: hsl(271, 91%, 45%);
    --color-text-primary: hsl(0, 0%, 98%);
    --color-text-muted: hsl(240, 5%, 65%);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-glow: hsla(var(--clr-accent-raw), 0.4);
    
    /* Typography */
    --ff-heading: 'Roboto Mono', monospace;
    --ff-body: 'Roboto Mono', monospace;
    
    /* Spacing */
    --space-xs: clamp(0.5rem, 0.25rem + 0.5vi, 0.75rem);
    --space-s: clamp(0.75rem, 0.5rem + 1vi, 1.25rem);
    --space-m: clamp(1.25rem, 1rem + 1.5vi, 2rem);
    --space-l: clamp(2rem, 1.5rem + 2vi, 3.5rem);
    --space-xl: clamp(3.5rem, 2.5rem + 4vi, 6rem);
    
    /* Shadows */
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px hsla(var(--clr-accent-raw), 0.2);
  }

  body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--ff-body);
    font-size: 1rem;
    overflow-x: hidden;
    
    /* Futuristic grid background */
    background-image: 
      radial-gradient(at 0% 0%, hsla(var(--clr-accent-raw), 0.08) 0px, transparent 50%),
      radial-gradient(at 100% 100%, hsla(var(--clr-accent-raw), 0.05) 0px, transparent 50%),
      linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-attachment: fixed;
  }

  h1, h2, h3, h4 {
    font-family: var(--ff-heading);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  p {
    font-weight: 300;
    color: var(--color-text-muted);
  }
  
  /* Focus management */
  :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
  }
  
  /* Scrollbar Customization */
  scrollbar-color: var(--color-accent) rgba(0,0,0,0.3);
  scrollbar-width: thin;

  ::-webkit-scrollbar {
    width: 6px;
  }
  ::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--color-accent-dim);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
  }
}

@layer theme {
  /* Glassmorphism Panels */
  .glass-panel {
    background: rgba(var(--clr-surface-raw), 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }

  .glass-panel:hover {
    border-color: var(--color-border-glow);
    box-shadow: var(--shadow-glow), var(--shadow-soft);
  }

  /* Glow Elements */
  .glow-text {
    text-shadow: 0 0 10px hsla(var(--clr-accent-raw), 0.4);
  }

  .accent-gradient-text {
    background: linear-gradient(135deg, #ffffff 30%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@layer components {
  /* Header & Navigation */
  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: var(--space-xs) 0;
    background: rgba(var(--clr-bg-raw), 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
  }

  .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-s);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    font-family: var(--ff-heading);
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-primary);
  }

  .logo span {
    color: var(--color-accent);
  }

  .nav-menu {
    display: flex;
    gap: var(--space-m);
  }

  .nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    position: relative;
    padding: 4px 0;
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .nav-link:hover, .nav-link.active {
    color: var(--color-text-primary);
  }

  .nav-link:hover::after, .nav-link.active::after {
    width: 100%;
  }

  /* Scroll Progress Bar */
  .scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--color-accent);
    width: 0%;
    z-index: 101;
  }

  /* Hero Section */
  .hero-section {
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    align-items: center;
    position: relative;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--space-s);
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-m);
    align-items: center;
  }

  @media (max-width: 768px) {
    .hero-grid {
      grid-template-columns: 1fr;
      text-align: center;
      gap: var(--space-l);
    }
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(var(--clr-accent-raw), 0.1);
    border: 1px solid var(--color-border-glow);
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--ff-heading);
    color: var(--color-accent);
    margin-bottom: var(--space-s);
  }

  .hero-title {
    font-size: clamp(2.5rem, 2rem + 3vi, 4.5rem);
    margin-bottom: var(--space-xs);
    text-wrap: balance;
  }

  .hero-tagline {
    font-size: clamp(1.1rem, 1rem + 0.5vi, 1.4rem);
    color: var(--color-text-muted);
    margin-bottom: var(--space-m);
    text-wrap: pretty;
    max-width: 650px;
  }
  
  @media (max-width: 768px) {
    .hero-tagline {
      margin-inline: auto;
    }
  }

  .hero-actions {
    display: flex;
    gap: var(--space-s);
    margin-bottom: var(--space-m);
  }

  @media (max-width: 768px) {
    .hero-actions {
      justify-content: center;
    }
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    gap: 8px;
  }

  .btn-primary {
    background-color: var(--color-accent);
    color: #000;
    box-shadow: var(--shadow-glow);
  }

  .btn-primary:hover {
    background-color: #fff;
    box-shadow: 0 0 30px hsla(var(--clr-accent-raw), 0.4);
  }

  .btn-secondary {
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.02);
  }

  .btn-secondary:hover {
    border-color: var(--color-accent);
    background: rgba(var(--clr-accent-raw), 0.05);
  }

  /* Cybernetic Hologram/Avatar */
  .hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .holo-container {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, hsla(var(--clr-accent-raw), 0.2) 0%, transparent 70%);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  @media (max-width: 480px) {
    .holo-container {
      width: 250px;
      height: 250px;
    }
  }

  .holo-ring {
    position: absolute;
    border: 1px dashed var(--color-border-glow);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
  }

  .holo-ring-1 {
    width: 100%;
    height: 100%;
  }

  .holo-ring-2 {
    width: 80%;
    height: 80%;
    animation-direction: reverse;
    animation-duration: 15s;
    border-style: solid;
    border-width: 1px;
    opacity: 0.3;
  }

  .holo-avatar {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    background-color: #0b0b14;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-glow);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .holo-avatar svg {
    width: 60%;
    height: 60%;
    fill: var(--color-accent);
    filter: drop-shadow(0 0 10px var(--color-accent));
  }

  .holo-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    animation: scan 3s ease-in-out infinite;
    opacity: 0.8;
  }

  /* Metric Cards Dashboard */
  .metrics-section {
    padding: var(--space-m) 0;
  }

  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-s);
  }

  .metric-card {
    padding: var(--space-m);
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-accent);
  }

  .metric-val {
    font-size: clamp(2rem, 1.8rem + 1.2vi, 3.2rem);
    font-family: var(--ff-heading);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 4px;
  }

  .metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    color: var(--color-text-muted);
  }

  /* Section Styles */
  .section {
    padding: var(--space-xl) 0;
  }

  .section-title-wrap {
    margin-bottom: var(--space-l);
    position: relative;
  }

  .section-subtitle {
    color: var(--color-accent);
    font-family: var(--ff-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    display: block;
  }

  .section-title {
    font-size: clamp(2rem, 1.8rem + 1vi, 3rem);
    color: var(--color-text-primary);
    position: relative;
    display: inline-block;
  }

  /* Interactive SEO Terminal Widget */
  .terminal-wrapper {
    max-width: 800px;
    margin: 0 auto;
  }

  .terminal-header {
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 10px var(--space-s);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

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

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

  .td-red { background: #ef4444; }
  .td-yellow { background: #eab308; }
  .td-green { background: #22c55e; }

  .terminal-title {
    font-family: var(--ff-heading);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .terminal-status {
    font-size: 0.7rem;
    color: var(--color-accent);
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    animation: pulse 1.5s infinite;
  }

  .terminal-body {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: var(--space-m);
    font-family: monospace;
    font-size: 0.9rem;
    color: #a7f3d0;
  }

  .terminal-input-row {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    margin-bottom: var(--space-s);
    flex-wrap: wrap;
  }

  .terminal-prompt {
    color: var(--color-accent);
    font-weight: bold;
  }

  .terminal-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    min-inline-size: 200px;
    transition: border-color 0.2s ease;
  }

  .terminal-input:focus {
    border-color: var(--color-accent);
    outline: none;
  }

  .terminal-btn {
    background: var(--color-accent);
    color: #000;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s ease;
  }

  .terminal-btn:hover {
    background: #fff;
  }

  .terminal-console {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: var(--space-s);
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted);
  }

  .terminal-log-line {
    margin-bottom: 6px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .terminal-log-line.success {
    color: var(--color-accent);
  }

  .terminal-log-line.warning {
    color: #fb923c;
  }

  .terminal-log-line.system {
    color: #60a5fa;
  }

  /* Skills Grid and Category Panels */
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-m);
  }

  .skill-cat-card {
    padding: var(--space-m);
    height: 100%;
  }

  .skill-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-s);
  }

  .skill-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(var(--clr-accent-raw), 0.1);
    border: 1px solid var(--color-border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
  }

  .skill-cat-title {
    font-size: 1.2rem;
    color: var(--color-text-primary);
  }

  .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--space-s);
  }

  .skill-tag {
    font-size: 0.8rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
  }

  .skill-tag:hover {
    border-color: var(--color-accent);
    color: var(--color-text-primary);
    background: rgba(var(--clr-accent-raw), 0.05);
    transform: translateY(-2px);
  }

  /* Experience Timeline */
  .timeline-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: var(--space-m);
  }

  .timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 7px;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-accent) 0%, rgba(255, 255, 255, 0.05) 100%);
  }

  .timeline-item {
    position: relative;
    margin-bottom: var(--space-l);
  }

  .timeline-dot-indicator {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #030305;
    border: 3px solid var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent);
    z-index: 2;
  }

  .timeline-card {
    padding: var(--space-m);
  }

  .timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
    gap: 8px;
  }

  .timeline-title-group h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .timeline-company {
    color: var(--color-accent);
    font-weight: 500;
  }

  .timeline-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    font-family: monospace;
  }

  .timeline-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--space-s);
  }

  .timeline-key-work {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
  }

  .timeline-bullet {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }

  .timeline-bullet::before {
    content: '▶';
    color: var(--color-accent);
    font-size: 0.65rem;
    margin-top: 4px;
    flex-shrink: 0;
  }

  /* Certifications & Tools Console */
  .cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-s);
  }

  .cert-card {
    padding: var(--space-s);
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .cert-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    flex-shrink: 0;
  }

  .cert-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .cert-issuer {
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }

  /* Contact terminal */
  .contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
  }

  .form-group {
    margin-bottom: var(--space-s);
  }

  .form-label {
    display: block;
    font-size: 0.85rem;
    font-family: var(--ff-heading);
    margin-bottom: 6px;
    color: var(--color-text-muted);
  }

  .form-input, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    transition: all 0.2s ease;
  }

  .form-input:focus, .form-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(var(--clr-accent-raw), 0.1);
    outline: none;
  }

  .contact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-top: var(--space-m);
  }

  .social-links {
    display: flex;
    gap: var(--space-s);
  }

  .social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
  }

  .social-link:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(var(--clr-accent-raw), 0.05);
    transform: translateY(-2px);
  }

  /* Footer */
  .app-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-m) 0;
    background: rgba(var(--clr-surface-raw), 0.3);
    text-align: center;
  }

  .footer-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
  }
}

@layer utilities {
  .text-center { text-align: center; }
  .margin-bottom-s { margin-bottom: var(--space-s); }
  .margin-bottom-m { margin-bottom: var(--space-m); }
  .margin-bottom-l { margin-bottom: var(--space-l); }
  
  /* Animations */
  @keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  @keyframes scan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
  }

  @keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--color-accent); }
    100% { transform: scale(1); opacity: 0.7; }
  }

  /* Reveal animation for sections */
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.active {
    opacity: 1;
    transform: translateY(0);
  }
}
