/* ========================================
   RESPONSIVE DESIGN - MEDIA QUERIES
======================================== */

@media (min-width: 769px) {
  .timeline-title .hci-note {
    display: inline-flex;
    white-space: nowrap;
  }
}

@media (hover: none) and (pointer: coarse) {
  a[href]:not(.sidebar-link):not(.btn),
  a[href]:not(.sidebar-link):not(.btn):hover,
  a[href]:not(.sidebar-link):not(.btn):focus-visible {
    text-decoration: underline;
    text-decoration-color: currentColor;
  }

  .timeline-item.clickable .timeline-title,
  .achievement-item.clickable .achievement-title {
    text-decoration: underline;
    text-decoration-color: currentColor;
  }
}

@media (max-width: 768px) {
  .about > h2,
  .about > section,
  .projects > h2,
  .projects > div,
  .skills > h2,
  .skills > div,
  .contact > h2,
  .contact > p,
  .contact > nav {
    padding: 0 1rem;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-display {
    white-space: normal;
    font-size: clamp(2rem, 10vw, 3.5rem);
    margin-bottom: 1.25rem;
  }

  .hero-meta {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-description {
    max-width: 100%;
  }

  h1,
  .hero-title {
    font-size: var(--font-size-h1-mobile);
  }

  h2,
  .section-title {
    font-size: var(--font-size-h2-mobile);
  }

  .hero-subtitle {
    font-size: var(--font-size-subtitle-mobile);
  }

  h3,
  .subsection-title,
  .project-title,
  .skill-title,
  .modal-title {
    font-size: var(--font-size-h3-mobile);
  }

  h4,
  .timeline-title,
  .achievement-item .achievement-content .achievement-title {
    font-size: var(--font-size-h4-mobile);
  }

  .section-title {
    margin-bottom: 0.75rem;
  }

  aside {
    top: 5rem;
    width: 100%;
    height: calc(100vh - 5rem);
    left: -100%;
    overflow: hidden;
  }

  aside.open {
    left: 0;
  }

  .sidebar-links {
    padding: 2rem 3rem 1rem;
    gap: 1.5rem;
    justify-content: flex-start;
    align-items: flex-start;
    height: auto;
    min-height: 0;
    margin-top: 0;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-link {
    font-size: 1.5rem;
    padding: 1rem 0;
    text-align: left;
    width: auto;
    font-weight: 400;
  }

  .sidebar-link::before {
    left: -1rem;
  }

  header {
    height: 5rem;
    align-items: center;
    background: var(--header-bg);
    backdrop-filter: blur(0.9375rem) saturate(180%);
    -webkit-backdrop-filter: blur(0.9375rem) saturate(180%);
    padding: 0 1rem;
    pointer-events: auto;
    transition: background-color 0.2s ease;
  }

  header.menu-open {
    background: var(--surface-1);
  }

  .header-title {
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    transform: none;
    pointer-events: none;
  }

  .header-title.visible,
  .menu-toggle.active + .header-title {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    width: 2rem;
    height: 2rem;
    padding: 0.5rem;
    gap: 0.25rem;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .menu-toggle:hover {
    transform: none;
    opacity: 0.7;
    border-color: transparent;
  }

  .sidebar-footer {
    padding: 1rem 1.25rem 2.5rem;
    gap: 1.25rem;
    margin-top: 0;
    position: sticky;
    bottom: 0;
    width: 100%;
    border-top: 0.0625rem solid var(--surface-border);
    background: var(--surface-1);
    z-index: 2;
  }

  .toggle-dots {
    width: 1.0625rem;
    height: 1.0625rem;
  }

  .lang-option,
  .theme-option {
    padding: 0.375rem 0.75rem;
  }

  .about .subsection-title {
    font-size: var(--font-size-h3-mobile);
    margin-bottom: 1rem;
  }

  .timeline-header .timeline-title {
    font-size: var(--font-size-h4-mobile);
  }

  .timeline-header.grouped-header .timeline-title {
    font-size: var(--font-size-h4-mobile);
  }

  .timeline-title .hci-note {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin-top: 0.2rem;
    margin-left: 0.05rem;
    white-space: nowrap;
  }

  .timeline-title .hci-arrow {
    display: block;
    width: 2.45rem;
    height: 1.18rem;
    margin: 0 0.22rem 0 0.08rem;
    transform: none;
  }

  .timeline-title .hci-arrow svg {
    display: block;
  }

  .timeline-title .hci-arrow .hci-arrow-desktop-shape {
    display: none;
  }

  .timeline-title .hci-arrow .hci-arrow-mobile-shape {
    display: block;
  }

  .timeline-title .hci-highlight {
    top: 0;
    margin-left: 0;
    font-size: 1em;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .timeline-header .timeline-period::before {
    content: none;
  }

  .achievements-grid {
    gap: 0;
  }

  .achievement-item {
    padding: 0.75rem 0;
  }

  .achievement-item .achievement-content .achievement-year {
    float: none;
    margin-top: 0.25rem;
    display: block;
    padding: 0.125rem 0.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }

  .modal-body {
    padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  }

  .modal-close {
    top: 1rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    margin: 1rem 1rem 0 0;
  }

  .close-line {
    width: 0.875rem;
  }

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

  .contact-description {
    margin-bottom: 2.5rem;
  }

  .social-links {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  footer {
    padding: 2rem 0 2.5rem;
    margin-top: 0;
  }

  .footer-inner {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  aside {
    padding-bottom: 2rem;
  }

  .sidebar-links {
    padding: 1.5rem 1rem 1rem;
    gap: 1.5rem;
    justify-content: flex-start;
  }

  .sidebar-link {
    padding: 0.875rem 1rem;
    text-align: center;
  }

  .sidebar-footer {
    padding: 1rem 1rem 1.25rem;
    gap: 0.75rem;
  }

  .controls-toggle {
    width: 2.25rem;
    height: 2.25rem;
  }

  .toggle-dots {
    width: 1rem;
    height: 1rem;
  }

  .sidebar-controls {
    gap: 1rem;
    max-height: 45vh;
    overflow-y: auto;
  }

  .lang-option,
  .theme-option {
    padding: 0.375rem 0.625rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) and (max-height: 720px) {
  .sidebar-footer {
    position: sticky !important;
    bottom: 0 !important;
    width: 100%;
    background: var(--surface-1);
    z-index: 2;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border-top: 0.0625rem solid var(--surface-border);
  }

  .controls-toggle {
    width: 2.375rem !important;
    height: 2.375rem !important;
    background-color: var(--surface-1) !important;
    border: 0.0625rem solid var(--surface-border) !important;
    outline: none !important;
  }

  .controls-toggle.active,
  .controls-toggle.active:hover,
  .controls-toggle.active:focus-visible {
    background-color: var(--surface-1) !important;
  }
}

@media (max-width: 480px) and (max-height: 500px) {
  .sidebar-footer {
    bottom: 0 !important;
    padding: 0.5rem 1rem !important;
    gap: 0.5rem !important;
  }

  .controls-toggle {
    width: 2.25rem !important;
    height: 2.25rem !important;
  }

  .toggle-dots {
    width: 0.875rem !important;
    height: 0.875rem !important;
  }
}
