/* ===================================
   ADA LOVELACE TRIBUTE - RESPONSIVE STYLES
   Mobile-First Approach
   =================================== */

/* ===================================
   BASE RESPONSIVE ADJUSTMENTS
   =================================== */

/* Large Screens (1400px+) */
@media screen and (min-width: 1400px) {
  .header-title {
    padding-left: 10%;
  }

  .about-section {
    gap: var(--space-2xl);
  }

  .about-pic {
    width: 380px;
    height: 380px;
  }
}

/* ===================================
   TABLETS & SMALL LAPTOPS (1200px and below)
   =================================== */

@media screen and (max-width: 1200px) {
  .about-section {
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
  }

  .about-pic {
    width: 280px;
    height: 280px;
  }

  .about-content {
    max-width: 700px;
  }

  .about-content p {
    text-align: center;
  }

  .resources {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

/* ===================================
   TABLETS (1025px and below)
   =================================== */

@media screen and (max-width: 1025px) {

  /* Navigation - Hamburger mode */
  .navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    transform: translateY(-100%);
    opacity: 0;
    transition:
      transform var(--duration-normal) var(--ease-out-expo),
      opacity var(--duration-normal) var(--ease-out-expo);
  }

  .navigation.responsive {
    transform: translateY(0);
    opacity: 1;
  }

  .navigation li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .navigation a {
    padding: 1.25rem 2rem;
    text-align: center;
  }

  .navigation a::after {
    display: none;
  }

  .ham-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Header adjustments */
  .header {
    background-attachment: scroll;
  }

  .header-title {
    padding: var(--space-lg);
    padding-bottom: var(--space-xl);
  }

  /* Timeline adjustments */
  .timeline-section {
    padding-left: 2.5rem;
  }

  .timeline-in-detail::before {
    left: calc(-2.5rem - 5px);
    width: 12px;
    height: 12px;
  }

  /* Final Section Redesign */
  .final-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-md);
  }

  .final-content {
    max-width: 100%;
    align-items: center;
    order: 2;
  }

  .final-quote {
    border-left: none;
    border-top: 3px solid var(--gold);
    padding: var(--space-md) var(--space-sm);
    background: rgba(0, 0, 0, 0.4);
  }

  .final-quote p {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    position: relative;
    z-index: 1;
    text-align: center;
  }

  .final-quote cite {
    text-align: center;
    padding-left: 0;
  }

  .final-quote::before {
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6rem;
    z-index: 0;
  }

  .final-resources {
    border-top: none;
    padding-top: 0;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xl);
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .resources-list {
    justify-content: center;
    width: 100%;
  }

  .resources-list a {
    width: auto;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }

  .resources-img {
    order: 1; /* Image first on mobile */
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 3/4;
    margin: 0 auto;
    transform: rotate(0deg);
  }
}

/* ===================================
   SMALL TABLETS (800px and below)
   =================================== */

