.mobile-menu-toggle,
.mobile-quickbar,
.mobile-nav-sheet {
  display: none;
}

.portfolio-card picture {
  display: block;
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: 78px;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    min-height: auto;
    padding: 16px 0;
  }

  header nav,
  .nav-links {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  header nav a,
  .nav-links a {
    white-space: nowrap;
  }

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

  body.mobile-menu-ready .nav {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  body.mobile-menu-ready .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    color: #fff;
    font-family: inherit;
    font-size: .96rem;
    font-weight: 800;
    line-height: 1;
    background: #8b1e2d;
    border: 0;
    border-radius: 7px;
    box-shadow: 0 10px 22px rgba(32, 18, 22, .18);
    cursor: pointer;
  }

  .mobile-menu-toggle__bars {
    display: grid;
    gap: 4px;
    width: 18px;
  }

  .mobile-menu-toggle__bars span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  body.mobile-menu-ready header nav,
  body.mobile-menu-ready .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 80px 0;
  }

  section {
    padding: 64px 0;
  }

  .grid,
  .keyword-groups,
  .portfolio-grid,
  .process-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .cta-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo {
    min-height: 280px;
  }

  .portfolio-card {
    min-width: 0;
  }

  .mobile-quickbar {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 70;
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(12, 58, 86, .24);
  }

  .mobile-quickbar__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 46px;
    padding: 0 12px;
    color: #fff;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    background: #8b1e2d;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
  }

  .mobile-quickbar__item:not(:first-child) {
    background: #074b72;
  }

  .mobile-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
  }

  .mobile-nav-sheet.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 29, 43, .46);
    border: 0;
  }

  .mobile-nav-panel {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: min(82vh, 680px);
    overflow: auto;
    color: var(--ink);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(7, 29, 43, .34);
    transform: translateY(18px);
    transition: transform .18s ease;
  }

  .mobile-nav-sheet.is-open .mobile-nav-panel {
    transform: translateY(0);
  }

  .mobile-nav-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav-head strong {
    font-size: 1.15rem;
  }

  .mobile-nav-close {
    min-height: 40px;
    padding: 0 14px;
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    background: #8b1e2d;
    border: 0;
    border-radius: 7px;
  }

  .mobile-nav-links {
    display: grid;
    padding: 6px 16px 12px;
  }

  .mobile-nav-links a {
    padding: 14px 0;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav-actions {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: var(--off);
    border-top: 1px solid var(--line);
  }

  .mobile-nav-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    background: #8b1e2d;
    border-radius: 7px;
  }

  .mobile-nav-actions a:nth-child(2),
  .mobile-nav-actions a:nth-child(3) {
    background: #074b72;
  }

  .ai-assistant {
    bottom: 88px;
  }
}

@media (max-width: 700px) {
  .grid,
  .keyword-groups,
  .portfolio-grid,
  .process-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  body:not(.mobile-menu-ready) header nav,
  body:not(.mobile-menu-ready) .nav-links {
    gap: 14px;
    font-size: 0.92rem;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .brand-name,
  .brand span:not(.brand-mark) {
    font-size: 1.12rem;
  }

  .hero {
    padding: 64px 0;
  }

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

  .button,
  .button-row .button,
  .form-actions .button,
  .hero-actions .button {
    width: auto;
    min-width: min(220px, 100%);
    max-width: 100%;
  }

  .button-row,
  .form-actions,
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .stats {
    margin-top: 24px;
  }
}

@media (max-width: 560px) {
  .portfolio-grid {
    gap: 16px;
  }

  .portfolio-card img {
    aspect-ratio: 16 / 10;
    max-height: 260px;
    object-fit: cover;
  }

  .portfolio-card div,
  .keyword-panel,
  .panel,
  .content-card {
    padding: 18px;
  }

  .section-head {
    margin-bottom: 24px;
  }

  .section-head h2 {
    font-size: 1.85rem;
  }

  .keyword-list {
    gap: 8px;
  }

  .keyword-list li {
    max-width: 100%;
    font-size: .92rem;
    line-height: 1.25;
  }

  .ai-assistant {
    right: 10px;
    bottom: 88px;
  }

  .ai-assistant__panel {
    max-height: calc(100vh - 150px);
    overflow: auto;
  }
}
