/* DevPost - Responsive Design System */

/* Large Desktop */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .hero-content {
    gap: 4rem;
  }
}

/* Desktop */
@media (max-width: 1440px) {
  :root {
    --text-5xl: clamp(2.25rem, 5vw, 3rem);
  }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
  .hero {
    min-height: auto;
    padding-top: calc(72px + 3rem);
    padding-bottom: 3rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text .subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .timeline::before {
    display: none;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .section {
    padding: 3.5rem 0;
  }

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

/* Tablet Portrait */
@media (max-width: 768px) {
  :root {
    --text-5xl: clamp(1.875rem, 4.5vw, 2.5rem);
    --text-4xl: clamp(1.5rem, 4vw, 2rem);
  }

  .container {
    padding: 0 1.25rem;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface-white);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--github-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  [data-theme="dark"] .nav-links {
    background: var(--surface-card);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--github-border);
    font-size: var(--text-base);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-actions .btn:not(.mobile-cta) {
    display: none;
  }

  .hero {
    padding-top: calc(72px + 2rem);
  }

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

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

  .step-number {
    width: 64px;
    height: 64px;
    font-size: var(--text-xl);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-legal {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .card-mockup,
  .card-morph {
    padding: 1.25rem;
  }

  .testimonial-quote {
    font-size: var(--text-base);
  }

  .section {
    padding: 2.5rem 0;
  }

  .section-header h2 {
    margin-bottom: 0.75rem;
  }

  /* Tool page */
  .tool-grid {
    grid-template-columns: 1fr !important;
  }

  .tool-output {
    position: relative;
    top: auto;
  }

  /* Form */
  .form-textarea {
    min-height: 120px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --text-5xl: clamp(1.625rem, 4vw, 2rem);
    --text-4xl: clamp(1.375rem, 3.5vw, 1.75rem);
    --text-3xl: clamp(1.25rem, 3vw, 1.5rem);
  }

  .container {
    padding: 0 1rem;
  }

  .navbar {
    padding: 0 1rem;
    height: 64px;
  }

  .nav-links {
    top: 64px;
  }

  .nav-brand {
    font-size: var(--text-base);
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: var(--text-base);
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: var(--text-sm);
  }

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

  .feature-card {
    padding: 1.25rem;
  }

  .feature-icon {
    width: 48px;
    height: 48px;
  }

  .card-mockup {
    padding: 1rem;
    font-size: 0.8rem;
  }

  .card-header .repo-icon {
    width: 28px;
    height: 28px;
  }

  .step-number {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
  }

  .footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-column h4 {
    font-size: 0.75rem;
  }

  .footer-links a,
  .footer-bottom p,
  .footer-legal a {
    font-size: 0.8rem;
  }

  .floating-icon svg {
    width: 36px;
    height: 36px;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  .author-avatar {
    width: 48px;
    height: 48px;
    font-size: var(--text-base);
  }

  .timeline-step p {
    font-size: 0.8rem;
  }

  /* Pill radios */
  .pill-group {
    flex-wrap: wrap;
  }

  .pill {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  /* Tool */
  .tool-output-card {
    padding: 1.25rem;
  }

  .output-text {
    font-size: var(--text-sm);
  }

  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    text-align: center;
  }
}

/* Small Mobile */
@media (max-width: 360px) {
  :root {
    --text-5xl: 1.5rem;
    --text-4xl: 1.375rem;
  }

  .container {
    padding: 0 0.875rem;
  }

  .navbar {
    padding: 0 0.75rem;
  }

  .section {
    padding: 2rem 0;
  }

  .feature-card,
  .card,
  .testimonial-card {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .mobile-menu-toggle,
  .theme-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .hero,
  .section {
    padding: 1rem 0;
  }

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

/* High Contrast / Accessibility */
@media (prefers-contrast: high) {
  :root {
    --github-border: #000;
    --text-body: #000;
  }

  [data-theme="dark"] {
    --github-border: #fff;
    --text-body: #fff;
  }

  .btn,
  .form-input,
  .form-textarea,
  .form-select {
    border-width: 2px;
  }
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.btn:focus-visible,
.nav-link:focus-visible {
  outline-offset: 4px;
}

/* Landscape orientation on small screens */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(72px + 1.5rem);
    padding-bottom: 1.5rem;
  }

  .floating-icons {
    display: none;
  }
}