@media screen and (max-width: 800px) {

  /* Typography scale adjustments */
  :root {
    --fs-display: clamp(1.75rem, 7vw, 2.5rem);
    --fs-h3: clamp(1.5rem, 5vw, 2rem);
  }

  /* Header */
  .header {
    min-height: 80vh;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .header-title {
    max-width: 100%;
    padding: var(--space-md);
    text-align: center;
  }

  .scroll-indicator {
    display: none;
  }

  /* About Section */
  .about-section {
    width: 95%;
    padding: var(--space-lg) 0;
  }

  .about-pic {
    width: 220px;
    height: 220px;
  }

  /* Timeline - Centered vertical */
  .tribute-info {
    width: 95%;
    padding: var(--space-lg) 0;
  }

  .tribute-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
  }

  .timeline-section {
    padding-left: 2rem;
  }

  .timeline-section::before {
    left: 5px;
  }

  .timeline-in-detail {
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
  }

  .timeline-in-detail::before {
    left: calc(-2rem + 1px);
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .timeline-in-detail:hover {
    transform: none;
  }

  .timeline-year p {
    font-size: 1.25rem;
  }

  /* Blockquote */
  .blockquote {
    margin: var(--space-lg) auto;
  }

  .blockquote::before {
    left: 1rem;
    font-size: 3rem;
  }

  .blockquote::after {
    right: 1rem;
    font-size: 3rem;
    bottom: -1rem;
  }

  /* Resources */
  .resources {
    width: 95%;
    padding: var(--space-lg) 0;
  }

  .resources-img {
    height: 160px;
  }

  /* Footer */
  footer {
    padding: var(--space-md);
  }
}

/* ===================================
   MOBILE PHONES (576px and below)
   =================================== */

@media screen and (max-width: 576px) {

  /* Typography further reduced */
  :root {
    --fs-display: clamp(1.5rem, 8vw, 2rem);
    --fs-h3: clamp(1.25rem, 6vw, 1.5rem);
    --fs-body: clamp(0.95rem, 4vw, 1.05rem);
  }

  /* Navigation */
  .navigation a {
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
  }

  .ham-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  /* Header */
  .header {
    min-height: 70vh;
  }

  .header-title {
    padding: var(--space-sm);
  }

  h1 {
    letter-spacing: 1px;
  }

  h2 {
    letter-spacing: 2px;
    font-size: 0.9rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  /* About */
  .about-section {
    gap: var(--space-md);
  }

  .about-pic {
    width: 180px;
    height: 180px;
    box-shadow:
      0 0 0 3px var(--gold),
      0 0 20px rgba(212, 175, 55, 0.2);
  }

  .about-pic::before {
    inset: -5px;
    filter: blur(10px);
  }

  .about-content h3 {
    font-size: 1.4rem;
  }

  /* Timeline */
  .timeline-section {
    padding-left: 1.5rem;
  }

  .timeline-section::before {
    left: 3px;
    width: 1px;
  }

  .timeline-in-detail::before {
    left: calc(-1.5rem + 0px);
    width: 8px;
    height: 8px;
  }

  .timeline-in-detail {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
  }

  .timeline-year p {
    font-size: 1.1rem;
  }

  .timeline-month p {
    font-size: 0.75rem;
  }

  .timeline-event p {
    font-size: 0.9rem;
  }

  /* Blockquote */
  .blockquote {
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
  }

  .blockquote p {
    font-size: 0.95rem;
  }

  .blockquote::before,
  .blockquote::after {
    font-size: 2.5rem;
    opacity: 0.15;
  }

  .blockquote::before {
    top: 0;
    left: 0.5rem;
  }

  .blockquote::after {
    bottom: -0.5rem;
    right: 0.5rem;
  }

  /* Resources */
  .resources-img {
    max-width: 250px;
    height: 140px;
  }

  .resources-list li {
    padding-left: 1.25rem;
  }

  .resources-list a {
    font-size: 0.9rem;
  }

  /* Footer */
  .footer-tribute {
    font-size: 0.9rem;
  }

  .footer-credits {
    font-size: 0.75rem;
  }
}

/* ===================================
   EXTRA SMALL PHONES (400px and below)
   =================================== */

@media screen and (max-width: 400px) {
  :root {
    --fs-display: 1.4rem;
    --fs-h3: 1.15rem;
  }

  .header {
    min-height: 60vh;
  }

  h2 {
    font-size: 0.8rem;
  }

  .about-pic {
    width: 150px;
    height: 150px;
  }

  .about-content h3 {
    font-size: 1.2rem;
  }

  .timeline-year p {
    font-size: 1rem;
  }

  .blockquote::before,
  .blockquote::after {
    display: none;
  }
}

/* ===================================
   LANDSCAPE MOBILE
   =================================== */

@media screen and (max-width: 800px) and (orientation: landscape) {
  .header {
    min-height: 100vh;
  }

  .about-section {
    flex-direction: row;
    text-align: left;
  }

  .about-pic {
    width: 180px;
    height: 180px;
  }

  .about-content p {
    text-align: left;
  }
}

/* ===================================
   HIGH DPI / RETINA DISPLAYS
   =================================== */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  .about-pic,
  .resources-img,
  .header {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  body {
    background: white;
    color: black;
  }

  nav,
  .ham-icon,
  .scroll-indicator {
    display: none !important;
  }

  .header {
    min-height: auto;
    background: none;
    padding: 2rem;
    page-break-after: always;
  }

  h1,
  h2,
  h3 {
    color: black;
  }

  .about-pic {
    box-shadow: none;
    border: 2px solid #ccc;
  }

  .about-pic::before {
    display: none;
  }

  .timeline-in-detail {
    break-inside: avoid;
  }

  .blockquote {
    border: 1px solid #ccc;
    background: #f5f5f5;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   =================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --gold: #ffd700;
    --white: #ffffff;
    --white-muted: #e0e0e0;
    --black: #000000;
  }

  .timeline-in-detail {
    border: 2px solid var(--gold);
  }

  .navigation a::after {
    height: 3px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .about-pic {
    animation: none;
  }

  .scroll-indicator {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .timeline-in-detail:hover {
    transform: none;
  }
}