/* ==================== RESPONSIVE BREAKPOINTS ==================== */
/* Mobile first approach */

/* ==================== SMALL DEVICES (480px+) ==================== */
@media (min-width: 480px) {
  .hero__ctas {
    flex-direction: row;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer__content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ==================== MEDIUM DEVICES / TABLETS (768px+) ==================== */
@media (min-width: 768px) {
  /* Header */
  .menu-toggle {
    display: none;
  }

  .nav {
    display: block !important;
  }

  /* Hero */
  .hero__content {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    gap: var(--space-3xl);
  }

  .hero__text {
    order: 1;
  }

  .hero__image {
    order: 2;
    justify-content: flex-end;
  }

  .hero__headshot {
    width: clamp(280px, 25vw, 350px);
    height: clamp(280px, 25vw, 350px);
  }

  .hero__role {
    justify-content: flex-start;
  }

  .hero__tags {
    justify-content: flex-start;
  }

  .hero__ctas {
    justify-content: flex-start;
  }

  /* About */
  .about__content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }

  /* Timeline Desktop Layout */
  .timeline__container {
    padding-left: 0;
  }

  .timeline__line {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: calc(50% - 30px);
    padding-left: 0;
    padding-right: 0;
  }

  .timeline__item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
    padding-right: var(--space-xl);
  }

  .timeline__item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
    padding-left: var(--space-xl);
  }

  .timeline__item:nth-child(odd) .timeline__dot {
    left: auto;
    right: calc(-7px - var(--space-xl));
  }

  .timeline__item:nth-child(even) .timeline__dot {
    left: calc(-7px - var(--space-xl));
    right: auto;
  }

  .timeline__item:nth-child(odd) .timeline__header {
    justify-content: flex-end;
  }

  .timeline__item:nth-child(odd) .timeline__highlights {
    justify-content: flex-end;
  }
}

/* ==================== LARGE DEVICES / DESKTOPS (1024px+) ==================== */
@media (min-width: 1024px) {
  .hero__headshot {
    width: 380px;
    height: 380px;
  }

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

  .nav__list {
    gap: var(--space-2xl);
  }
}

/* ==================== EXTRA LARGE DEVICES (1280px+) ==================== */
@media (min-width: 1280px) {
  :root {
    --container-max: 1400px;
  }

  .hero__headshot {
    width: 420px;
    height: 420px;
  }
}

/* ==================== MOBILE NAVIGATION (max-width: 767px) ==================== */
@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-lg);
  }

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

  .nav__list {
    flex-direction: column;
    gap: 0;
  }

  .nav__link {
    display: block;
    padding: var(--space-md);
    font-size: var(--fs-lg);
    border-bottom: 1px solid var(--glass-border);
  }

  .nav__link:last-child {
    border-bottom: none;
  }

  .nav__link::after {
    display: none;
  }

  /* Hero Mobile */
  .hero {
    text-align: center;
  }

  .hero__scroll {
    display: none;
  }

  /* Timeline Mobile */
  .timeline__item {
    padding-left: 50px;
  }

  .timeline__line {
    left: 15px;
  }

  .timeline__dot {
    left: 9px;
  }

  .timeline__header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Footer Mobile */
  .footer__content {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .footer__legal {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ==================== TOUCH DEVICE OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }

  .nav__link {
    padding: var(--space-md);
  }

  .footer__social-link {
    width: 48px;
    height: 48px;
  }

  /* Disable hover effects on touch */
  .card:hover {
    transform: none;
  }

  .project-card:hover .project-card__image img {
    transform: none;
  }

  .btn--primary:hover,
  .btn--secondary:hover {
    transform: none;
  }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.3);
    --color-text-secondary: #d4d4d8;
    --color-text-muted: #a1a1aa;
  }

  .card,
  .timeline__content {
    border-width: 2px;
  }

  .btn--secondary {
    border-width: 3px;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .header,
  .hero__scroll,
  .page-loader,
  .menu-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }

  .card {
    border: 1px solid #ccc;
    background: white;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
