/**
 * MAIN STYLESHEET
 * Pranav Shah — Portfolio CMS
 * 
 * Bundles typography, variables, base styles, component library, and section architectures.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('./variables.css');
@import url('./base.css');
@import url('./components.css');

/* ==========================================================================
   Subtle Professional Animations & Transitions
   ========================================================================== */
@keyframes heroPortraitIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms cubic-bezier(0.16, 1, 0.3, 1), transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.project-card {
  animation: fadeUp 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(circle at 85% 15%, var(--accent-primary-tint) 0%, transparent 45%);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.hero__content {
  flex: 1;
  max-width: 680px;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  color: var(--accent-primary);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.hero__name {
  font-size: var(--font-size-hero);
  font-weight: 800;
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.03em;
}

.hero__headline {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  line-height: var(--line-height-heading);
  margin-bottom: var(--space-4);
}

.hero__description {
  font-size: var(--font-size-body);
  color: var(--text-secondary);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-8);
}

.hero__socials {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Hero Profile Image — Refined, Larger on Desktop, Fully Responsive */
.hero__portrait-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: heroPortraitIn 650ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__portrait-ring {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  padding: 5px;
  border: 3px solid var(--border-color);
  box-shadow: 0 16px 40px var(--accent-primary-tint), var(--shadow-lg);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), border-color 300ms ease, box-shadow 300ms ease;
}

.hero__portrait-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary-tint) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero__portrait-ring:hover {
  transform: scale(1.025);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 48px rgba(37, 99, 235, 0.18), var(--shadow-lg);
}

.hero__portrait-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero__avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary-tint) 0%, var(--bg-surface-secondary) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-h2);
  color: var(--accent-primary);
}

/* ==========================================================================
   About & Pillars Section
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-8);
}

.pillar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.pillar-card__title {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.pillar-card__text {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  line-height: var(--line-height-body);
}

/* ==========================================================================
   Project Grid & Cards
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-6);
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.project-card__title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.project-card__tagline {
  font-size: var(--font-size-caption);
  color: var(--accent-primary);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-3);
}

.project-card__description {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.project-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border-top: 1px solid var(--border-color-subtle);
  padding-top: var(--space-4);
}

/* ==========================================================================
   Skills Matrix Grid
   ========================================================================== */
.skills-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.skills-category-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.skills-category-title {
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color-subtle);
}

.skills-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ==========================================================================
   Experience & Education Cards
   ========================================================================== */
.timeline-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.experience-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.experience-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.experience-card__org {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.experience-card__role {
  font-size: var(--font-size-small);
  color: var(--accent-primary);
  font-weight: var(--font-weight-medium);
}

.experience-card__period {
  font-size: var(--font-size-caption);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.experience-card__desc {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: var(--space-3);
  line-height: var(--line-height-body);
}

/* ==========================================================================
   Case Study & Blog Article Pages
   ========================================================================== */
.case-study-hero {
  padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(circle at 80% 20%, var(--accent-primary-tint) 0%, transparent 40%);
}

.case-study-meta {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

.case-study-body {
  padding: var(--space-12) 0;
}

.case-study-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.case-study-section__title {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.feature-item {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-small);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Markdown Articles */
.markdown-body {
  line-height: var(--line-height-loose);
  font-size: var(--font-size-body);
  color: var(--text-secondary);
}

.markdown-body h2 {
  font-size: var(--font-size-h2);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.markdown-body h3 {
  font-size: var(--font-size-h3);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.markdown-body pre {
  background-color: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-family-code);
  font-size: var(--font-size-small);
  color: var(--text-primary);
  margin: var(--space-6) 0;
}

.markdown-body code {
  font-family: var(--font-family-code);
  background-color: var(--bg-surface-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-8) 0;
}

/* ==========================================================================
   Responsive Adjustments & Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero__portrait-ring {
    width: 270px;
    height: 270px;
  }
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 900px) {
  .hero {
    padding: var(--space-12) 0 var(--space-10);
  }
  .hero__inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: var(--space-8);
  }
  .hero__content {
    max-width: 100%;
  }
  .hero__portrait-ring {
    width: 230px;
    height: 230px;
    margin: 0 auto;
  }
  .hero__actions {
    justify-content: center;
  }
  .hero__socials {
    justify-content: center;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero__name {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }
  .hero__headline {
    font-size: var(--font-size-h4);
  }
  .hero__portrait-ring {
    width: 210px;
    height: 210px;
  }
  .case-study-section {
    padding: var(--space-5);
  }

  /* Projects Section Mobile Vertical Timeline */
  .projects-grid {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 28px;
    gap: var(--space-8);
  }
  .projects-grid::before {
    content: '';
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 7px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--border-color) 100%);
    border-radius: 2px;
  }
  .project-card {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .project-card::before {
    content: '';
    position: absolute;
    top: 24px;
    left: -28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    border: 3px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--border-color);
    z-index: 2;
    transition: all var(--transition-fast);
  }
  .project-card:hover::before {
    box-shadow: 0 0 0 3px var(--accent-primary);
    transform: scale(1.1);
  }
  .project-card::after {
    content: '';
    position: absolute;
    top: 30px;
    left: -21px;
    width: 21px;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: var(--space-8) 0 var(--space-8);
  }
  .hero__portrait-ring {
    width: 180px;
    height: 180px;
  }
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }
  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .filter-bar {
    gap: var(--space-1);
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }
  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: var(--font-size-caption);
  }

  /* Projects Section Adjustments for Small Mobile */
  .projects-grid {
    padding-left: 22px;
    gap: var(--space-6);
  }
  .projects-grid::before {
    left: 5px;
    top: 20px;
    bottom: 20px;
  }
  .project-card {
    padding: var(--space-4);
    border-radius: var(--radius-card);
  }
  .project-card::before {
    top: 20px;
    left: -23px;
    width: 12px;
    height: 12px;
  }
  .project-card::after {
    top: 25px;
    left: -17px;
    width: 17px;
  }
  .project-card__title {
    font-size: var(--font-size-h4);
  }
  .project-card__actions {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .project-card__actions .btn {
    min-height: 38px;
  }
}

@media (max-width: 360px) {
  .hero__portrait-ring {
    width: 150px;
    height: 150px;
  }
  .hero__name {
    font-size: 1.75rem;
  }
  .projects-grid {
    padding-left: 18px;
    gap: var(--space-5);
  }
  .projects-grid::before {
    left: 4px;
  }
  .project-card {
    padding: var(--space-3) var(--space-3);
  }
  .project-card::before {
    top: 18px;
    left: -19px;
    width: 10px;
    height: 10px;
  }
  .project-card::after {
    top: 22px;
    left: -14px;
    width: 14px;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion Preference
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .project-card, .hero__portrait-wrapper {
    animation: none !important;
  }
}
