/* ===== Tablet Landscape (1024px) ===== */

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .hero-code {
    display: none;
  }

  .hero-photo-frame {
    width: 260px;
    height: 300px;
  }

  .hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-inline-end: -40px;
  }

  .sticker {
    font-size: 0.9rem !important;
    padding: 6px 14px;
  }

  .process-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  .step {
    border-bottom: 3px solid rgba(255, 229, 0, 0.3);
  }

  .step:nth-child(odd) {
    border-inline-end: 3px solid rgba(255, 229, 0, 0.3);
  }

  .comparison-cell {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

/* ===== Tablet Portrait (768px) ===== */

@media (max-width: 768px) {
  :root {
    --section-py: 70px;
    --container-px: 20px;
  }

  /* Navbar - show hamburger */
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav-actions .btn {
    display: none;
  }

  /* Marquee — smaller on tablet */
  .marquee-bar {
    height: 32px;
  }
  .marquee-text {
    font-size: 0.8rem;
  }
  .navbar {
    top: 32px;
  }
  .mobile-menu {
    top: calc(var(--nav-height) + 32px);
  }

  /* Stamp — smaller on tablet */
  .stamp-seal {
    width: 100px;
    height: 100px;
  }
  .stamp-seal span {
    font-size: 0.7rem;
  }
  .stamp-seal span:first-child {
    font-size: 1.2rem;
  }

  /* Broken grid — reset on mobile */
  .hero-photo-broken {
    transform: rotate(5deg);
    margin-inline-start: 0;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 50px) 0 80px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo-frame {
    width: 200px;
    height: 230px;
    margin: 0 auto;
  }

  /* Hide SOME stickers on mobile — keep a few for chaos */
  .sticker:nth-child(n+7) {
    display: none;
  }

  /* Keep first 6 stickers but smaller */
  .sticker {
    font-size: 0.8rem !important;
    padding: 5px 12px;
  }

  /* Stats separator hidden on mobile stack */
  .stat-item:not(:last-child)::after {
    display: none;
  }

  .hero h1 {
    margin-inline-end: 0;
    font-size: clamp(2.8rem, 10vw, 4rem);
    text-shadow: 3px 3px 0 #FF3300;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn {
    text-align: center;
  }

  /* Hero glows — prevent overflow */
  .hero-glow {
    width: 300px;
    height: 300px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: start;
  }

  .stat-item h3 {
    font-size: 2.5rem;
    min-width: 80px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Process */
  .process-steps {
    grid-template-columns: 1fr;
    border: 4px solid #FFE500;
  }

  .step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-align: start;
    border-inline-end: none !important;
    border-bottom: 3px solid rgba(255, 229, 0, 0.3);
  }

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

  .step-number {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin: 0;
  }

  /* Portfolio filters — horizontal scroll */
  .portfolio-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 8px;
    display: flex;
  }

  .filter-btn {
    flex-shrink: 0;
    min-height: 44px;
    flex: none;
    padding: 8px 16px;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Video */
  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-play-btn svg {
    width: 48px;
    height: 48px;
  }

  /* Advantage — card layout on mobile */
  .comparison-table {
    border: none;
    border-radius: 0;
  }

  .comparison-row {
    grid-template-columns: 1fr;
    border-bottom: none;
    margin-bottom: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 3px solid #FFE500;
    overflow: hidden;
  }

  .comparison-cell:not(:last-child) {
    border-inline-end: none;
    border-bottom: 2px solid rgba(255, 229, 0, 0.2);
  }

  .comparison-row.header {
    display: none;
  }

  .comparison-cell {
    padding: 12px 16px;
  }

  .comparison-cell::before {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-form {
    padding: 28px;
  }

  .contact-info > p {
    border-right: none;
    padding-right: 0;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Section numbers */
  .section-number {
    font-size: 0.85rem;
  }

  /* Touch targets — minimum 44px */
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .hamburger {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .lang-switch a {
    padding: 8px 14px;
    min-height: 36px;
    display: flex;
    align-items: center;
  }
}

/* ===== Phone (480px) ===== */

@media (max-width: 480px) {
  :root {
    --section-py: 56px;
    --container-px: 16px;
  }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }

  .hero h1 {
    font-size: clamp(2.2rem, 9vw, 3.5rem);
  }

  .section-header {
    margin-bottom: 40px;
  }

  .card {
    padding: 24px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
  }

  .faq-question {
    padding: 16px 20px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .faq-answer-inner {
    padding: 0 20px 16px;
    font-size: 0.9rem;
  }

  /* Marquee — even smaller on phone */
  .marquee-bar {
    height: 28px;
  }
  .marquee-text {
    font-size: 0.7rem;
  }
  .navbar {
    top: 28px;
  }
  .mobile-menu {
    top: calc(var(--nav-height) + 28px);
  }

  /* Stamp — hide on small phone */
  .stamp-seal {
    display: none;
  }

  /* Hero — tighter on small phones */
  .hero {
    padding: calc(var(--nav-height) + 40px) 0 60px;
  }

  .hero-photo-frame {
    width: 170px;
    height: 195px;
    border-width: 5px;
  }

  /* Stats — stack vertically */
  .stat-item {
    gap: 12px;
  }

  .stat-item h3 {
    font-size: 2rem;
    min-width: 70px;
  }

  /* Portfolio card body */
  .portfolio-body {
    padding: 16px;
  }

  .portfolio-body h3 {
    font-size: 1.05rem;
  }

  /* Contact form */
  .contact-form {
    padding: 20px;
    box-shadow: 6px 6px 0 #FF3300;
  }

  /* Video card body */
  .video-card-body {
    padding: 16px;
  }

  /* Stickers — hide all on small phone */
  .sticker {
    display: none;
  }

  /* Brutalist stripe thinner */
  .brutalist-stripe {
    height: 10px;
  }
}

/* ===== Very Small Phone (360px) ===== */

@media (max-width: 360px) {
  :root {
    --container-px: 12px;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-photo-frame {
    width: 140px;
    height: 160px;
  }

  .nav-logo img {
    height: 40px;
    width: 40px;
  }
}

/* ===== Landscape Phone ===== */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 80px 0 40px;
  }

  .hero-grid {
    gap: 20px;
  }

  .assistant-panel {
    max-height: 80vh;
  }

  .mobile-menu {
    overflow-y: auto;
    padding: 20px;
    justify-content: flex-start;
    gap: 20px;
  }
}
