
/* Nezzo Studio — mobile fit v3
   Loaded after the main stylesheet so mobile opens at a readable 100% layout.
   Desktop styles are intentionally untouched. */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 820px) {
  html {
    width: 100%;
    min-width: 0;
    background: #070b0f;
  }

  body {
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    background:
      radial-gradient(circle at 92% 2%, rgba(215,179,107,.08), transparent 25rem),
      radial-gradient(circle at -10% 24%, rgba(93,120,145,.08), transparent 22rem),
      #070b0f !important;
    color: #f4f6f7 !important;
  }

  .topbar {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 64px !important;
    padding: 0 14px !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 10px !important;
    background: rgba(7,11,15,.97) !important;
  }

  .brand {
    min-width: 0 !important;
    overflow: hidden;
  }

  .brand img {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px;
  }

  .brand span {
    display: inline !important;
    min-width: 0;
    max-width: 170px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f1f3f4 !important;
    font-size: .58rem !important;
    letter-spacing: 2px !important;
  }

  .menu-btn {
    display: block !important;
    flex: 0 0 40px;
  }

  .mobile-nav {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100% - 16px) !important;
  }

  .shell {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px 10px 26px !important;
    display: block !important;
  }

  .main-column,
  .sidebar-column,
  .section-block,
  .activity-section,
  .project-grid,
  .activity-layout,
  .heatmap-wrap,
  .activity-feed,
  .side-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .main-column,
  .sidebar-column {
    display: block !important;
  }

  .sidebar-column > * {
    margin-top: 12px;
  }

  .hero {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 22px 16px 16px !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(215,179,107,.20) !important;
    border-radius: 17px !important;
    background:
      radial-gradient(circle at 78% 80%, rgba(215,179,107,.11), transparent 36%),
      linear-gradient(145deg,#111920,#090e13) !important;
    color: #f5f6f7 !important;
  }

  .hero-copy {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .status-pill {
    box-sizing: border-box;
    width: fit-content !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.35;
    color: #d8dde1 !important;
    background: rgba(215,179,107,.07) !important;
    border-color: rgba(215,179,107,.26) !important;
    font-size: .60rem !important;
  }

  .hero h1 {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    color: #ffffff !important;
    font-size: clamp(2.15rem, 10.8vw, 3.05rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -2.4px !important;
    overflow-wrap: anywhere;
  }

  .hero h1 span {
    color: #e5c98f !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #e5c98f !important;
    text-shadow: 0 0 22px rgba(215,179,107,.10) !important;
  }

  .hero-copy > p {
    width: 100%;
    max-width: 100% !important;
    margin-top: 14px !important;
    color: #b5bec6 !important;
    opacity: 1 !important;
    font-size: .82rem !important;
    line-height: 1.65 !important;
  }

  .hero-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
  }

  .hero-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 44px !important;
    padding: 0 9px !important;
    font-size: .66rem !important;
    white-space: nowrap;
  }

  .hero-mark {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 150px !important;
    min-height: 150px !important;
    padding: 10px !important;
    overflow: hidden !important;
    border-radius: 14px !important;
  }

  .hero-mark img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 140px !important;
    max-height: 126px !important;
    object-fit: contain !important;
  }

  .metrics-bar {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 10px;
    padding: 7px !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
  }

  .metric {
    min-width: 0 !important;
    min-height: 70px !important;
    padding: 9px !important;
    border: 1px solid #202b34 !important;
    border-radius: 11px !important;
  }

  .metric strong { color: #f5f6f7 !important; }
  .metric small { color: #9aa4ad !important; }

  .section-title-row {
    width: 100%;
    max-width: 100%;
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .section-title h2 { color: #f4f6f7 !important; font-size: 1.03rem !important; }
  .section-title p { color: #949fa8 !important; font-size: .65rem !important; }

  .filters {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }

  .project-grid {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 14px !important;
  }

  .project-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    background: linear-gradient(155deg,#111920,#0b1116 72%) !important;
  }

  .project-thumb {
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 170px !important;
    max-height: 195px !important;
    aspect-ratio: auto !important;
    margin: 0 0 11px !important;
    padding: 10px !important;
    overflow: hidden !important;
    background: linear-gradient(145deg,#0b1116,#10171d) !important;
  }

  .project-thumb img {
    display: block !important;
    width: 100% !important;
    height: 170px !important;
    max-width: 100% !important;
    max-height: 170px !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .project-head h3 { color: #f5f6f7 !important; font-size: .84rem !important; }
  .project-head p { color: #98a2aa !important; font-size: .59rem !important; }
  .project-desc { color: #aab2b9 !important; font-size: .67rem !important; line-height: 1.58 !important; }
  .project-meta { color: #8d97a0 !important; font-size: .57rem !important; }

  .activity-layout {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 10px !important;
  }

  .heatmap-wrap {
    overflow: hidden !important;
  }

  .heatmap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(32,minmax(2px,1fr)) !important;
    gap: 2px !important;
  }

  .side-card {
    padding: 17px !important;
    color: #f4f6f7 !important;
  }

  .side-card > p,
  .service-list a,
  .mini-list {
    color: #a5afb7 !important;
  }

  .tech-grid {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: clamp(2rem,10.5vw,2.65rem) !important;
  }

  .hero-actions {
    grid-template-columns: minmax(0,1fr) !important;
  }

  .project-thumb {
    min-height: 155px !important;
    max-height: 178px !important;
  }

  .project-thumb img {
    height: 155px !important;
    max-height: 155px !important;
  }
}


/* =========================================================
   FIXED HEADER — desktop + mobile
   Keeps the Nezzo Studio top bar visible while scrolling.
   ========================================================= */
html{
  scroll-padding-top:92px !important;
}

body{
  padding-top:76px !important;
}

.topbar{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  right:0 !important;
  width:100% !important;
  z-index:1000 !important;
  transform:translateZ(0);
  -webkit-transform:translateZ(0);
  box-shadow:0 8px 28px rgba(0,0,0,.18);
}

/* Mobile menu stays directly under the fixed header. */
.mobile-nav{
  position:fixed !important;
  z-index:999 !important;
}

/* Tablet / mobile header height is 64px in mobile-fit-v3. */
@media(max-width:820px){
  html{
    scroll-padding-top:78px !important;
  }

  body{
    padding-top:64px !important;
  }

  .topbar{
    height:64px !important;
  }

  .mobile-nav{
    top:64px !important;
  }
}

/* Extra-safe iPhone notch handling without moving desktop layout. */
@supports (padding-top: env(safe-area-inset-top)){
  @media(max-width:820px){
    body{
      padding-top:calc(64px + env(safe-area-inset-top)) !important;
    }

    .topbar{
      height:calc(64px + env(safe-area-inset-top)) !important;
      padding-top:env(safe-area-inset-top) !important;
    }

    .mobile-nav{
      top:calc(64px + env(safe-area-inset-top)) !important;
    }
  }
}
