/* ==========================================================================
   Portfolio Stylesheet — Sayanth Ashokan
   Minimal, professional design for DevOps & Linux System Administration
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Tokens (Light Mode Default + Dark Mode)
   -------------------------------------------------------------------------- */
:root {
  /* Light Theme Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-alt: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.25);

  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --header-bg: rgba(255, 255, 255, 0.9);

  --status-green: #16a34a;
  --status-green-soft: rgba(22, 163, 74, 0.12);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-pixel: 'Press Start 2P', monospace;

  /* Layout */
  --container-max: 1120px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.22s ease;
}

[data-theme="dark"] {
  --bg-main: #0b1120;
  --bg-surface: #111827;
  --bg-alt: #0f172a;
  --bg-subtle: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-border: rgba(59, 130, 246, 0.35);

  --border-color: #1e293b;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(11, 17, 32, 0.9);

  --status-green: #22c55e;
  --status-green-soft: rgba(34, 197, 94, 0.16);
}

/* --------------------------------------------------------------------------
   2. Base Reset & Typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background-color: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Focus visibility for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  background-color: var(--accent);
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Desktop Mouse Particle Canvas */
.particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* --------------------------------------------------------------------------
   3. Layout Helpers & Reusable Components
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5.5rem 0;
}

.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  max-width: 680px;
  margin-bottom: 2.75rem;
}

.section-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.section-title {
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-subtitle {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  transition: transform var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.btn-outline:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Sticky Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Super Mario-inspired font ONLY on the website logo */
.nav-logo {
  font-family: var(--font-pixel);
  font-size: clamp(0.66rem, 1.35vw, 0.82rem);
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition);
}

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

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--transition), background-color var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.nav-link.active {
  color: var(--accent);
  background-color: var(--accent-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Mobile Hamburger Toggle */
.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 6.25rem 0 5.5rem;
}

.hero-container {
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Super Mario-inspired font ONLY on the user's name */
.hero-name {
  font-family: var(--font-pixel);
  font-size: clamp(1.3rem, 3.6vw, 2.3rem);
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  word-break: break-word;
}

.hero-headline {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-intro {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 68ch;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

.social-pill:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.placeholder-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. About Section
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

.about-narrative {
  padding: 2rem;
}

.about-narrative p + p {
  margin-top: 1rem;
}

.about-narrative p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.highlight-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.highlight-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.highlight-text {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   7. Technical Skills Section
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-card {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skill-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.skill-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skill-tag {
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. Projects Section
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
}

.project-top {
  margin-bottom: 0.85rem;
}

.project-index {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.project-tags li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
}

.project-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: color var(--transition);
}

.project-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.project-link--placeholder {
  color: var(--text-muted);
}

.project-link--placeholder:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. DevOps Learning Journey (Visual Timeline)
   -------------------------------------------------------------------------- */
.journey-banner {
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
  border-left: 4px solid var(--accent);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--status-green);
  box-shadow: 0 0 0 5px var(--status-green-soft);
  flex-shrink: 0;
}

.journey-banner-text {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.journey-banner-text strong {
  color: var(--text-primary);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-left: 2.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -2.75rem;
  top: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-card {
  padding: 1.25rem 1.5rem;
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.timeline-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   10. Contact Section
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.contact-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.contact-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.contact-card-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.contact-value:hover {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: auto;
}

.profile-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.profile-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition), transform var(--transition), background-color var(--transition);
}

.profile-link-row:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.profile-link-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text-primary);
}

.profile-name {
  display: block;
  font-weight: 600;
  font-size: 0.975rem;
}

.profile-url-placeholder {
  display: block;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.profile-arrow {
  font-weight: 600;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   11. Footer & Toast Notification
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-main);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-top-link {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-top-link:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1500;
  max-width: 340px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background-color: var(--text-primary);
  color: var(--bg-main);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   12. Subtle Scroll Fade-In Animations
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card,
  .btn,
  .social-pill,
  .profile-link-row {
    transition: none;
  }

  .card:hover,
  .btn:hover,
  .social-pill:hover,
  .profile-link-row:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   13. Responsive Breakpoints (Tablet & Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.5rem 1.5rem;
    display: none;
  }

  .nav-menu.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .nav-link {
    display: block;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 4rem 0;
  }

  .hero-section {
    padding: 4.5rem 0 4rem;
  }

  .skills-grid,
  .projects-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons .btn,
  .contact-actions .btn {
    width: 100%;
  }

  .timeline {
    padding-left: 2.35rem;
  }

  .timeline::before {
    left: 14px;
  }

  .timeline-marker {
    left: -2.35rem;
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}
