/* ============================================
   Prashanth Yadav Pittakala — Portfolio
   Design System & Styles
   ============================================ */

/* ---------- Reset & Base ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --border: #334155;
  --radius: 8px;
  --transition: 0.2s ease;
  --max-width: 1100px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Skip Link (Accessibility) ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
  font-weight: 500;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* ---------- Focus Styles ---------- */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  color: var(--text-secondary);
}

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

main {
  flex: 1;
  padding: 3rem 0;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: color var(--transition), background-color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background-color: var(--surface);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-primary);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero .description {
  max-width: 680px;
  margin: 0 auto 2rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
}

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

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

/* ---------- Sections ---------- */
.section {
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}

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

.card-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.card-label.finding {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.card-label.project {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.card-label.internship {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-link {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ---------- Severity Badge ---------- */
.severity {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.severity.high {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.severity.medium {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* ---------- Detail Page ---------- */
.detail-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-header h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-section {
  margin-bottom: 2.5rem;
}

.detail-section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-section ul,
.detail-section ol {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.detail-section li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.detail-section p {
  margin-bottom: 0.75rem;
}

code,
.code-block {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

code {
  background-color: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

.code-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

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

.timeline-year {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.25rem;
  margin-top: 2rem;
  position: relative;
}

.timeline-year:first-child {
  margin-top: 0;
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
  padding-left: 0.75rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border);
  border: 2px solid var(--bg);
}

.timeline-item .date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.timeline-item .event {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-group {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ---------- Experience ---------- */
.experience-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.experience-item h3 {
  margin-bottom: 0.25rem;
}

.experience-item .role {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.experience-item .period {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.experience-item ul {
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.experience-item li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

/* ---------- Contact ---------- */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition);
}

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

.contact-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.contact-info .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.contact-info .value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ---------- Disclosure ---------- */
.disclosure-content {
  max-width: 720px;
}

.disclosure-content h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.disclosure-content h2:first-child {
  margin-top: 0;
}

.disclosure-content p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

.disclosure-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.disclosure-content li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

/* ---------- Page Header ---------- */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

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

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.footer-links {
  display: flex;
  gap: 1.25rem;
}

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

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

/* ---------- Back Link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

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

/* ---------- Back to Top Button ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 15px 20px -5px rgb(0 0 0 / 0.2);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Smooth Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }

  .nav-links.open {
    display: flex;
    max-height: 500px;
  }

  @supports not (transition: max-height 0.3s) {
    .nav-links {
      display: none;
    }
    
    .nav-links.open {
      display: flex;
    }
  }

  .nav-links a {
    padding: 0.75rem 0.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .subtitle {
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

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

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  main {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .navbar,
  .nav-toggle,
  .footer,
  .back-to-top,
  .skip-link,
  .hero-actions {
    display: none !important;
  }

  body {
    background-color: #fff;
    color: #000;
  }

  .hero,
  .section {
    page-break-inside: avoid;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}