@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  /* Default: Titanium Console Palette (WCAG AAA compliant) */
  --bg-dark: #0b0d13;       /* Environment background: Obsidian Slate */
  --bg-card: #131622;       /* Secondary structural background: Slate Card */
  --bg-terminal: #0d0f1a;   /* Code console background: Dark Terminal */
  --border: #1e2433;        /* Fine divider border */
  --primary-start: #00ff9d; /* Mint Terminal Green */
  --primary-end: #5af78e;   /* Terminal Sage Green */
  --text: #f5f7fa;          /* Core text: Ice Silver */
  --text-muted: #c5cedc;    /* Body/Descriptions: Mint-Silver */
  --text-darker: #9fa7b7;   /* Meta/Tags/Terminal: Highly readable Light Space Gray */
  
  --gradient: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 24px rgba(0, 255, 157, 0.15);
  
  /* Environment gradients and glow variables */
  --bg-gradient: radial-gradient(circle at 50% 0%, rgba(0, 255, 157, 0.08) 0%, transparent 60%);
  --glow-color: rgba(0, 255, 157, 0.2);
}

/* Optional Class Trigger: Neural Siri Palette Override (WCAG AAA compliant) */
body.theme-siri {
  --bg-dark: #060810;       /* Environment background: Deep Obsidian */
  --bg-card: #0c0e17;       /* Secondary structural background: Siri Dark Card */
  --bg-terminal: #090a13;   /* Code console background: Dark Terminal */
  --border: #1e2335;        /* Fine divider border */
  --primary-start: #4f46e5; /* Deep Indigo */
  --primary-end: #06b6d4;   /* Electric Cyan */
  --text: #f8fafc;          /* Core text: Frost Silver */
  --text-muted: #cbd5e1;    /* Body/Descriptions: Crisp Silver-Gray */
  --text-darker: #8a99ad;   /* Meta/Tags/Terminal: Muted gray */
  
  --gradient: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.15);
  --bg-gradient: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.12) 0%, transparent 60%);
  --glow-color: rgba(79, 70, 229, 0.2);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: var(--bg-gradient);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px; /* Spacious, majestic starting height at top of page */
  background-color: rgba(6, 8, 16, 0); /* transparent on load */
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease, border-color 0.4s ease;
}

header.scrolled {
  height: 80px; /* normal compact height when scrolled */
  background-color: rgba(6, 8, 16, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 35, 53, 0.5);
}

.nav-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
}

.brand-link svg {
  height: 96px; /* Massive prominent logo on load */
  width: auto;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 20px var(--glow-color));
}

header.scrolled .brand-link svg {
  height: 48px; /* compact logo size when scrolled */
  filter: none;
}

/* Dynamic colors for the inline SVG brand logo */
.brand-link svg .brand-text {
  font-family: var(--font-mono);
}
.brand-link svg [fill="url(#primaryGrad)"],
.brand-link svg [fill="url(#cyberTeal)"] {
  fill: url(#brandGrad) !important;
}

/* Navigation Links */
nav ul {
  display: flex;
  gap: 32px;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

nav a:hover,
nav a.active {
  color: var(--text);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
}

/* Sections Layout */
section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 60px 24px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-end);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: inline-block;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

/* Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 140px;
  position: relative;
}

.hero-logo-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  margin-bottom: 32px;
  filter: drop-shadow(0 0 30px rgba(79, 70, 229, 0.35));
  animation: logoPulse 4s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  0% {
    filter: drop-shadow(0 0 25px rgba(79, 70, 229, 0.25));
  }
  100% {
    filter: drop-shadow(0 0 45px rgba(6, 182, 212, 0.45));
  }
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: var(--bg-dark);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 32px var(--glow-color);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: rgba(30, 35, 53, 0.2);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(30, 35, 53, 0.4);
  border-color: var(--text-muted);
}

/* About / Philosophy Section with Terminal */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start; /* Align elements to the top of the section */
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.1fr 1.2fr;
  }
  .terminal-window {
    display: block; /* Show terminal window only on desktop viewports */
  }
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.about-text p a {
  color: var(--primary-end);
  text-decoration: underline;
  text-decoration-color: rgba(6, 182, 212, 0.25);
  text-underline-offset: 3px;
  transition: var(--transition);
}

.about-text p a:hover {
  color: var(--text);
  text-decoration-color: var(--primary-end);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Terminal Component */
.terminal-window {
  display: none; /* Hide on mobile/tablet viewports by default */
  background-color: var(--bg-terminal);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-header {
  background-color: rgba(30, 35, 53, 0.3);
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  position: relative;
}

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

.tdot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.tdot-close { background-color: #ef4444; }
.tdot-minimize { background-color: #f59e0b; }
.tdot-expand { background-color: #10b981; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-darker);
  font-size: 0.75rem;
  font-weight: 500;
}

.terminal-body {
  padding: 24px;
  color: var(--text);
  min-height: 280px;
}

.terminal-line {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.terminal-prompt {
  color: var(--primary-end);
}

.terminal-cmd {
  color: var(--text);
  margin-left: 8px;
}

.terminal-output {
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.terminal-output.highlight {
  color: #5af78e;
}

/* Projects / Contributions Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 12px 24px -10px rgba(6, 8, 16, 0.8), var(--shadow-glow);
}

.project-icon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.folder-icon {
  color: var(--primary-end);
}

.project-links {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
}

.project-links a:hover {
  color: var(--text);
}

.project-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.project-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-darker);
}

.project-tag {
  background: rgba(30, 35, 53, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Blog List Section */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .blog-row {
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 32px;
  }
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-darker);
}

.blog-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.blog-row:hover .blog-title {
  color: var(--primary-end);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.blog-tags {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-end);
}

/* Contact Section & Footer */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info-block p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.channel {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 8px;
}

.channel-icon {
  color: var(--primary-end);
  display: flex;
  align-items: center;
}

.channel-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-darker);
  display: block;
}

.channel-value {
  font-size: 1rem;
  font-weight: 500;
}

.channel:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: var(--shadow-glow);
}

/* PGP Console */
.pgp-console {
  background-color: var(--bg-terminal);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
}

.pgp-title-row {
  background-color: rgba(30, 35, 53, 0.3);
  padding: 10px 16px;
  border-bottom: 1.5px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-darker);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(30, 35, 53, 0.5);
  color: var(--text);
}

.pgp-body {
  padding: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 230px; /* Perfectly bounds long GPG blocks */
  line-height: 1.4;
}

footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  color: var(--text-darker);
  font-size: 0.85rem;
}

.footer-content svg {
  height: 24px;
  width: auto;
  opacity: 0.5;
}

/* Responsive Mobile Layout adjustments */
@media (max-width: 767px) {
  .hero-title {
    font-size: 2.8rem;
  }
  
  nav {
    display: none; /* Can implement simple modal or trigger drawer */
  }
  
  .mobile-toggle {
    display: block;
  }
}
