html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

body {
  overflow-x: hidden;
}

.page-wrapper {
  overflow-x: clip;
}

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

@media (max-width: 991px) {
  body.portfolio-page .portfolio-grid,
  body.portfolio-page .portfolio-card-grid,
  body.portfolio-page .portfolio-panel-grid,
  body.portfolio-page .portfolio-two-column,
  body.portfolio-page .portfolio-links-grid {
    grid-template-columns: 1fr !important;
  }

  body.portfolio-page .portfolio-grid > div[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  body.portfolio-page [style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }

  body.portfolio-page .footer-main-links-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem !important;
  }
}

@media (max-width: 767px) {
  body.portfolio-page .mobile-menu-sheet {
    display: block;
    position: absolute;
    left: 0.85rem;
    top: 50%;
    z-index: 30;
    transform: translateY(-50%);
  }

  body.portfolio-page details.mobile-menu-sheet > .mobile-menu-summary {
    display: flex !important;
    min-height: 44px;
    padding-inline: 0.9rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    list-style: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.portfolio-page details.mobile-menu-sheet > .mobile-menu-summary::-webkit-details-marker {
    display: none;
  }

  body.portfolio-page details.mobile-menu-sheet > .mobile-menu-summary * {
    pointer-events: none;
  }

  body.portfolio-page .mobile-menu-panel {
    display: none;
  }

  body.portfolio-page .mobile-menu-sheet[open] > .mobile-menu-summary {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10001;
    transform: none;
  }

  body.portfolio-page .mobile-menu-sheet[open] .mobile-menu-panel {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 4.75rem 1rem 1rem;
    background: rgba(43, 29, 19, 0.22);
    backdrop-filter: blur(10px);
    overflow-y: auto;
  }

  body.portfolio-page .mobile-menu-card {
    width: min(100%, 24rem);
    margin: 0 auto;
    padding: 1rem;
    border: 1px solid rgba(91, 69, 52, 0.14);
    border-radius: 1.4rem;
    background: rgba(247, 240, 232, 0.98);
    box-shadow: 0 24px 60px rgba(43, 29, 19, 0.18);
  }

  body.portfolio-page .mobile-menu-note {
    margin: 0 0 0.85rem;
    color: #7e624d;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.portfolio-page .mobile-menu-links,
  body.portfolio-page .mobile-menu-secondary {
    display: grid;
    gap: 0.55rem;
  }

  body.portfolio-page .mobile-menu-secondary {
    margin-top: 0.9rem;
  }

  body.portfolio-page .mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(91, 69, 52, 0.12);
    border-radius: 999px;
    background: rgba(234, 218, 219, 0.34);
    color: #2b1d13;
    font-size: 0.92rem;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
  }

  body.portfolio-page .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(247, 240, 232, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(91, 69, 52, 0.12);
  }

  body.portfolio-page .nav > .nav-menu-button {
    display: flex !important;
    position: absolute;
    left: 0.85rem;
    top: 50%;
    z-index: 20;
    transform: translateY(-50%);
    display: none !important;
  }

  body.portfolio-page .nav-main {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 4.4rem;
    padding: 0.55rem 3.9rem;
  }

  body.portfolio-page .nav-main-wrapper,
  body.portfolio-page .nav-main-wrapper.is-on-left,
  body.portfolio-page .portfolio-nav-stack {
    display: none !important;
  }

  body.portfolio-page .nav-brand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-inline: auto;
    padding: 0;
    text-align: center;
    width: auto;
  }

  body.portfolio-page .nav-brand .logo-image-default {
    margin: 0 !important;
    width: 0.95rem;
    height: 0.95rem;
  }

  body.portfolio-page .nav-brand .brand-name-text {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  body.portfolio-page .nav-brand .brand-slogan {
    display: none !important;
  }

  body.portfolio-page .fullscreen-menu {
    display: none !important;
  }

  body.portfolio-page .fullscreen-menu.is-open {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow-y: auto;
  }

  body.portfolio-page .fullscreen-menu.is-open .menu-close {
    cursor: pointer;
  }

  body.portfolio-page .portfolio-section {
    padding: 3rem 1rem !important;
  }

  body.portfolio-page .portfolio-shell {
    width: min(100%, 40rem) !important;
  }

  body.portfolio-page .portfolio-title {
    font-size: clamp(2.2rem, 11vw, 3.6rem) !important;
    line-height: 1 !important;
  }

  body.portfolio-page .portfolio-section-title,
  body.portfolio-page .section-title,
  body.portfolio-page .large-title {
    font-size: clamp(1.95rem, 8vw, 3rem) !important;
    line-height: 1.05 !important;
  }

  body.portfolio-page .brand-slogan,
  body.portfolio-page .portfolio-subtitle,
  body.portfolio-page .portfolio-section-intro,
  body.portfolio-page .portfolio-copy-block p,
  body.portfolio-page .portfolio-panel p,
  body.portfolio-page .portfolio-card p,
  body.portfolio-page .portfolio-step p,
  body.portfolio-page .portfolio-signal p,
  body.portfolio-page .portfolio-metric p,
  body.portfolio-page .portfolio-link-card p,
  body.portfolio-page .portfolio-contact-card p,
  body.portfolio-page .portfolio-image-caption,
  body.portfolio-page .portfolio-note {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  body.portfolio-page .footer-main-link,
  body.portfolio-page .portfolio-button {
    min-height: 44px !important;
  }

  body.portfolio-page .portfolio-actions,
  body.portfolio-page .portfolio-inline-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem !important;
  }

  body.portfolio-page .portfolio-actions .portfolio-button,
  body.portfolio-page .portfolio-inline-links .portfolio-button,
  body.portfolio-page .footer-main-link {
    width: 100%;
    justify-content: center;
  }

  body.portfolio-page .portfolio-metric-list,
  body.portfolio-page .portfolio-steps,
  body.portfolio-page .portfolio-chip-row {
    gap: 0.85rem !important;
  }

  body.portfolio-page .portfolio-media {
    min-height: min(62vw, 22rem) !important;
  }

  body.portfolio-page .portfolio-image-caption {
    position: static !important;
    margin-top: 0.75rem !important;
  }

  body.portfolio-page .portfolio-photo-stack,
  body.portfolio-page .portfolio-media,
  body.portfolio-page .portfolio-panel,
  body.portfolio-page .portfolio-link-card,
  body.portfolio-page .portfolio-contact-card {
    border-radius: 1.25rem !important;
  }

  body.portfolio-page .footer-main-links-wrapper {
    grid-template-columns: 1fr !important;
  }

  body:not(.portfolio-page) .footer-background-images,
  body:not(.portfolio-page) .contact-brush-banner {
    display: none !important;
  }

  body:not(.portfolio-page) .nav-brand .brand-slogan {
    display: none !important;
  }

  body:not(.portfolio-page) .nav-brand .brand-name-text {
    font-size: 0.92rem !important;
    letter-spacing: 0.08em;
  }

  body:not(.portfolio-page) .footer-main-links-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem !important;
  }

  body:not(.portfolio-page) .footer-main-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px !important;
    padding: 0.85rem 0.7rem !important;
  }

  body:not(.portfolio-page) .fullscreen-menu.is-open {
    padding: 1rem;
  }

  body:not(.portfolio-page) .menu-layout {
    gap: 1.25rem;
  }

  body:not(.portfolio-page) .menu-main-link,
  body:not(.portfolio-page) .menu-small-link {
    min-height: 44px;
  }
}

@media (max-width: 479px) {
  body.portfolio-page .portfolio-section {
    padding: 2.4rem 0.9rem !important;
  }

  body.portfolio-page .portfolio-shell {
    width: 100% !important;
  }

  body.portfolio-page .nav-main {
    min-height: 4rem;
    padding-inline: 3.3rem;
  }

  body.portfolio-page .portfolio-button,
  body.portfolio-page .portfolio-button.is-secondary {
    width: 100%;
  }

  body:not(.portfolio-page) .footer-main-links-wrapper {
    grid-template-columns: 1fr !important;
  }
}
